This commit is contained in:
Shahrad Elahi 2023-11-01 20:13:26 +03:30
parent 6bd9a63ad7
commit 857d3d26b5
3 changed files with 30 additions and 8 deletions

View File

@ -34,7 +34,12 @@ function remove_duplicate_env() {
touch /app/.env.local touch /app/.env.local
chmod 400 /app/.env.local chmod 400 /app/.env.local
echo "NEXTAUTH_SECRET=$(openssl rand -base64 32)" >>/app/.env.local
if ! grep -q "NEXTAUTH_SECRET" /app/.env.local; then
cat <<EOF >>/app/.env.local
NEXTAUTH_SECRET=$(openssl rand -base64 32)
EOF
fi
# Checking if there is `UI_PASSWORD` environment variable # 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 hex and storing it to
@ -42,7 +47,9 @@ echo "NEXTAUTH_SECRET=$(openssl rand -base64 32)" >>/app/.env.local
if [ -n "$UI_PASSWORD" ]; then if [ -n "$UI_PASSWORD" ]; then
ui_password_hex=$(echo -n "$UI_PASSWORD" | xxd -ps -u) ui_password_hex=$(echo -n "$UI_PASSWORD" | xxd -ps -u)
sed -e '/^HASHED_PASSWORD=/d' /app/.env.local sed -e '/^HASHED_PASSWORD=/d' /app/.env.local
echo "HASHED_PASSWORD=$ui_password_hex" >>/app/.env.local cat <<EOF >>/app/.env.local
HASHED_PASSWORD=$ui_password_hex
EOF
unset UI_PASSWORD unset UI_PASSWORD
fi fi
@ -79,6 +86,13 @@ screen -L -Logfile /var/vlogs/tor -dmS tor bash -c "tor -f /etc/tor/torrc"
# Starting Redis server in detached mode # Starting Redis server in detached mode
screen -L -Logfile /var/vlogs/redis -dmS redis bash -c "redis-server --port 6479 --daemonize no --dir /data --appendonly yes" screen -L -Logfile /var/vlogs/redis -dmS redis bash -c "redis-server --port 6479 --daemonize no --dir /data --appendonly yes"
echo " _ ___ ___ __ _ "
echo "| | / (_)_______ / | ____/ /___ ___ (_)___ "
echo "| | /| / / / ___/ _ \/ /| |/ __ / __ \`__ \/ / __ \\"
echo "| |/ |/ / / / / __/ ___ / /_/ / / / / / / / / / /"
echo "|__/|__/_/_/ \___/_/ |_\__,_/_/ /_/ /_/_/_/ /_/ "
echo " "
sleep 1 sleep 1
echo -e "\n======================== Versions ========================" echo -e "\n======================== Versions ========================"
echo -e "Alpine Version: \c" && cat /etc/alpine-release echo -e "Alpine Version: \c" && cat /etc/alpine-release

View File

@ -7,7 +7,7 @@ export default withAuth({
return !!token return !!token
}, },
}, },
}) });
// See "Matching Paths" below to learn more // See "Matching Paths" below to learn more
// https://nextjs.org/docs/app/building-your-application/routing/middleware#matching-paths // https://nextjs.org/docs/app/building-your-application/routing/middleware#matching-paths
@ -15,4 +15,4 @@ export const config = {
matcher: [ matcher: [
'/((?!api/auth|api/healthcheck|_next/static|_next/image|login|logo.png|fonts|favicon.ico).*)', '/((?!api/auth|api/healthcheck|_next/static|_next/image|login|logo.png|fonts|favicon.ico).*)',
], ],
} };

16
src/package-lock.json generated
View File

@ -949,6 +949,8 @@
}, },
"node_modules/busboy": { "node_modules/busboy": {
"version": "1.6.0", "version": "1.6.0",
"resolved": "https://registry.npmjs.org/busboy/-/busboy-1.6.0.tgz",
"integrity": "sha512-8SFQbg/0hQ9xy3UNTB0YEnsNBbWfhf7RtnzpL7TkBiTBRfrQ9Fxcnz7VJsleJpyp6rVLvXiuORqjlHi5q+PYuA==",
"dependencies": { "dependencies": {
"streamsearch": "^1.1.0" "streamsearch": "^1.1.0"
}, },
@ -1389,11 +1391,13 @@
}, },
"node_modules/glob-to-regexp": { "node_modules/glob-to-regexp": {
"version": "0.4.1", "version": "0.4.1",
"license": "BSD-2-Clause" "resolved": "https://registry.npmjs.org/glob-to-regexp/-/glob-to-regexp-0.4.1.tgz",
"integrity": "sha512-lkX1HJXwyMcprw/5YUZc2s7DrpAiHB21/V+E1rHUrVNokkvB6bqMzT0VfV6/86ZNabt1k14YOIaT7nDvOX3Iiw=="
}, },
"node_modules/graceful-fs": { "node_modules/graceful-fs": {
"version": "4.2.11", "version": "4.2.11",
"license": "ISC" "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz",
"integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ=="
}, },
"node_modules/has": { "node_modules/has": {
"version": "1.0.3", "version": "1.0.3",
@ -3019,6 +3023,8 @@
}, },
"node_modules/streamsearch": { "node_modules/streamsearch": {
"version": "1.1.0", "version": "1.1.0",
"resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-1.1.0.tgz",
"integrity": "sha512-Mcc5wHehp9aXz1ax6bZUyY5afg9u2rv5cqQI3mRrYkGC8rW2hM02jWuwjtL++LS5qinSyhj2QfLyNsuc+VsExg==",
"engines": { "engines": {
"node": ">=10.0.0" "node": ">=10.0.0"
} }
@ -3080,7 +3086,8 @@
}, },
"node_modules/styled-jsx": { "node_modules/styled-jsx": {
"version": "5.1.1", "version": "5.1.1",
"license": "MIT", "resolved": "https://registry.npmjs.org/styled-jsx/-/styled-jsx-5.1.1.tgz",
"integrity": "sha512-pW7uC1l4mBZ8ugbiZrcIsiIvVx1UmTfw7UkC3Um2tmfUq9Bhk8IiyEIPl6F8agHgjzku6j0xQEZbfA5uSgSaCw==",
"dependencies": { "dependencies": {
"client-only": "0.0.1" "client-only": "0.0.1"
}, },
@ -3438,7 +3445,8 @@
}, },
"node_modules/watchpack": { "node_modules/watchpack": {
"version": "2.4.0", "version": "2.4.0",
"license": "MIT", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz",
"integrity": "sha512-Lcvm7MGST/4fup+ifyKi2hjyIAwcdI4HRgtvTpIUxBRhB+RFtUh8XtDOxUfctVCnhVi+QQj49i91OyvzkJl6cg==",
"dependencies": { "dependencies": {
"glob-to-regexp": "^0.4.1", "glob-to-regexp": "^0.4.1",
"graceful-fs": "^4.1.2" "graceful-fs": "^4.1.2"