Compare commits

..
Author SHA1 Message Date
MickLesk 8ab8a4cb1c Generate the NPM admin config and repair certbot's venv on update
2.16.0 ships production.conf only as a template that its s6 prepare step renders,
so installs outside Docker never listened on 81; render it on install, on update
while keeping a custom admin port, and on update for containers already stuck on
2.16.0. Certbot's upgrade died on a dist-info without RECORD, which pip's own
--ignore-installed hint does not clear, so drop such records before upgrading.
2026-09-26 20:44:07 +02:00
4 changed files with 18 additions and 3 deletions
+12
View File
@@ -118,10 +118,18 @@ EOF
$STD "$CERTBOT_PYTHON" -m ensurepip --upgrade
fi
$STD "$CERTBOT_PYTHON" -m pip install --upgrade pip setuptools wheel
find /opt/certbot/lib/python3*/site-packages -maxdepth 1 -name '*.dist-info' -type d ! -exec test -e '{}/RECORD' ';' -exec rm -rf '{}' + 2>/dev/null || true
$STD "$CERTBOT_PYTHON" -m pip install --upgrade certbot certbot-dns-cloudflare
msg_ok "Updated Certbot"
fi
if [[ -f /etc/nginx/conf.d/production.conf.template && ! -f /etc/nginx/conf.d/production.conf ]]; then
msg_info "Restoring Admin Interface"
sed 's/{{NPM_ADMIN_PORT}}/81/g' /etc/nginx/conf.d/production.conf.template >/etc/nginx/conf.d/production.conf
systemctl restart openresty
msg_ok "Restored Admin Interface"
fi
if check_for_gh_release "nginxproxymanager" "NginxProxyManager/nginx-proxy-manager"; then
msg_info "Stopping Services"
systemctl stop openresty
@@ -159,6 +167,10 @@ EOF
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
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)
sed "s/{{NPM_ADMIN_PORT}}/${ADMIN_PORT:-81}/g" /etc/nginx/conf.d/production.conf.template >/etc/nginx/conf.d/production.conf
fi
mkdir -p /tmp/nginx/body \
/run/nginx \
+2 -2
View File
@@ -30,7 +30,7 @@ function update_script() {
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "Trilium" "TriliumNext/Trilium" "" "" "v"; then
if check_for_gh_release "Trilium" "TriliumNext/Trilium"; then
if [[ -d /opt/trilium/db ]]; then
DB_PATH="/opt/trilium/db"
DB_RESTORE_PATH="/opt/trilium/db"
@@ -53,7 +53,7 @@ function update_script() {
rm -rf /opt/trilium
msg_ok "Backed up Database"
fetch_and_deploy_gh_release "Trilium" "TriliumNext/Trilium" "prebuild" "latest" "/opt/trilium" "TriliumNotes-Server-*linux-$(arch_resolve "x64" "arm64").tar.xz" "v"
fetch_and_deploy_gh_release "Trilium" "TriliumNext/Trilium" "prebuild" "latest" "/opt/trilium" "TriliumNotes-Server-*linux-$(arch_resolve "x64" "arm64").tar.xz"
msg_info "Restoring Database"
mkdir -p "$(dirname "${DB_RESTORE_PATH}")"
+3
View File
@@ -96,6 +96,9 @@ 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
rm -f /etc/nginx/conf.d/dev.conf
if [[ -f /etc/nginx/conf.d/production.conf.template ]]; then
sed 's/{{NPM_ADMIN_PORT}}/81/g' /etc/nginx/conf.d/production.conf.template >/etc/nginx/conf.d/production.conf
fi
mkdir -p /tmp/nginx/body \
/run/nginx \
+1 -1
View File
@@ -13,7 +13,7 @@ setting_up_container
network_check
update_os
fetch_and_deploy_gh_release "Trilium" "TriliumNext/Trilium" "prebuild" "latest" "/opt/trilium" "TriliumNotes-Server-*linux-$(arch_resolve "x64" "arm64").tar.xz" "v"
fetch_and_deploy_gh_release "Trilium" "TriliumNext/Trilium" "prebuild" "latest" "/opt/trilium" "TriliumNotes-Server-*linux-$(arch_resolve "x64" "arm64").tar.xz"
msg_info "Creating Service"
cat <<EOF >/etc/systemd/system/trilium.service