From 6894e1511eef3f7e6822670f7fc95372710cc2ee Mon Sep 17 00:00:00 2001 From: tremor021 Date: Mon, 17 Mar 2025 14:40:30 +0100 Subject: [PATCH] Move from git pull to tarball --- ct/cryptpad.sh | 10 ++++++++-- install/cryptpad-install.sh | 12 +++++++----- 2 files changed, 15 insertions(+), 7 deletions(-) diff --git a/ct/cryptpad.sh b/ct/cryptpad.sh index 0da381f..9cb3738 100644 --- a/ct/cryptpad.sh +++ b/ct/cryptpad.sh @@ -35,15 +35,21 @@ function update_script() { msg_ok "Stopped $APP" msg_info "Updating $APP to ${RELEASE}" + cp /opt/cryptpad/config/config.js /opt/config.js + wget -q "https://github.com/cryptpad/cryptpad/archive/refs/tags/${RELEASE}.tar.gz" -O $temp_file + tar zxf $temp_file + cp -rf cryptpad-$RELEASE/* /opt/cryptpad cd /opt/cryptpad - $STD git fetch origin --tags - $STD git checkout $RELEASE $STD npm ci $STD npm run install:components $STD npm run build echo "${RELEASE}" >/opt/${APP}_version.txt msg_ok "Updated $APP to ${RELEASE}" + msg_info "Cleaning Up" + rm -f $temp_file + msg_ok "Cleanup Completed" + msg_info "Starting $APP" systemctl start cryptpad msg_ok "Started $APP" diff --git a/install/cryptpad-install.sh b/install/cryptpad-install.sh index a619697..634b4f4 100644 --- a/install/cryptpad-install.sh +++ b/install/cryptpad-install.sh @@ -33,14 +33,15 @@ $STD apt-get update $STD apt-get install -y nodejs msg_ok "Setup Node.js" -read -p "Do you want to install OnlyOffice components? (Y/N): " onlyoffice +read -p "Install OnlyOffice components instead of CKEditor? (Y/N): " onlyoffice msg_info "Setup ${APPLICATION}" +temp_file=$(mktemp) RELEASE=$(curl -s https://api.github.com/repos/cryptpad/cryptpad/releases/latest | grep "tag_name" | awk '{print substr($2, 2, length($2)-3) }') -cd /opt -$STD git clone https://github.com/cryptpad/cryptpad.git cryptpad -cd cryptpad -$STD git checkout $RELEASE +wget -q "https://github.com/cryptpad/cryptpad/archive/refs/tags/${RELEASE}.tar.gz" -O $temp_file +tar zxf $temp_file +mv cryptpad-$RELEASE /opt/cryptpad +cd /opt/cryptpad $STD npm ci $STD npm run install:components $STD npm run build @@ -81,6 +82,7 @@ motd_ssh customize msg_info "Cleaning up" +rm -f $temp_file $STD apt-get -y autoremove $STD apt-get -y autoclean msg_ok "Cleaned"