This commit is contained in:
Bob Mottram 2017-11-07 21:22:59 +00:00
commit 2e6f9e3507
3 changed files with 8 additions and 5 deletions

View File

@ -199,6 +199,7 @@ function pleroma_create_database {
return
fi
systemctl restart postgresql
add_postgresql_user pleroma "$PLEROMA_ADMIN_PASSWORD" encrypted
run_system_query_postgresql "create database pleroma;"
# temporarily allow the user to create databases
@ -207,11 +208,12 @@ function pleroma_create_database {
run_system_query_postgresql "GRANT ALL ON ALL tables IN SCHEMA public TO pleroma;"
run_system_query_postgresql "GRANT ALL ON ALL sequences IN SCHEMA public TO pleroma;"
run_system_query_postgresql "CREATE EXTENSION citext;"
run_system_query_postgresql "set statement_timeout to 20000;"
read_config_param "PLEROMA_SECRET_KEY"
if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then
PLEROMA_SECRET_KEY="$(create_password 30)$(create_password 30)"
if [ ${#PLEROMA_SECRET_KEY} -lt 50 ]; then
if [ ${#PLEROMA_SECRET_KEY} -lt 64 ]; then
PLEROMA_SECRET_KEY="$(create_password 30)$(create_password 30)$(create_password 30)"
if [ ${#PLEROMA_SECRET_KEY} -lt 64 ]; then
run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
run_system_query_postgresql "ALTER USER pleroma NOCREATEDB;"
echo $'Pleroma secret key not created'
@ -244,6 +246,7 @@ function pleroma_create_database {
fi
sudo -u pleroma mix local.hex --force
sudo -u pleroma mix deps.compile mimerl
systemctl restart postgresql
sudo -u pleroma mix ecto.create --force
if [ ! "$?" = "0" ]; then
run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"

View File

@ -36,7 +36,7 @@ VARIANTS='mesh'
# change these versions at your peril. Things will often crash if you don't
# have specifically the correct versions
NODEJS_VERSION='6.11.4'
NODEJS_N_VERSION='2.1.8'
NODEJS_N_VERSION='2.1.7'
NPM_VERSION='4.0.5'
# This file keeps track of the apps needing nodejs

View File

@ -64,7 +64,7 @@ function install_postgresql {
fi
${PROJECT_NAME}-pass -u root -a postgresql -p "$POSTGRESQL_PASSWORD"
apt-get -yq install postgresql postgresql-contrib postgresql-client
apt-get -yq install postgresql-9.6 postgresql-contrib-9.6 postgresql-client
apt-get -yq remove --purge apache2-bin*
if [ -d /etc/apache2 ]; then
rm -rf /etc/apache2