瀏覽代碼

Get cryptpad config file

Bob Mottram 7 年之前
父節點
當前提交
08b465af6a
共有 1 個文件被更改,包括 10 次插入6 次删除
  1. 10
    6
      src/freedombone-app-cryptpad

+ 10
- 6
src/freedombone-app-cryptpad 查看文件

@@ -489,12 +489,6 @@ function install_cryptpad {
489 489
     else
490 490
         sed -i "s|domain:.*|domain: 'http://$CRYPTPAD_ONION_HOSTNAME',|g" config.js
491 491
     fi
492
-    #if [[ $ONION_ONLY != 'no' ]]; then
493
-    #    sed -i "/module.exports/a ]," config.js
494
-    #    sed -i "/module.exports/a '\/etc\/ssl\/private\/${CRYPTPAD_DOMAIN_NAME}.key'" config.js
495
-    #    sed -i "/module.exports/a '\/etc\/ssl\/certs\/${CRYPTPAD_DOMAIN_NAME}.pem'" config.js
496
-    #    sed -i "/module.exports/a privKeyAndCertFiles: [" config.js
497
-    #fi
498 492
 
499 493
     chown -R cryptpad:cryptpad $CRYPTPAD_DIR
500 494
 
@@ -519,6 +513,16 @@ function install_cryptpad {
519 513
     systemctl daemon-reload
520 514
     systemctl start cryptpad.service
521 515
 
516
+    if [ ! -d $CRYPTPAD_DIR/customize/api ]; then
517
+        mkdir -p $CRYPTPAD_DIR/customize/api
518
+    fi
519
+    wget 127.0.0.1:$CRYPTPAD_PORT/api/config -O $CRYPTPAD_DIR/customize/api/config
520
+    if [ ! -f $CRYPTPAD_DIR/customize/api/config ]; then
521
+        echo $'Unable to wget api/config'
522
+        exit 89252
523
+    fi
524
+    chown -R cryptpad:cryptpad $CRYPTPAD_DIR
525
+
522 526
     systemctl restart nginx
523 527
 
524 528
     APP_INSTALLED=1