浏览代码

Merge branch 'stretch' of https://github.com/bashrc/freedombone

Bob Mottram 8 年前
父节点
当前提交
ccb32bc1a3
共有 2 个文件被更改,包括 17 次插入6 次删除
  1. 17
    5
      src/freedombone-app-ghost
  2. 0
    1
      src/freedombone-image-customise

+ 17
- 5
src/freedombone-app-ghost 查看文件

1
-#!/bin/bash
1
+emacs#!/bin/bash
2
 #
2
 #
3
 # .---.                  .              .
3
 # .---.                  .              .
4
 # |                      |              |
4
 # |                      |              |
175
         return
175
         return
176
     fi
176
     fi
177
     cd /var/www/$GHOST_DOMAIN_NAME/htdocs
177
     cd /var/www/$GHOST_DOMAIN_NAME/htdocs
178
+
179
+    npm i -g ghost-cli
178
     /usr/local/bin/ghost update
180
     /usr/local/bin/ghost update
181
+
179
     ghost_replace_services
182
     ghost_replace_services
180
     ghost_remove_offsite_links
183
     ghost_remove_offsite_links
184
+
181
     chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
185
     chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs
182
     systemctl restart ghost
186
     systemctl restart ghost
183
 }
187
 }
378
 
382
 
379
     # now install ghost itself
383
     # now install ghost itself
380
     npm install -g ghost-cli
384
     npm install -g ghost-cli
381
-    ghost install local
385
+
386
+    GHOST_ONION_HOSTNAME=$(add_onion_service ghost 80 ${GHOST_ONION_PORT})
387
+
388
+    ghost install local --port ${GHOST_PORT}
389
+
390
+    # kill the started ghost process
391
+    kill_pid=$(ps aux | grep "ghost run" | awk -F ' ' '{print $2}' | head -n 1)
392
+    kill $kill_pid
393
+
394
+    # NOTE: this has to be http, not https
395
+    sed -i "s|\"url\":|\"url\": \"http://${GHOST_DOMAIN_NAME}/\",|g" /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.development.json
382
 
396
 
383
     adduser --system --home=/var/www/${GHOST_DOMAIN_NAME}/htdocs/ --group ghost
397
     adduser --system --home=/var/www/${GHOST_DOMAIN_NAME}/htdocs/ --group ghost
384
 
398
 
392
     echo 'User=ghost' >> /etc/systemd/system/ghost.service
406
     echo 'User=ghost' >> /etc/systemd/system/ghost.service
393
     echo 'Group=ghost' >> /etc/systemd/system/ghost.service
407
     echo 'Group=ghost' >> /etc/systemd/system/ghost.service
394
     echo "WorkingDirectory=/var/www/${GHOST_DOMAIN_NAME}/htdocs" >> /etc/systemd/system/ghost.service
408
     echo "WorkingDirectory=/var/www/${GHOST_DOMAIN_NAME}/htdocs" >> /etc/systemd/system/ghost.service
395
-    echo "ExecStart=/usr/local/bin/ghost run" >> /etc/systemd/system/ghost.service
409
+    echo "ExecStart=/usr/local/bin/ghost run -D" >> /etc/systemd/system/ghost.service
396
     echo "ExecStop=/usr/local/bin/ghost stop" >> /etc/systemd/system/ghost.service
410
     echo "ExecStop=/usr/local/bin/ghost stop" >> /etc/systemd/system/ghost.service
397
     echo "ExecRestart=/usr/local/bin/ghost restart" >> /etc/systemd/system/ghost.service
411
     echo "ExecRestart=/usr/local/bin/ghost restart" >> /etc/systemd/system/ghost.service
398
     echo 'Restart=always' >> /etc/systemd/system/ghost.service
412
     echo 'Restart=always' >> /etc/systemd/system/ghost.service
410
     systemctl daemon-reload
424
     systemctl daemon-reload
411
     systemctl start ghost
425
     systemctl start ghost
412
 
426
 
413
-    GHOST_ONION_HOSTNAME=$(add_onion_service ghost 80 ${GHOST_ONION_PORT})
414
-
415
     if [[ ${ONION_ONLY} == "no" ]]; then
427
     if [[ ${ONION_ONLY} == "no" ]]; then
416
         function_check nginx_http_redirect
428
         function_check nginx_http_redirect
417
         nginx_http_redirect ${GHOST_DOMAIN_NAME}
429
         nginx_http_redirect ${GHOST_DOMAIN_NAME}

+ 0
- 1
src/freedombone-image-customise 查看文件

1275
     git clone $TOXIC_REPO $rootdir/repos/toxic
1275
     git clone $TOXIC_REPO $rootdir/repos/toxic
1276
     git clone $TURTL_REPO $rootdir/repos/turtl
1276
     git clone $TURTL_REPO $rootdir/repos/turtl
1277
     git clone $KANBOARD_REPO $rootdir/repos/kanboard
1277
     git clone $KANBOARD_REPO $rootdir/repos/kanboard
1278
-    git clone $KEYSERVER_SKS_REPO $rootdir/repos/keyserver
1279
     git clone $KEYSERVER_WEB_REPO $rootdir/repos/keyserverweb
1278
     git clone $KEYSERVER_WEB_REPO $rootdir/repos/keyserverweb
1280
     #git clone $WEKAN_REPO $rootdir/repos/wekan
1279
     #git clone $WEKAN_REPO $rootdir/repos/wekan
1281
     #git clone $FLOW_ROUTER_REPO $rootdir/repos/flowrouter
1280
     #git clone $FLOW_ROUTER_REPO $rootdir/repos/flowrouter