fix(update-backend): adjust file permissions and handle environment variables safely
All checks were successful
Deploy to production / deploy (push) Successful in 4m25s
All checks were successful
Deploy to production / deploy (push) Successful in 4m25s
- Updated the permission settings for the environment file to 640, ensuring it is readable only by the owner and the deploy group. - Modified the sequelize configuration to safely handle missing environment variables, converting them to strings or setting them to undefined to prevent runtime errors. [force-deploy]
This commit is contained in:
@@ -33,11 +33,14 @@ echo "Quelle: $SOURCE_ENV"
|
||||
echo "Ziel: $TARGET_ENV"
|
||||
|
||||
sudo -n ls -l "$SOURCE_ENV"
|
||||
sudo -n install -m 600 -o yourpart -g yourpart "$SOURCE_ENV" "$TARGET_ENV"
|
||||
# 640, Owner yourpart, Gruppe = Deploy-User: npm/db:migrate muss .env lesen (dotenv),
|
||||
# ohne die Datei weltlesbar zu machen.
|
||||
DEPLOY_GROUP="$(id -gn)"
|
||||
sudo -n install -m 640 -o yourpart -g "$DEPLOY_GROUP" "$SOURCE_ENV" "$TARGET_ENV"
|
||||
|
||||
echo "Prüfe kopierte Datei..."
|
||||
ls -l "$TARGET_ENV"
|
||||
sudo -n head -n 1 "$TARGET_ENV" >/dev/null
|
||||
head -n 1 "$TARGET_ENV" >/dev/null
|
||||
|
||||
echo "✓ .env-Datei wurde übernommen"
|
||||
|
||||
|
||||
Reference in New Issue
Block a user