Removed unnecessary comments
This commit is contained in:
@@ -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
|
# License: MIT | https://github.com/community-scripts/ProxmoxVE/raw/main/LICENSE
|
||||||
# Source: https://github.com/a1ex4/ownfoil
|
# 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"
|
APP="ownfoil"
|
||||||
var_tags="${var_tags:-gaming}" # Max 2 tags, semicolon-separated
|
var_tags="${var_tags:-gaming}" # Max 2 tags, semicolon-separated
|
||||||
var_cpu="${var_cpu:-1}" # CPU cores: 1-4 typical
|
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_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_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
|
header_info "$APP" # Display app name and setup header
|
||||||
variables # Initialize build.func variables
|
variables # Initialize build.func variables
|
||||||
color # Load color variables for output
|
color # Load color variables for output
|
||||||
catch_errors # Enable error handling with automatic exit on failure
|
catch_errors # Enable error handling with automatic exit on failure
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# UPDATE SCRIPT - Called when user selects "Update" from web interface
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
function update_script() {
|
function update_script() {
|
||||||
header_info
|
header_info
|
||||||
check_container_storage
|
check_container_storage
|
||||||
check_container_resources
|
check_container_resources
|
||||||
|
|
||||||
# Step 1: Verify installation exists
|
|
||||||
if [[ ! -d /opt/ownfoil ]]; then
|
if [[ ! -d /opt/ownfoil ]]; then
|
||||||
msg_error "No ${APP} Installation Found!"
|
msg_error "No ${APP} Installation Found!"
|
||||||
exit
|
exit
|
||||||
fi
|
fi
|
||||||
|
|
||||||
# Step 2: Check if update is available
|
|
||||||
if check_for_gh_release "ownfoil" "a1ex4/ownfoil"; then
|
if check_for_gh_release "ownfoil" "a1ex4/ownfoil"; then
|
||||||
|
|
||||||
# Step 3: Stop services before update
|
|
||||||
msg_info "Stopping Service"
|
msg_info "Stopping Service"
|
||||||
systemctl stop ownfoil
|
systemctl stop ownfoil
|
||||||
msg_ok "Stopped Service"
|
msg_ok "Stopped Service"
|
||||||
|
|
||||||
# Step 4: Backup critical data before overwriting
|
|
||||||
msg_info "Backing up Data"
|
msg_info "Backing up Data"
|
||||||
cp -r /opt/ownfoil/app/config /opt/ownfoil_data_backup 2>/dev/null || true
|
cp -r /opt/ownfoil/app/config /opt/ownfoil_data_backup 2>/dev/null || true
|
||||||
msg_ok "Backed up Data"
|
msg_ok "Backed up Data"
|
||||||
|
|
||||||
# Step 5: Download and deploy new version
|
|
||||||
fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil"
|
fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil"
|
||||||
|
|
||||||
#6: Run post-update commands
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
cd /opt/ownfoil
|
cd /opt/ownfoil
|
||||||
$STD source .venv/bin/activate
|
$STD source .venv/bin/activate
|
||||||
$STD uv pip install -r requirements.txt
|
$STD uv pip install -r requirements.txt
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
# Step 7: Restore data from backup
|
|
||||||
msg_info "Restoring Data"
|
msg_info "Restoring Data"
|
||||||
cp -r /opt/ownfoil_data_backup /opt/ownfoil/app/config 2>/dev/null || true
|
cp -r /opt/ownfoil_data_backup /opt/ownfoil/app/config 2>/dev/null || true
|
||||||
rm -rf /opt/ownfoil_data_backup
|
rm -rf /opt/ownfoil_data_backup
|
||||||
msg_ok "Restored Data"
|
msg_ok "Restored Data"
|
||||||
|
|
||||||
# Step 8: Restart service with new version
|
|
||||||
msg_info "Starting Service"
|
msg_info "Starting Service"
|
||||||
systemctl start ownfoil
|
systemctl start ownfoil
|
||||||
msg_ok "Started Service"
|
msg_ok "Started Service"
|
||||||
@@ -82,7 +61,6 @@ function update_script() {
|
|||||||
exit
|
exit
|
||||||
}
|
}
|
||||||
|
|
||||||
# Step 8: Healthcheck!
|
|
||||||
function health_check() {
|
function health_check() {
|
||||||
header_info
|
header_info
|
||||||
|
|
||||||
@@ -99,17 +77,10 @@ function health_check() {
|
|||||||
msg_ok "Health check passed"
|
msg_ok "Health check passed"
|
||||||
}
|
}
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# MAIN EXECUTION - Container creation flow
|
|
||||||
# ============================================================================
|
|
||||||
|
|
||||||
start
|
start
|
||||||
build_container
|
build_container
|
||||||
description
|
description
|
||||||
|
|
||||||
# ============================================================================
|
|
||||||
# COMPLETION MESSAGE
|
|
||||||
# ============================================================================
|
|
||||||
msg_ok "Completed successfully!\n"
|
msg_ok "Completed successfully!\n"
|
||||||
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
echo -e "${CREATING}${GN}${APP} setup has been successfully initialized!${CL}"
|
||||||
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
echo -e "${INFO}${YW} Access it using the following URL:${CL}"
|
||||||
|
|||||||
@@ -13,19 +13,11 @@ setting_up_container
|
|||||||
network_check
|
network_check
|
||||||
update_os
|
update_os
|
||||||
|
|
||||||
# =============================================================================
|
|
||||||
# 1. DEPENDENCIES - Only add app-specific dependencies here!
|
|
||||||
# =============================================================================
|
|
||||||
|
|
||||||
msg_info "Installing Dependencies"
|
msg_info "Installing Dependencies"
|
||||||
$STD apt install -y \
|
$STD apt install -y \
|
||||||
git
|
git
|
||||||
msg_ok "Installed Dependencies"
|
msg_ok "Installed Dependencies"
|
||||||
|
|
||||||
|
|
||||||
# =============================================================================
|
|
||||||
# 2: Python Application with uv
|
|
||||||
# ------------------------------------
|
|
||||||
setup_uv
|
setup_uv
|
||||||
|
|
||||||
fetch_and_deploy_gh_release "ownfoil" "a1ex4/ownfoil" "tarball" "latest" "/opt/ownfoil"
|
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
|
$STD uv pip install -r requirements.txt
|
||||||
msg_ok "Setup ownfoil"
|
msg_ok "Setup ownfoil"
|
||||||
|
|
||||||
# =============================================================================
|
|
||||||
# 3. CREATE SYSTEMD SERVICE
|
|
||||||
# =============================================================================
|
|
||||||
|
|
||||||
msg_info "Creating Service"
|
msg_info "Creating Service"
|
||||||
cat <<EOF >/etc/systemd/system/ownfoil.service
|
cat <<EOF >/etc/systemd/system/ownfoil.service
|
||||||
[Unit]
|
[Unit]
|
||||||
@@ -61,10 +49,6 @@ EOF
|
|||||||
systemctl enable -q --now ownfoil
|
systemctl enable -q --now ownfoil
|
||||||
msg_ok "Created Service"
|
msg_ok "Created Service"
|
||||||
|
|
||||||
# =============================================================================
|
|
||||||
# 4. CLEANUP & FINALIZATION
|
|
||||||
# =============================================================================
|
|
||||||
|
|
||||||
motd_ssh
|
motd_ssh
|
||||||
customize
|
customize
|
||||||
cleanup_lxc
|
cleanup_lxc
|
||||||
|
|||||||
Reference in New Issue
Block a user