Create new env file from example; fix installation & update (#9097)

This commit is contained in:
Chris
2025-11-12 15:12:57 -05:00
committed by GitHub
parent afdcc2a624
commit 2cf7b446c0
2 changed files with 21 additions and 21 deletions

View File

@@ -28,8 +28,6 @@ $STD npm install
export NODE_ENV=production
$STD npm run frontend:build
mv ./dist ./backend
mv ./public/locales ./backend/dist
mv ./public/favicon.* ./backend/dist
msg_ok "Configured Tududi"
msg_info "Creating env and database"
@@ -37,15 +35,16 @@ DB_LOCATION="/opt/tududi-db"
UPLOAD_DIR="/opt/tududi-uploads"
mkdir -p {"$DB_LOCATION","$UPLOAD_DIR"}
SECRET="$(openssl rand -hex 64)"
cat <<EOF >/opt/tududi/backend/.env
TUDUDI_SESSION_SECRET=${SECRET}
TUDUDI_ALLOWED_ORIGINS=<your tududi IP or FQDN>
NODE_ENV=production
DB_FILE=${DB_LOCATION}/production.sqlite3
TUDUDI_UPLOAD_PATH=${UPLOAD_DIR}
DISABLE_TELEGRAM=true
DIABLE_SCHEDULER=false
EOF
sed -e '/^NODE_ENV=/s/=.*$/=production/' \
-e 's/^TUDUDI_USER/# TUDUDI_USER/g' \
-e "/_SECRET=/s/=.*$/=${SECRET}/" \
-e "/^# DB_FILE/s/^# //; \
\|DB_FILE|s|/path.*$|${DB_LOCATION}/production.sqlite3|" \
-e "/^# TUDUDI_ALLOWED/s/^# //; \
\|_ORIGINS=|s|=.*$|=<your tududi IP or FDQN>|" \
-e "/^# TUDUDI_UPLOAD/s/^# //; \
\|UPLOAD_PATH=|s|=.*$|=${UPLOAD_DIR}|" \
/opt/tududi/backend/.env.example >/opt/tududi/backend/.env
export DB_FILE="${DB_LOCATION}/production.sqlite3"
$STD npm run db:init
msg_ok "Created env and database"