freedombone-app-ghost 18KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464
  1. #!/bin/bash
  2. #
  3. # .---. . .
  4. # | | |
  5. # |--- .--. .-. .-. .-.| .-. .--.--. |.-. .-. .--. .-.
  6. # | | (.-' (.-' ( | ( )| | | | )( )| | (.-'
  7. # ' ' --' --' -' - -' ' ' -' -' -' ' - --'
  8. #
  9. # Freedom in the Cloud
  10. #
  11. # Ghost blog
  12. #
  13. # License
  14. # =======
  15. #
  16. # Copyright (C) 2016 Bob Mottram <bob@freedombone.net>
  17. #
  18. # This program is free software: you can redistribute it and/or modify
  19. # it under the terms of the GNU Affero General Public License as published by
  20. # the Free Software Foundation, either version 3 of the License, or
  21. # (at your option) any later version.
  22. #
  23. # This program is distributed in the hope that it will be useful,
  24. # but WITHOUT ANY WARRANTY; without even the implied warranty of
  25. # MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  26. # GNU Affero General Public License for more details.
  27. #
  28. # You should have received a copy of the GNU Affero General Public License
  29. # along with this program. If not, see <http://www.gnu.org/licenses/>.
  30. VARIANTS="full full-vim writer"
  31. IN_DEFAULT_INSTALL=0
  32. SHOW_ON_ABOUT=1
  33. GHOST_DOMAIN_NAME=
  34. GHOST_CODE=
  35. GHOST_ONION_PORT=8104
  36. GHOST_VERSION='0.11.3'
  37. GHOST_PORT=2368
  38. ghost_variables=(GHOST_VERSION
  39. GHOST_DOMAIN_NAME
  40. GHOST_CODE
  41. GHOST_ADMIN_PASSWORD
  42. ONION_ONLY
  43. DDNS_PROVIDER
  44. MY_USERNAME)
  45. function ghost_replace_proprietary_services {
  46. replace_file=$1
  47. sed -i 's|Twitter Profile|GNU Social Profile|g' $replace_file
  48. sed -i 's|Twitter Username|GNU Social Username|g' $replace_file
  49. sed -i 's|twitter.com|quitter.se|g' $replace_file
  50. sed -i 's|Facebook Page|Hubzilla Channel|g' $replace_file
  51. sed -i 's|www.facebook.com/username|hubzilladomain/username|g' $replace_file
  52. sed -i 's|www.facebook.com/ghost|hubzilladomain/username|g' $replace_file
  53. sed -i 's|www.facebook.com/testuser|hubzilladomain/username|g' $replace_file
  54. sed -i 's|www.facebook.com/testing|hubzilladomain/username|g' $replace_file
  55. sed -i 's|www.facebook.com/test|hubzilladomain/username|g' $replace_file
  56. sed -i 's|www.facebook.com/yourUsername|hubzilladomain/username|g' $replace_file
  57. sed -i 's|www.facebook.com/yourPage|hubzilladomain/username|g' $replace_file
  58. sed -i 's|Facebook Username|Hubzilla Channel|g' $replace_file
  59. sed -i 's|www.facebook.com|hubzilladomain|g' $replace_file
  60. sed -i 's|facebook value|hubzilla value|g' $replace_file
  61. sed -i '/<section class="share">/,/<\/section>/d' $replace_file
  62. }
  63. function ghost_replace_services {
  64. ghost_replace_proprietary_services /var/www/${GHOST_DOMAIN_NAME}/htdocs/core/built/assets/ghost.js
  65. ghost_replace_proprietary_services /var/www/${GHOST_DOMAIN_NAME}/htdocs/core/built/assets/ghost.min.js
  66. ghost_replace_proprietary_services /var/www/${GHOST_DOMAIN_NAME}/htdocs/content/themes/casper/post.hbs
  67. }
  68. function remove_user_ghost {
  69. remove_username="$1"
  70. }
  71. function add_user_ghost {
  72. if [[ $(app_is_installed ghost) == "0" ]]; then
  73. echo '0'
  74. return
  75. fi
  76. new_username="$1"
  77. new_user_password="$2"
  78. echo '0'
  79. }
  80. function install_interactive_ghost {
  81. if [ ! $ONION_ONLY ]; then
  82. ONION_ONLY='no'
  83. fi
  84. if [[ $ONION_ONLY != "no" ]]; then
  85. GHOST_DOMAIN_NAME='ghost.local'
  86. write_config_param "GHOST_DOMAIN_NAME" "$GHOST_DOMAIN_NAME"
  87. else
  88. function_check interactive_site_details
  89. interactive_site_details "ghost" "GHOST_DOMAIN_NAME" "GHOST_CODE"
  90. fi
  91. APP_INSTALLED=1
  92. }
  93. function change_password_ghost {
  94. GHOST_USERNAME="$1"
  95. GHOST_PASSWORD="$2"
  96. if [ ${#GHOST_PASSWORD} -lt 8 ]; then
  97. echo $'Ghost password is too short'
  98. return
  99. fi
  100. #${PROJECT_NAME}-pass -u $GHOST_USERNAME -a ghost -p "$GHOST_PASSWORD"
  101. }
  102. function reconfigure_ghost {
  103. echo -n ''
  104. }
  105. function upgrade_ghost {
  106. read_config_param "GHOST_DOMAIN_NAME"
  107. GHOST_PATH=/var/www/$GHOST_DOMAIN_NAME/htdocs
  108. function_check set_repo_commit
  109. set_repo_commit $GHOST_PATH "ghost commit" "$GHOST_COMMIT" $GHOST_REPO
  110. ghost_replace_services
  111. systemctl restart ghost
  112. }
  113. function backup_local_ghost {
  114. GHOST_DOMAIN_NAME='ghost.local'
  115. if grep -q "ghost domain" $COMPLETION_FILE; then
  116. GHOST_DOMAIN_NAME=$(get_completion_param "ghost domain")
  117. fi
  118. ghost_path=/var/www/${GHOST_DOMAIN_NAME}/htdocs
  119. if [ -d $ghost_path ]; then
  120. function_check backup_database_to_usb
  121. backup_database_to_usb ghost
  122. backup_directory_to_usb $ghost_path ghost
  123. restart_site
  124. fi
  125. }
  126. function restore_local_ghost {
  127. GHOST_DOMAIN_NAME='ghost.local'
  128. if grep -q "ghost domain" $COMPLETION_FILE; then
  129. GHOST_DOMAIN_NAME=$(get_completion_param "ghost domain")
  130. fi
  131. if [ $GHOST_DOMAIN_NAME ]; then
  132. function_check ghost_create_database
  133. ghost_create_database
  134. function_check restore_database
  135. restore_database ghost ${GHOST_DOMAIN_NAME}
  136. fi
  137. }
  138. function backup_remote_ghost {
  139. GHOST_DOMAIN_NAME='ghost.local'
  140. if grep -q "ghost domain" $COMPLETION_FILE; then
  141. GHOST_DOMAIN_NAME=$(get_completion_param "ghost domain")
  142. fi
  143. temp_backup_dir=/var/www/${GHOST_DOMAIN_NAME}/htdocs
  144. if [ -d $temp_backup_dir ]; then
  145. suspend_site ${GHOST_DOMAIN_NAME}
  146. backup_database_to_friend ghost
  147. backup_directory_to_friend $temp_backup_dir ghost
  148. restart_site
  149. else
  150. echo $"Ghost domain specified but not found in /var/www/${GHOST_DOMAIN_NAME}"
  151. exit 2578
  152. fi
  153. }
  154. function restore_remote_ghost {
  155. GHOST_DOMAIN_NAME='ghost.local'
  156. if grep -q "ghost domain" $COMPLETION_FILE; then
  157. GHOST_DOMAIN_NAME=$(get_completion_param "ghost domain")
  158. fi
  159. function_check restore_database_from_friend
  160. function_check ghost_create_database
  161. ghost_create_database
  162. restore_database_from_friend ghost ${GHOST_DOMAIN_NAME}
  163. restart_site
  164. chown -R ghost: /var/www/$GHOST_DOMAIN_NAME/htdocs/
  165. }
  166. function remove_ghost {
  167. if [ ${#GHOST_DOMAIN_NAME} -eq 0 ]; then
  168. return
  169. fi
  170. systemctl stop ghost
  171. systemctl disable ghost
  172. rm /etc/systemd/system/ghost.service
  173. function_check remove_nodejs
  174. remove_nodejs ghost
  175. drop_database ghost
  176. remove_backup_database_local ghost
  177. read_config_param "GHOST_DOMAIN_NAME"
  178. nginx_dissite $GHOST_DOMAIN_NAME
  179. remove_certs ${GHOST_DOMAIN_NAME}
  180. deluser --remove-all-files ghost
  181. if [ -f /etc/nginx/sites-available/$GHOST_DOMAIN_NAME ]; then
  182. rm -f /etc/nginx/sites-available/$GHOST_DOMAIN_NAME
  183. fi
  184. if [ -d /var/www/$GHOST_DOMAIN_NAME ]; then
  185. rm -rf /var/www/$GHOST_DOMAIN_NAME
  186. fi
  187. remove_config_param GHOST_DOMAIN_NAME
  188. remove_config_param GHOST_CODE
  189. function_check remove_onion_service
  190. remove_onion_service ghost ${GHOST_ONION_PORT}
  191. remove_completion_param "install_ghost"
  192. sed -i '/Ghost/d' $COMPLETION_FILE
  193. sed -i '/ghost/d' $COMPLETION_FILE
  194. function_check remove_ddns_domain
  195. remove_ddns_domain $GHOST_DOMAIN_NAME
  196. }
  197. function ghost_create_config {
  198. ghost_config=/var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
  199. echo "var path = require('path')," > $ghost_config
  200. echo ' config;' >> $ghost_config
  201. echo '' >> $ghost_config
  202. echo 'config = {' >> $ghost_config
  203. echo ' production: {' >> $ghost_config
  204. echo ' // This needs to be http and NOT https' >> $ghost_config
  205. echo " url: 'http://${GHOST_DOMAIN_NAME}'," >> $ghost_config
  206. echo ' mail: {' >> $ghost_config
  207. echo " transport: 'SMTP'," >> $ghost_config
  208. echo ' options: {' >> $ghost_config
  209. echo " service: 'Sendmail'," >> $ghost_config
  210. echo ' }' >> $ghost_config
  211. echo ' },' >> $ghost_config
  212. echo ' database: {' >> $ghost_config
  213. echo " client: 'mysql'," >> $ghost_config
  214. echo ' connection: {' >> $ghost_config
  215. echo " host : '127.0.0.1'," >> $ghost_config
  216. echo " user : 'root'," >> $ghost_config
  217. echo " password : '${MARIADB_PASSWORD}'," >> $ghost_config
  218. echo " database : 'ghost'," >> $ghost_config
  219. echo " charset : 'utf8'" >> $ghost_config
  220. echo ' }' >> $ghost_config
  221. echo ' },' >> $ghost_config
  222. echo '' >> $ghost_config
  223. echo ' server: {' >> $ghost_config
  224. echo " host: '127.0.0.1'," >> $ghost_config
  225. echo " port: '${GHOST_PORT}'" >> $ghost_config
  226. echo ' },' >> $ghost_config
  227. echo ' logging: false' >> $ghost_config
  228. echo ' }' >> $ghost_config
  229. echo '};' >> $ghost_config
  230. echo '' >> $ghost_config
  231. echo 'module.exports = config;' >> $ghost_config
  232. chmod 700 $ghost_config
  233. }
  234. function ghost_create_database {
  235. if [ -f ${IMAGE_PASSWORD_FILE} ]; then
  236. GIT_ADMIN_PASSWORD="$(printf `cat $IMAGE_PASSWORD_FILE`)"
  237. else
  238. if [ ! ${GIT_ADMIN_PASSWORD} ]; then
  239. GIT_ADMIN_PASSWORD="$(create_password ${MINIMUM_PASSWORD_LENGTH})"
  240. fi
  241. fi
  242. if [ ! $GIT_ADMIN_PASSWORD ]; then
  243. return
  244. fi
  245. function_check create_database
  246. create_database ghost "$GHOST_ADMIN_PASSWORD"
  247. }
  248. function install_ghost {
  249. if [ ! $ONION_ONLY ]; then
  250. ONION_ONLY='no'
  251. fi
  252. if [ ! $GHOST_DOMAIN_NAME ]; then
  253. echo $'The ghost domain name was not specified'
  254. exit 5062
  255. fi
  256. # for the avatar changing command
  257. apt-get -yq install unzip wget
  258. if [ ! -d /var/www/$GHOST_DOMAIN_NAME/htdocs ]; then
  259. mkdir -p /var/www/$GHOST_DOMAIN_NAME/htdocs
  260. fi
  261. cd /var/www/$GHOST_DOMAIN_NAME/htdocs
  262. wget https://ghost.org/zip/ghost-${GHOST_VERSION}.zip
  263. if [ ! -f ghost-${GHOST_VERSION}.zip ]; then
  264. echo $'Unable to download ghost'
  265. rm -rf /var/www/$GHOST_DOMAIN_NAME
  266. exit 63892
  267. fi
  268. unzip ghost-${GHOST_VERSION}.zip
  269. if [ ! -f /var/www/${GHOST_DOMAIN_NAME}/htdocs/index.js ]; then
  270. echo $'ghost failed to unzip'
  271. rm -rf /var/www/$GHOST_DOMAIN_NAME
  272. exit 63835
  273. fi
  274. function_check install_nodejs
  275. install_nodejs ghost
  276. sed -i "/sqlite/d" /var/www/${GHOST_DOMAIN_NAME}/htdocs/package.json
  277. npm install --production
  278. function_check install_mariadb
  279. install_mariadb
  280. function_check get_mariadb_password
  281. get_mariadb_password
  282. function_check ghost_create_database
  283. ghost_create_database
  284. ghost_create_config
  285. adduser --system --home=/var/www/${GHOST_DOMAIN_NAME}/htdocs/ --group ghost
  286. chown -R ghost: /var/www/${GHOST_DOMAIN_NAME}/htdocs/
  287. echo '[Unit]' > /etc/systemd/system/ghost.service
  288. echo 'Description=Ghost Blog' >> /etc/systemd/system/ghost.service
  289. echo 'After=syslog.target' >> /etc/systemd/system/ghost.service
  290. echo 'After=network.target' >> /etc/systemd/system/ghost.service
  291. echo 'After=mysqld.service' >> /etc/systemd/system/ghost.service
  292. echo '' >> /etc/systemd/system/ghost.service
  293. echo '[Service]' >> /etc/systemd/system/ghost.service
  294. echo 'Type=simple' >> /etc/systemd/system/ghost.service
  295. echo 'User=ghost' >> /etc/systemd/system/ghost.service
  296. echo 'Group=ghost' >> /etc/systemd/system/ghost.service
  297. echo "WorkingDirectory=/var/www/${GHOST_DOMAIN_NAME}/htdocs" >> /etc/systemd/system/ghost.service
  298. echo "ExecStart=/usr/local/bin/node /var/www/${GHOST_DOMAIN_NAME}/htdocs/index.js" >> /etc/systemd/system/ghost.service
  299. echo 'Restart=always' >> /etc/systemd/system/ghost.service
  300. echo 'RestartSec=60' >> /etc/systemd/system/ghost.service
  301. echo "Environment=NODE_ENV=production PORT=${GHOST_PORT}" >> /etc/systemd/system/ghost.service
  302. echo '' >> /etc/systemd/system/ghost.service
  303. echo '[Install]' >> /etc/systemd/system/ghost.service
  304. echo 'WantedBy=multi-user.target' >> /etc/systemd/system/ghost.service
  305. systemctl enable ghost
  306. systemctl daemon-reload
  307. systemctl start ghost
  308. GHOST_ONION_HOSTNAME=$(add_onion_service ghost 80 ${GHOST_ONION_PORT})
  309. if [[ ${ONION_ONLY} == "no" ]]; then
  310. function_check nginx_http_redirect
  311. nginx_http_redirect ${GHOST_DOMAIN_NAME}
  312. echo 'server {' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  313. echo ' listen 443 ssl;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  314. echo ' listen [::]:443 ssl;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  315. echo " root /var/www/${GHOST_DOMAIN_NAME}/htdocs;" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  316. echo " server_name ${GHOST_DOMAIN_NAME};" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  317. echo ' access_log /dev/null;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  318. echo " error_log /dev/null;" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  319. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  320. function_check nginx_ssl
  321. nginx_ssl ${GHOST_DOMAIN_NAME}
  322. function_check nginx_disable_sniffing
  323. nginx_disable_sniffing ${GHOST_DOMAIN_NAME}
  324. echo ' add_header Strict-Transport-Security max-age=0;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  325. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  326. echo ' location / {' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  327. function_check nginx_limits
  328. nginx_limits ${GHOST_DOMAIN_NAME} '10G'
  329. echo " proxy_pass http://localhost:${GHOST_PORT};" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  330. echo ' }' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  331. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  332. echo ' fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  333. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  334. echo ' error_page 403 /core/templates/403.php;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  335. echo ' error_page 404 /core/templates/404.php;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  336. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  337. echo ' location = /robots.txt {' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  338. echo ' allow all;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  339. echo ' log_not_found off;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  340. echo ' access_log /dev/null;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  341. echo ' }' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  342. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  343. nginx_keybase $GHOST_DOMAIN_NAME
  344. echo '}' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  345. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  346. else
  347. echo -n '' > /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  348. fi
  349. echo 'server {' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  350. echo " listen 127.0.0.1:${GHOST_ONION_PORT} default_server;" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  351. echo " root /var/www/$GHOST_DOMAIN_NAME/htdocs;" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  352. echo " server_name $GHOST_ONION_HOSTNAME;" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  353. echo ' access_log /dev/null;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  354. echo " error_log /dev/null;" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  355. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  356. function_check nginx_disable_sniffing
  357. nginx_disable_sniffing ${GHOST_DOMAIN_NAME}
  358. echo ' add_header Strict-Transport-Security max-age=0;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  359. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  360. echo ' location / {' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  361. function_check nginx_limits
  362. nginx_limits ${GHOST_DOMAIN_NAME} '10G'
  363. echo " proxy_pass http://localhost:${GHOST_PORT};" >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  364. echo ' }' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  365. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  366. echo ' fastcgi_buffers 64 4K;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  367. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  368. echo ' error_page 403 /core/templates/403.php;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  369. echo ' error_page 404 /core/templates/404.php;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  370. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  371. echo ' location = /robots.txt {' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  372. echo ' allow all;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  373. echo ' log_not_found off;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  374. echo ' access_log /dev/null;' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  375. echo ' }' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  376. echo '' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  377. nginx_keybase ${GHOST_DOMAIN_NAME}
  378. echo '}' >> /etc/nginx/sites-available/${GHOST_DOMAIN_NAME}
  379. function_check create_site_certificate
  380. create_site_certificate $GHOST_DOMAIN_NAME 'yes'
  381. function_check configure_php
  382. configure_php
  383. if [[ $ONION_ONLY != 'no' ]]; then
  384. sed -i "s|url: .*|url: 'http://${GHOST_ONION_HOSTNAME}',|g" /var/www/${GHOST_DOMAIN_NAME}/htdocs/config.js
  385. systemctl restart ghost
  386. fi
  387. ghost_replace_services
  388. function_check nginx_ensite
  389. nginx_ensite $GHOST_DOMAIN_NAME
  390. systemctl restart nginx
  391. ${PROJECT_NAME}-pass -u $MY_USERNAME -a ghost -p "$GHOST_ADMIN_PASSWORD"
  392. function_check add_ddns_domain
  393. add_ddns_domain $GHOST_DOMAIN_NAME
  394. set_completion_param "ghost domain" "$GHOST_DOMAIN_NAME"
  395. APP_INSTALLED=1
  396. }
  397. # NOTE: deliberately no exit 0