From 98e2865f3369befda60c9e62b0e1c623a93eb2da Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Tue, 7 Nov 2017 10:31:49 +0000 Subject: [PATCH] Setting pleroma initial background --- src/freedombone-app-pleroma | 18 +++++++----------- src/freedombone-utils-gnusocialtools | 17 +++++++++++------ 2 files changed, 18 insertions(+), 17 deletions(-) diff --git a/src/freedombone-app-pleroma b/src/freedombone-app-pleroma index 9699f4a3..60f5f365 100755 --- a/src/freedombone-app-pleroma +++ b/src/freedombone-app-pleroma @@ -727,22 +727,18 @@ function install_pleroma { ${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" - install_gnusocial_default_background "gnusocial" "$PLEROMA_DOMAIN_NAME" - if [ ! -f $PLEROMA_DIR/static/config.json ]; then + # NOTE: we don't need to install the frontend separately, + # since the backend contains a precompiled version of it + + install_gnusocial_default_background "pleroma" "$PLEROMA_DOMAIN_NAME" + if [ ! -f $PLEROMA_DIR/priv/static/static/config.json ]; then echo $"$PLEROMA_DIR/static/config.json file missing" exit 323689 fi - sed -i 's|"theme":.*|"theme": "base16-apathy.css",|g' $PLEROMA_DIR/static/config.json + sed -i 's|"theme":.*|"theme": "base16-apathy.css",|g' $PLEROMA_DIR/priv/static/static/config.json if [ $PLEROMA_BACKGROUND_IMAGE_URL ]; then - pleroma_set_background_image_from_url $PLEROMA_DIR "$PLEROMA_DOMAIN_NAME" "$PLEROMA_BACKGROUND_IMAGE_URL" "$PLEROMA_TITLE" - fi - - if [ ! -f $PLEROMA_DIR/index.html ]; then - echo $'Pleroma index file missing' - exit 7825393 + pleroma_set_background_image_from_url $PLEROMA_DIR/priv/static "$PLEROMA_DOMAIN_NAME" "$PLEROMA_BACKGROUND_IMAGE_URL" "$PLEROMA_TITLE" fi diff --git a/src/freedombone-utils-gnusocialtools b/src/freedombone-utils-gnusocialtools index bd9a7235..dbc34b3f 100755 --- a/src/freedombone-utils-gnusocialtools +++ b/src/freedombone-utils-gnusocialtools @@ -268,26 +268,31 @@ function install_gnusocial_default_background { gnusocial_type=$1 domain_name=$2 + basedir=/var/www/${domain_name}/htdocs + if [[ "$gnusocial_type" == 'pleroma' ]]; then + basedir=$PLEROMA_DIR/priv/static + fi + # customise the logo - if [ -f /var/www/${domain_name}/htdocs/static/logo.png ]; then + if [ -f $basedir/static/logo.png ]; then if [ -f ~/freedombone/img/logo_fbone3.png ]; then - cp ~/freedombone/img/logo_fbone3.png /var/www/${domain_name}/htdocs/static/logo.png + cp ~/freedombone/img/logo_fbone3.png $basedir/static/logo.png else if [ -f /home/$MY_USERNAME/freedombone/img/logo_fbone3.png ]; then - cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png /var/www/${domain_name}/htdocs/static/logo.png + cp /home/$MY_USERNAME/freedombone/img/logo_fbone3.png $basedir/static/logo.png fi fi fi - if [ ! -f /var/www/${domain_name}/htdocs/static/bg.jpg ]; then + if [ ! -f $basedir/static/bg.jpg ]; then return fi if [ -f ~/freedombone/img/backgrounds/${gnusocial_type}.jpg ]; then - cp ~/freedombone/img/backgrounds/${gnusocial_type}.jpg /var/www/${domain_name}/htdocs/static/bg.jpg + cp ~/freedombone/img/backgrounds/${gnusocial_type}.jpg $basedir/static/bg.jpg else if [ -f /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg ]; then - cp /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg /var/www/${domain_name}/htdocs/static/bg.jpg + cp /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg $basedir/static/bg.jpg fi fi }