diff --git a/src/api/web.rs b/src/api/web.rs index 9b08a723..0c60a352 100644 --- a/src/api/web.rs +++ b/src/api/web.rs @@ -9,11 +9,12 @@ use rocket_contrib::json::Json; use serde_json::Value; use crate::util::Cached; +use crate::error::Error; use crate::CONFIG; pub fn routes() -> Vec { if CONFIG.web_vault_enabled() { - routes![web_index, app_id, web_files, attachments, alive] + routes![web_index, app_id, web_files, attachments, alive, images] } else { routes![attachments, alive] } @@ -62,3 +63,13 @@ fn alive() -> Json { Json(format_date(&Utc::now().naive_utc())) } + +#[get("/images/")] +fn images(filename: String) -> Result>, Error> { + let image_type = ContentType::new("image", "png"); + match filename.as_ref() { + "mail-github.png" => Ok(Content(image_type , include_bytes!("../static/images/mail-github.png").to_vec())), + "logo-gray.png" => Ok(Content(image_type, include_bytes!("../static/images/logo-gray.png").to_vec())), + _ => err!("Image not found") + } +} \ No newline at end of file diff --git a/src/static/images/logo-gray.png b/src/static/images/logo-gray.png new file mode 100644 index 00000000..b045df54 Binary files /dev/null and b/src/static/images/logo-gray.png differ diff --git a/src/static/images/mail-github.png b/src/static/images/mail-github.png new file mode 100644 index 00000000..07935f11 Binary files /dev/null and b/src/static/images/mail-github.png differ diff --git a/src/static/templates/email/invite_accepted.html.hbs b/src/static/templates/email/invite_accepted.html.hbs index 71b8d174..cb8e3c79 100644 --- a/src/static/templates/email/invite_accepted.html.hbs +++ b/src/static/templates/email/invite_accepted.html.hbs @@ -82,7 +82,7 @@ Invitation accepted @@ -118,11 +118,7 @@ Invitation accepted diff --git a/src/static/templates/email/invite_confirmed.html.hbs b/src/static/templates/email/invite_confirmed.html.hbs index 746f96ed..81b5fefb 100644 --- a/src/static/templates/email/invite_confirmed.html.hbs +++ b/src/static/templates/email/invite_confirmed.html.hbs @@ -82,7 +82,7 @@ Invitation to {{org_name}} confirmed
@@ -114,11 +114,7 @@ Invitation to {{org_name}} confirmed diff --git a/src/static/templates/email/pw_hint_none.html.hbs b/src/static/templates/email/pw_hint_none.html.hbs index 4b97e57f..ef13b15d 100644 --- a/src/static/templates/email/pw_hint_none.html.hbs +++ b/src/static/templates/email/pw_hint_none.html.hbs @@ -82,7 +82,7 @@ Sorry, you have no password hint...
@@ -113,11 +113,7 @@ Sorry, you have no password hint... diff --git a/src/static/templates/email/pw_hint_some.hbs b/src/static/templates/email/pw_hint_some.hbs index a2917a3d..f16dc2b1 100644 --- a/src/static/templates/email/pw_hint_some.hbs +++ b/src/static/templates/email/pw_hint_some.hbs @@ -3,5 +3,6 @@ Your master password hint You (or someone) recently requested your master password hint. Your hint is: "{{hint}}" +Log in: Web Vault If you did not request your master password hint you can safely ignore this email. diff --git a/src/static/templates/email/pw_hint_some.html.hbs b/src/static/templates/email/pw_hint_some.html.hbs index 44cb3856..99220718 100644 --- a/src/static/templates/email/pw_hint_some.html.hbs +++ b/src/static/templates/email/pw_hint_some.html.hbs @@ -82,7 +82,7 @@ Your master password hint
@@ -119,11 +119,7 @@ Your master password hint diff --git a/src/static/templates/email/send_org_invite.html.hbs b/src/static/templates/email/send_org_invite.html.hbs index 6a9799a6..c8cec680 100644 --- a/src/static/templates/email/send_org_invite.html.hbs +++ b/src/static/templates/email/send_org_invite.html.hbs @@ -82,7 +82,7 @@ Join {{org_name}}
@@ -121,11 +121,7 @@ Join {{org_name}}