mirror of
https://github.com/unshackle-dl/unshackle.git
synced 2025-10-23 15:11:08 +00:00
feat: add service-specific configuration overrides
Add support for per-service configuration overrides allowing fine-tuned control of downloader and command options on a service-by-service basis. Fixes #13
This commit is contained in:
@@ -380,6 +380,33 @@ class dl:
|
||||
if getattr(config, "decryption_map", None):
|
||||
config.decryption = config.decryption_map.get(self.service, config.decryption)
|
||||
|
||||
service_config = config.services.get(self.service, {})
|
||||
|
||||
reserved_keys = {
|
||||
"profiles",
|
||||
"api_key",
|
||||
"certificate",
|
||||
"api_endpoint",
|
||||
"region",
|
||||
"device",
|
||||
"endpoints",
|
||||
"client",
|
||||
}
|
||||
|
||||
for config_key, override_value in service_config.items():
|
||||
if config_key in reserved_keys:
|
||||
continue
|
||||
|
||||
if isinstance(override_value, dict) and hasattr(config, config_key):
|
||||
current_config = getattr(config, config_key, {})
|
||||
if isinstance(current_config, dict):
|
||||
merged_config = {**current_config, **override_value}
|
||||
setattr(config, config_key, merged_config)
|
||||
|
||||
self.log.debug(
|
||||
f"Applied service-specific '{config_key}' overrides for {self.service}: {override_value}"
|
||||
)
|
||||
|
||||
with console.status("Loading Key Vaults...", spinner="dots"):
|
||||
self.vaults = Vaults(self.service)
|
||||
total_vaults = len(config.key_vaults)
|
||||
|
||||
Reference in New Issue
Block a user