Skip to content

Commit f185001

Browse files
authored
Update to Python3 for OTP secret generation
1 parent 34e3993 commit f185001

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

environments/magento2.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,9 @@ In addition to the below manual process, there is a `Github Template available f
173173

174174
## Configure 2FA provider
175175
OTPAUTH_QRI=
176-
TFA_SECRET=$(python -c "import base64; print base64.b32encode('$(pwgen -A1 128)')" | sed 's/=*$//')
176+
# Python 2: TFA_SECRET=$(python -c "import base64; print base64.b32encode('$(pwgen -A1 128)')" | sed 's/=*$//')
177+
# Python 3:
178+
TFA_SECRET=$(python3 -c "import base64; print(base64.b32encode(bytearray('$(pwgen -A1 128)', 'ascii')).decode('utf-8'))" | sed 's/=*$//')
177179
OTPAUTH_URL=$(printf "otpauth://totp/%s%%3Alocaladmin%%40example.com?issuer=%s&secret=%s" \
178180
"${TRAEFIK_SUBDOMAIN}.${TRAEFIK_DOMAIN}" "${TRAEFIK_SUBDOMAIN}.${TRAEFIK_DOMAIN}" "${TFA_SECRET}"
179181
)

0 commit comments

Comments
 (0)