Browse Source

changed/fixed folder for secret file

root 7 months ago
parent
commit
3897ca9e6a
2 changed files with 4 additions and 3 deletions
  1. 2 1
      build/Dockerfile
  2. 2 2
      build/totp/new-secret.py

+ 2 - 1
build/Dockerfile

@@ -1,6 +1,7 @@
 FROM alpine:3.16
 RUN  apk add tzdata python3 py3-pip && \
-     pip3 install --upgrade pyotp pyqrcode
+     pip3 install --upgrade pyotp pyqrcode && \
+     mkdir /mnt/secret && chown -R 1000:1000 /mnt/secret
 
 COPY --chown=1000:1000 totp/ /opt/totp
 

+ 2 - 2
build/totp/new-secret.py

@@ -15,10 +15,10 @@ TOTP_URL=pyotp.totp.TOTP(TOTP_SECRET).provisioning_uri(email, issuer_name=issuer
 #print(TOTP_SECRET)
 #print(pyqrcode.create(TOTP_URL).terminal(quiet_zone=1))
 
-env = open('/mnt/.env', 'w')
+env = open('/mnt/secret/.env', 'w')
 env.write("SECRET=" + TOTP_SECRET)
 env.close()
 
-qr = open('/mnt/secret.qr', 'w')
+qr = open('/mnt/secret/secret.qr', 'w')
 qr.write(pyqrcode.create(TOTP_URL).terminal(quiet_zone=1))
 qr.close()