Redirect old dashboard routes to new routes
This commit is contained in:
parent
9d452ed8cb
commit
65b8ba3b47
596
Cargo.lock
generated
596
Cargo.lock
generated
File diff suppressed because it is too large
Load Diff
@ -1,16 +1,27 @@
|
||||
server {
|
||||
server_name www.reminder-bot.com;
|
||||
|
||||
return 301 $scheme://reminder-bot.com$request_uri;
|
||||
return 301 https://reminder-bot.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 80;
|
||||
server_name reminder-bot.com;
|
||||
server_name beta.reminder-bot.com;
|
||||
|
||||
return 301 https://reminder-bot.com$request_uri;
|
||||
}
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name beta.reminder-bot.com;
|
||||
|
||||
ssl_certificate /etc/letsencrypt/live/beta.reminder-bot.com/fullchain.pem;
|
||||
ssl_certificate_key /etc/letsencrypt/live/beta.reminder-bot.com/privkey.pem;
|
||||
|
||||
return 301 https://reminder-bot.com$request_uri;
|
||||
}
|
||||
|
||||
|
||||
server {
|
||||
listen 443 ssl;
|
||||
server_name reminder-bot.com;
|
||||
@ -25,6 +36,8 @@ server {
|
||||
proxy_buffers 4 256k;
|
||||
proxy_busy_buffers_size 256k;
|
||||
|
||||
client_max_body_size 10M;
|
||||
|
||||
location / {
|
||||
proxy_pass http://localhost:18920;
|
||||
proxy_redirect off;
|
@ -177,6 +177,8 @@ pub async fn initialize(
|
||||
.mount(
|
||||
"/dashboard",
|
||||
routes![
|
||||
routes::dashboard::reminders_redirect,
|
||||
routes::dashboard::todos_redirect,
|
||||
routes::dashboard::dashboard,
|
||||
routes::dashboard::dashboard_home,
|
||||
routes::dashboard::api::delete_reminder,
|
||||
|
@ -697,6 +697,18 @@ pub enum DashboardPage {
|
||||
NotConfigured(Template),
|
||||
}
|
||||
|
||||
// Legacy route to maintain compatibility with old dashboard routing
|
||||
#[get("/?<id>")]
|
||||
pub async fn reminders_redirect(id: &str) -> Redirect {
|
||||
Redirect::to(format!("/dashboard/{}/reminders", id))
|
||||
}
|
||||
|
||||
// Legacy route to maintain compatibility with old dashboard routing
|
||||
#[get("/todo?<id>")]
|
||||
pub async fn todos_redirect(id: &str) -> Redirect {
|
||||
Redirect::to(format!("/dashboard/{}/todos", id))
|
||||
}
|
||||
|
||||
#[get("/")]
|
||||
pub async fn dashboard_home(cookies: &CookieJar<'_>) -> DashboardPage {
|
||||
if cookies.get_private("userid").is_some() {
|
||||
|
Loading…
Reference in New Issue
Block a user