Preserve previously installed phpMyAdmin instances
Coulobre Panel CI / Checks (Python 3.12) (pull_request) Canceled after 0s
Coulobre Panel CI / Checks (Python 3.14) (pull_request) Canceled after 0s

This commit is contained in:
parkel committed 2026-12-01 15:13:36 +01:00
1 parent 471b76fd98
commit 3bbd8db4fc
1 file changed
+12 -1
+12 -1
View File
@@ -53,6 +53,10 @@ ROUNDCUBE_SHA256 = (
)
ROUNDCUBE_ROOT = Path("/opt/coulobre-roundcube")
APT_GET = "/usr/bin/apt-get"
PHPMYADMIN_INDEX = Path("/usr/share/phpmyadmin/index.php")
PHPMYADMIN_PACKAGE_RECORD = Path(
"/var/lib/coulobre/operator/phpmyadmin-package"
)
def install_tool(request, command):
@@ -219,7 +223,14 @@ def install_packages(target, command):
packages = ["php-fpm", *(f"php-{name}" for name in extensions)]
if target == "phpmyadmin":
packages.append("phpmyadmin")
if not Path("/usr/share/phpmyadmin/index.php").is_file():
if PHPMYADMIN_INDEX.is_file() and not os.path.lexists(
PHPMYADMIN_PACKAGE_RECORD
):
raise ValueError(
"Use the manual setup for the existing phpMyAdmin package."
)
keep_file(PHPMYADMIN_PACKAGE_RECORD, "managed\n", 0o600)
if not PHPMYADMIN_INDEX.is_file():
packages.append("dbconfig-no-thanks")
with TemporaryDirectory() as temp:
answers = Path(temp) / "phpmyadmin"