Refactor: Alpine IT-Tools (#6579)

* Refactor

* Update

* Update deps
This commit is contained in:
Slaviša Arežina
2025-08-08 15:42:09 +02:00
committed by GitHub
parent d934d1b51b
commit e2a310dd3a
3 changed files with 15 additions and 16 deletions

View File

@@ -14,17 +14,17 @@ network_check
update_os
msg_info "Installing Dependencies"
$STD apk add nginx
$STD apk add --no-cache \
nginx \
python3
msg_ok "Installed Dependencies"
msg_info "Installing IT-Tools"
RELEASE=$(curl -fsSL https://api.github.com/repos/CorentinTh/it-tools/releases/latest | grep '"tag_name":' | cut -d '"' -f4)
DOWNLOAD_URL="https://github.com/CorentinTh/it-tools/releases/download/${RELEASE}/it-tools-${RELEASE#v}.zip"
curl -fsSL -o it-tools.zip "$DOWNLOAD_URL"
RELEASE=$(curl -fsSL https://api.github.com/repos/sharevb/it-tools/releases/latest | grep '"tag_name":' | cut -d '"' -f4)
curl -fsSL "https://github.com/sharevb/it-tools/releases/download/${RELEASE}/it-tools-${RELEASE#v}.zip" -o it-tools.zip
mkdir -p /usr/share/nginx/html
$STD unzip it-tools.zip -d /tmp/it-tools
cp -r /tmp/it-tools/dist/* /usr/share/nginx/html
$STD unzip it-tools.zip -d /tmp/
mv /tmp/dist/* /usr/share/nginx/html
cat <<'EOF' >/etc/nginx/http.d/default.conf
server {
listen 80;
@@ -39,14 +39,14 @@ server {
EOF
$STD rc-update add nginx default
$STD rc-service nginx start
echo "${RELEASE}" >/opt/${APPLICATION}_version.txt
echo "${RELEASE}" >/opt/"${APPLICATION}"_version.txt
msg_ok "Installed IT-Tools"
motd_ssh
customize
msg_info "Cleaning up"
rm -rf /tmp/it-tools
rm -rf /tmp/dist
rm -f it-tools.zip
$STD apk cache clean
msg_ok "Cleaned"