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

@@ -178,6 +178,9 @@ class AppOperation(Base):
id = Column(Integer, primary_key=True, index=True)
installed_app_id = Column(Integer, ForeignKey("installed_apps.id", ondelete="CASCADE"), index=True, nullable=True)
# Только для операций без installed_app_id (напр. golden_template) — чтобы
# различать прогресс/историю сборки шаблона по серверам Proxmox.
server_id = Column(Integer, ForeignKey("proxmox_servers.id", ondelete="CASCADE"), index=True, nullable=True)
type = Column(String(20), nullable=False) # install/update/rollback/delete/start/stop/restart
status = Column(String(20), nullable=False, default="running") # running/completed/failed
progress = Column(Integer, nullable=False, default=0)
@@ -192,6 +195,7 @@ class AppOperation(Base):
"id": self.id,
"kind": "appstore",
"installed_app_id": self.installed_app_id,
"server_id": self.server_id,
"type": self.type,
"status": self.status,
"progress": self.progress,

View File

@@ -4,8 +4,12 @@ from .base import *
# "node" — на хосте Proxmox (root@node по SSH)
# "guest" — внутри VM (QEMU guest agent) или LXC (pct exec через SSH ноды)
SCRIPT_TARGET_TYPES = ("node", "guest")
SCRIPT_SOURCES = ("manual", "git")
SCRIPT_SOURCES = ("manual", "git", "community-scripts")
SCRIPT_EXECUTION_STATUSES = ("running", "success", "failed")
# Формат метаданных, по которому синкается git-источник:
# "header-comment" — заголовочные bash-комментарии (# name: / # param: ...)
# "community-scripts-ct" — ct/*.sh из community-scripts/ProxmoxVE (APP=, var_*)
SCRIPT_REPO_METADATA_FORMATS = ("header-comment", "community-scripts-ct")
class ScriptGitRepo(Base):
@@ -17,6 +21,8 @@ class ScriptGitRepo(Base):
branch = Column(String(100), nullable=False, default="main")
# glob относительно корня репозитория, напр. "scripts/**/*.sh"
path_glob = Column(String(300), nullable=False, default="**/*.sh")
# см. SCRIPT_REPO_METADATA_FORMATS
metadata_format = Column(String(30), nullable=False, default="header-comment")
enabled = Column(Boolean, nullable=False, default=True)
last_synced_at = Column(DateTime(timezone=True), nullable=True)
last_sync_error = Column(Text, nullable=True)
@@ -28,6 +34,7 @@ class ScriptGitRepo(Base):
"url": self.url,
"branch": self.branch,
"path_glob": self.path_glob,
"metadata_format": self.metadata_format,
"enabled": self.enabled,
"last_synced_at": self.last_synced_at.isoformat() if self.last_synced_at else None,
"last_sync_error": self.last_sync_error,

View File

@@ -121,6 +121,7 @@ class DeployTask(Base):
name = Column(String(100), nullable=False)
template_id = Column(Integer, nullable=True)
server_id = Column(Integer, nullable=True)
target_server_id = Column(Integer, nullable=True)
user_id = Column(Integer, ForeignKey("users.id", ondelete="CASCADE"), nullable=False, index=True)
vmid = Column(Integer, nullable=True)
@@ -145,6 +146,7 @@ class DeployTask(Base):
'change_password': f"Смена пароля: {self.name}",
'image_download': f"Загрузка образа: {self.name}",
'image_template': f"Шаблон из образа: {self.name}",
'remote_migrate': f"Remote-миграция: {self.name}",
}
return {
'id': self.id,
@@ -158,6 +160,7 @@ class DeployTask(Base):
'name': self.name,
'template_id': self.template_id,
'server_id': self.server_id,
'target_server_id': self.target_server_id,
'vmid': self.vmid,
'node': self.node,
'error_message': self.error_message,