fix(appstore): DNS, per-server golden template, bind-mount perms, delete race
All checks were successful
Backend Tests / pytest (Python 3.12) (push) Successful in 1m1s
Deploy to Production / Trigger production update (push) Successful in 8s

App Store install/update pipeline reliability fixes:
- explicit nameserver (APPSTORE_NAMESERVER) on App Store LXCs and the golden
  template build CT, instead of inheriting a node resolver that may be
  unreachable from the container network (e.g. Tailscale-only DNS)
- golden template storage/resolution moved from one global setting to
  per-server_id (migration 37: app_operations.server_id) — building it on one
  Proxmox server no longer overwrites the template configured for another
- golden template automated build fixed: vzdump export step no longer fails
  on "unable to parse directory volume name 'vztmpl/probe'"
- bind-mount host directories are pre-created with permissive ownership
  before `docker compose up`, fixing Permission denied for non-root
  containers (e.g. MariaDB) writing to Docker-auto-created root-owned dirs
- delete/teardown now waits for Proxmox to actually confirm the destroy task
  finished (was silently proceeding after a short timeout, letting a new
  install reuse the VMID while the node was still wiping the old disk)
- pct create retries a few times on transient "got lock" config errors
- failed pipeline steps now report the tail of command output (4000 chars)
  instead of the head, so the real error isn't buried under pull/progress noise
- install error box in the UI wraps long text and scrolls instead of
  stretching the dialog

Also carries forward in-progress script catalog / instances / RBAC changes
that were already uncommitted in the working tree before this session.

Bump to v1.9.1, update WIKI.md/docs/CHANGELOG accordingly.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
This commit is contained in:
markmorado
2026-07-17 04:49:40 +05:00
parent b8536ac2e8
commit 6a79dd2048
40 changed files with 1100 additions and 109 deletions

View File

@@ -1328,6 +1328,12 @@ def migrate_deploy_tasks_kind(conn):
logger.info("✓ deploy_tasks.kind column added")
def migrate_deploy_tasks_target_server(conn):
"""Migration 36: Add 'target_server_id' column to deploy_tasks (remote-migrate destination cluster)"""
add_column_if_not_exists(conn, 'deploy_tasks', 'target_server_id', 'INTEGER')
logger.info("✓ deploy_tasks.target_server_id column added")
def migrate_user_ssh_keys_table(conn):
"""Migration 24: Create user_ssh_keys table for SSH key library per user."""
if table_exists(conn, 'user_ssh_keys'):
@@ -1536,6 +1542,15 @@ def migrate_appstore_catalog_source(conn):
logger.info("✓ App Store catalog_apps.source column added")
def migrate_script_repo_metadata_format(conn):
"""Add metadata_format column to script_git_repos (header-comment | community-scripts-ct)."""
if not table_exists(conn, 'script_git_repos'):
return
if add_column_if_not_exists(conn, 'script_git_repos', 'metadata_format',
"VARCHAR(30) NOT NULL DEFAULT 'header-comment'"):
logger.info("✓ Added metadata_format column to script_git_repos")
def migrate_appstore_installed(conn):
"""Create installed_apps and app_operations tables for the App Engine (M2)."""
if not table_exists(conn, 'installed_apps'):
@@ -1629,6 +1644,29 @@ def migrate_ipam_network_workspace(conn):
logger.info("✓ ipam_networks.workspace_id/is_default already exist")
def migrate_app_operations_server_id(conn):
"""Migration 37: app_operations.server_id (per-server golden-template tracking).
Нужен только для операций без installed_app_id (golden_template) — чтобы
прогресс/история сборки золотого шаблона различались по серверам Proxmox,
а не показывали последнюю сборку глобально независимо от того, для
какого сервера она запускалась.
"""
if not table_exists(conn, 'app_operations'):
logger.info("Table app_operations does not exist, skipping server_id migration")
return
if add_column_if_not_exists(
conn, 'app_operations', 'server_id',
'INTEGER REFERENCES proxmox_servers(id) ON DELETE CASCADE'
):
conn.execute(text(
"CREATE INDEX IF NOT EXISTS idx_app_operations_server ON app_operations(server_id)"
))
logger.info("✓ Added app_operations.server_id")
else:
logger.info("✓ app_operations.server_id already exists")
def run_all_migrations(engine, db_session=None):
"""
Run all migrations in order.
@@ -1915,6 +1953,30 @@ def run_all_migrations(engine, db_session=None):
logger.warning(f"App Store catalog source migration: {e}")
conn.rollback()
# Migration 35: script_git_repos metadata_format column (header-comment | community-scripts-ct)
try:
migrate_script_repo_metadata_format(conn)
conn.commit()
except Exception as e:
logger.warning(f"Script repo metadata_format migration: {e}")
conn.rollback()
# Migration 36: deploy_tasks.target_server_id column (remote-migrate destination cluster)
try:
migrate_deploy_tasks_target_server(conn)
conn.commit()
except Exception as e:
logger.warning(f"Deploy tasks target_server_id migration: {e}")
conn.rollback()
# Migration 37: app_operations.server_id column (per-server golden template)
try:
migrate_app_operations_server_id(conn)
conn.commit()
except Exception as e:
logger.warning(f"App operations server_id migration: {e}")
conn.rollback()
logger.info("=" * 50)
logger.info("✓ All migrations completed successfully")
logger.info("=" * 50)