Setting pleroma initial background

This commit is contained in:
Bob Mottram 2017-11-07 10:31:49 +00:00
parent 4e8a9bb393
commit 98e2865f33
2 changed files with 18 additions and 17 deletions

View File

@ -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

View File

@ -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
}