From 404b9feef200b9d791c45b59ac0d80269c855c06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Slavi=C5=A1a=20Are=C5=BEina?= <58952836+tremor021@users.noreply.github.com> Date: Mon, 28 Jul 2025 23:21:47 +0200 Subject: [PATCH] Refactor (#6314) --- ct/cronicle.sh | 29 +++++++++-------------------- frontend/public/json/cronicle.json | 2 +- install/cronicle-install.sh | 8 +++----- 3 files changed, 13 insertions(+), 26 deletions(-) diff --git a/ct/cronicle.sh b/ct/cronicle.sh index 8500a0032..5dc536c38 100644 --- a/ct/cronicle.sh +++ b/ct/cronicle.sh @@ -56,30 +56,18 @@ function update_script() { LATEST=$(curl -fsSL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4) IP=$(hostname -I | awk '{print $1}') msg_info "Installing Dependencies" - - $STD apt-get install -y git - $STD apt-get install -y make - $STD apt-get install -y g++ - $STD apt-get install -y gcc - $STD apt-get install -y ca-certificates - $STD apt-get install -y gnupg + $STD apt-get install -y \ + git \ + build-essential \ + ca-certificates \ + gnupg2 msg_ok "Installed Dependencies" - msg_info "Setting up Node.js Repository" - mkdir -p /etc/apt/keyrings - curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key | gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg - echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_22.x nodistro main" >/etc/apt/sources.list.d/nodesource.list - msg_ok "Set up Node.js Repository" + NODE_VERSION="22" setup_nodejs + fetch_and_deploy_gh_release "cronicle" "jhuckaby/Cronicle" - msg_info "Installing Node.js" - $STD apt-get update - $STD apt-get install -y nodejs - msg_ok "Installed Node.js" - - msg_info "Installing Cronicle Worker" - mkdir -p /opt/cronicle + msg_info "Configuring Cronicle Worker" cd /opt/cronicle - $STD tar zxvf <(curl -fsSL https://github.com/jhuckaby/Cronicle/archive/${LATEST}.tar.gz) --strip-components 1 $STD npm install $STD node bin/build.js dist sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json @@ -88,6 +76,7 @@ function update_script() { chmod 775 /etc/init.d/cronicled $STD update-rc.d cronicled defaults msg_ok "Installed Cronicle Worker" + echo -e "\n Add Masters secret key to /opt/cronicle/conf/config.json \n" exit fi diff --git a/frontend/public/json/cronicle.json b/frontend/public/json/cronicle.json index 8447fd628..395cafb27 100644 --- a/frontend/public/json/cronicle.json +++ b/frontend/public/json/cronicle.json @@ -9,7 +9,7 @@ "updateable": true, "privileged": false, "interface_port": 3012, - "documentation": null, + "documentation": "https://github.com/jhuckaby/Cronicle/blob/master/README.md", "website": "https://github.com/jhuckaby/Cronicle", "logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/chronicle.webp", "config_path": "/opt/cronicle/conf/config.json", diff --git a/install/cronicle-install.sh b/install/cronicle-install.sh index 9caee26ee..36575bbad 100644 --- a/install/cronicle-install.sh +++ b/install/cronicle-install.sh @@ -14,13 +14,11 @@ network_check update_os NODE_VERSION="22" setup_nodejs +fetch_and_deploy_gh_release "cronicle" "jhuckaby/Cronicle" -msg_info "Installing Cronicle Primary Server" -LATEST=$(curl -fsSL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4) +msg_info "Configuring Cronicle Primary Server" IP=$(hostname -I | awk '{print $1}') -mkdir -p /opt/cronicle cd /opt/cronicle -$STD tar zxvf <(curl -fsSL https://github.com/jhuckaby/Cronicle/archive/${LATEST}.tar.gz) --strip-components 1 $STD npm install $STD node bin/build.js dist sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json @@ -29,7 +27,7 @@ $STD /opt/cronicle/bin/control.sh start $STD cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled chmod 775 /etc/init.d/cronicled $STD update-rc.d cronicled defaults -msg_ok "Installed Cronicle Primary Server" +msg_ok "Configured Cronicle Primary Server" motd_ssh customize