Compare commits
3 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 44bb35abac | |||
| 1ae5f9c679 | |||
| 9a052b3ef7 |
@@ -32,7 +32,7 @@ The latest official docker image is at [https://gitea.scu.si/FlorianWalther/-/pa
|
|||||||
|
|
||||||
You can pull it like this:
|
You can pull it like this:
|
||||||
```
|
```
|
||||||
docker pull gitea.scu.si/florianwalther/password-generator:latest
|
docker pull gitea.scu.si/florian.walther/password-generator:latest
|
||||||
```
|
```
|
||||||
|
|
||||||
## more usage examples
|
## more usage examples
|
||||||
|
|||||||
2
main.go
2
main.go
@@ -48,6 +48,7 @@ func passwordHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
// new help handler
|
// new help handler
|
||||||
func helpHandler(w http.ResponseWriter, r *http.Request) {
|
func helpHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
log.Printf("helpHandler called from %s\n", r.RemoteAddr())
|
||||||
helpHTML := `
|
helpHTML := `
|
||||||
<!DOCTYPE html>
|
<!DOCTYPE html>
|
||||||
<html>
|
<html>
|
||||||
@@ -136,6 +137,7 @@ func helpHandler(w http.ResponseWriter, r *http.Request) {
|
|||||||
|
|
||||||
|
|
||||||
func webHandler(w http.ResponseWriter, r *http.Request) {
|
func webHandler(w http.ResponseWriter, r *http.Request) {
|
||||||
|
log.Printf("webHandler called from %s\n", r.RemoteAddr())
|
||||||
password := generatePassword()
|
password := generatePassword()
|
||||||
html := fmt.Sprintf(
|
html := fmt.Sprintf(
|
||||||
`<DOCTYPE html>
|
`<DOCTYPE html>
|
||||||
|
|||||||
@@ -14,6 +14,12 @@ After making above changes you have to reload your ~/bashrc, in order to activat
|
|||||||
|
|
||||||
Now you can enter `genpasswd` and get a fresh password from the API Endpoint.
|
Now you can enter `genpasswd` and get a fresh password from the API Endpoint.
|
||||||
|
|
||||||
|
## get 10 fresh passwords
|
||||||
|
|
||||||
|
```bash
|
||||||
|
for i in {1..10}; do echo $(curl -s https://passwd.scu.si/api/password); done
|
||||||
|
```
|
||||||
|
|
||||||
# building the app
|
# building the app
|
||||||
|
|
||||||
you can build the app yourself like this:
|
you can build the app yourself like this:
|
||||||
|
|||||||
Reference in New Issue
Block a user