File tree Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Expand file tree Collapse file tree 1 file changed +16
-10
lines changed Original file line number Diff line number Diff line change @@ -124,22 +124,28 @@ $ docker ps | grep whoami
124124
125125This password is encrypted in our configs ` .configs/traefik.toml `
126126
127- To quickly generate yours with htpasswd, use my container:
127+ #### Generate your user/pass:
128+
129+ Here is a script you can run:
128130
129131```
130- docker run --rm -it devmtl/alpinefire:3.8-D sh -c 'htpasswd -Bbn admin changethispass'
131- ```
132+ command -v docker >/dev/null 2>&1 || { echo >&2 "I require Docker but it's not installed. Aborting."; exit 1; }
132133
133- This will display:
134+ echo "Basic auth generator:"
135+ read -p "User: " USER
136+ read -p "Password: " PW
134137
135- ```
136- admin:$2y$05$F44r3C0UXd5aK/o6Y7KgwObpYXJzUMe/rAfP2q9fxiw1DZfUEdl1S
137- ```
138+ # Generate strings
139+ clear && echo
138140
139- You need to double the sign ` $ ` . Here is the variable you will use:
141+ echo "------- A) Use the result with basicauth.usersfile: --------"
142+ docker run ctr.run/github.com/firepress-org/alpine:master sh -c \
143+ "htpasswd -nbB ${USER} ${PW}"
140144
141- ```
142- admin:$$2y$$05$$F44r3C0UXd5aK/o6Y7KgwObpYXJzUMe/rAfP2q9fxiw1DZfUEdl1S
145+ echo "------- B) use the result within your compose file."
146+ echo "This double the $ sign (else the $ sign is interpreted as a variable: --------"
147+ docker run ctr.run/github.com/firepress-org/alpine:master sh -c \
148+ "htpasswd -nbB ${USER} ${PW}" | sed -e s/\\$/\\$\\$/g
143149```
144150
145151Insert this string in your ` .configs/traefik.toml ` .
You can’t perform that action at this time.
0 commit comments