Compare commits

..
Author SHA1 Message Date
MickLesk 06d17359fc Host tools: report the containers' real exit code and what failed
update-lxcs and clean-lxcs ended with 1 even when every failed container
gave the same code (141 of 163 update-lxcs failures in a week were apt's
100); they now exit with that code. update-apps adds the failing step from
the engine's .errinfo in the container, so "exit code: 1" says what broke.
2026-11-28 15:06:16 +01:00
community-scripts-pr-app[bot]andgithub-actions[bot] a7216552a4 Update CHANGELOG.md (#19151)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-28 14:00:40 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] 95c8b405cd Update CHANGELOG.md (#19150)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-28 14:00:05 +00:00
community-scripts-pr-app[bot]andgithub-actions[bot] 45c058574f Update CHANGELOG.md (#19149)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2026-11-28 13:22:43 +00:00
push-app-to-main[bot] 5712738915 Add dokuwiki (ct) (#19138)
Co-authored-by: push-app-to-main[bot] <203845782+push-app-to-main[bot]@users.noreply.github.com>
2026-11-28 14:22:12 +01:00
8 changed files with 221 additions and 125 deletions

No files matched your search

+8 -1
View File
@@ -589,6 +589,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
## 2026-11-28
### 🆕 New Scripts
- DokuWiki [@MickLesk](https://github.com/MickLesk) ([#19138](https://github.com/community-scripts/ProxmoxVE/pull/19138))
### 🚀 Updated Scripts
- #### 🐞 Bug Fixes
@@ -597,7 +601,10 @@ Exercise vigilance regarding copycat or coat-tailing sites that seek to exploit
### 💾 Core
- PHP: Keep Sury from pulling a second PHP in, and read the version from packages [@MickLesk](https://github.com/MickLesk) ([core#316](https://github.com/community-scripts/core/pull/316))
- Leave a legacy version file to the app it belongs to [@MickLesk](https://github.com/MickLesk) ([core#317](https://github.com/community-scripts/core/pull/317))
- incus: draw the banner when the header cache belongs to another user [@MickLesk](https://github.com/MickLesk) ([core#318](https://github.com/community-scripts/core/pull/318))
- Incus: Report Incus VM runs to telemetry [@MickLesk](https://github.com/MickLesk) ([core#319](https://github.com/community-scripts/core/pull/319))
- PHP: Keep Sury from pulling a second PHP in, and read the version from packages [@MickLesk](https://github.com/MickLesk) ([core#316](https://github.com/community-scripts/core/pull/316))
- Give PVE containers from linuxcontainers.org images the Proxmox templates Base set [@MickLesk](https://github.com/MickLesk) ([core#315](https://github.com/community-scripts/core/pull/315))
- PHP: keep modules, pools and settings when setup_php changes the PHP version [@MickLesk](https://github.com/MickLesk) ([core#314](https://github.com/community-scripts/core/pull/314))
-53
View File
@@ -1,53 +0,0 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/coder/coder
APP="Coder"
var_tags="${var_tags:-development;ide;workspaces}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_access_url="${var_access_url:-}"
export var_admin_email="${var_admin_email:-}"
export var_admin_pass="${var_admin_pass:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -f /etc/coder.d/coder.env ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "coder" "coder/coder"; then
DPKG_FORCE_CONFOLD=1 fetch_and_deploy_gh_release "coder" "coder/coder" "binary" "latest" "" "coder_*_linux_$(arch_resolve "amd64" "arm64").deb"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}:3000${CL}"
echo -e "${INFO}${YW}Admin credentials: /opt/coder_data/.env${CL}"
+66
View File
@@ -0,0 +1,66 @@
#!/usr/bin/env bash
_cs_boot="${COMMUNITY_SCRIPTS_CORE_DIR:-$(dirname "${BASH_SOURCE[0]}")/../../core}/core/build.func"
source "$_cs_boot" 2>/dev/null || source <(curl -fsSL "${COMMUNITY_SCRIPTS_CORE_URL:-https://raw.githubusercontent.com/community-scripts/core/main}/core/build.func")
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/dokuwiki/dokuwiki
APP="DokuWiki"
var_tags="${var_tags:-wiki;documentation}"
var_cpu="${var_cpu:-1}"
var_ram="${var_ram:-512}"
var_disk="${var_disk:-4}"
var_os="${var_os:-debian}"
var_version="${var_version:-13}"
var_arm64="${var_arm64:-yes}"
var_unprivileged="${var_unprivileged:-1}"
export var_admin_user="${var_admin_user:-}"
export var_admin_pass="${var_admin_pass:-}"
header_info "$APP"
variables
color
catch_errors
function update_script() {
header_info
check_container_storage
check_container_resources
if [[ ! -d /opt/dokuwiki ]]; then
msg_error "No ${APP} Installation Found!"
exit
fi
if check_for_gh_release "dokuwiki" "dokuwiki/dokuwiki"; then
msg_info "Stopping DokuWiki"
systemctl stop nginx php8.4-fpm
msg_ok "Stopped DokuWiki"
fetch_and_deploy_gh_release "dokuwiki" "dokuwiki/dokuwiki" "prebuild" "latest" "/opt/dokuwiki" "dokuwiki-*.tgz"
msg_info "Removing obsolete DokuWiki files"
grep -E '^[[:alnum:]_][^[:space:]]*$' /opt/dokuwiki/data/deleted.files | grep -Fv '..' | sed 's|^|/opt/dokuwiki/|' | xargs -r -d '\n' rm -rf --
rm -f /opt/dokuwiki/install.php /opt/dokuwiki/data/cache/messages.txt
chown -R www-data:www-data /opt/dokuwiki
msg_ok "Removed obsolete DokuWiki files"
msg_info "Starting DokuWiki"
systemctl start php8.4-fpm nginx
msg_ok "Started DokuWiki"
msg_ok "Updated successfully!"
fi
exit
}
start
build_container
description
msg_ok "Completed Successfully!\n"
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
echo -e "${INFO}${YW}Access it using the following URL:${CL}"
echo -e "${GATEWAY}${BGN}http://${IP}${CL}"
echo -e "${INFO}${YW}Admin login: /opt/dokuwiki_data/.env (inside the container)${CL}"
-68
View File
@@ -1,68 +0,0 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/coder/coder
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
setup_postgresql
PG_DB_NAME="coder" PG_DB_USER="coder" PG_DB_CREDS_FILE="/dev/null" setup_postgresql_db
fetch_and_deploy_gh_release "coder" "coder/coder" "binary" "latest" "" "coder_*_linux_$(arch_resolve "amd64" "arm64").deb"
var_access_url="${var_access_url:-http://${LOCAL_IP}:3000}"
if [[ ! "$var_access_url" =~ ^https?:// ]]; then
msg_warn "Access URL '${var_access_url}' has no scheme, using http://${var_access_url}"
var_access_url="http://${var_access_url}"
fi
msg_info "Configuring Coder"
cat <<EOF >/etc/coder.d/coder.env
CODER_HTTP_ADDRESS=0.0.0.0:3000
CODER_ACCESS_URL=${var_access_url}
CODER_PG_CONNECTION_URL=postgres://coder:${PG_DB_PASS}@127.0.0.1:5432/coder?sslmode=disable
EOF
chmod 640 /etc/coder.d/coder.env
chown root:coder /etc/coder.d/coder.env
mkdir -p /opt/coder_data
cat <<EOF >/opt/coder_data/.env
CODER_ADMIN_USERNAME=admin
CODER_ADMIN_EMAIL=${var_admin_email:-admin@coder.local}
CODER_ADMIN_PASSWORD=${var_admin_pass:-$(random_password)}
EOF
chmod 600 /opt/coder_data/.env
# The first start runs all database migrations before it reports ready, longer than 90s on slow disks
mkdir -p /etc/systemd/system/coder.service.d
cat <<EOF >/etc/systemd/system/coder.service.d/override.conf
[Service]
TimeoutStartSec=30min
EOF
systemctl daemon-reload
systemctl enable -q --now coder
msg_ok "Configured Coder"
msg_info "Creating Coder Admin"
source /opt/coder_data/.env
for _ in {1..60}; do
curl -fsS http://127.0.0.1:3000/healthz >/dev/null 2>&1 && break
sleep 2
done
$STD coder login http://127.0.0.1:3000 \
--first-user-username "$CODER_ADMIN_USERNAME" \
--first-user-email "$CODER_ADMIN_EMAIL" \
--first-user-password "$CODER_ADMIN_PASSWORD" \
--first-user-full-name "Admin" \
--first-user-trial=false
msg_ok "Created Coder Admin"
motd_ssh
customize
cleanup_lxc
+127
View File
@@ -0,0 +1,127 @@
#!/usr/bin/env bash
# Copyright (c) 2021-2026 community-scripts ORG
# Author: MickLesk (CanbiZ)
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
# Source: https://github.com/dokuwiki/dokuwiki
source /dev/stdin <<<"$FUNCTIONS_FILE_PATH"
color
verb_ip6
catch_errors
setting_up_container
network_check
update_os
var_admin_user="${var_admin_user:-admin}"
var_admin_user="${var_admin_user,,}"
if [[ ! "$var_admin_user" =~ ^[a-z0-9._-]+$ ]]; then
msg_warn "Invalid admin username '${var_admin_user}', using admin"
var_admin_user="admin"
fi
var_admin_pass="${var_admin_pass:-$(random_password 16)}"
msg_info "Installing Dependencies"
$STD apt install -y nginx
msg_ok "Installed Dependencies"
PHP_VERSION="8.4" PHP_FPM="YES" setup_php
fetch_and_deploy_gh_release "dokuwiki" "dokuwiki/dokuwiki" "prebuild" "latest" "/opt/dokuwiki" "dokuwiki-*.tgz"
msg_info "Configuring DokuWiki"
mkdir -p /opt/dokuwiki_data
cat <<EOF >/opt/dokuwiki_data/.env
DOKUWIKI_ADMIN_USER=${var_admin_user}
DOKUWIKI_ADMIN_PASS=${var_admin_pass}
EOF
chmod 600 /opt/dokuwiki_data/.env
cat <<'EOF' >/opt/dokuwiki/conf/local.php
<?php
$conf['title'] = 'DokuWiki';
$conf['lang'] = 'en';
$conf['license'] = 'cc-by-sa';
$conf['useacl'] = 1;
$conf['superuser'] = '@admin';
$conf['disableactions'] = 'register';
$conf['userewrite'] = 1;
EOF
ADMIN_HASH=$(php -r 'echo password_hash($argv[1], PASSWORD_BCRYPT);' "$var_admin_pass")
cat <<EOF >/opt/dokuwiki/conf/users.auth.php
# users.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# login:passwordhash:Real Name:email:groups,comma,separated
${var_admin_user}:${ADMIN_HASH}:Administrator:admin@localhost:admin,user
EOF
cat <<'EOF' >/opt/dokuwiki/conf/acl.auth.php
# acl.auth.php
# <?php exit()?>
# Don't modify the lines above
#
# none 0, read 1, edit 2, create 4, upload 8, delete 16
* @ALL 1
* @user 8
EOF
cat <<'EOF' >/opt/dokuwiki/conf/plugins.local.php
<?php
$plugins['authad'] = 0;
$plugins['authldap'] = 0;
EOF
rm -f /opt/dokuwiki/install.php
chown -R www-data:www-data /opt/dokuwiki
msg_ok "Configured DokuWiki"
msg_info "Configuring Nginx"
PHP_SOCK=$(get_php_fpm_socket)
cat <<EOF >/etc/nginx/sites-available/dokuwiki
server {
listen 80;
listen [::]:80;
server_name _;
root /opt/dokuwiki;
index doku.php;
client_max_body_size 128M;
server_tokens off;
fastcgi_hide_header X-Powered-By;
location ~ ^/(conf|bin|inc|vendor)/ {
deny all;
}
location ~ ^/data/ {
internal;
}
location ~ /\.|^/(install\.php|README|VERSION|COPYING|SECURITY\.md)\$ {
deny all;
}
location ~ ^/lib.*\.(js|css|gif|png|ico|jpg|jpeg|svg)\$ {
expires 365d;
}
location / {
try_files \$uri \$uri/ @dokuwiki;
}
location @dokuwiki {
rewrite ^/_media/(.*) /lib/exe/fetch.php?media=\$1 last;
rewrite ^/_detail/(.*) /lib/exe/detail.php?media=\$1 last;
rewrite ^/_export/([^/]+)/(.*) /doku.php?do=export_\$1&id=\$2 last;
rewrite ^/(.*) /doku.php?id=\$1&\$args last;
}
location ~ \.php\$ {
try_files \$uri \$uri/ /doku.php;
include fastcgi_params;
fastcgi_param SCRIPT_FILENAME \$document_root\$fastcgi_script_name;
fastcgi_param REDIRECT_STATUS 200;
fastcgi_pass unix:${PHP_SOCK};
}
}
EOF
nginx_enable_site "dokuwiki"
msg_ok "Configured Nginx"
motd_ssh
customize
cleanup_lxc
+5
View File
@@ -161,6 +161,11 @@ if [ "${#failed_containers[@]}" -gt 0 ]; then
[ -s "$RUN_LOG" ] && echo -e "Their output: $RUN_LOG\n"
printf -v CS_ERROR_MSG '%s; ' "${failed_containers[@]}"
CS_ERROR_MSG="Cleaning failed in ${#failed_containers[@]} container(s): ${CS_ERROR_MSG%; }"
# One code shared by every failed container is the real one (100 is apt), not "1".
codes=$(printf '%s\n' "${failed_containers[@]}" | sed -n 's/^[^:]*: cleaning exited with \([0-9]*\).*/\1/p')
if [[ -n "$codes" && $(wc -l <<<"$codes") -eq ${#failed_containers[@]} && $(sort -u <<<"$codes" | wc -l) -eq 1 ]]; then
exit "$(head -n1 <<<"$codes")"
fi
exit 1
fi
echo -e "${GN} Finished, Selected Containers Cleaned. ${CL} \n"
+10 -3
View File
@@ -620,6 +620,7 @@ for container in $CHOICE; do
fi
#4) Update service, using the update command
pct exec "$container" -- touch /tmp/.cs-update-start 2>/dev/null || true
# Prepend a no-op 'clear' wrapper to PATH so update scripts calling clear
# don't fail without a TTY — works for all shells incl. ash (no export -f)
SETUP_CMD="mkdir -p /tmp/.nc; printf '#!/bin/sh\n:\n' > /tmp/.nc/clear; chmod +x /tmp/.nc/clear; export PATH=/tmp/.nc:\$PATH; export TERM=dumb; "
@@ -631,6 +632,12 @@ for container in $CHOICE; do
opensuse) pct exec "$container" -- bash -c "${SETUP_CMD}${UPDATE_CMD}" ;;
esac
exit_code=$?
# The engine in the container leaves what failed in an .errinfo file; without it
# the report says only "exit code: 1".
update_detail=""
if [ $exit_code -ne 0 ]; then
update_detail=$(pct exec "$container" -- sh -c 'f=$(find /root /tmp -maxdepth 1 -name "*.errinfo" -newer /tmp/.cs-update-start 2>/dev/null | head -n1); [ -n "$f" ] || exit 0; m=$(sed -n "s/^MESSAGE=//p" "$f" | head -n1); [ -n "$m" ] || m=$(sed -n "s/^COMMAND=//p" "$f" | head -n1); printf "%s" "$m" | head -c 200' 2>/dev/null || true)
fi
#5) if build resources are different than run resources, then:
if [ "$UPDATE_BUILD_RESOURCES" -eq "1" ]; then
@@ -665,7 +672,7 @@ for container in $CHOICE; do
log_result "$container" "$service" "SKIPPED" "Storage critically low on /boot (>80%)"
log_write "Container $container ($service): SKIPPED — storage critically low on /boot"
elif [ "$BACKUP_CHOICE" == "yes" ]; then
msg_error "Update failed for container $container ($service, exit code: $exit_code) — attempting restore"
msg_error "Update failed for container $container ($service, exit code: $exit_code)${update_detail:+: $update_detail} — attempting restore"
log_write "Container $container ($service): FAILED (exit $exit_code) — attempting restore"
msg_info "Restoring LXC $container from backup ($STORAGE_CHOICE)"
wait
@@ -703,8 +710,8 @@ for container in $CHOICE; do
exit 235
fi
else
msg_error "Update failed for container $container ($service, exit code: $exit_code)"
log_result "$container" "$service" "FAILED" "Exit code $exit_code"
msg_error "Update failed for container $container ($service, exit code: $exit_code)${update_detail:+: $update_detail}"
log_result "$container" "$service" "FAILED" "Exit code $exit_code${update_detail:+: $update_detail}"
log_write "Container $container ($service): FAILED (exit $exit_code)"
if [[ "$var_continue_on_error" == "yes" ]]; then
echo -e "${YW}[WARN]${CL} Continuing to next container (var_continue_on_error=yes)"
+5
View File
@@ -174,5 +174,10 @@ echo ""
if [ "${#failed_containers[@]}" -gt 0 ]; then
printf -v CS_ERROR_MSG '%s; ' "${failed_containers[@]}"
CS_ERROR_MSG="Update failed in ${#failed_containers[@]} container(s): ${CS_ERROR_MSG%; }"
# One code shared by every failed container is the real one (100 is apt), not "1".
codes=$(printf '%s\n' "${failed_containers[@]}" | sed -n 's/^[^:]*: update exited with \([0-9]*\).*/\1/p')
if [[ -n "$codes" && $(wc -l <<<"$codes") -eq ${#failed_containers[@]} && $(sort -u <<<"$codes" | wc -l) -eq 1 ]]; then
exit "$(head -n1 <<<"$codes")"
fi
exit 1
fi