Merge branch 'main' of gitea.scu.si:Florian.Walther/Web-Password
All checks were successful
/ push_to_registry (push) Successful in 58s

This commit is contained in:
Florian Walther
2026-02-04 00:00:04 +01:00
5 changed files with 70 additions and 14 deletions

View File

@@ -42,11 +42,14 @@ func generatePassword() string {
}
func passwordHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("APIHandler called from %s\n", r.RemoteAddr)
password := generatePassword()
fmt.Fprint(w, password)
}
// new help handler
func helpHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("helpHandler called from %s\n", r.RemoteAddr)
helpHTML := `
<!DOCTYPE html>
<html>
@@ -297,7 +300,9 @@ func helpHandler(w http.ResponseWriter, r *http.Request) {
fmt.Fprint(w, helpHTML)
}
func webHandler(w http.ResponseWriter, r *http.Request) {
log.Printf("webHandler called from %s\n", r.RemoteAddr)
password := generatePassword()
html := fmt.Sprintf(
`<DOCTYPE html>