|
@@ -76,6 +76,18 @@ function reconfigure_cryptpad {
|
76
|
76
|
fi
|
77
|
77
|
}
|
78
|
78
|
|
|
79
|
+function cryptpad_generate_api_config {
|
|
80
|
+ if [ ! -d $CRYPTPAD_DIR/customize/api ]; then
|
|
81
|
+ mkdir -p $CRYPTPAD_DIR/customize/api
|
|
82
|
+ fi
|
|
83
|
+ wget 127.0.0.1:$CRYPTPAD_PORT/api/config -O $CRYPTPAD_DIR/customize/api/config
|
|
84
|
+ if [ ! -f $CRYPTPAD_DIR/customize/api/config ]; then
|
|
85
|
+ echo $'Unable to wget api/config'
|
|
86
|
+ exit 89252
|
|
87
|
+ fi
|
|
88
|
+ chown -R cryptpad:cryptpad $CRYPTPAD_DIR
|
|
89
|
+}
|
|
90
|
+
|
79
|
91
|
function upgrade_cryptpad {
|
80
|
92
|
CURR_CRYPTPAD_COMMIT=$(get_completion_param "cryptpad commit")
|
81
|
93
|
if [[ "$CURR_CRYPTPAD_COMMIT" == "$CRYPTPAD_COMMIT" ]]; then
|
|
@@ -90,7 +102,7 @@ function upgrade_cryptpad {
|
90
|
102
|
|
91
|
103
|
cd $CRYPTPAD_DIR
|
92
|
104
|
npm install
|
93
|
|
- chown -R cryptpad:cryptpad $CRYPTPAD_DIR
|
|
105
|
+ cryptpad_generate_api_config
|
94
|
106
|
su -c 'bower install' - cryptpad
|
95
|
107
|
|
96
|
108
|
systemctl start cryptpad
|
|
@@ -544,15 +556,7 @@ function install_cryptpad {
|
544
|
556
|
|
545
|
557
|
sleep 6
|
546
|
558
|
|
547
|
|
- if [ ! -d $CRYPTPAD_DIR/customize/api ]; then
|
548
|
|
- mkdir -p $CRYPTPAD_DIR/customize/api
|
549
|
|
- fi
|
550
|
|
- wget 127.0.0.1:$CRYPTPAD_PORT/api/config -O $CRYPTPAD_DIR/customize/api/config
|
551
|
|
- if [ ! -f $CRYPTPAD_DIR/customize/api/config ]; then
|
552
|
|
- echo $'Unable to wget api/config'
|
553
|
|
- exit 89252
|
554
|
|
- fi
|
555
|
|
- chown -R cryptpad:cryptpad $CRYPTPAD_DIR
|
|
559
|
+ cryptpad_generate_api_config
|
556
|
560
|
|
557
|
561
|
# install again
|
558
|
562
|
cd $CRYPTPAD_DIR
|