Parcourir la source

Ensure we run all node commands with the cloudron user

Johannes Zellner il y a 8 ans
Parent
commit
e43dcb0b27
1 fichiers modifiés avec 2 ajouts et 4 suppressions
  1. 2 4
      start.sh

+ 2 - 4
start.sh

@@ -47,7 +47,7 @@ if [[ ! -f /app/data/.setup_done ]]; then
     }"
 
     # this will create a config.json
-    node /app/code/app --setup "${setup}"
+    /usr/local/bin/gosu cloudron:cloudron node /app/code/app --setup "${setup}"
     touch /app/data/.setup_done
 fi
 
@@ -79,13 +79,11 @@ done
 
 echo "=> Enabling the local mailer"
 ${mongo_cli} --eval "db.objects.update({ _key: \"settings:emailer-local\" }, { \$set: { \"host\": \"${MAIL_SMTP_SERVER}\", \"port\": \"${MAIL_SMTP_PORT}\", \"username\": \"${MAIL_SMTP_USERNAME}\", \"password\": \"${MAIL_SMTP_PASSWORD}\", \"secure\": \"off\" } }, { upsert: true })"
-
 ${mongo_cli} --eval "db.objects.update({ _key: \"config\" }, { \$set: { \"email:from\": \"${MAIL_FROM}\", \"email:from_name\": \"NodeBB\" } }, { upsert: true })"
-
 ${mongo_cli} --eval "db.objects.update({ _key: \"plugins:active\" }, { \$set: { \"value\": \"nodebb-plugin-emailer-local\", \"score\": \"0\" } }, { upsert: true })"
 
 echo "=> Updating nodebb"
-node /app/code/app --upgrade
+/usr/local/bin/gosu cloudron:cloudron node /app/code/app --upgrade
 
 echo "=> Starting nodebb"
 /usr/local/bin/gosu cloudron:cloudron node /app/code/loader.js --no-daemon --no-silent