Default pleroma background for gnusocial

This commit is contained in:
Bob Mottram 2017-04-11 14:20:40 +01:00
parent c267271e95
commit b80a55c357
4 changed files with 39 additions and 0 deletions

Binary file not shown.

After

Width:  |  Height:  |  Size: 27 KiB

View File

@ -358,6 +358,7 @@ function upgrade_gnusocial {
gnusocial_hourly_script gnusocial $GNUSOCIAL_DOMAIN_NAME
upgrade_pleroma "$GNUSOCIAL_DOMAIN_NAME" "gnusocial" "$GNUSOCIAL_BACKGROUND_IMAGE_URL" "$GNUSOCIAL_TITLE"
install_gnusocial_default_background "gnusocial" "$GNUSOCIAL_DOMAIN_NAME"
chown -R www-data:www-data /var/www/${GNUSOCIAL_DOMAIN_NAME}/htdocs
}
@ -983,6 +984,7 @@ function install_gnusocial {
function_check install_nodejs
install_nodejs pleroma-gnusocial
install_pleroma "gnusocial" "$GNUSOCIAL_DOMAIN_NAME" "$GNUSOCIAL_BACKGROUND_IMAGE_URL" "$GNUSOCIAL_TITLE"
install_gnusocial_default_background "gnusocial" "$GNUSOCIAL_DOMAIN_NAME"
fi
# unleash the daemons!

View File

@ -342,6 +342,7 @@ function upgrade_postactiv {
postactiv_running_script
upgrade_pleroma "$POSTACTIV_DOMAIN_NAME" "postactiv" "$POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_TITLE"
install_gnusocial_default_background "postactiv" "$POSTACTIV_DOMAIN_NAME"
chown -R www-data:www-data /var/www/${POSTACTIV_DOMAIN_NAME}/htdocs
}
@ -767,6 +768,7 @@ function install_postactiv {
function_check install_nodejs
install_nodejs pleroma-gnusocial
install_pleroma "postactiv" "$POSTACTIV_DOMAIN_NAME" "$POSTACTIV_BACKGROUND_IMAGE_URL" "$POSTACTIV_TITLE"
install_gnusocial_default_background "postactiv" "$POSTACTIV_DOMAIN_NAME"
fi
expire_gnusocial_posts "$POSTACTIV_DOMAIN_NAME" "postactiv" "$POSTACTIV_EXPIRE_MONTHS"

View File

@ -174,6 +174,34 @@ function install_qvitter {
install_completed ${app_name}_theme
}
function install_gnusocial_default_background {
gnusocial_type=$1
domain_name=$2
# customise the logo
if [ -f /var/www/${domain_name}/htdocs/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
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
fi
fi
fi
if [ ! -f /var/www/${domain_name}/htdocs/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
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
fi
fi
}
function install_pleroma {
app_name="$1"
pleroma_domain="$2"
@ -219,6 +247,7 @@ function install_pleroma {
mv /var/www/${pleroma_domain}/htdocs/index.php /var/www/${pleroma_domain}/htdocs/index_qvitter.php
fi
sed -i 's|index.php|index_qvitter.php|g' $nginx_site
sed -i 's|"theme":.*|"theme": "base16-apathy.css",|g' /var/www/${pleroma_domain}/htdocs/static/config.json
chown -R www-data:www-data /var/www/${pleroma_domain}/htdocs
}
@ -237,8 +266,14 @@ function upgrade_pleroma {
echo 'Unable to build pleroma'
exit 268362
fi
if [ -f /var/www/${domain_name}/htdocs/static/config.json ]; then
cp /var/www/${domain_name}/htdocs/static/config.json /var/www/${domain_name}/htdocs/static/config.json.old
fi
cp -r $INSTALL_DIR/pleroma/dist/* /var/www/${domain_name}/htdocs/
pleroma_set_background_image_from_url "$domain_name" "$background_url" "$title"
if [ -f /var/www/${domain_name}/htdocs/static/config.json.old ]; then
mv /var/www/${domain_name}/htdocs/static/config.json.old /var/www/${domain_name}/htdocs/static/config.json
fi
if [ -f /var/www/${domain_name}/htdocs/index.php ]; then
mv /var/www/${domain_name}/htdocs/index.php /var/www/${domain_name}/htdocs/index_qvitter.php