Refactor (#6314)
This commit is contained in:
parent
cc6f56fec8
commit
404b9feef2
@ -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)
|
LATEST=$(curl -fsSL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
||||||
IP=$(hostname -I | awk '{print $1}')
|
IP=$(hostname -I | awk '{print $1}')
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
|
$STD apt-get install -y \
|
||||||
$STD apt-get install -y git
|
git \
|
||||||
$STD apt-get install -y make
|
build-essential \
|
||||||
$STD apt-get install -y g++
|
ca-certificates \
|
||||||
$STD apt-get install -y gcc
|
gnupg2
|
||||||
$STD apt-get install -y ca-certificates
|
|
||||||
$STD apt-get install -y gnupg
|
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
msg_info "Setting up Node.js Repository"
|
NODE_VERSION="22" setup_nodejs
|
||||||
mkdir -p /etc/apt/keyrings
|
fetch_and_deploy_gh_release "cronicle" "jhuckaby/Cronicle"
|
||||||
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"
|
|
||||||
|
|
||||||
msg_info "Installing Node.js"
|
msg_info "Configuring Cronicle Worker"
|
||||||
$STD apt-get update
|
|
||||||
$STD apt-get install -y nodejs
|
|
||||||
msg_ok "Installed Node.js"
|
|
||||||
|
|
||||||
msg_info "Installing Cronicle Worker"
|
|
||||||
mkdir -p /opt/cronicle
|
|
||||||
cd /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 npm install
|
||||||
$STD node bin/build.js dist
|
$STD node bin/build.js dist
|
||||||
sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json
|
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
|
chmod 775 /etc/init.d/cronicled
|
||||||
$STD update-rc.d cronicled defaults
|
$STD update-rc.d cronicled defaults
|
||||||
msg_ok "Installed Cronicle Worker"
|
msg_ok "Installed Cronicle Worker"
|
||||||
|
|
||||||
echo -e "\n Add Masters secret key to /opt/cronicle/conf/config.json \n"
|
echo -e "\n Add Masters secret key to /opt/cronicle/conf/config.json \n"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
"updateable": true,
|
"updateable": true,
|
||||||
"privileged": false,
|
"privileged": false,
|
||||||
"interface_port": 3012,
|
"interface_port": 3012,
|
||||||
"documentation": null,
|
"documentation": "https://github.com/jhuckaby/Cronicle/blob/master/README.md",
|
||||||
"website": "https://github.com/jhuckaby/Cronicle",
|
"website": "https://github.com/jhuckaby/Cronicle",
|
||||||
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/chronicle.webp",
|
"logo": "https://cdn.jsdelivr.net/gh/selfhst/icons/webp/chronicle.webp",
|
||||||
"config_path": "/opt/cronicle/conf/config.json",
|
"config_path": "/opt/cronicle/conf/config.json",
|
||||||
|
@ -14,13 +14,11 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
NODE_VERSION="22" setup_nodejs
|
NODE_VERSION="22" setup_nodejs
|
||||||
|
fetch_and_deploy_gh_release "cronicle" "jhuckaby/Cronicle"
|
||||||
|
|
||||||
msg_info "Installing Cronicle Primary Server"
|
msg_info "Configuring Cronicle Primary Server"
|
||||||
LATEST=$(curl -fsSL https://api.github.com/repos/jhuckaby/Cronicle/releases/latest | grep '"tag_name":' | cut -d'"' -f4)
|
|
||||||
IP=$(hostname -I | awk '{print $1}')
|
IP=$(hostname -I | awk '{print $1}')
|
||||||
mkdir -p /opt/cronicle
|
|
||||||
cd /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 npm install
|
||||||
$STD node bin/build.js dist
|
$STD node bin/build.js dist
|
||||||
sed -i "s/localhost:3012/${IP}:3012/g" /opt/cronicle/conf/config.json
|
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
|
$STD cp /opt/cronicle/bin/cronicled.init /etc/init.d/cronicled
|
||||||
chmod 775 /etc/init.d/cronicled
|
chmod 775 /etc/init.d/cronicled
|
||||||
$STD update-rc.d cronicled defaults
|
$STD update-rc.d cronicled defaults
|
||||||
msg_ok "Installed Cronicle Primary Server"
|
msg_ok "Configured Cronicle Primary Server"
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
|
Loading…
x
Reference in New Issue
Block a user