mirror of
https://github.com/element-hq/synapse.git
synced 2026-04-03 16:35:54 +00:00
Fixes: #8088 Previously we would perform OIDC discovery on startup, which involves making HTTP requests to the identity provider(s). If that took a long time, we would block startup. If that failed, we would crash startup. This commit: - makes the loading happen in the background on startup - makes an error in the 'preload' non-fatal (though it logs at CRITICAL for visibility) - adds a templated error page to show on failed redirects (for unavailable providers), as otherwise you get a JSON response in your navigator. - This involves introducing 2 new exception types to mark other exceptions and keep the error handling fine-grained. The machinery was already there to load-on-demand the discovery config, so when the identity provider comes back up, the discovery is reattempted and login can succeed. Signed-off-by: Olivier 'reivilibre <oliverw@matrix.org>
65 lines
2.2 KiB
Django/Jinja
65 lines
2.2 KiB
Django/Jinja
{% if use_forking_launcher %}
|
|
[program:synapse_fork]
|
|
environment=http_proxy="%(ENV_SYNAPSE_HTTP_PROXY)s",https_proxy="%(ENV_SYNAPSE_HTTPS_PROXY)s",no_proxy="%(ENV_SYNAPSE_NO_PROXY)s"
|
|
command=/usr/local/bin/python -m synapse.app.complement_fork_starter
|
|
{{ main_config_path }}
|
|
synapse.app.homeserver
|
|
--config-path="{{ main_config_path }}"
|
|
{%- if extra_config_dir %}
|
|
--config-path="{{ extra_config_dir }}"
|
|
{%- endif %}
|
|
--config-path=/conf/workers/shared.yaml
|
|
{%- for worker in workers %}
|
|
-- {{ worker.app }}
|
|
--config-path="{{ main_config_path }}"
|
|
{%- if extra_config_dir %}
|
|
--config-path="{{ extra_config_dir }}"
|
|
{%- endif %}
|
|
--config-path=/conf/workers/shared.yaml
|
|
--config-path=/conf/workers/{{ worker.name }}.yaml
|
|
{%- endfor %}
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
autorestart=unexpected
|
|
exitcodes=0
|
|
|
|
{% else %}
|
|
[program:synapse_main]
|
|
environment=http_proxy="%(ENV_SYNAPSE_HTTP_PROXY)s",https_proxy="%(ENV_SYNAPSE_HTTPS_PROXY)s",no_proxy="%(ENV_SYNAPSE_NO_PROXY)s"
|
|
command=/usr/local/bin/prefix-log /usr/local/bin/python -m synapse.app.homeserver
|
|
--config-path="{{ main_config_path }}"
|
|
{%- if extra_config_dir %}
|
|
--config-path="{{ extra_config_dir }}"
|
|
{%- endif %}
|
|
--config-path=/conf/workers/shared.yaml
|
|
priority=10
|
|
# Log startup failures to supervisord's stdout/err
|
|
# Regular synapse logs will still go in the configured data directory
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
autorestart=unexpected
|
|
exitcodes=0
|
|
|
|
|
|
{% for worker in workers %}
|
|
[program:synapse_{{ worker.name }}]
|
|
environment=http_proxy="%(ENV_SYNAPSE_HTTP_PROXY)s",https_proxy="%(ENV_SYNAPSE_HTTPS_PROXY)s",no_proxy="%(ENV_SYNAPSE_NO_PROXY)s"
|
|
command=/usr/local/bin/prefix-log /usr/local/bin/python -m {{ worker.app }}
|
|
--config-path="{{ main_config_path }}"
|
|
--config-path=/conf/workers/shared.yaml
|
|
--config-path=/conf/workers/{{ worker.name }}.yaml
|
|
autorestart=unexpected
|
|
priority=500
|
|
exitcodes=0
|
|
stdout_logfile=/dev/stdout
|
|
stdout_logfile_maxbytes=0
|
|
stderr_logfile=/dev/stderr
|
|
stderr_logfile_maxbytes=0
|
|
|
|
{% endfor %}
|
|
{% endif %}
|