diff --git a/Dockerfile b/Dockerfile index de2ab03..5956536 100644 --- a/Dockerfile +++ b/Dockerfile @@ -20,7 +20,7 @@ RUN apk add -U --no-cache \ wireguard-tools \ tor &&\ # NPM packages - npm install -g @litehex/node-checksum &&\ + npm install -g @litehex/node-checksum@0.2 &&\ # Clear APK cache rm -rf /var/cache/apk/* diff --git a/Dockerfile-Dev b/Dockerfile-Dev index ecdc84f..db09df6 100644 --- a/Dockerfile-Dev +++ b/Dockerfile-Dev @@ -20,7 +20,7 @@ RUN apk add -U --no-cache \ wireguard-tools \ tor &&\ # NPM packages - npm install -g @litehex/node-checksum &&\ + npm install -g @litehex/node-checksum@0.2 &&\ # Clear APK cache rm -rf /var/cache/apk/* diff --git a/docker-entrypoint.sh b/docker-entrypoint.sh index 23ff55b..a9d8921 100644 --- a/docker-entrypoint.sh +++ b/docker-entrypoint.sh @@ -75,12 +75,12 @@ EOF fi # Checking if there is `UI_PASSWORD` environment variable -# if there was, converting it to hex and storing it to +# if there was, converting it to sha256 and storing it to # the .env if [ -n "$UI_PASSWORD" ]; then sed -i '/^HASHED_PASSWORD/d' "${ENV_FILE}" tee -a "${ENV_FILE}" &>/dev/null < { return { @@ -29,7 +30,7 @@ export const actions: Actions = { const { password } = form.data; const hashed = HASHED_PASSWORD.toLowerCase(); - const receivedHashed = Buffer.from(password.toString()).toString('hex').toLowerCase(); + const receivedHashed = sha256(password).toLowerCase(); if (hashed !== receivedHashed) { return setError(form, 'password', 'Incorrect password.');