From 19428773accc578fc103d09ec899682b0dd34102 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 6 Nov 2017 14:15:33 +0000 Subject: [PATCH] Set pleroma password --- src/freedombone-app-pleroma | 32 +++++++++++++++++--------------- 1 file changed, 17 insertions(+), 15 deletions(-) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 1918ab6b..d771eeb1 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -190,9 +190,21 @@ 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;" + pleroma_secret=config/dev.secret.exs + cp 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 + sed -i "s|database:.*|database: \"pleroma\",|g" $pleroma_secret + sed -i "/config :pleroma, Pleroma.Web.Endpoint/a url: [host: \"$PLEROMA_DOMAIN_NAME\", scheme: \"https\", port: 443]," $pleroma_secret + + pleroma_config=config/config.exs + sed -i "s|name: .*|name: \"$PLEROMA_TITLE\",|g" $pleroma_config + sed -i "s|email: .*|email: \"$MY_EMAIL_ADDRESS\",|g" $pleroma_config + cd $PLEROMA_DIR - mix ecto.create - mix ecto.migrate + mix local.rebar --force + mix ecto.create --force + mix ecto.migrate --force } function reconfigure_pleroma { @@ -620,28 +632,18 @@ function install_pleroma { systemctl restart postgresql systemctl restart nginx - ${PROJECT_NAME}-pass -u $MY_USERNAME -a pleroma -p "$PLEROMA_ADMIN_PASSWORD" - set_completion_param "pleroma domain" "$PLEROMA_DOMAIN_NAME" # back end cd $PLEROMA_DIR - mix deps.get + mix local.hex --force + mix deps.get --force function_check pleroma_create_database pleroma_create_database - pleroma_secret=config/dev.secret.exs - cp 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 - sed -i "s|database:.*|database: \"pleroma\",|g" $pleroma_secret - sed -i "/config :pleroma, Pleroma.Web.Endpoint/a url: [host: \"$PLEROMA_DOMAIN_NAME\", scheme: \"https\", port: 443]," $pleroma_secret - - pleroma_config=config/config.exs - sed -i "s|name: .*|name: \"$PLEROMA_TITLE\",|g" $pleroma_config - sed -i "s|email: .*|email: \"$MY_EMAIL_ADDRESS\",|g" $pleroma_config + ${PROJECT_NAME}-pass -u $MY_USERNAME -a pleroma -p "$PLEROMA_ADMIN_PASSWORD" # front end install_pleroma_front_end "pleroma" "$PLEROMA_DOMAIN_NAME" "$PLEROMA_BACKGROUND_IMAGE_URL" "$PLEROMA_TITLE"