This repository was archived by the owner on Apr 26, 2024. It is now read-only.
-
-
Notifications
You must be signed in to change notification settings - Fork 2.1k
This repository was archived by the owner on Apr 26, 2024. It is now read-only.
Improve customizability and consistency of templates #7280
Copy link
Copy link
Closed
Labels
T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.z-p3(Deprecated Label)(Deprecated Label)
Description
Some new templates were added recently that dealt with SSO (#7102, #7240, #7279, #7067), but I think this is a wider issue.
There's a few oddities with the templates used in Synapse:
- Some are hard-coded HTML embedded in Python (this is non-ideal due to no syntax highlighting in editors, etc as well as not being customizable).
- Some "templates" are loaded as raw HTML files, but some are treated as Jinja2. (Note also that some of those are loaded during the configuration step, while some are loaded while handlers are initialized.)
- There's a variety of template directories that must be configured:
account_validity
,saml2_config
,sso
,email
,user_consent
. - Some of those template directories also allow you to customize the names of templates, while others use hard-coded names (e.g. the
account_renewed_html_path
setting vs. SSO uses hard-coded names).
I think there's a few concrete things we could do to improve this situation:
- Use a single template directory and allow the user to configure it in a single place.
- Treat all template files as Jinja (even if they don't have variable expressions there could be other reasons you'd want it to be Jinja).
- Hard-code all template names and document them well.
- (Somewhat unrelated, but...) Fix We should fall back to the default templates if we don't find a particular template in the custom template directory #6583 so that missing templates don't break Synapse.
babolivier and dklimpel
Metadata
Metadata
Assignees
Labels
T-TaskRefactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.Refactoring, removal, replacement, enabling or disabling functionality, other engineering tasks.z-p3(Deprecated Label)(Deprecated Label)