Skip to content
Snippets Groups Projects
Commit 62beb7db authored by Bob Mottram's avatar Bob Mottram
Browse files

Tidy gnusocial app

parent 907791dd
No related branches found
No related tags found
No related merge requests found
......@@ -53,6 +53,9 @@ SHARINGS_THEME_COMMIT='7106c7ef03'
GNUSOCIAL_NSFW_REPO="https://gitgud.io/ShitposterClub/SensitiveContent"
GNUSOCIAL_NSFW_COMMIT='a096bbe0cfae9a9b177682920ffb58d32a48e136'
# script which causes old posts to expire
gnusocial_expire_script=/usr/bin/gnusocial-expire
function install_interactive_gnusocial {
if [ ! $ONION_ONLY ]; then
ONION_ONLY='no'
......@@ -360,6 +363,9 @@ function remove_gnusocial {
remove_onion_service microblog ${MICROBLOG_ONION_PORT}
sed -i '/install_gnusocial/d' $COMPLETION_FILE
sed -i '/GNU Social /d' $COMPLETION_FILE
if grep -q "$gnusocial_expire_script" /etc/crontab; then
sed -i "/$gnusocial_expire_script/d" /etc/crontab
fi
remove_app gnusocial
}
......@@ -615,6 +621,10 @@ function install_gnusocial_main {
echo $"Microblog administrator password: $MICROBLOG_ADMIN_PASSWORD" >> /home/$MY_USERNAME/README
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README
else
if [ -f /home/$MY_USERNAME/README ]; then
sed -i "s|Microblog administrator password.*|Microblog administrator password: $MICROBLOG_ADMIN_PASSWORD|g" /home/$MY_USERNAME/README
fi
fi
if ! grep -q "Microblog onion domain" /home/$MY_USERNAME/README; then
......@@ -622,10 +632,24 @@ function install_gnusocial_main {
echo '' >> /home/$MY_USERNAME/README
chown $MY_USERNAME:$MY_USERNAME /home/$MY_USERNAME/README
chmod 600 /home/$MY_USERNAME/README
else
if [ -f /home/$MY_USERNAME/README ]; then
sed -i "s|Microblog onion domain.*|Microblog onion domain: ${MICROBLOG_ONION_HOSTNAME}|g" /home/$MY_USERNAME/README
fi
fi
if ! grep -q "GNU Social onion domain" $COMPLETION_FILE; then
echo "GNU Social onion domain:${MICROBLOG_ONION_HOSTNAME}" >> $COMPLETION_FILE
else
sed -i "s|GNU Social onion domain.*|GNU Social onion domain:${MICROBLOG_ONION_HOSTNAME}|g" $COMPLETION_FILE
fi
if ! grep -q "GNU Social domain" $COMPLETION_FILE; then
echo "GNU Social domain:$MICROBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
else
sed -i "s|GNU Social domain.*|GNU Social domain:$MICROBLOG_DOMAIN_NAME|g" $COMPLETION_FILE
fi
echo "GNU Social onion domain:${MICROBLOG_ONION_HOSTNAME}" >> $COMPLETION_FILE
echo "GNU Social domain:$MICROBLOG_DOMAIN_NAME" >> $COMPLETION_FILE
install_completed gnusocial_main
}
......@@ -754,8 +778,6 @@ function expire_gnusocial_posts {
return
fi
gnusocial_expire_script=/usr/bin/gnusocial-expire
echo '<?php' > $gnusocial_expire_script
echo '' >> $gnusocial_expire_script
echo '// GNU Social post expiry script, based on StatExpire by Tony Baldwin' >> $gnusocial_expire_script
......@@ -894,6 +916,8 @@ function install_gnusocial_theme {
if ! grep -q "GNU Social theme commit" $COMPLETION_FILE; then
echo "GNU Social theme commit:$MICROBLOG_THEME_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social theme commit.*|GNU Social theme commit:$MICROBLOG_THEME_COMMIT|g" $COMPLETION_FILE
fi
chown -R www-data:www-data /var/www/$MICROBLOG_DOMAIN_NAME/htdocs
......@@ -935,6 +959,8 @@ function install_gnusocial_markdown {
if ! grep -q "GNU Social Markdown commit" $COMPLETION_FILE; then
echo "GNU Social Markdown commit:$MICROBLOG_MARKDOWN_COMMIT" >> $COMPLETION_FILE
else
sed -i "s|GNU Social Markdown commit.*|GNU Social Markdown commit:$MICROBLOG_MARKDOWN_COMMIT|g" $COMPLETION_FILE
fi
chown -R www-data:www-data $MICROBLOG_PATH
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment