Restoring fedwiki password

This commit is contained in:
Bob Mottram 2018-01-05 21:51:58 +00:00
parent 1834784191
commit a4fae48858
1 changed files with 11 additions and 0 deletions

View File

@ -150,6 +150,7 @@ function change_password_fedwiki {
fi fi
${PROJECT_NAME}-pass -u $FEDWIKI_USERNAME -a fedwiki -p "$FEDWIKI_PASSWORD" ${PROJECT_NAME}-pass -u $FEDWIKI_USERNAME -a fedwiki -p "$FEDWIKI_PASSWORD"
sed -i "s|--cookieSecret .*|--cookieSecret '${FEDWIKI_PASSWORD}'|g" /etc/systemd/system/fedwiki.service sed -i "s|--cookieSecret .*|--cookieSecret '${FEDWIKI_PASSWORD}'|g" /etc/systemd/system/fedwiki.service
sed -i "s|\"secret\":.*|\"secret\": \"${FEDWIKI_PASSWORD}\"|g" ${FEDWIKI_DATA}/status/owner.json
systemctl daemon-reload systemctl daemon-reload
systemctl restart fedwiki systemctl restart fedwiki
write_config_param "FEDWIKI_COOKIE" "$FEDWIKI_PASSWORD" write_config_param "FEDWIKI_COOKIE" "$FEDWIKI_PASSWORD"
@ -214,6 +215,11 @@ function restore_local_fedwiki {
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
fi fi
FEDWIKI_PASSWORD=$(cat ${FEDWIKI_DATA}/status/owner.json | grep secret | awk -F '"' '{print $4}')
${PROJECT_NAME}-pass -u $FEDWIKI_USERNAME -a fedwiki -p "$FEDWIKI_PASSWORD"
sed -i "s|--cookieSecret .*|--cookieSecret '${FEDWIKI_PASSWORD}'|g" /etc/systemd/system/fedwiki.service
write_config_param "FEDWIKI_COOKIE" "$FEDWIKI_PASSWORD"
systemctl daemon-reload
systemctl start fedwiki systemctl start fedwiki
restart_site restart_site
fi fi
@ -262,6 +268,11 @@ function restore_remote_fedwiki {
rm -rf $temp_restore_dir rm -rf $temp_restore_dir
fi fi
FEDWIKI_PASSWORD=$(cat ${FEDWIKI_DATA}/status/owner.json | grep secret | awk -F '"' '{print $4}')
${PROJECT_NAME}-pass -u $FEDWIKI_USERNAME -a fedwiki -p "$FEDWIKI_PASSWORD"
sed -i "s|--cookieSecret .*|--cookieSecret '${FEDWIKI_PASSWORD}'|g" /etc/systemd/system/fedwiki.service
write_config_param "FEDWIKI_COOKIE" "$FEDWIKI_PASSWORD"
systemctl daemon-reload
systemctl start fedwiki systemctl start fedwiki
restart_site restart_site
} }