|
@@ -77,10 +77,13 @@ for plugin in $(./nodebb plugins | grep 'nodebb-' | cut -f3 -d' '); do
|
|
fi
|
|
fi
|
|
done
|
|
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 })"
|
|
|
|
|
|
+# setup email
|
|
|
|
+## remove legacy emailer-local plugin settings
|
|
|
|
+${mongo_cli} --eval "db.objects.remove({ _key: 'settings:emailer-local' })"
|
|
|
|
+${mongo_cli} --eval "db.objects.remove({ _key: 'plugins:active', value: 'nodebb-plugin-emailer-local' })"
|
|
|
|
+
|
|
|
|
+echo "Setting up email"
|
|
|
|
+${mongo_cli} --eval "db.objects.update({ _key: 'config' }, { \$set: { 'email:smtpTransport:enabled': '1', 'email:smtpTransport:service': 'nodebb-custom-smtp', 'email:smtpTransport:host': '${MAIL_SMTP_SERVER}', 'email:smtpTransport:port': '${MAIL_SMTP_PORT}', 'smtpTransport': '${MAIL_SMTP_USERNAME}', 'email:smtpTransport:pass': '${MAIL_SMTP_PASSWORD}', 'email:smtpTransport:security': 'NONE', 'email:from': '${MAIL_FROM}' } }, { upsert: true })"
|
|
|
|
|
|
# there are 3 binaries
|
|
# there are 3 binaries
|
|
# nodebb - this is used for controlling nodebb (start/stop/restart) etc
|
|
# nodebb - this is used for controlling nodebb (start/stop/restart) etc
|