Remove logging settings which cause crashes

This commit is contained in:
Bob Mottram 2016-11-04 17:20:36 +00:00
parent 2d216cf241
commit 941c13267e
2 changed files with 16 additions and 22 deletions

View File

@ -181,27 +181,7 @@ function create_etherpad_settings {
echo ' ["timeslider_export", "timeslider_returnToPad"]' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' ]' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' },' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' "loglevel": "INFO",' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' "logconfig" :' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' { "appenders": [' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' { "type": "console"' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' //, "category": "access"// only logs pad access' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' },' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' { "type": "logLevelFilter"' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' , "level": "error" // filters out all log messages that have a lower level than "error"' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' , "appender":' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' { "type": "smtp"' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' , "subject": "[Admin] An error occured in your Etherpad instance!"' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo " , \"recipients\": \"admin@${DEFAULT_DOMAIN_NAME}\"" >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' , "sendInterval": 300 // 60 * 5 = 5 minutes -- will buffer log messages; set to 0 to send a mail for every message' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' , "transport": "SMTP", "SMTP": { // see https://github.com/andris9/Nodemailer#possible-transport-methods' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' "host": "localhost", "port": 25,' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' "secureConnection": false,' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' }' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' }' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' }' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' ]' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' }' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo ' "loglevel": "INFO"' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
echo '}' >> /var/www/${ETHERPAD_DOMAIN_NAME}/htdocs/settings.json
}

View File

@ -33,8 +33,11 @@
VARIANTS='mesh'
NODEJS_VERSION='6.2.2'
# change these versions at your peril. Things will often crash if you don't
# have specifically the correct versions
NODEJS_VERSION='6.9.0'
NODEJS_N_VERSION='2.1.4'
NPM_VERSION='4.0.2'
# This file keeps track of the apps needing nodejs
# so that it can be removed if tere are no apps which need it
@ -79,6 +82,16 @@ function remove_nodejs {
fi
sed -i "/install_${1}/d" $NODEJS_INSTALLED_APPS_FILE
if ! grep "install_" $NODEJS_INSTALLED_APPS_FILE; then
cat <<EOF > /root/remove-nodejs.sh
#!/bin/bash
PATH="/usr/bin:/usr/sbin:/usr/local/bin:/usr/local/sbin:/bin"
NODE_PATH="/usr/lib/node_modules"
npm uninstall -g --save
exit 0
EOF
chmod +x /root/remove-nodejs.sh
/root/remove-nodejs.sh
apt-get -yq remove --purge nodejs
if [ -f /usr/bin/nodejs ]; then
@ -125,6 +138,7 @@ cp /usr/bin/nodejs /usr/bin/node
/usr/bin/curl -0 -L https://npmjs.org/install.sh | sh
npm install -g n@${NODEJS_N_VERSION} --save
n ${NODEJS_VERSION}
npm update -g npm@{NPM_VERSION}
exit 0
EOF
chmod +x /root/install-nodejs.sh