diff --git a/.github/ISSUE_TEMPLATE.md b/.github/ISSUE_TEMPLATE/bug_report.md similarity index 92% rename from .github/ISSUE_TEMPLATE.md rename to .github/ISSUE_TEMPLATE/bug_report.md index 7aaabd7d..758853ce 100644 --- a/.github/ISSUE_TEMPLATE.md +++ b/.github/ISSUE_TEMPLATE/bug_report.md @@ -1,3 +1,12 @@ +--- +name: Bug report +about: Create a report to help us improve +title: '' +labels: '' +assignees: '' + +--- + + +

+This is a test email to verify the SMTP configuration for {{url}}. +

+

When you can read this email it is probably configured correctly.

+ diff --git a/src/static/templates/email/smtp_test.html.hbs b/src/static/templates/email/smtp_test.html.hbs new file mode 100644 index 00000000..154bda0c --- /dev/null +++ b/src/static/templates/email/smtp_test.html.hbs @@ -0,0 +1,129 @@ +Bitwarden_rs SMTP Test + + + + + + Bitwarden_rs + + + + + + + + + + +
+ + + + +
+ + + + +
+ + + + + + + +
+ This is a test email to verify the SMTP configuration for {{url}}. +
+ When you can read this email it is probably configured correctly. +
+
+ + + + + +
+
+ + diff --git a/src/static/templates/email/welcome.hbs b/src/static/templates/email/welcome.hbs index be4f530e..2717aa44 100644 --- a/src/static/templates/email/welcome.hbs +++ b/src/static/templates/email/welcome.hbs @@ -2,7 +2,7 @@ Welcome

-Thank you for creating an account at {{url}}. You may now log in with your new account. +Thank you for creating an account at {{url}}. You may now log in with your new account.

If you did not request to create an account, you can safely ignore this email.

diff --git a/src/static/templates/email/welcome.html.hbs b/src/static/templates/email/welcome.html.hbs index 5f782f31..27930715 100644 --- a/src/static/templates/email/welcome.html.hbs +++ b/src/static/templates/email/welcome.html.hbs @@ -96,7 +96,7 @@ Welcome diff --git a/src/static/templates/email/welcome_must_verify.hbs b/src/static/templates/email/welcome_must_verify.hbs index 2a7f86e5..53cecfca 100644 --- a/src/static/templates/email/welcome_must_verify.hbs +++ b/src/static/templates/email/welcome_must_verify.hbs @@ -2,7 +2,7 @@ Welcome

-Thank you for creating an account at {{url}}. Before you can login with your new account, you must verify this email address by clicking the link below. +Thank you for creating an account at {{url}}. Before you can login with your new account, you must verify this email address by clicking the link below.

diff --git a/src/static/templates/email/welcome_must_verify.html.hbs b/src/static/templates/email/welcome_must_verify.html.hbs index d6de9738..945789c7 100644 --- a/src/static/templates/email/welcome_must_verify.html.hbs +++ b/src/static/templates/email/welcome_must_verify.html.hbs @@ -96,7 +96,7 @@ Welcome

- Thank you for creating an account at {{url}}. You may now log in with your new account. + Thank you for creating an account at {{url}}. You may now log in with your new account.
diff --git a/src/util.rs b/src/util.rs index d8666d49..37aab856 100644 --- a/src/util.rs +++ b/src/util.rs @@ -109,7 +109,7 @@ impl<'r, R: Responder<'r>> Responder<'r> for Cached { } } -// Log all the routes from the main base paths list, and the attachments endoint +// Log all the routes from the main paths list, and the attachments endpoint // Effectively ignores, any static file route, and the alive endpoint const LOGGED_ROUTES: [&str; 6] = [ "/api", @@ -157,7 +157,10 @@ impl Fairing for BetterLogging { } let uri = request.uri(); let uri_path = uri.path(); - if self.0 || LOGGED_ROUTES.iter().any(|r| uri_path.starts_with(r)) { + // FIXME: trim_start_matches() could result in over-trimming in pathological cases; + // strip_prefix() would be a better option once it's stable. + let uri_subpath = uri_path.trim_start_matches(&CONFIG.domain_path()); + if self.0 || LOGGED_ROUTES.iter().any(|r| uri_subpath.starts_with(r)) { match uri.query() { Some(q) => info!(target: "request", "{} {}?{}", method, uri_path, &q[..q.len().min(30)]), None => info!(target: "request", "{} {}", method, uri_path), @@ -169,8 +172,10 @@ impl Fairing for BetterLogging { if !self.0 && request.method() == Method::Options { return; } - let uri_path = request.uri().path(); - if self.0 || LOGGED_ROUTES.iter().any(|r| uri_path.starts_with(r)) { + // FIXME: trim_start_matches() could result in over-trimming in pathological cases; + // strip_prefix() would be a better option once it's stable. + let uri_subpath = request.uri().path().trim_start_matches(&CONFIG.domain_path()); + if self.0 || LOGGED_ROUTES.iter().any(|r| uri_subpath.starts_with(r)) { let status = response.status(); if let Some(ref route) = request.route() { info!(target: "response", "{} => {} {}", route, status.code, status.reason)
- Thank you for creating an account at {{url}}. Before you can login with your new account, you must verify this email address by clicking the link below. + Thank you for creating an account at {{url}}. Before you can login with your new account, you must verify this email address by clicking the link below.