diff --git a/install/gitea-install.sh b/install/gitea-install.sh index 88af785f8..e48029432 100644 --- a/install/gitea-install.sh +++ b/install/gitea-install.sh @@ -15,8 +15,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y git -$STD apt-get install -y sqlite3 +$STD apt install -y git sqlite3 msg_ok "Installed Dependencies" fetch_and_deploy_gh_release "gitea" "go-gitea/gitea" "singlefile" "latest" "/usr/local/bin" "gitea-*-linux-amd64" @@ -68,8 +67,4 @@ msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/glance-install.sh b/install/glance-install.sh index 23850e784..687f0c837 100644 --- a/install/glance-install.sh +++ b/install/glance-install.sh @@ -39,8 +39,7 @@ EOF msg_ok "Configured Glance" msg_info "Creating Service" -service_path="/etc/systemd/system/glance.service" -echo "[Unit] +cat </etc/systemd/system/glance.service Description=Glance Daemon After=network.target @@ -53,15 +52,11 @@ KillMode=process Restart=on-failure [Install] -WantedBy=multi-user.target" >$service_path - +WantedBy=multi-user.target +EOF systemctl enable -q --now glance msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/go2rtc-install.sh b/install/go2rtc-install.sh index 2abfd4779..0bc754f64 100644 --- a/install/go2rtc-install.sh +++ b/install/go2rtc-install.sh @@ -34,8 +34,4 @@ msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/goaway-install.sh b/install/goaway-install.sh index 061ebfb7b..3db1d4f19 100644 --- a/install/goaway-install.sh +++ b/install/goaway-install.sh @@ -14,7 +14,7 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y net-tools +$STD apt install -y net-tools msg_ok "Installed Dependencies" fetch_and_deploy_gh_release "goaway" "pommee/goaway" "prebuild" "latest" "/opt/goaway" "goaway_*_linux_amd64.tar.gz" @@ -54,9 +54,4 @@ msg_ok "Service Created" motd_ssh customize - -msg_info "Cleaning up" -$STD apt -y autoremove -$STD apt -y autoclean -$STD apt -y clean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/gokapi-install.sh b/install/gokapi-install.sh index 272a7a05f..1fd714e8e 100644 --- a/install/gokapi-install.sh +++ b/install/gokapi-install.sh @@ -39,8 +39,4 @@ msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/gotify-install.sh b/install/gotify-install.sh index 15fe235d2..86c215316 100644 --- a/install/gotify-install.sh +++ b/install/gotify-install.sh @@ -39,8 +39,4 @@ msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/grafana-install.sh b/install/grafana-install.sh index 5c1920002..a5a722c01 100644 --- a/install/grafana-install.sh +++ b/install/grafana-install.sh @@ -14,26 +14,25 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ +$STD apt install -y \ apt-transport-https \ software-properties-common msg_ok "Installed Dependencies" msg_info "Setting up Grafana Repository" -curl -fsSL "https://apt.grafana.com/gpg.key" -o "/usr/share/keyrings/grafana.key" -echo "deb [signed-by=/usr/share/keyrings/grafana.key] https://apt.grafana.com stable main" >/etc/apt/sources.list.d/grafana.list +setup_deb822_repo \ + "grafana" \ + "https://apt.grafana.com/gpg.key" \ + "https://apt.grafana.com" \ + "stable" \ + "main" msg_ok "Set up Grafana Repository" msg_info "Installing Grafana" -$STD apt-get update -$STD apt-get install -y grafana -systemctl enable -q --now grafana-server +$STD apt install -y grafana +systemctl enable -q --now grafana-server msg_ok "Installed Grafana" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/graylog-install.sh b/install/graylog-install.sh index 397d8ebab..91afdbbac 100644 --- a/install/graylog-install.sh +++ b/install/graylog-install.sh @@ -19,17 +19,17 @@ msg_info "Setup Graylog Data Node" PASSWORD_SECRET=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16) curl -fsSL "https://packages.graylog2.org/repo/packages/graylog-6.3-repository_latest.deb" -o "graylog-6.3-repository_latest.deb" $STD dpkg -i graylog-6.3-repository_latest.deb -$STD apt-get update -$STD apt-get install graylog-datanode -y +$STD apt update +$STD apt install graylog-datanode -y sed -i "s/password_secret =/password_secret = $PASSWORD_SECRET/g" /etc/graylog/datanode/datanode.conf systemctl enable -q --now graylog-datanode msg_ok "Setup Graylog Data Node" -msg_info "Setup ${APPLICATION}" -$STD apt-get install graylog-server +msg_info "Setup Graylog" +$STD apt install graylog-server ROOT_PASSWORD=$(openssl rand -base64 18 | tr -dc 'a-zA-Z0-9' | head -c16) { - echo "${APPLICATION} Credentials" + echo "Graylog Credentials" echo "Admin User: admin" echo "Admin Password: ${ROOT_PASSWORD}" } >>~/graylog.creds @@ -38,13 +38,9 @@ sed -i "s/password_secret =/password_secret = $PASSWORD_SECRET/g" /etc/graylog/s sed -i "s/root_password_sha2 =/root_password_sha2 = $ROOT_PASSWORD/g" /etc/graylog/server/server.conf sed -i 's/#http_bind_address = 127.0.0.1.*/http_bind_address = 0.0.0.0:9000/g' /etc/graylog/server/server.conf systemctl enable -q --now graylog-server -msg_ok "Setup ${APPLICATION}" +rm -f graylog-*-repository_latest.deb +msg_ok "Setup Graylog" motd_ssh customize - -msg_info "Cleaning up" -rm -f graylog-*-repository_latest.deb -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/grist-install.sh b/install/grist-install.sh index f499b3da3..9c49b62ac 100644 --- a/install/grist-install.sh +++ b/install/grist-install.sh @@ -14,11 +14,12 @@ network_check update_os msg_info "Installing Dependencies" -$STD apt-get install -y \ +$STD apt install -y \ make \ ca-certificates \ python3-venv msg_ok "Installed Dependencies" + NODE_VERSION="22" NODE_MODULE="yarn@latest" setup_nodejs fetch_and_deploy_gh_release "grist" "gristlabs/grist-core" "tarball" @@ -50,14 +51,9 @@ EnvironmentFile=-/opt/grist/.env [Install] WantedBy=multi-user.target EOF - systemctl enable -q --now grist msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/grocy-install.sh b/install/grocy-install.sh index d1e888392..7eb2edb7f 100644 --- a/install/grocy-install.sh +++ b/install/grocy-install.sh @@ -13,10 +13,6 @@ setting_up_container network_check update_os -msg_info "Installing Dependencies" -$STD apt-get install -y apt-transport-https -msg_ok "Installed Dependencies" - PHP_VERSION="8.3" PHP_MODULE="sqlite3,bz2" PHP_APACHE="yes" setup_php fetch_and_deploy_gh_release "grocy" "grocy/grocy" "prebuild" "latest" "/var/www/html" "grocy*.zip" @@ -47,8 +43,4 @@ msg_ok "Installed grocy" motd_ssh customize - -msg_info "Cleaning up" -$STD apt-get -y autoremove -$STD apt-get -y autoclean -msg_ok "Cleaned" +cleanup_lxc diff --git a/install/guardian-install.sh b/install/guardian-install.sh index 994ee4407..894032e6b 100644 --- a/install/guardian-install.sh +++ b/install/guardian-install.sh @@ -20,7 +20,7 @@ msg_ok "Installed Dependencies" NODE_VERSION="24" setup_nodejs fetch_and_deploy_gh_release "guardian" "HydroshieldMKII/Guardian" "tarball" "latest" "/opt/guardian" -msg_info "Configuring ${APPLICATION}" +msg_info "Configuring Guardian" cd /opt/guardian/backend $STD npm ci $STD npm run build @@ -28,7 +28,7 @@ cd /opt/guardian/frontend $STD npm ci export DEPLOYMENT_MODE=standalone $STD npm run build -msg_ok "Configured ${APPLICATION}" +msg_ok "Configured Guardian" msg_info "Creating Service" cat </etc/systemd/system/guardian-backend.service @@ -60,16 +60,10 @@ RestartSec=3 [Install] WantedBy=multi-user.target EOF - systemctl enable -q --now guardian-backend systemctl enable -q --now guardian-frontend msg_ok "Created Service" motd_ssh customize - -msg_info "Cleaning up" -$STD apt -y autoremove -$STD apt -y autoclean -$STD apt -y clean -msg_ok "Cleaned" +cleanup_lxc diff --git a/misc/tools.func b/misc/tools.func index 05604d51d..73eb08a37 100644 --- a/misc/tools.func +++ b/misc/tools.func @@ -622,7 +622,8 @@ setup_deb822_repo() { } # Create deb822 sources file - cat </etc/apt/sources.list.d/${name}.sources + if [[ -n "$component" ]]; then + cat </etc/apt/sources.list.d/${name}.sources Types: deb URIs: $repo_url Suites: $suite @@ -630,6 +631,15 @@ Components: $component Architectures: $architectures Signed-By: /etc/apt/keyrings/${name}.gpg EOF + else + cat </etc/apt/sources.list.d/${name}.sources +Types: deb +URIs: $repo_url +Suites: $suite +Architectures: $architectures +Signed-By: /etc/apt/keyrings/${name}.gpg +EOF + fi # Use cached apt update local apt_cache_file="/var/cache/apt-update-timestamp" @@ -1141,7 +1151,7 @@ function fetch_and_deploy_gh_release() { rm -rf "${target:?}/"* fi - tar --no-same-owner -xzf "$tmpdir/$filename" -C "$tmpdir" || { + tar --no-same-owner -xzf "$tmpdir/$filename" -C "$tmpdir" || { msg_error "Failed to extract tarball" rm -rf "$tmpdir" return 1