From af294f36eaf1902157de863c65628c8f3e1cfe07 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Tue, 31 Mar 2026 15:14:54 +0200 Subject: [PATCH 1/9] Added ownfoil --- ct/headers/ownfoil | 6 ++ ct/ownfoil.sh | 116 +++++++++++++++++++++++++++++++++++++ install/ownfoil-install.sh | 70 ++++++++++++++++++++++ 3 files changed, 192 insertions(+) create mode 100644 ct/headers/ownfoil create mode 100644 ct/ownfoil.sh create mode 100644 install/ownfoil-install.sh diff --git a/ct/headers/ownfoil b/ct/headers/ownfoil new file mode 100644 index 00000000..41f489c3 --- /dev/null +++ b/ct/headers/ownfoil @@ -0,0 +1,6 @@ + _____ .__.__ + ______ _ _______/ ____\____ |__| | + / _ \ \/ \/ / \ __\/ _ \| | | +( <_> ) / | \ | ( <_> ) | |__ + \____/ \/\_/|___| /__| \____/|__|____/ + \/ diff --git a/ct/ownfoil.sh b/ct/ownfoil.sh new file mode 100644 index 00000000..e30d41b2 --- /dev/null +++ b/ct/ownfoil.sh @@ -0,0 +1,116 @@ +#!/usr/bin/env bash +source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxVE/main/misc/build.func) +# Copyright (c) 2021-2026 community-scripts ORG +# Author: pajjski +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/a1ex4/ownfoil + +# ============================================================================ +# APP CONFIGURATION +# ============================================================================ +# These values are sent to build.func and define default container resources. +# Users can customize these during installation via the interactive prompts. +# ============================================================================ + +APP="ownfoil" +var_tags="${var_tags:-gaming}" # Max 2 tags, semicolon-separated +var_cpu="${var_cpu:-1}" # CPU cores: 1-4 typical +var_ram="${var_ram:-1024}" # RAM in MB: 512, 1024, 2048, etc. +var_disk="${var_disk:-4}" # Disk in GB: 6, 8, 10, 20 typical +var_os="${var_os:-debian}" # OS: debian, ubuntu, alpine +var_version="${var_version:-13}" # OS Version: 13 (Debian), 24.04 (Ubuntu), 3.21 (Alpine) +var_unprivileged="${var_unprivileged:-1}" # 1=unprivileged (secure), 0=privileged (for Docker/Podman) + +# ============================================================================ +# INITIALIZATION - These are required in all CT scripts +# ============================================================================ +header_info "$APP" # Display app name and setup header +variables # Initialize build.func variables +color # Load color variables for output +catch_errors # Enable error handling with automatic exit on failure + +# ============================================================================ +# UPDATE SCRIPT - Called when user selects "Update" from web interface +# ============================================================================ + +function update_script() { + header_info + check_container_storage + check_container_resources + + # Step 1: Verify installation exists + if [[ ! -d /opt/ownfoil ]]; then + msg_error "No ${APP} Installation Found!" + exit + fi + + # Step 2: Check if update is available + if check_for_gh_release "ownfoil" "a1ex4/ownfoil"; then + + # Step 3: Stop services before update + msg_info "Stopping Service" + systemctl stop ownfoil + msg_ok "Stopped Service" + + # Step 4: Backup critical data before overwriting + msg_info "Backing up Data" + cp -r /opt/ownfoil/app/config /opt/ownfoil_data_backup 2>/dev/null || true + msg_ok "Backed up Data" + + # Step 5: Download and deploy new version + fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil" + + #6: Run post-update commands + msg_info "Installing Dependencies" + cd /opt/ownfoil + $STD source .venv/bin/activate + $STD uv pip install -r requirements.txt + msg_ok "Installed Dependencies" + + # Step 7: Restore data from backup + msg_info "Restoring Data" + cp -r /opt/ownfoil_data_backup /opt/ownfoil/app/config 2>/dev/null || true + rm -rf /opt/ownfoil_data_backup + msg_ok "Restored Data" + + # Step 8: Restart service with new version + msg_info "Starting Service" + systemctl start ownfoil + msg_ok "Started Service" + msg_ok "Updated successfully!" + fi + exit +} + +# Step 8: Healthcheck! +function health_check() { + header_info + + if [[ ! -d /opt/ownfoil ]]; then + msg_error "Application not found!" + exit 1 + fi + + if ! systemctl is-active --quiet ownfoil; then + msg_error "Application service not running" + exit 1 + fi + + msg_ok "Health check passed" +} + +# ============================================================================ +# MAIN EXECUTION - Container creation flow +# ============================================================================ + +start +build_container +description + +# ============================================================================ +# COMPLETION MESSAGE +# ============================================================================ +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 "${TAB}${GATEWAY}${BGN}http://${IP}:8465${CL}" diff --git a/install/ownfoil-install.sh b/install/ownfoil-install.sh new file mode 100644 index 00000000..9a76f87d --- /dev/null +++ b/install/ownfoil-install.sh @@ -0,0 +1,70 @@ +#!/usr/bin/env bash + +# Copyright (c) 2021-2026 community-scripts ORG +# Author: pajjski +# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE +# Source: https://github.com/a1ex4/ownfoil + +source /dev/stdin <<<"$FUNCTIONS_FILE_PATH" +color +verb_ip6 +catch_errors +setting_up_container +network_check +update_os + +# ============================================================================= +# 1. DEPENDENCIES - Only add app-specific dependencies here! +# ============================================================================= + +msg_info "Installing Dependencies" +$STD apt install -y \ + git +msg_ok "Installed Dependencies" + + +# ============================================================================= +# 2: Python Application with uv +# ------------------------------------ +setup_uv + +fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil" + +msg_info "Setting up Ownfoil" +cd /opt/ownfoil +$STD uv venv .venv +$STD source .venv/bin/activate +$STD uv pip install -r requirements.txt +msg_ok "Setup ownfoil" + +# ============================================================================= +# 3. CREATE SYSTEMD SERVICE +# ============================================================================= + +msg_info "Creating Service" +cat </etc/systemd/system/ownfoil.service +[Unit] +Description=ownfoil Service +After=network.target + +[Service] +Type=simple +User=root +WorkingDirectory=/opt/ownfoil +ExecStart=/opt/ownfoil/.venv/bin/python /opt/ownfoil/app/app.py +Restart=on-failure +RestartSec=5 + +[Install] +WantedBy=multi-user.target +EOF +systemctl enable -q --now ownfoil +msg_ok "Created Service" + +# ============================================================================= +# 4. CLEANUP & FINALIZATION +# ============================================================================= + +motd_ssh +customize +cleanup_lxc From 5215659bf0a0e713df80889d9cba40f5169f4960 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Thu, 2 Apr 2026 12:43:43 +0200 Subject: [PATCH 2/9] Removed unnecessary comments --- ct/ownfoil.sh | 31 +------------------------------ install/ownfoil-install.sh | 16 ---------------- 2 files changed, 1 insertion(+), 46 deletions(-) diff --git a/ct/ownfoil.sh b/ct/ownfoil.sh index e30d41b2..51e5c063 100644 --- a/ct/ownfoil.sh +++ b/ct/ownfoil.sh @@ -5,13 +5,6 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV # License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE # Source: https://github.com/a1ex4/ownfoil -# ============================================================================ -# APP CONFIGURATION -# ============================================================================ -# These values are sent to build.func and define default container resources. -# Users can customize these during installation via the interactive prompts. -# ============================================================================ - APP="ownfoil" var_tags="${var_tags:-gaming}" # Max 2 tags, semicolon-separated var_cpu="${var_cpu:-1}" # CPU cores: 1-4 typical @@ -21,59 +14,45 @@ var_os="${var_os:-debian}" # OS: debian, ubuntu, alpine var_version="${var_version:-13}" # OS Version: 13 (Debian), 24.04 (Ubuntu), 3.21 (Alpine) var_unprivileged="${var_unprivileged:-1}" # 1=unprivileged (secure), 0=privileged (for Docker/Podman) -# ============================================================================ -# INITIALIZATION - These are required in all CT scripts -# ============================================================================ + header_info "$APP" # Display app name and setup header variables # Initialize build.func variables color # Load color variables for output catch_errors # Enable error handling with automatic exit on failure -# ============================================================================ -# UPDATE SCRIPT - Called when user selects "Update" from web interface -# ============================================================================ function update_script() { header_info check_container_storage check_container_resources - # Step 1: Verify installation exists if [[ ! -d /opt/ownfoil ]]; then msg_error "No ${APP} Installation Found!" exit fi - # Step 2: Check if update is available if check_for_gh_release "ownfoil" "a1ex4/ownfoil"; then - - # Step 3: Stop services before update msg_info "Stopping Service" systemctl stop ownfoil msg_ok "Stopped Service" - # Step 4: Backup critical data before overwriting msg_info "Backing up Data" cp -r /opt/ownfoil/app/config /opt/ownfoil_data_backup 2>/dev/null || true msg_ok "Backed up Data" - # Step 5: Download and deploy new version fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil" - #6: Run post-update commands msg_info "Installing Dependencies" cd /opt/ownfoil $STD source .venv/bin/activate $STD uv pip install -r requirements.txt msg_ok "Installed Dependencies" - # Step 7: Restore data from backup msg_info "Restoring Data" cp -r /opt/ownfoil_data_backup /opt/ownfoil/app/config 2>/dev/null || true rm -rf /opt/ownfoil_data_backup msg_ok "Restored Data" - # Step 8: Restart service with new version msg_info "Starting Service" systemctl start ownfoil msg_ok "Started Service" @@ -82,7 +61,6 @@ function update_script() { exit } -# Step 8: Healthcheck! function health_check() { header_info @@ -99,17 +77,10 @@ function health_check() { msg_ok "Health check passed" } -# ============================================================================ -# MAIN EXECUTION - Container creation flow -# ============================================================================ - start build_container description -# ============================================================================ -# COMPLETION MESSAGE -# ============================================================================ 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}" diff --git a/install/ownfoil-install.sh b/install/ownfoil-install.sh index 9a76f87d..5a82bd54 100644 --- a/install/ownfoil-install.sh +++ b/install/ownfoil-install.sh @@ -13,19 +13,11 @@ setting_up_container network_check update_os -# ============================================================================= -# 1. DEPENDENCIES - Only add app-specific dependencies here! -# ============================================================================= - msg_info "Installing Dependencies" $STD apt install -y \ git msg_ok "Installed Dependencies" - -# ============================================================================= -# 2: Python Application with uv -# ------------------------------------ setup_uv fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil" @@ -37,10 +29,6 @@ $STD source .venv/bin/activate $STD uv pip install -r requirements.txt msg_ok "Setup ownfoil" -# ============================================================================= -# 3. CREATE SYSTEMD SERVICE -# ============================================================================= - msg_info "Creating Service" cat </etc/systemd/system/ownfoil.service [Unit] @@ -61,10 +49,6 @@ EOF systemctl enable -q --now ownfoil msg_ok "Created Service" -# ============================================================================= -# 4. CLEANUP & FINALIZATION -# ============================================================================= - motd_ssh customize cleanup_lxc From b805eea37c18c9128855966064f248eb94ff0b1d Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Thu, 2 Apr 2026 21:45:04 +0200 Subject: [PATCH 3/9] Deleted file which gets auto-generated --- ct/headers/ownfoil | 6 ------ 1 file changed, 6 deletions(-) delete mode 100644 ct/headers/ownfoil diff --git a/ct/headers/ownfoil b/ct/headers/ownfoil deleted file mode 100644 index 41f489c3..00000000 --- a/ct/headers/ownfoil +++ /dev/null @@ -1,6 +0,0 @@ - _____ .__.__ - ______ _ _______/ ____\____ |__| | - / _ \ \/ \/ / \ __\/ _ \| | | -( <_> ) / | \ | ( <_> ) | |__ - \____/ \/\_/|___| /__| \____/|__|____/ - \/ From 8d1a3a5baf714735498d2004e8b4e079c05f2b19 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Thu, 9 Apr 2026 09:55:36 +0200 Subject: [PATCH 4/9] Removed unnecessary function and comments --- ct/ownfoil.sh | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/ct/ownfoil.sh b/ct/ownfoil.sh index 51e5c063..ae1d437a 100644 --- a/ct/ownfoil.sh +++ b/ct/ownfoil.sh @@ -6,19 +6,19 @@ source <(curl -fsSL https://raw.githubusercontent.com/community-scripts/ProxmoxV # Source: https://github.com/a1ex4/ownfoil APP="ownfoil" -var_tags="${var_tags:-gaming}" # Max 2 tags, semicolon-separated -var_cpu="${var_cpu:-1}" # CPU cores: 1-4 typical -var_ram="${var_ram:-1024}" # RAM in MB: 512, 1024, 2048, etc. -var_disk="${var_disk:-4}" # Disk in GB: 6, 8, 10, 20 typical -var_os="${var_os:-debian}" # OS: debian, ubuntu, alpine -var_version="${var_version:-13}" # OS Version: 13 (Debian), 24.04 (Ubuntu), 3.21 (Alpine) -var_unprivileged="${var_unprivileged:-1}" # 1=unprivileged (secure), 0=privileged (for Docker/Podman) +var_tags="${var_tags:-gaming}" +var_cpu="${var_cpu:-1}" +var_ram="${var_ram:-1024}" +var_disk="${var_disk:-4}" +var_os="${var_os:-debian}" +var_version="${var_version:-13}" +var_unprivileged="${var_unprivileged:-1}" -header_info "$APP" # Display app name and setup header -variables # Initialize build.func variables -color # Load color variables for output -catch_errors # Enable error handling with automatic exit on failure +header_info "$APP" +variables +color +catch_errors function update_script() { @@ -40,7 +40,7 @@ function update_script() { cp -r /opt/ownfoil/app/config /opt/ownfoil_data_backup 2>/dev/null || true msg_ok "Backed up Data" - fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil" + CLEAN_INSTALL=1 fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil" msg_info "Installing Dependencies" cd /opt/ownfoil @@ -61,22 +61,6 @@ function update_script() { exit } -function health_check() { - header_info - - if [[ ! -d /opt/ownfoil ]]; then - msg_error "Application not found!" - exit 1 - fi - - if ! systemctl is-active --quiet ownfoil; then - msg_error "Application service not running" - exit 1 - fi - - msg_ok "Health check passed" -} - start build_container description From 60a07e4b07d43a2ebf3e1506737638d4746ad564 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Fri, 10 Apr 2026 11:08:07 +0200 Subject: [PATCH 5/9] initial json-file with metadata for ownfoil --- json/ownfoil.json | 38 ++++++++++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 json/ownfoil.json diff --git a/json/ownfoil.json b/json/ownfoil.json new file mode 100644 index 00000000..e317d87e --- /dev/null +++ b/json/ownfoil.json @@ -0,0 +1,38 @@ +{ + "name":"Ownfoil", + "slug":"ownfoil", + "categories":[ + 24 + ], + "description":"Ownfoil is a Nintendo Switch library manager, that will also turn your library into a fully customizable and self-hosted Shop, supporting multiple clients like Tinfoil, Cyberfoil and Sphaira.", + "type":"ct", + "privileged":false, + "updateable":true, + "interface_port":8465, + "documentation":"https://github.com/a1ex4/ownfoil", + "website":"https://github.com/a1ex4/ownfoil", + "logo":null, + "config_path":"/opt/ownfoil/app/config", + "install_methods_json":[ + { + "type":"default", + "resources":{ + "cpu":1, + "ram":1024, + "hdd":4, + "os":"Debian", + "version":"13" + } + } + ], + "notes_json":[ + { + "text":"Ownfoil requires an admin user to be created to enable Authentication. Go to the Settings tab to create a first user that will have admin rights.", + "type":"warning" + }, + { + "text":"More CPU/RAM may be required depening on library size and number of concurrent users", + "type":"info" + } + ] +} From 34829ea4fc914b25dc0711872a7a39be9d90c4d6 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Fri, 10 Apr 2026 11:13:16 +0200 Subject: [PATCH 6/9] Added missing credentials and script name --- json/ownfoil.json | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/json/ownfoil.json b/json/ownfoil.json index e317d87e..a18a4629 100644 --- a/json/ownfoil.json +++ b/json/ownfoil.json @@ -16,6 +16,7 @@ "install_methods_json":[ { "type":"default", + "script":"ct/ownfoil.sh", "resources":{ "cpu":1, "ram":1024, @@ -25,6 +26,10 @@ } } ], + "default_credentials":{ + "username":null, + "password":null + }, "notes_json":[ { "text":"Ownfoil requires an admin user to be created to enable Authentication. Go to the Settings tab to create a first user that will have admin rights.", From 19514e1ac760dc9ce52dc1748c763410c3390165 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Fri, 10 Apr 2026 11:42:22 +0200 Subject: [PATCH 7/9] Rewmoved unecessary credentials, link to non-existing documentation and fixed config path to application yaml-file instead of config folder --- json/ownfoil.json | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/json/ownfoil.json b/json/ownfoil.json index a18a4629..66bddfce 100644 --- a/json/ownfoil.json +++ b/json/ownfoil.json @@ -9,10 +9,10 @@ "privileged":false, "updateable":true, "interface_port":8465, - "documentation":"https://github.com/a1ex4/ownfoil", + "documentation":null, "website":"https://github.com/a1ex4/ownfoil", "logo":null, - "config_path":"/opt/ownfoil/app/config", + "config_path":"/opt/ownfoil/app/config/settings.yaml", "install_methods_json":[ { "type":"default", @@ -26,10 +26,6 @@ } } ], - "default_credentials":{ - "username":null, - "password":null - }, "notes_json":[ { "text":"Ownfoil requires an admin user to be created to enable Authentication. Go to the Settings tab to create a first user that will have admin rights.", From c8206b35e1aead92c648e3de63c880d2848dc526 Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Fri, 10 Apr 2026 13:56:18 +0200 Subject: [PATCH 8/9] Restored, not un-necessary credentials and fixed notes section --- json/ownfoil.json | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/json/ownfoil.json b/json/ownfoil.json index 66bddfce..dfd70ee1 100644 --- a/json/ownfoil.json +++ b/json/ownfoil.json @@ -9,7 +9,7 @@ "privileged":false, "updateable":true, "interface_port":8465, - "documentation":null, + "documentation":"https://github.com/a1ex4/ownfoil", "website":"https://github.com/a1ex4/ownfoil", "logo":null, "config_path":"/opt/ownfoil/app/config/settings.yaml", @@ -26,7 +26,11 @@ } } ], - "notes_json":[ + "default_credentials":{ + "username":null, + "password":null + }, + "notes":[ { "text":"Ownfoil requires an admin user to be created to enable Authentication. Go to the Settings tab to create a first user that will have admin rights.", "type":"warning" From dd19e3abf8e6cb6da4728c9d430115b9bea17e6f Mon Sep 17 00:00:00 2001 From: Andreas Kruse Date: Sat, 11 Apr 2026 20:25:35 +0200 Subject: [PATCH 9/9] Changed intendation to 4 --- json/ownfoil.json | 84 +++++++++++++++++++++++------------------------ 1 file changed, 42 insertions(+), 42 deletions(-) diff --git a/json/ownfoil.json b/json/ownfoil.json index dfd70ee1..e3545f8e 100644 --- a/json/ownfoil.json +++ b/json/ownfoil.json @@ -1,43 +1,43 @@ { - "name":"Ownfoil", - "slug":"ownfoil", - "categories":[ - 24 - ], - "description":"Ownfoil is a Nintendo Switch library manager, that will also turn your library into a fully customizable and self-hosted Shop, supporting multiple clients like Tinfoil, Cyberfoil and Sphaira.", - "type":"ct", - "privileged":false, - "updateable":true, - "interface_port":8465, - "documentation":"https://github.com/a1ex4/ownfoil", - "website":"https://github.com/a1ex4/ownfoil", - "logo":null, - "config_path":"/opt/ownfoil/app/config/settings.yaml", - "install_methods_json":[ - { - "type":"default", - "script":"ct/ownfoil.sh", - "resources":{ - "cpu":1, - "ram":1024, - "hdd":4, - "os":"Debian", - "version":"13" - } - } - ], - "default_credentials":{ - "username":null, - "password":null - }, - "notes":[ - { - "text":"Ownfoil requires an admin user to be created to enable Authentication. Go to the Settings tab to create a first user that will have admin rights.", - "type":"warning" - }, - { - "text":"More CPU/RAM may be required depening on library size and number of concurrent users", - "type":"info" - } - ] -} + "name":"Ownfoil", + "slug":"ownfoil", + "categories": [ + 24 + ], + "description": "Ownfoil is a Nintendo Switch library manager, that will also turn your library into a fully customizable and self-hosted Shop, supporting multiple clients like Tinfoil, Cyberfoil and Sphaira.", + "type": "ct", + "privileged": false, + "updateable": true, + "interface_port": 8465, + "documentation": "https://github.com/a1ex4/ownfoil", + "website":" https://github.com/a1ex4/ownfoil", + "logo": null, + "config_path": "/opt/ownfoil/app/config/settings.yaml", + "install_methods": [ + { + "type": "default", + "script": "ct/ownfoil.sh", + "resources": { + "cpu": 1, + "ram": 1024, + "hdd": 4, + "os": "Debian", + "version": "13" + } + } + ], + "default_credentials": { + "username": null, + "password": null + }, + "notes": [ + { + "text": "Ownfoil requires an admin user to be created to enable Authentication. Go to the Settings tab to create a first user that will have admin rights.", + "type": "warning" + }, + { + "text": "More CPU/RAM may be required depening on library size and number of concurrent users", + "type": "info" + } + ] +} \ No newline at end of file