vaultwarden/src
Mathijs van Veluw 294b429436
Add dynamic CSS support (#4940)
* Add dynamic CSS support

Together with https://github.com/dani-garcia/bw_web_builds/pull/180 this PR will add support for dynamic CSS changes.

For example, we could hide the register link if signups are not allowed.
In the future show or hide the SSO button depending on if it is enabled or not.

There also is a special `user.vaultwarden.scss` file so that users can add custom CSS without the need to modify the default (static) changes.
This will prevent future changes from not being applied and still have the custom user changes to be added.

Also added a special redirect when someone goes directly to `/index.html` as that might cause issues with loading other scripts and files.

Signed-off-by: BlackDex <black.dex@gmail.com>

* Add versions and fallback to built-in

- Add both Vaultwarden and web-vault versions to the css_options.
- Fallback to the inner templates if rendering or compiling the scss fails.
  This ensures the basics are always working even if someone breaks the templates.

Signed-off-by: BlackDex <black.dex@gmail.com>

* Fix fallback code to actually work

The fallback now works by using an alternative `reg!` macro.
This adds an extra template register which prefixes the template with `fallback_`.

Signed-off-by: BlackDex <black.dex@gmail.com>

* Updated the wiki link in the user template

---------

Signed-off-by: BlackDex <black.dex@gmail.com>
2024-11-11 20:14:04 +01:00
..
api Add dynamic CSS support (#4940) 2024-11-11 20:14:04 +01:00
db Update crates and fix several issues 2024-11-10 23:56:19 +01:00
static Add dynamic CSS support (#4940) 2024-11-11 20:14:04 +01:00
auth.rs Add extra linting (#4977) 2024-09-23 20:25:32 +02:00
config.rs Add dynamic CSS support (#4940) 2024-11-11 20:14:04 +01:00
crypto.rs Remove get_random_64() 2022-11-13 10:03:06 +01:00
error.rs Add extra linting (#4977) 2024-09-23 20:25:32 +02:00
http_client.rs Add extra linting (#4977) 2024-09-23 20:25:32 +02:00
mail.rs Update crates and fix several issues 2024-11-10 23:56:19 +01:00
main.rs Hide user name on invite status (#5110) 2024-10-19 18:22:21 +02:00
ratelimit.rs Basic ratelimit for user login (including 2FA) and admin login 2021-12-22 21:48:49 +01:00
util.rs Update crates and fix several issues 2024-11-10 23:56:19 +01:00