fix: comprehensive script audit - bug fixes and optimizations
- ct/invidious.sh: fix copy-paste bug (OxiCloud code in update block) - install/invidious-install.sh: fix sed redirect, service filename mismatch - ct/forgejo-runner.sh: fix binary download path, bump Debian to 13 - ct/authentik.sh: add -f flag to curl (fail on HTTP errors) - ct/localagi.sh: add -f flag to curl, add installation check guard - ct/ente.sh: fix broken install check (/var -> /opt/ente), apt-get -> apt - ct/garmin-grafana.sh: add explicit tarball mode to fetch_and_deploy - install/garmin-grafana-install.sh: fix local outside function, add tarball mode - install/ente-install.sh: uncomment cleanup_lxc - install/github-runner-install.sh: add missing , fix msg_info text - ct/step-ca.sh: remove duplicate success message - ct/devuan.sh, ct/ubuntu.sh: apt-get -> apt, remove duplicate msg_ok
This commit is contained in:
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -s https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
# Author: Thieneret
|
# Author: Thieneret
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||||
|
|||||||
@@ -29,8 +29,8 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating Devuan LXC"
|
msg_info "Updating Devuan LXC"
|
||||||
$STD apt-get update
|
$STD apt update
|
||||||
$STD apt-get -y upgrade
|
$STD apt -y upgrade
|
||||||
msg_ok "Updated Devuan LXC"
|
msg_ok "Updated Devuan LXC"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -24,13 +24,13 @@ function update_script() {
|
|||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
if [[ ! -d /var ]]; then
|
if [[ ! -d /opt/ente ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating Ente LXC"
|
msg_info "Updating Ente LXC"
|
||||||
$STD apt-get update
|
$STD apt update
|
||||||
$STD apt-get -y upgrade
|
$STD apt -y upgrade
|
||||||
msg_ok "Updated Ente LXC"
|
msg_ok "Updated Ente LXC"
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -12,7 +12,7 @@ var_cpu="${var_cpu:-2}"
|
|||||||
var_ram="${var_ram:-2048}"
|
var_ram="${var_ram:-2048}"
|
||||||
var_disk="${var_disk:-8}"
|
var_disk="${var_disk:-8}"
|
||||||
var_os="${var_os:-debian}"
|
var_os="${var_os:-debian}"
|
||||||
var_version="${var_version:-12}"
|
var_version="${var_version:-13}"
|
||||||
|
|
||||||
var_unprivileged="${var_unprivileged:-1}"
|
var_unprivileged="${var_unprivileged:-1}"
|
||||||
var_nesting="${var_nesting:-1}"
|
var_nesting="${var_nesting:-1}"
|
||||||
@@ -39,7 +39,7 @@ function update_script() {
|
|||||||
|
|
||||||
RELEASE=$(curl -fsSL https://data.forgejo.org/api/v1/repos/forgejo/runner/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+' | sed 's/^v//')
|
RELEASE=$(curl -fsSL https://data.forgejo.org/api/v1/repos/forgejo/runner/releases/latest | grep -oP '"tag_name":\s*"\K[^"]+' | sed 's/^v//')
|
||||||
msg_info "Updating Forgejo Runner to v${RELEASE}"
|
msg_info "Updating Forgejo Runner to v${RELEASE}"
|
||||||
curl -fsSL "https://code.forgejo.org/forgejo/runner/releases/download/v${RELEASE}/forgejo-runner-linux-amd64" -o forgejo-runner
|
curl -fsSL "https://code.forgejo.org/forgejo/runner/releases/download/v${RELEASE}/forgejo-runner-linux-amd64" -o /usr/local/bin/forgejo-runner
|
||||||
chmod +x /usr/local/bin/forgejo-runner
|
chmod +x /usr/local/bin/forgejo-runner
|
||||||
msg_ok "Updated Forgejo Runner"
|
msg_ok "Updated Forgejo Runner"
|
||||||
|
|
||||||
|
|||||||
@@ -40,7 +40,7 @@ function update_script() {
|
|||||||
cp -r /opt/garmin-grafana/.garminconnect /opt/garmin-grafana-tokens.bak
|
cp -r /opt/garmin-grafana/.garminconnect /opt/garmin-grafana-tokens.bak
|
||||||
msg_ok "Backed up Data"
|
msg_ok "Backed up Data"
|
||||||
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "garmin-grafana" "arpanghosh8453/garmin-grafana"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "garmin-grafana" "arpanghosh8453/garmin-grafana" "tarball"
|
||||||
|
|
||||||
msg_info "Restoring Data"
|
msg_info "Restoring Data"
|
||||||
cp /opt/garmin-grafana.env.bak /opt/garmin-grafana/.env
|
cp /opt/garmin-grafana.env.bak /opt/garmin-grafana/.env
|
||||||
|
|||||||
@@ -41,21 +41,22 @@ function update_script() {
|
|||||||
|
|
||||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Invidious" "iv-org/invidious" "tarball" "latest" "/opt/invidious"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Invidious" "iv-org/invidious" "tarball" "latest" "/opt/invidious"
|
||||||
if check_for_gh_release "Invidious-Companion" "iv-org/invidious-companion"; then
|
if check_for_gh_release "Invidious-Companion" "iv-org/invidious-companion"; then
|
||||||
CLEAN_INSTALL fetch_and_deploy_gh_release "Invidious-Companion" "iv-org/invidious-companion" "prebuild" "latest" "/opt/invidious-companion" "invidious_companion-x86_64-unknown-linux-gnu.tar.gz"
|
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "Invidious-Companion" "iv-org/invidious-companion" "prebuild" "latest" "/opt/invidious-companion" "invidious_companion-x86_64-unknown-linux-gnu.tar.gz"
|
||||||
fi
|
fi
|
||||||
|
|
||||||
msg_info "Updating Invidious"
|
msg_info "Rebuilding Invidious"
|
||||||
PG_DB_PASS="$(sed -n '/Password:/s/[^:]*:[[:space:]]//p' ~/oxicloud.creds)"
|
cd /opt/invidious
|
||||||
cd /opt/oxicloud
|
$STD make
|
||||||
export DATABASE_URL="postgres://oxicloud:${PG_DB_PASS}@localhost/oxicloud"
|
msg_ok "Rebuilt Invidious"
|
||||||
export RUSTFLAGS="-C target-cpu=native"
|
|
||||||
$STD cargo build --release
|
|
||||||
mv target/release/oxicloud /usr/bin/oxicloud && chmod +x /usr/bin/oxicloud
|
|
||||||
msg_ok "Updated Invidious"
|
|
||||||
|
|
||||||
msg_info "Starting Invidious"
|
msg_info "Restoring config"
|
||||||
$STD systemctl start oxicloud
|
cp /opt/invidious-config.yml /opt/invidious/config/config.yml
|
||||||
msg_ok "Started Invidious"
|
rm -f /opt/invidious-config.yml
|
||||||
|
msg_ok "Restored config"
|
||||||
|
|
||||||
|
msg_info "Starting services"
|
||||||
|
$STD systemctl start invidious invidious-companion
|
||||||
|
msg_ok "Started services"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated successfully!"
|
||||||
fi
|
fi
|
||||||
exit
|
exit
|
||||||
|
|||||||
@@ -1,5 +1,5 @@
|
|||||||
#!/usr/bin/env bash
|
#!/usr/bin/env bash
|
||||||
source <(curl -sSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVED/main/misc/build.func)
|
||||||
# Copyright (c) 2021-2026 community-scripts ORG
|
# Copyright (c) 2021-2026 community-scripts ORG
|
||||||
# Author: BillyOutlast
|
# Author: BillyOutlast
|
||||||
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
# License: MIT | https://github.com/community-scripts/ProxmoxVED/raw/main/LICENSE
|
||||||
@@ -25,6 +25,11 @@ function update_script() {
|
|||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
|
if [[ ! -d /opt/localagi ]]; then
|
||||||
|
msg_error "No ${APP} Installation Found!"
|
||||||
|
exit
|
||||||
|
fi
|
||||||
|
|
||||||
if check_for_gh_release "localagi" "mudler/LocalAGI"; then
|
if check_for_gh_release "localagi" "mudler/LocalAGI"; then
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop localagi
|
systemctl stop localagi
|
||||||
|
|||||||
@@ -35,9 +35,8 @@ function update_script() {
|
|||||||
|
|
||||||
if check_for_gh_release "step-badger" "lukasz-lobocki/step-badger"; then
|
if check_for_gh_release "step-badger" "lukasz-lobocki/step-badger"; then
|
||||||
fetch_and_deploy_gh_release "step-badger" "lukasz-lobocki/step-badger" "prebuild" "latest" "/opt/step-badger" "step-badger_Linux_x86_64.tar.gz"
|
fetch_and_deploy_gh_release "step-badger" "lukasz-lobocki/step-badger" "prebuild" "latest" "/opt/step-badger" "step-badger_Linux_x86_64.tar.gz"
|
||||||
msg_ok "Updated successfully!"
|
msg_ok "Updated step-badger"
|
||||||
fi
|
fi
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -30,10 +30,9 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
msg_info "Updating Ubuntu LXC"
|
msg_info "Updating Ubuntu LXC"
|
||||||
$STD apt-get update
|
$STD apt update
|
||||||
$STD apt-get -y upgrade
|
$STD apt -y upgrade
|
||||||
msg_ok "Updated Ubuntu LXC"
|
msg_ok "Updated Ubuntu LXC"
|
||||||
msg_ok "Updated successfully!"
|
|
||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -350,4 +350,4 @@ msg_ok "Created helper scripts"
|
|||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
#cleanup_lxc
|
cleanup_lxc
|
||||||
|
|||||||
@@ -54,7 +54,7 @@ msg_ok "Installed Grafana"
|
|||||||
|
|
||||||
msg_info "Configuring Grafana"
|
msg_info "Configuring Grafana"
|
||||||
GRAFANA_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
|
GRAFANA_PASS=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | cut -c1-13)
|
||||||
local retries=0
|
retries=0
|
||||||
while ! grafana-cli admin reset-admin-password "${GRAFANA_PASS}" &>/dev/null; do
|
while ! grafana-cli admin reset-admin-password "${GRAFANA_PASS}" &>/dev/null; do
|
||||||
((retries++))
|
((retries++))
|
||||||
[[ $retries -ge 30 ]] && break
|
[[ $retries -ge 30 ]] && break
|
||||||
@@ -64,7 +64,7 @@ $STD grafana-cli plugins install marcusolsson-hourly-heatmap-panel
|
|||||||
$STD systemctl restart grafana-server
|
$STD systemctl restart grafana-server
|
||||||
msg_ok "Configured Grafana"
|
msg_ok "Configured Grafana"
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "garmin-grafana" "arpanghosh8453/garmin-grafana"
|
fetch_and_deploy_gh_release "garmin-grafana" "arpanghosh8453/garmin-grafana" "tarball"
|
||||||
|
|
||||||
msg_info "Configuring garmin-grafana"
|
msg_info "Configuring garmin-grafana"
|
||||||
mkdir -p /opt/garmin-grafana/.garminconnect
|
mkdir -p /opt/garmin-grafana/.garminconnect
|
||||||
|
|||||||
@@ -12,8 +12,8 @@ network_check
|
|||||||
update_os
|
update_os
|
||||||
|
|
||||||
|
|
||||||
msg_info "Install Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
apt install -y \
|
$STD apt install -y \
|
||||||
git \
|
git \
|
||||||
gh
|
gh
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|||||||
@@ -72,12 +72,11 @@ msg_ok "Migrated database"
|
|||||||
|
|
||||||
msg_info "Configuring services"
|
msg_info "Configuring services"
|
||||||
sed -e 's|=invidious|=root|' \
|
sed -e 's|=invidious|=root|' \
|
||||||
-e 's|/home|/opt|' /opt/invidious.service /etc/systemd/system/invidious.service
|
-e 's|/home|/opt|' /opt/invidious.service >/etc/systemd/system/invidious.service
|
||||||
curl -fsSL https://github.com/iv-org/invidious-companion/raw/refs/heads/master/invidious-companion.service -o /etc/systemd/system/invidious-companion.service
|
curl -fsSL https://github.com/iv-org/invidious-companion/raw/refs/heads/master/invidious-companion.service -o /etc/systemd/system/invidious-companion.service
|
||||||
sed -i -e "s|CHANGE_ME$|${SECRET_KEY}|" \
|
sed -i -e "s|CHANGE_ME$|${SECRET_KEY}|" \
|
||||||
-e 's|=invidious$|=root|' \
|
-e 's|=invidious$|=root|' \
|
||||||
-e 's|/home|/opt|' /etc/systemd/system/invidious_companion.service
|
-e 's|/home|/opt|' /etc/systemd/system/invidious-companion.service
|
||||||
systemctl daemon-reload
|
|
||||||
systemctl -q enable --now invidious invidious-companion
|
systemctl -q enable --now invidious invidious-companion
|
||||||
msg_ok "Configured services"
|
msg_ok "Configured services"
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user