mirror of
https://github.com/community-scripts/ProxmoxVE.git
synced 2026-10-01 22:49:39 +00:00
Compare commits
4
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
738c3029fa | ||
|
|
f86db843e2 | ||
|
|
a311805a36 | ||
|
|
e91f2abe21 |
@@ -558,6 +558,11 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
|
||||
- romm: keep the asset links in sync with ROMM_BASE_PATH [@MickLesk](https://github.com/MickLesk) ([#17610](https://github.com/community-scripts/ProxmoxVE/pull/17610))
|
||||
- teslamate: build from the elixir directory since 4.3.0 [@MickLesk](https://github.com/MickLesk) ([#17612](https://github.com/community-scripts/ProxmoxVE/pull/17612))
|
||||
|
||||
- #### ✨ New Features
|
||||
|
||||
- feat(glance): add alpine os [@skilletfun](https://github.com/skilletfun) ([#17605](https://github.com/community-scripts/ProxmoxVE/pull/17605))
|
||||
- feat(blocky): add alpine os [@skilletfun](https://github.com/skilletfun) ([#17637](https://github.com/community-scripts/ProxmoxVE/pull/17637))
|
||||
|
||||
- #### 🔧 Refactor
|
||||
|
||||
- several scripts: apt instead of apt-get, cleanup_lxc, nginx_enable_site, drop needless daemon-reloads [@MickLesk](https://github.com/MickLesk) ([#17624](https://github.com/community-scripts/ProxmoxVE/pull/17624))
|
||||
|
||||
+45
-8
@@ -9,22 +9,30 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
|
||||
APP="Blocky"
|
||||
var_tags="${var_tags:-adblock}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then
|
||||
var_os=$(msg_menu "Choose the container OS" \
|
||||
"debian" "Debian 13" \
|
||||
"alpine" "Alpine 3.24 (smaller footprint)")
|
||||
fi
|
||||
|
||||
if [[ "${var_os:-}" == "alpine" ]]; then
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_version="${var_version:-3.24}"
|
||||
else
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_version="${var_version:-13}"
|
||||
fi
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
update_deb_based() {
|
||||
if [[ ! -d /opt/blocky ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
@@ -46,6 +54,35 @@ function update_script() {
|
||||
exit
|
||||
}
|
||||
|
||||
update_alpine() {
|
||||
if [[ ! -d /opt/blocky ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if check_for_gh_release "blocky" "0xERR0R/blocky"; then
|
||||
msg_info "Stopping Service"
|
||||
rc-service blocky stop
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
create_backup /opt/blocky/config.yml
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "blocky" "0xERR0R/blocky" "prebuild" "latest" "/opt/blocky" "blocky_*_Linux_$(arch_resolve "x86_64" "arm64").tar.gz"
|
||||
restore_backup
|
||||
|
||||
msg_info "Starting Service"
|
||||
rc-service blocky start
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
run_os_update
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
+52
-9
@@ -9,23 +9,30 @@ source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_
|
||||
APP="Glance"
|
||||
var_tags="${var_tags:-dashboard}"
|
||||
var_cpu="${var_cpu:-1}"
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_os="${var_os:-debian}"
|
||||
var_version="${var_version:-13}"
|
||||
var_arm64="${var_arm64:-yes}"
|
||||
var_unprivileged="${var_unprivileged:-1}"
|
||||
if [[ -z "${var_os:-}" ]] && command -v pveversion >/dev/null 2>&1; then
|
||||
var_os=$(msg_menu "Choose the container OS" \
|
||||
"debian" "Debian 13" \
|
||||
"alpine" "Alpine 3.24 (smaller footprint)")
|
||||
fi
|
||||
|
||||
if [[ "${var_os:-}" == "alpine" ]]; then
|
||||
var_ram="${var_ram:-256}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_version="${var_version:-3.24}"
|
||||
else
|
||||
var_ram="${var_ram:-512}"
|
||||
var_disk="${var_disk:-2}"
|
||||
var_version="${var_version:-13}"
|
||||
fi
|
||||
|
||||
header_info "$APP"
|
||||
variables
|
||||
color
|
||||
catch_errors
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
|
||||
update_deb_based() {
|
||||
if [[ ! -f /etc/systemd/system/glance.service ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
@@ -54,6 +61,42 @@ function update_script() {
|
||||
exit
|
||||
}
|
||||
|
||||
update_alpine() {
|
||||
if [[ ! -f /etc/init.d/glance ]]; then
|
||||
msg_error "No ${APP} Installation Found!"
|
||||
exit
|
||||
fi
|
||||
if [[ ! -d /opt/glance_data ]]; then
|
||||
msg_info "Creating config directory"
|
||||
mkdir -p /opt/glance_data/
|
||||
cp /opt/glance/*.yml /opt/glance_data/
|
||||
sed -i 's|/opt/glance/glance\.yml|/opt/glance_data/glance.yml|' /etc/init.d/glance
|
||||
rc-service glance restart
|
||||
msg_ok "Created config directory"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "glance" "glanceapp/glance"; then
|
||||
msg_info "Stopping Service"
|
||||
rc-service glance stop
|
||||
msg_ok "Stopped Service"
|
||||
|
||||
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-$(arch_resolve).tar.gz"
|
||||
|
||||
msg_info "Starting Service"
|
||||
rc-service glance start
|
||||
msg_ok "Started Service"
|
||||
msg_ok "Updated successfully!"
|
||||
fi
|
||||
exit
|
||||
}
|
||||
|
||||
function update_script() {
|
||||
header_info
|
||||
check_container_storage
|
||||
check_container_resources
|
||||
run_os_update
|
||||
}
|
||||
|
||||
start
|
||||
build_container
|
||||
description
|
||||
|
||||
+5
-11
@@ -129,13 +129,6 @@ EOF
|
||||
msg_ok "Restored Admin Interface"
|
||||
fi
|
||||
|
||||
if grep -q '^user npm' /usr/local/openresty/nginx/conf/nginx.conf 2>/dev/null; then
|
||||
msg_info "Repairing OpenResty config"
|
||||
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
|
||||
systemctl restart openresty
|
||||
msg_ok "Repaired OpenResty config"
|
||||
fi
|
||||
|
||||
if check_for_gh_release "nginxproxymanager" "NginxProxyManager/nginx-proxy-manager"; then
|
||||
msg_info "Stopping Services"
|
||||
systemctl stop openresty
|
||||
@@ -172,7 +165,6 @@ EOF
|
||||
cp /opt/nginxproxymanager/docker/rootfs/etc/letsencrypt.ini /etc/letsencrypt.ini
|
||||
cp /opt/nginxproxymanager/docker/rootfs/etc/logrotate.d/nginx-proxy-manager /etc/logrotate.d/nginx-proxy-manager
|
||||
ln -sf /etc/nginx/nginx.conf /etc/nginx/conf/nginx.conf
|
||||
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
|
||||
rm -f /etc/nginx/conf.d/dev.conf
|
||||
if [[ -f /etc/nginx/conf.d/production.conf.template ]]; then
|
||||
ADMIN_PORT=$(grep -oP '^\s*listen\s+\K[0-9]+(?=\s+default)' /etc/nginx/conf.d/production.conf 2>/dev/null | head -n1 || true)
|
||||
@@ -245,16 +237,18 @@ EOF
|
||||
|
||||
msg_info "Starting Services"
|
||||
if [ -f /opt/certbot/bin/certbot ]; then
|
||||
CERTBOT_VER=$(/opt/certbot/bin/certbot --version 2>&1 | awk '/^certbot [0-9]/{print $2; exit}' || true)
|
||||
CERTBOT_VER=$(/opt/certbot/bin/certbot --version 2>&1 | awk '{print $NF}' || echo "0.0.0")
|
||||
elif command -v certbot &>/dev/null; then
|
||||
CERTBOT_VER=$(certbot --version 2>&1 | awk '/^certbot [0-9]/{print $2; exit}' || true)
|
||||
CERTBOT_VER=$(certbot --version 2>&1 | awk '{print $NF}' || echo "0.0.0")
|
||||
else
|
||||
CERTBOT_VER="2.0.0"
|
||||
fi
|
||||
[[ "${CERTBOT_VER:-}" =~ ^[0-9][0-9.]*$ ]] || CERTBOT_VER="2.0.0"
|
||||
if grep -q "Environment=CERTBOT_VERSION" /lib/systemd/system/npm.service; then
|
||||
sed -i "s|Environment=CERTBOT_VERSION=.*|Environment=CERTBOT_VERSION=${CERTBOT_VER}|" /lib/systemd/system/npm.service
|
||||
else
|
||||
sed -i "/Environment=NODE_ENV=production/a Environment=CERTBOT_VERSION=${CERTBOT_VER}" /lib/systemd/system/npm.service
|
||||
fi
|
||||
sed -i 's/user npm/user root/g; s/^pid/#pid/g' /usr/local/openresty/nginx/conf/nginx.conf
|
||||
sed -r -i 's/^([[:space:]]*)su npm npm/\1#su npm npm/g;' /etc/logrotate.d/nginx-proxy-manager
|
||||
if [ -n "$(command -v node)" ]; then
|
||||
sed -i -E "s|^ExecStart=.*/node index\.js|ExecStart=$(command -v node) index.js|" /lib/systemd/system/npm.service
|
||||
|
||||
+83
-11
@@ -13,13 +13,14 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "blocky" "0xERR0R/blocky" "prebuild" "latest" "/opt/blocky" "blocky_*_Linux_$(arch_resolve "x86_64" "arm64").tar.gz"
|
||||
setup_deb_based() {
|
||||
fetch_and_deploy_gh_release "blocky" "0xERR0R/blocky" "prebuild" "latest" "/opt/blocky" "blocky_*_Linux_$(arch_resolve "x86_64" "arm64").tar.gz"
|
||||
|
||||
msg_info "Configuring Blocky"
|
||||
if systemctl is-active systemd-resolved >/dev/null 2>&1; then
|
||||
systemctl disable -q --now systemd-resolved
|
||||
fi
|
||||
cat <<EOF >/opt/blocky/config.yml
|
||||
msg_info "Configuring Blocky"
|
||||
if systemctl is-active systemd-resolved >/dev/null 2>&1; then
|
||||
systemctl disable -q --now systemd-resolved
|
||||
fi
|
||||
cat <<EOF >/opt/blocky/config.yml
|
||||
# configuration documentation: https://0xerr0r.github.io/blocky/latest/configuration/
|
||||
|
||||
upstreams:
|
||||
@@ -61,10 +62,10 @@ log:
|
||||
# optional: Log level (one from trace, debug, info, warn, error). Default: info
|
||||
level: info
|
||||
EOF
|
||||
msg_ok "Configured Blocky"
|
||||
msg_ok "Configured Blocky"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/blocky.service
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/blocky.service
|
||||
[Unit]
|
||||
Description=Blocky
|
||||
After=network-online.target
|
||||
@@ -80,8 +81,79 @@ ExecStart=/opt/blocky/./blocky --config config.yml
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
$STD systemctl enable -q --now blocky
|
||||
msg_ok "Created Service"
|
||||
$STD systemctl enable -q --now blocky
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
setup_alpine() {
|
||||
fetch_and_deploy_gh_release "blocky" "0xERR0R/blocky" "prebuild" "latest" "/opt/blocky" "blocky_*_Linux_$(arch_resolve "x86_64" "arm64").tar.gz"
|
||||
|
||||
msg_info "Configuring Blocky"
|
||||
cat <<EOF >/opt/blocky/config.yml
|
||||
# configuration documentation: https://0xerr0r.github.io/blocky/latest/configuration/
|
||||
|
||||
upstreams:
|
||||
groups:
|
||||
# these external DNS resolvers will be used. Blocky picks 2 random resolvers from the list for each query
|
||||
# format for resolver: [net:]host:[port][/path]. net could be empty (default, shortcut for tcp+udp), tcp+udp, tcp, udp, tcp-tls or https (DoH). If port is empty, default port will be used (53 for udp and tcp, 853 for tcp-tls, 443 for https (Doh))
|
||||
# this configuration is mandatory, please define at least one external DNS resolver
|
||||
default:
|
||||
# Cloudflare
|
||||
- 1.1.1.1
|
||||
# Quad9 DNS-over-TLS server (DoT)
|
||||
- tcp-tls:dns.quad9.net
|
||||
|
||||
# optional: use allow/denylists to block queries (for example ads, trackers, adult pages etc.)
|
||||
blocking:
|
||||
# definition of denylist groups. Can be external link (http/https) or local file
|
||||
denylists:
|
||||
ads:
|
||||
- https://raw.githubusercontent.com/StevenBlack/hosts/master/hosts
|
||||
# definition: which groups should be applied for which client
|
||||
clientGroupsBlock:
|
||||
# default will be used, if no special definition for a client name exists
|
||||
default:
|
||||
- ads
|
||||
|
||||
# optional: write query information (question, answer, client, duration etc.) to daily csv file
|
||||
queryLog:
|
||||
# optional one of: mysql, postgresql, csv, csv-client. If empty, log to console
|
||||
type:
|
||||
|
||||
# optional: use these DNS servers to resolve denylist urls and upstream DNS servers. It is useful if no system DNS resolver is configured, and/or to encrypt the bootstrap queries.
|
||||
bootstrapDns:
|
||||
- upstream: tcp-tls:one.one.one.one
|
||||
ips:
|
||||
- 1.1.1.1
|
||||
|
||||
# optional: logging configuration
|
||||
log:
|
||||
# optional: Log level (one from trace, debug, info, warn, error). Default: info
|
||||
level: info
|
||||
EOF
|
||||
msg_ok "Configured Blocky"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/init.d/blocky
|
||||
#!/sbin/openrc-run
|
||||
name="blocky"
|
||||
description="Blocky Daemon"
|
||||
command="/opt/blocky/blocky"
|
||||
command_args="--config /opt/blocky/config.yml"
|
||||
command_background="yes"
|
||||
pidfile="/run/blocky.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/blocky
|
||||
$STD rc-update add blocky default
|
||||
$STD rc-service blocky start
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
run_os_setup
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
@@ -13,11 +13,12 @@ setting_up_container
|
||||
network_check
|
||||
update_os
|
||||
|
||||
fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-$(arch_resolve).tar.gz"
|
||||
setup_deb_based() {
|
||||
fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-$(arch_resolve).tar.gz"
|
||||
|
||||
msg_info "Configuring Glance"
|
||||
mkdir -p /opt/glance_data
|
||||
cat <<EOF >/opt/glance_data/glance.yml
|
||||
msg_info "Configuring Glance"
|
||||
mkdir -p /opt/glance_data
|
||||
cat <<EOF >/opt/glance_data/glance.yml
|
||||
pages:
|
||||
- name: Startpage
|
||||
width: slim
|
||||
@@ -37,10 +38,10 @@ pages:
|
||||
- title: Helper Scripts
|
||||
url: https://github.com/community-scripts/ProxmoxVE
|
||||
EOF
|
||||
msg_ok "Configured Glance"
|
||||
msg_ok "Configured Glance"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/glance.service
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/systemd/system/glance.service
|
||||
[Unit]
|
||||
Description=Glance Daemon
|
||||
After=network.target
|
||||
@@ -56,8 +57,58 @@ Restart=on-failure
|
||||
[Install]
|
||||
WantedBy=multi-user.target
|
||||
EOF
|
||||
systemctl enable -q --now glance
|
||||
msg_ok "Created Service"
|
||||
systemctl enable -q --now glance
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
setup_alpine() {
|
||||
fetch_and_deploy_gh_release "glance" "glanceapp/glance" "prebuild" "latest" "/opt/glance" "glance-linux-$(arch_resolve).tar.gz"
|
||||
|
||||
msg_info "Configuring Glance"
|
||||
mkdir -p /opt/glance_data
|
||||
cat <<EOF >/opt/glance_data/glance.yml
|
||||
pages:
|
||||
- name: Startpage
|
||||
width: slim
|
||||
hide-desktop-navigation: true
|
||||
center-vertically: true
|
||||
columns:
|
||||
- size: full
|
||||
widgets:
|
||||
- type: search
|
||||
autofocus: true
|
||||
- type: bookmarks
|
||||
groups:
|
||||
- title: General
|
||||
links:
|
||||
- title: Google
|
||||
url: https://www.google.com/
|
||||
- title: Helper Scripts
|
||||
url: https://github.com/community-scripts/ProxmoxVE
|
||||
EOF
|
||||
msg_ok "Configured Glance"
|
||||
|
||||
msg_info "Creating Service"
|
||||
cat <<EOF >/etc/init.d/glance
|
||||
#!/sbin/openrc-run
|
||||
name="glance"
|
||||
description="Glance Daemon"
|
||||
command="/opt/glance/glance"
|
||||
command_args="--config /opt/glance_data/glance.yml"
|
||||
command_background="yes"
|
||||
pidfile="/run/glance.pid"
|
||||
|
||||
depend() {
|
||||
need net
|
||||
}
|
||||
EOF
|
||||
chmod +x /etc/init.d/glance
|
||||
rc-update add glance default
|
||||
rc-service glance start
|
||||
msg_ok "Created Service"
|
||||
}
|
||||
|
||||
run_os_setup
|
||||
|
||||
motd_ssh
|
||||
customize
|
||||
|
||||
Reference in New Issue
Block a user