Separate custom logo function for pleroma

This commit is contained in:
Bob Mottram 2018-03-19 11:01:59 +00:00
parent 775177fc8d
commit 4737a503a7
2 changed files with 29 additions and 16 deletions

View File

@ -766,6 +766,8 @@ function upgrade_pleroma {
sudo -u pleroma mix deps.clean --build mime sudo -u pleroma mix deps.clean --build mime
sudo -u pleroma mix ecto.migrate sudo -u pleroma mix ecto.migrate
#pleroma_custom_logo "$PLEROMA_DIR"
expire_pleroma_posts "$PLEROMA_DOMAIN_NAME" "$PLEROMA_EXPIRE_MONTHS" expire_pleroma_posts "$PLEROMA_DOMAIN_NAME" "$PLEROMA_EXPIRE_MONTHS"
create_pleroma_blocklist create_pleroma_blocklist

View File

@ -95,6 +95,32 @@ function qvitter_update_background {
fi fi
} }
function pleroma_custom_logo {
basedir="$1"
if [ "$2" ]; then
if [[ "$2" == *".png" ]]; then
cp "$2" "$basedir/priv/static/static/logo.png"
return
fi
fi
if [ -f "$basedir/static/logo.png" ]; then
if [ -f "$HOME/${PROJECT_NAME}/img/logo_fbone3.png" ]; then
cp "$HOME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/static/logo.png"
if [ -d "$basedir/priv/static/static" ]; then
cp "$HOME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/priv/static/static/logo.png"
fi
else
if [ -f "/home/$MY_USERNAME/${PROJECT_NAME}/img/logo_fbone3.png" ]; then
cp "/home/$MY_USERNAME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/static/logo.png"
if [ -d "$basedir/priv/static/static" ]; then
cp "/home/$MY_USERNAME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/priv/static/static/logo.png"
fi
fi
fi
fi
}
function pleroma_set_background_image_from_url { function pleroma_set_background_image_from_url {
basedir="$1" basedir="$1"
domain_name="$2" domain_name="$2"
@ -157,22 +183,7 @@ function pleroma_set_background_image_from_url {
return return
fi fi
# customise the logo pleroma_custom_logo "$basedir"
if [ -f "$basedir/static/logo.png" ]; then
if [ -f "$HOME/${PROJECT_NAME}/img/logo_fbone3.png" ]; then
cp "$HOME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/static/logo.png"
if [ -d "$basedir/priv/static/static" ]; then
cp "$HOME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/priv/static/static/logo.png"
fi
else
if [ -f "/home/$MY_USERNAME/${PROJECT_NAME}/img/logo_fbone3.png" ]; then
cp "/home/$MY_USERNAME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/static/logo.png"
if [ -d "$basedir/priv/static/static" ]; then
cp "/home/$MY_USERNAME/${PROJECT_NAME}/img/logo_fbone3.png" "$basedir/priv/static/static/logo.png"
fi
fi
fi
fi
# customise the title # customise the title
if [ -f "$basedir/static/config.json" ]; then if [ -f "$basedir/static/config.json" ]; then