Add mailbox-scoped sign-on for Roundcube

This commit is contained in:
parkel committed 2026-11-21 20:18:05 +01:00
1 parent 8f9c5c0c94
commit 07b26838c9
15 files changed
+573 -82

No files matched your search

+22
View File
@@ -1,4 +1,5 @@
import os
import re
from pathlib import Path
from urllib.parse import urlsplit
@@ -175,6 +176,27 @@ if PHPMYADMIN_URL:
"Set a random phpMyAdmin bridge key of at least 32 characters."
)
ROUNDCUBE_URL = os.environ.get("COULOBRE_ROUNDCUBE_URL", "").rstrip("/")
ROUNDCUBE_BRIDGE_KEY = os.environ.get("COULOBRE_ROUNDCUBE_BRIDGE_KEY", "")
if ROUNDCUBE_URL:
roundcube = urlsplit(ROUNDCUBE_URL)
if (
roundcube.scheme != "https"
or not roundcube.hostname
or roundcube.username is not None
or roundcube.query
or roundcube.fragment
or any(character.isspace() for character in ROUNDCUBE_URL)
):
raise ImproperlyConfigured("Set an HTTPS Roundcube base URL.")
if (
re.fullmatch(r"[A-Za-z0-9_-]{32,128}", ROUNDCUBE_BRIDGE_KEY) is None
or ROUNDCUBE_BRIDGE_KEY == PHPMYADMIN_BRIDGE_KEY
):
raise ImproperlyConfigured(
"Set a dedicated random Roundcube bridge key."
)
LOCAL_ACCOUNT_BACKUPS = os.environ.get("COULOBRE_LOCAL_ACCOUNT_BACKUPS") == "1"
LOCAL_ACCOUNT_BACKUP_MAIL = (
os.environ.get("COULOBRE_LOCAL_ACCOUNT_BACKUP_MAIL") == "1"