From 009a29343e12510b7ab309cb3488fa2ecc917399 Mon Sep 17 00:00:00 2001 From: Kosmos Date: Tue, 25 Aug 2026 11:56:41 +0000 Subject: [PATCH] Synchronize frontend plugin configuration --- README.md | 23 +++++++++++++++++++++++ docker/client-config.patch | 22 +++++++++++++++------- 2 files changed, 38 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index 6a647cd..c10b59c 100644 --- a/README.md +++ b/README.md @@ -51,6 +51,19 @@ Set secure MariaDB passwords in `.env`. Then, set at least these values in "provider": "hcaptcha", "secret": "replace with your hCaptcha secret" }, + "plugins": [ + "announcement", + "application", + "banner", + "challenge", + "division", + "downloads", + "economy", + "event", + "poll", + "route", + "task" + ], "external_plugins": ["client-config"] } ``` @@ -68,6 +81,16 @@ Create an hCaptcha site for the public frontend domain. Set its secret in the `captcha.secret` value. Set the related public site key as `VITE_HCAPTCHA_SITEKEY` in the frontend deployment. +The upstream sample uses plural names for some built-in plugins, but the +backend expects the singular names shown above. This deployment configuration +enables all built-in plugins by default. Keep `client-config` separate in +`external_plugins`. + +The deployment patch synchronizes the plugin list from `config/config.json` to +the stored frontend configuration when the backend starts. Other frontend +settings in MariaDB stay unchanged. Restart the backend after you enable or +disable a plugin. + ## Start the deployment ```bash diff --git a/docker/client-config.patch b/docker/client-config.patch index a323ea5..3d02d03 100644 --- a/docker/client-config.patch +++ b/docker/client-config.patch @@ -1,18 +1,26 @@ --- a/src/external_plugins/client-config.py +++ b/src/external_plugins/client-config.py -@@ -17,0 +18,6 @@ -+def normalize_client_config(config): +@@ -17,0 +18,7 @@ ++def normalize_client_config(config, plugins): + if not config["api_host"].startswith(("http://", "https://")): + config["api_host"] = f"https://{config['api_host']}" ++ config["plugins"] = plugins + return config + + -@@ -24 +30 @@ +@@ -24 +31 @@ - return json.loads(config) -+ return normalize_client_config(json.loads(config)) -@@ -37 +43 @@ ++ return normalize_client_config(json.loads(config), app.config.plugins) +@@ -37 +44 @@ - config = json.loads(t[0][0]) -+ config = normalize_client_config(json.loads(t[0][0])) -@@ -298 +304 @@ ++ config = normalize_client_config(json.loads(t[0][0]), app.config.plugins) +@@ -298 +305 @@ - "api_host": config["domain"], + "api_host": f"https://{config['domain']}", +@@ -306,0 +314,6 @@ ++ else: ++ frontend_conf = json.loads(t[0][2]) ++ if frontend_conf.get("plugins") != config["plugins"]: ++ frontend_conf["plugins"] = config["plugins"] ++ frontend_conf = convertQuotation(json.dumps(frontend_conf)) ++ cur.execute(f"UPDATE settings SET sval = '{frontend_conf}' WHERE skey = 'client-config/meta'")