Setting pleroma initial background
This commit is contained in:
parent
4e8a9bb393
commit
98e2865f33
|
@ -727,22 +727,18 @@ function install_pleroma {
|
||||||
|
|
||||||
${PROJECT_NAME}-pass -u $MY_USERNAME -a pleroma -p "$PLEROMA_ADMIN_PASSWORD"
|
${PROJECT_NAME}-pass -u $MY_USERNAME -a pleroma -p "$PLEROMA_ADMIN_PASSWORD"
|
||||||
|
|
||||||
# front end
|
# NOTE: we don't need to install the frontend separately,
|
||||||
install_pleroma_front_end "pleroma" "$PLEROMA_DOMAIN_NAME" "$PLEROMA_BACKGROUND_IMAGE_URL" "$PLEROMA_TITLE"
|
# since the backend contains a precompiled version of it
|
||||||
install_gnusocial_default_background "gnusocial" "$PLEROMA_DOMAIN_NAME"
|
|
||||||
if [ ! -f $PLEROMA_DIR/static/config.json ]; then
|
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"
|
echo $"$PLEROMA_DIR/static/config.json file missing"
|
||||||
exit 323689
|
exit 323689
|
||||||
fi
|
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
|
if [ $PLEROMA_BACKGROUND_IMAGE_URL ]; then
|
||||||
pleroma_set_background_image_from_url $PLEROMA_DIR "$PLEROMA_DOMAIN_NAME" "$PLEROMA_BACKGROUND_IMAGE_URL" "$PLEROMA_TITLE"
|
pleroma_set_background_image_from_url $PLEROMA_DIR/priv/static "$PLEROMA_DOMAIN_NAME" "$PLEROMA_BACKGROUND_IMAGE_URL" "$PLEROMA_TITLE"
|
||||||
fi
|
|
||||||
|
|
||||||
if [ ! -f $PLEROMA_DIR/index.html ]; then
|
|
||||||
echo $'Pleroma index file missing'
|
|
||||||
exit 7825393
|
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
|
||||||
|
|
|
@ -268,26 +268,31 @@ function install_gnusocial_default_background {
|
||||||
gnusocial_type=$1
|
gnusocial_type=$1
|
||||||
domain_name=$2
|
domain_name=$2
|
||||||
|
|
||||||
|
basedir=/var/www/${domain_name}/htdocs
|
||||||
|
if [[ "$gnusocial_type" == 'pleroma' ]]; then
|
||||||
|
basedir=$PLEROMA_DIR/priv/static
|
||||||
|
fi
|
||||||
|
|
||||||
# customise the logo
|
# 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
|
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
|
else
|
||||||
if [ -f /home/$MY_USERNAME/freedombone/img/logo_fbone3.png ]; then
|
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
|
fi
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ ! -f /var/www/${domain_name}/htdocs/static/bg.jpg ]; then
|
if [ ! -f $basedir/static/bg.jpg ]; then
|
||||||
return
|
return
|
||||||
fi
|
fi
|
||||||
|
|
||||||
if [ -f ~/freedombone/img/backgrounds/${gnusocial_type}.jpg ]; then
|
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
|
else
|
||||||
if [ -f /home/$MY_USERNAME/freedombone/img/backgrounds/${gnusocial_type}.jpg ]; then
|
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
|
||||||
fi
|
fi
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue