Update contribution docs and templates for best practices

Refreshed AI.md with new reference scripts, expanded checklist, and improved AI assistant tips. Updated container and install script templates for modern defaults (Debian 13, larger disk, two tags), clarified helper function usage, and improved update/backup patterns. Enhanced JSON template with realistic metadata, new fields, and example notes.
This commit is contained in:
CanbiZ
2026-01-18 17:54:44 +01:00
parent 5a975901ea
commit acdf4dbb2a
4 changed files with 190 additions and 135 deletions
+23 -30
View File
@@ -7,12 +7,12 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV
# App Default Values
APP="[AppName]"
var_tags="${var_tags:-[category]}"
var_tags="${var_tags:-[category1];[category2]}"
var_cpu="${var_cpu:-2}"
var_ram="${var_ram:-2048}"
var_disk="${var_disk:-4}"
var_disk="${var_disk:-8}"
var_os="${var_os:-debian}"
var_version="${var_version:-12}"
var_version="${var_version:-13}"
var_unprivileged="${var_unprivileged:-1}"
# =============================================================================
@@ -20,12 +20,12 @@ var_unprivileged="${var_unprivileged:-1}"
# =============================================================================
# APP - Display name, title case (e.g. "Koel", "Wallabag", "Actual Budget")
# var_tags - Max 2 tags, semicolon separated (e.g. "music;streaming", "finance")
# var_cpu - CPU cores: 1-4 typical
# var_ram - RAM in MB: 512, 1024, 2048, 4096 typical
# var_disk - Disk in GB: 4, 6, 8, 10, 20 typical
# var_cpu - CPU cores: 1-4 typical, 4+ for heavy apps
# var_ram - RAM in MB: 512, 1024, 2048, 4096, 8192 typical
# var_disk - Disk in GB: 6, 8, 10, 20 typical (more for data-heavy apps)
# var_os - OS: debian, ubuntu, alpine
# var_version - OS version: 12/13 (debian), 22.04/24.04 (ubuntu), 3.20/3.21 (alpine)
# var_unprivileged - 1 = unprivileged (secure, default), 0 = privileged (for docker etc.)
# var_version - OS version: 13 (debian), 24.04 (ubuntu), 3.21 (alpine)
# var_unprivileged - 1 = unprivileged (secure, default), 0 = privileged (for podman/docker)
header_info "$APP"
variables
@@ -45,39 +45,32 @@ function update_script() {
# check_for_gh_release returns 0 (true) if update available, 1 (false) if not
if check_for_gh_release "[appname]" "[owner/repo]"; then
msg_info "Stopping Services"
msg_info "Stopping Service"
systemctl stop [appname]
msg_ok "Stopped Services"
msg_ok "Stopped Service"
# Optional: Backup important data before update
msg_info "Creating Backup"
mkdir -p /tmp/[appname]_backup
cp /opt/[appname]/.env /tmp/[appname]_backup/ 2>/dev/null || true
cp -r /opt/[appname]/data /tmp/[appname]_backup/ 2>/dev/null || true
msg_ok "Created Backup"
msg_info "Backing up Data"
cp -r /opt/[appname]/data /opt/[appname]_data_backup 2>/dev/null || true
msg_ok "Backed up Data"
# CLEAN_INSTALL=1 removes old directory before extracting new version
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "[appname]" "[owner/repo]" "tarball" "latest" "/opt/[appname]"
CLEAN_INSTALL=1 fetch_and_deploy_gh_release "[appname]" "[owner/repo]"
# Restore configuration and data
# Restore configuration and data (if needed)
msg_info "Restoring Data"
cp /tmp/[appname]_backup/.env /opt/[appname]/ 2>/dev/null || true
cp -r /tmp/[appname]_backup/data/* /opt/[appname]/data/ 2>/dev/null || true
rm -rf /tmp/[appname]_backup
cp -r /opt/[appname]_data_backup/. /opt/[appname]/data/ 2>/dev/null || true
rm -rf /opt/[appname]_data_backup
msg_ok "Restored Data"
# Optional: Run any post-update commands
msg_info "Running Post-Update Tasks"
cd /opt/[appname]
# Examples:
# $STD npm ci --production
# $STD php artisan migrate --force
# $STD composer install --no-dev
msg_ok "Ran Post-Update Tasks"
# Optional: Run any post-update commands (npm, composer, migrations, etc.)
# cd /opt/[appname] && $STD npm ci --production
# cd /opt/[appname] && $STD composer install --no-dev
# cd /opt/[appname] && $STD php artisan migrate --force
msg_info "Starting Services"
msg_info "Starting Service"
systemctl start [appname]
msg_ok "Started Services"
msg_ok "Started Service"
msg_ok "Updated successfully!"
fi