feat: Introduce initial web frontend and backend services, and generalize directory configuration in docker-compose.
This commit is contained in:
+19
-1
@@ -52,7 +52,7 @@ SUPPORTED_EXTENSIONS = {
|
||||
|
||||
|
||||
def load_vault_config() -> Dict[str, Dict[str, Any]]:
|
||||
"""Read VAULT_N_* env vars and return vault configuration.
|
||||
"""Read VAULT_N_* and DIR_N_* env vars and return vault configuration.
|
||||
|
||||
Scans environment variables ``VAULT_1_NAME``/``VAULT_1_PATH``,
|
||||
``VAULT_2_NAME``/``VAULT_2_PATH``, etc. in sequential order.
|
||||
@@ -67,6 +67,7 @@ def load_vault_config() -> Dict[str, Dict[str, Any]]:
|
||||
- path: filesystem path (required)
|
||||
- attachmentsPath: relative attachments folder (optional)
|
||||
- scanAttachmentsOnStartup: boolean (default True)
|
||||
- type: "VAULT" or "DIR"
|
||||
"""
|
||||
vaults: Dict[str, Dict[str, Any]] = {}
|
||||
n = 1
|
||||
@@ -84,8 +85,25 @@ def load_vault_config() -> Dict[str, Dict[str, Any]]:
|
||||
"path": path,
|
||||
"attachmentsPath": attachments_path,
|
||||
"scanAttachmentsOnStartup": scan_attachments,
|
||||
"type": "VAULT"
|
||||
}
|
||||
n += 1
|
||||
|
||||
n = 1
|
||||
while True:
|
||||
name = os.environ.get(f"DIR_{n}_NAME")
|
||||
path = os.environ.get(f"DIR_{n}_PATH")
|
||||
if not name or not path:
|
||||
break
|
||||
|
||||
vaults[name] = {
|
||||
"path": path,
|
||||
"attachmentsPath": None,
|
||||
"scanAttachmentsOnStartup": False,
|
||||
"type": "DIR"
|
||||
}
|
||||
n += 1
|
||||
|
||||
return vaults
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user