gateway_env.py 933 B

12345678910111213141516171819202122232425
  1. """Signal env -> gateway config bridge (``PlatformEntry.env_overrides``)."""
  2. from gateway.config import Platform
  3. from gateway.platform_env import EnvCred, home_step
  4. from utils import is_truthy_value
  5. ENV_ENABLE_CREDENTIALS = ("SIGNAL_HTTP_URL",)
  6. ENV_OVERRIDES = (
  7. EnvCred(
  8. Platform.SIGNAL, ("SIGNAL_HTTP_URL", "SIGNAL_ACCOUNT"),
  9. fixed=(
  10. ("http_url", "SIGNAL_HTTP_URL"), ("account", "SIGNAL_ACCOUNT"),
  11. ("ignore_stories", "SIGNAL_IGNORE_STORIES", "true", is_truthy_value),
  12. ),
  13. ),
  14. home_step(Platform.SIGNAL, "SIGNAL_HOME_CHANNEL"),
  15. )
  16. # Authorization env names (``PlatformEntry`` fields). Core reads them from this file when the
  17. # live entry lacks them: a user plugin overriding this platform, safe mode, the plugin disabled.
  18. AUTHZ = {
  19. "allowed_users_env": "SIGNAL_ALLOWED_USERS",
  20. "allow_all_env": "SIGNAL_ALLOW_ALL_USERS",
  21. "allowlist_suppresses_pairing": True,
  22. }