Bezbednost — security headers, fail2ban logovanje, bruteforce zaštita, CSRF zaštita

This commit is contained in:
2026-06-03 21:38:16 +02:00
parent 974d76360a
commit ed7ae605b2
15 changed files with 352 additions and 18 deletions
@@ -102,6 +102,7 @@
params.append('naziv', this.modalNaziv.trim());
if (this.modalKategorijaID) params.append('kategorija_id', this.modalKategorijaID);
if (this.modalCena) params.append('prodajna_cena', this.modalCena);
params.append('_csrf', document.querySelector('meta[name="csrf-token"]')?.content || '');
try {
const odgovor = await fetch('/magacin/novi', {
+6
View File
@@ -110,6 +110,11 @@
<div class="greska">Pogrešno korisničko ime ili lozinka.</div>
{{else if eq .Greska "2"}}
<div class="greska">Greška na serveru. Pokušajte ponovo.</div>
{{else if eq .Greska "zakljucano"}}
<div class="greska">
Previše neuspelih pokušaja prijave. IP adresa je privremeno blokirana.
{{if .Preostalo}}<br>Pokušajte ponovo za: <strong>{{.Preostalo}}</strong>{{end}}
</div>
{{end}}
{{if .Sacuvano}}
@@ -117,6 +122,7 @@
{{end}}
<form method="POST" action="/prijava">
<input type="hidden" name="_csrf" value="{{.CsrfToken}}">
<div class="polje">
<label for="korisnicko_ime">Korisničko ime</label>
<input type="text" id="korisnicko_ime" name="korisnicko_ime"
+1
View File
@@ -89,6 +89,7 @@
{{end}}
<form method="POST" action="/setup">
<input type="hidden" name="_csrf" value="{{.CsrfToken}}">
<div class="polje">
<label for="korisnicko_ime">Korisničko ime</label>
<input type="text" id="korisnicko_ime" name="korisnicko_ime"
+1
View File
@@ -91,6 +91,7 @@
{{end}}
<form method="POST" action="/prijava/totp">
<input type="hidden" name="_csrf" value="{{.CsrfToken}}">
<div class="polje">
<label for="kod">Kod za verifikaciju</label>
<input type="text" id="kod" name="kod"