Merge branch 'main' of gitea.scu.si:Florian.Walther/Web-Password
All checks were successful
/ push_to_registry (push) Successful in 58s
All checks were successful
/ push_to_registry (push) Successful in 58s
This commit is contained in:
5
main.go
5
main.go
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user