소스 검색

Make email plugin work

Girish Ramakrishnan 8 년 전
부모
커밋
4c85c239e7
1개의 변경된 파일7개의 추가작업 그리고 4개의 파일을 삭제
  1. 7 4
      start.sh

+ 7 - 4
start.sh

@@ -25,7 +25,7 @@ fi
 echo "Moving node_modules"
 cp -rf /app/code/node_modules_copy/* /run/nodebb/node_modules
 
-chown -R cloudron:cloudron /app/data /run/nodebb /home/cloudron/.npm
+chown -R cloudron:cloudron /app/data /run/nodebb
 
 export NODE_ENV=production
 export NODE_PATH=/app/code/node_modules
@@ -69,6 +69,7 @@ sed -e "s,##APP_ORIGIN,${APP_ORIGIN}," \
     -e "s/##SECRET/${secret}/" \
     /app/code/config.json.template > /run/nodebb/config.json
 
+echo "Checking plugins to be installed"
 for plugin in $(./nodebb plugins | grep 'nodebb-' | cut -f3 -d' '); do
     if [[ ! -d "/app/code/node_modules/${plugin}" ]]; then
         echo "Could not find plugin ${plugin}. Installing it"
@@ -80,9 +81,11 @@ echo "Updating nodebb"
 node /app/code/app --upgrade
 
 echo "Enabling the local mailer"
-/usr/local/bin/gosu cloudron:cloudron /app/code/nodebb activate nodebb-plugin-emailer-local-bobo --config /run/nodebb/config.json
 ${mongo_cli} --eval "db.objects.update({ _key: \"settings:emailer-local\" }, { \$set: { \"emailer:local:host\": \"${MAIL_SMTP_SERVER}\", \"emailer:local:port\": \"${MAIL_SMTP_PORT}\", \"emailer:local:username\": \"${MAIL_SMTP_USERNAME}\", \"emailer:local:password\": \"${MAIL_SMTP_PASSWORD}\", \"emailer:local:secure\": \"off\" } }, { upsert: true })"
 
-${mongo_cli} --eval "db.objects.update({ _key: \"config\" }, { \$set: { \"email:from\": \"${MAIL_FROM}\" } }, { 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-bobo\", \"score\": \"0\" } }, { upsert: true })"
+
 echo "Starting nodebb"
-/usr/local/bin/gosu cloudron:cloudron node /app/code/loader.js --no-daemon --no-silent --config /run/nodebb/config.json
+/usr/local/bin/gosu cloudron:cloudron node /app/code/loader.js --no-daemon --no-silent