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 7aaabd7..758853c 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 0000000..154bda0 --- /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 be4f530..2717aa4 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 5f782f3..2793071 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 2a7f86e..53cecfc 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 d6de973..945789c 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 d8666d4..37aab85 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.