From c8ee6129d0bae396e464c49c91fad7fdc143dae6 Mon Sep 17 00:00:00 2001 From: Bob Mottram Date: Sun, 4 Feb 2018 22:53:50 +0000 Subject: [PATCH] Create ghost config file --- src/freedombone-app-ghost | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/src/freedombone-app-ghost b/src/freedombone-app-ghost index a885b496..979f878f 100755 --- a/src/freedombone-app-ghost +++ b/src/freedombone-app-ghost @@ -84,8 +84,9 @@ function ghost_replace_jquery { function ghost_rss_button { # remove feedly -aaargh! - sed -i 's|http://cloud.feedly.com/#subscription/feed/{{@blog.url}}/rss/|{{@blog.url}}/rss/|g' /var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/themes/casper/partials/site-nav.hbs - sed -i 's|http://cloud.feedly.com/#subscription/feed/{{url absolute="true"}}/rss/|{{url absolute="true"}}rss/|g' /var/www/$GHOST_DOMAIN_NAME/htdocs/current/content/themes/casper/author.hbs + sed -i 's|http://cloud.feedly.com/#subscription/feed/{{@blog.url}}/rss/|{{@blog.url}}/rss/|g' /var/www/$GHOST_DOMAIN_NAME/htdocs/versions/${GHOST_VERSION}/content/themes/casper/partials/site-nav.hbs + sed -i 's|http://cloud.feedly.com/#subscription/feed/{{url absolute="true"}}/rss/|{{url absolute="true"}}rss/|g' /var/www/$GHOST_DOMAIN_NAME/htdocs/versions/${GHOST_VERSION}/content/themes/casper/author.hbs + } function ghost_remove_offsite_links { @@ -464,8 +465,17 @@ function install_ghost { ghost_bust - # NOTE: this has to be http, not https - sed -i "s|\"url\":|\"url\": \"http://${GHOST_DOMAIN_NAME}/\",|g" /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + echo '{' > /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + if [[ "$ONION_ONLY" == 'no' ]]; then + # NOTE: url must be http, not https + echo " \"url\": \"http://${GHOST_DOMAIN_NAME}\"," >> /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + else + echo " \"url\": \"http://${GHOST_ONION_HOSTNAME}\"," >> /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + fi + echo ' "paths": {' >> /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + echo " \"contentPath\": \"/var/www/${GHOST_DOMAIN_NAME}/htdocs/content\"" >> /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + echo ' }' >> /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json + echo '}' >> /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json echo '[Unit]' > /etc/systemd/system/ghost.service echo 'Description=Ghost Blog' >> /etc/systemd/system/ghost.service