Fix error reporting in admin and some small fixes

- Fixed a bug in JavaScript which caused no messages to be shown to the
user in-case of an error send by the server.
- Changed mail error handling for better error messages
- Changed user/org actions from a to buttons, this should prevent
strange issues in-case of javascript issues and the page does re-load.
- Added Alpine and Debian info for the running docker image

During the mail error testing i encountered a bug which caused lettre to
panic. This panic only happens on debug builds and not release builds,
so no need to update anything on that part. This bug is also already
fixed. See https://github.com/lettre/lettre/issues/678 and https://github.com/lettre/lettre/pull/679

Resolves #2021
Could also fix the issue reported here #2022, or at least no hash `#` in
the url.
This commit is contained in:
BlackDex
2021-10-08 00:01:24 +02:00
parent 9930a0d752
commit 338756550a
8 changed files with 52 additions and 24 deletions

View File

@ -419,6 +419,18 @@ pub fn is_running_in_docker() -> bool {
Path::new("/.dockerenv").exists() || Path::new("/run/.containerenv").exists()
}
/// Simple check to determine on which docker base image vaultwarden is running.
/// We build images based upon Debian or Alpine, so these we check here.
pub fn docker_base_image() -> String {
if Path::new("/etc/debian_version").exists() {
"Debian".to_string()
} else if Path::new("/etc/alpine-release").exists() {
"Alpine".to_string()
} else {
"Unknown".to_string()
}
}
//
// Deserialization methods
//