Skip to content
Snippets Groups Projects
Commit e72ee994 authored by Bob Mottram's avatar Bob Mottram
Browse files

Location of cryptpad config file

parent 6e901ff5
No related branches found
No related tags found
No related merge requests found
Pipeline #72633 failed
...@@ -120,6 +120,9 @@ function upgrade_cryptpad { ...@@ -120,6 +120,9 @@ function upgrade_cryptpad {
set_repo_commit $CRYPTPAD_DIR "cryptpad commit" "$CRYPTPAD_COMMIT" $CRYPTPAD_REPO set_repo_commit $CRYPTPAD_DIR "cryptpad commit" "$CRYPTPAD_COMMIT" $CRYPTPAD_REPO
cd $CRYPTPAD_DIR || exit 254 cd $CRYPTPAD_DIR || exit 254
if [ -f $CRYPTPAD_DIR/config.js ]; then
mv $CRYPTPAD_DIR/config.js $CRYPTPAD_DIR/config/config.js
fi
cryptpad_create_config cryptpad_create_config
npm upgrade npm upgrade
npm install npm install
...@@ -289,12 +292,12 @@ function cryptpad_create_config { ...@@ -289,12 +292,12 @@ function cryptpad_create_config {
echo ' ],'; echo ' ],';
echo ''; echo '';
echo ' removeDonateButton: true,'; echo ' removeDonateButton: true,';
echo ' allowSubscriptions: false,'; } > "$cryptpad_prefix$CRYPTPAD_DIR/config.js" echo ' allowSubscriptions: false,'; } > "$cryptpad_prefix$CRYPTPAD_DIR/config/config.js"
if [[ "$cryptpad_install_type" == "mesh" ]]; then if [[ "$cryptpad_install_type" == "mesh" ]]; then
echo " myDomain: 'http://P${PEER_ID}.local'," >> "$cryptpad_prefix$CRYPTPAD_DIR/config.js" echo " myDomain: 'http://P${PEER_ID}.local'," >> "$cryptpad_prefix$CRYPTPAD_DIR/config/config.js"
else else
CRYPTPAD_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_cryptpad/hostname) CRYPTPAD_ONION_HOSTNAME=$(cat /var/lib/tor/hidden_service_cryptpad/hostname)
echo " myDomain: 'http://${CRYPTPAD_ONION_HOSTNAME}'," >> "$cryptpad_prefix$CRYPTPAD_DIR/config.js" echo " myDomain: 'http://${CRYPTPAD_ONION_HOSTNAME}'," >> "$cryptpad_prefix$CRYPTPAD_DIR/config/config.js"
fi fi
{ echo ' defaultStorageLimit: 50 * 1024 * 1024,'; { echo ' defaultStorageLimit: 50 * 1024 * 1024,';
echo ''; echo '';
...@@ -318,12 +321,12 @@ function cryptpad_create_config { ...@@ -318,12 +321,12 @@ function cryptpad_create_config {
echo ' maxUploadSize: 20 * 1024 * 1024,'; echo ' maxUploadSize: 20 * 1024 * 1024,';
echo ' //logFeedback: true,'; echo ' //logFeedback: true,';
echo ' //logRPC: true,'; echo ' //logRPC: true,';
echo '};'; } >> "$cryptpad_prefix$CRYPTPAD_DIR/config.js" echo '};'; } >> "$cryptpad_prefix$CRYPTPAD_DIR/config/config.js"
if [[ "$cryptpad_install_type" != "mesh" ]]; then if [[ "$cryptpad_install_type" != "mesh" ]]; then
chown cryptpad:cryptpad "$cryptpad_prefix$CRYPTPAD_DIR/config.js" chown cryptpad:cryptpad "$cryptpad_prefix$CRYPTPAD_DIR/config/config.js"
else else
chroot "$rootdir" chown cryptpad:cryptpad $CRYPTPAD_DIR/config.js chroot "$rootdir" chown cryptpad:cryptpad $CRYPTPAD_DIR/config/config.js
fi fi
} }
...@@ -455,12 +458,12 @@ npm install --arch=$NPM_ARCH --build-from-source ...@@ -455,12 +458,12 @@ npm install --arch=$NPM_ARCH --build-from-source
npm install --arch=$NPM_ARCH bower@1.8.4 npm install --arch=$NPM_ARCH bower@1.8.4
chown -R cryptpad:cryptpad $CRYPTPAD_DIR chown -R cryptpad:cryptpad $CRYPTPAD_DIR
su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad
cp config.example.js config.js cp config/config.example.js config/config.js
EOF EOF
chmod +x "$rootdir/usr/bin/install_cryptpad" chmod +x "$rootdir/usr/bin/install_cryptpad"
chroot "$rootdir" /usr/bin/install_cryptpad chroot "$rootdir" /usr/bin/install_cryptpad
if [ ! -f "$rootdir$CRYPTPAD_DIR/config.js" ]; then if [ ! -f "$rootdir$CRYPTPAD_DIR/config/config.js" ]; then
echo $'Cryptpad config file not found' echo $'Cryptpad config file not found'
exit 62 exit 62
fi fi
...@@ -661,8 +664,8 @@ function install_cryptpad { ...@@ -661,8 +664,8 @@ function install_cryptpad {
chown -R cryptpad:cryptpad $CRYPTPAD_DIR chown -R cryptpad:cryptpad $CRYPTPAD_DIR
su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad su -c './node_modules/bower/bin/bower install --config.interactive=false' - cryptpad
su -c './node_modules/bower/bin/bower update --config.interactive=false' - cryptpad su -c './node_modules/bower/bin/bower update --config.interactive=false' - cryptpad
cp config.example.js config.js cp config/config.example.js config/config.js
if [ ! -f config.js ]; then if [ ! -f config/config.js ]; then
echo $'Cryptpad config file not found' echo $'Cryptpad config file not found'
exit 62 exit 62
fi fi
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment