From aa5feabc517e692d10e6ecb135b973b35b39a43a Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Mon, 6 Nov 2017 21:35:20 +0000 Subject: [PATCH] Also change pleroma background image in a separate static subdirectory --- src/freedombone-app-pleroma | 1 + src/freedombone-utils-gnusocialtools | 14 ++++++++++++++ 2 files changed, 15 insertions(+) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 138fa84d..bc713a3b 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -309,6 +309,7 @@ function pleroma_set_title { PLEROMA_DOMAIN_NAME=$(get_completion_param "pleroma domain") write_config_param "PLEROMA_TITLE" "$PLEROMA_TITLE" sed -i "s|\"name\":.*|\"name\": \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/static/config.json + sed -i "s|\"name\":.*|\"name\": \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/priv/static/static/config.json sed -i "s|name: .*|name: \"${PLEROMA_TITLE}\",|g" $PLEROMA_DIR/config/config.exs systemctl restart pleroma dialog --title $"Set Pleroma title" \ diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index 63cb243b..1536a0f8 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -133,6 +133,11 @@ function pleroma_set_background_image_from_url { chown www-data:www-data static/bg_custom.${ext} sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" static/config.json fi + if [ -d priv/static/static ]; then + cp bg_custom.${ext} priv/static/static/bg_custom.${ext} + chown www-data:www-data priv/static/static/bg_custom.${ext} + sed -i "s|\"background\":.*|\"background\": \"/static/bg_custom.${ext}\",|g" priv/static/static/config.json + fi if [[ "$basedir" != $PLEROMA_DIR ]]; then qvitter_update_background ${domain_name} ${ext} @@ -148,9 +153,15 @@ function pleroma_set_background_image_from_url { if [ -f $basedir/static/logo.png ]; then if [ -f ~/freedombone/img/logo_fbone3.png ]; then cp ~/freedombone/img/logo_fbone3.png $basedir/static/logo.png + if [ -d $basedir/priv/static/static ]; then + cp ~/freedombone/img/logo_fbone3.png $basedir/priv/static/static/logo.png + fi else if [ -f /home/$MY_USERNAME/freedombone/img/logo_fbone3.png ]; then cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png $basedir/static/logo.png + if [ -d $basedir/priv/static/static ]; then + cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png $basedir/priv/static/static/logo.png + fi fi fi fi @@ -159,6 +170,9 @@ function pleroma_set_background_image_from_url { if [ -f $basedir/static/config.json ]; then sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/static/config.json fi + if [ -f $basedir/priv/static/static/config.json ]; then + sed -i "s|\"name\":.*|\"name\": \"${title}\",|g" $basedir/priv/static/static/config.json + fi echo "0" }