aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorUnrud <unrud@outlook.com>2022-01-19 00:59:45 +0100
committerUnrud <unrud@outlook.com>2022-01-19 01:08:00 +0100
commit3e8e476fc2ff1467ea05aa0944058288ccdadf92 (patch)
treed6b3ab7b8c0775117a034e0f198159d2e538bd96
parentUpdate for Radicale 3.1.1 (diff)
downloadradicaleinfcloud-3e8e476fc2ff1467ea05aa0944058288ccdadf92.tar.gz
radicaleinfcloud-3e8e476fc2ff1467ea05aa0944058288ccdadf92.tar.bz2
radicaleinfcloud-3e8e476fc2ff1467ea05aa0944058288ccdadf92.zip
Add option for InfCloud configuration
Closes #15
-rw-r--r--README.md5
-rw-r--r--radicale_infcloud/__init__.py7
2 files changed, 11 insertions, 1 deletions
diff --git a/README.md b/README.md
index 9b2e289..9215d23 100644
--- a/README.md
+++ b/README.md
@@ -18,9 +18,14 @@ python3 -m pip install --upgrade https://github.com/Unrud/RadicaleInfCloud/archi
Set the configuration option `type` in the `web` section to `radicale_infcloud`.
+The value of `infcloud_config` is appended to InfCloud's `config.js`.
+
```ini
[web]
type = radicale_infcloud
+# Optional InfCloud configuration
+infcloud_config = globalInterfaceLanguage='de_DE';
+ globalTimeZone='Europe/Berlin';
```
## License
diff --git a/radicale_infcloud/__init__.py b/radicale_infcloud/__init__.py
index 409ef28..c65d03f 100644
--- a/radicale_infcloud/__init__.py
+++ b/radicale_infcloud/__init__.py
@@ -20,7 +20,10 @@ from radicale.web import internal
import pkg_resources
-PLUGIN_CONFIG_SCHEMA = {"web": {}}
+PLUGIN_CONFIG_SCHEMA = {"web": {
+ "infcloud_config": {
+ "value": "",
+ "type": str}}}
class Web(internal.Web):
@@ -42,4 +45,6 @@ class Web(internal.Web):
<nav>
<ul>
<li><a href="infcloud">InfCloud</a></li>""")
+ if status == client.OK and path == "/.web/infcloud/config.js":
+ answer += self.configuration.get("web", "infcloud_config").encode()
return status, headers, answer
bgstack15