Revert "Move pleroma to production config"

This reverts commit 0982180705.
This commit is contained in:
Bob Mottram 2018-01-09 19:03:49 +00:00
parent 0982180705
commit 1d7888894f
1 changed files with 3 additions and 12 deletions

View File

@ -227,12 +227,11 @@ function pleroma_create_database {
echo $"Missing directory $PLEROMA_DIR/config"
exit 7835393
fi
pleroma_secret=$PLEROMA_DIR/config/prod.secret.exs
pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs
if [ ! -f $PLEROMA_DIR/config/dev.exs ]; then
echo $"Did not find $PLEROMA_DIR/config/dev.exs"
exit 78923528
fi
cp $PLEROMA_DIR/config/dev.exs $pleroma_secret
sed -i "s|username:.*|username: \"pleroma\",|g" $pleroma_secret
sed -i "s|password:.*|password: \"$PLEROMA_ADMIN_PASSWORD\",|g" $pleroma_secret
@ -273,20 +272,13 @@ function pleroma_create_database {
echo $'mix ecto.create failed'
exit 83653582
fi
sudo -u pleroma MIX_ENV=prod mix ecto.migrate --force
sudo -u pleroma mix ecto.migrate --force
if [ ! "$?" = "0" ]; then
run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
run_system_query_postgresql "ALTER USER pleroma NOCREATEDB;"
echo $'mix ecto.migrate failed'
exit 73752573
fi
sudo -u pleroma MIX_ENV=prod mix phx.digest --force
if [ ! "$?" = "0" ]; then
run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
run_system_query_postgresql "ALTER USER pleroma NOCREATEDB;"
echo $'mix phx.digest failed'
exit 783529235
fi
# revoke the ability to create databases for this user
run_system_query_postgresql "ALTER USER pleroma NOSUPERUSER;"
@ -886,7 +878,7 @@ function install_pleroma {
# We need to set up the url option again because it somehow gets
# lost during mix compile
pleroma_secret=$PLEROMA_DIR/config/prod.secret.exs
pleroma_secret=$PLEROMA_DIR/config/dev.secret.exs
if ! grep -q 'watchers: [],' $pleroma_secret; then
sed -i 's|watchers: []|watchers: [],|g' $pleroma_secret
fi
@ -907,7 +899,6 @@ function install_pleroma {
echo 'User=pleroma' >> /etc/systemd/system/pleroma.service
echo "WorkingDirectory=$PLEROMA_DIR" >> /etc/systemd/system/pleroma.service
echo "Environment=\"HOME=$PLEROMA_DIR\"" >> /etc/systemd/system/pleroma.service
echo "Environment=\"MIX_ENV=prod\"" >> /etc/systemd/system/pleroma.service
echo 'ExecStart=/usr/local/bin/mix phx.server' >> /etc/systemd/system/pleroma.service
echo 'ExecReload=/bin/kill $MAINPID' >> /etc/systemd/system/pleroma.service
echo 'KillMode=process' >> /etc/systemd/system/pleroma.service