diff --git a/Cargo.lock b/Cargo.lock index 97f69ad..5233cae 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -886,6 +886,12 @@ dependencies = [ "pin-project-lite", ] +[[package]] +name = "http-range-header" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ce4ef31cda248bbdb6e6820603b82dfcd9e833db65a43e997a0ccec777d11fe" + [[package]] name = "httparse" version = "1.8.0" @@ -1080,6 +1086,16 @@ version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "mime_guess" +version = "2.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" +dependencies = [ + "mime", + "unicase", +] + [[package]] name = "minijinja" version = "1.0.9" @@ -2214,10 +2230,18 @@ checksum = "1e9cd434a998747dd2c4276bc96ee2e0c7a2eadf3cae88e52be55a05fa9053f5" dependencies = [ "bitflags 2.4.1", "bytes", + "futures-util", "http", "http-body", "http-body-util", + "http-range-header", + "httpdate", + "mime", + "mime_guess", + "percent-encoding", "pin-project-lite", + "tokio", + "tokio-util", "tower-layer", "tower-service", "tracing", @@ -2354,6 +2378,15 @@ version = "1.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +[[package]] +name = "unicase" +version = "2.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" +dependencies = [ + "version_check", +] + [[package]] name = "unicode-bidi" version = "0.3.13" diff --git a/Cargo.toml b/Cargo.toml index 75236fe..254245d 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -14,7 +14,7 @@ serde = "1.0.190" uuid = { version = "1.5.0", features = ["v4", "fast-rng"] } totp-rs = "5.4.0" tracing-subscriber = { version = "0.3.17", features = ["env-filter"] } -tower-http = { version = "0.5", features = ["trace"] } +tower-http = { version = "0.5", features = ["trace", "fs"] } tracing = "0.1.40" askama = "0.10" minijinja = "1.0.9" diff --git a/auth.conf b/auth.conf index e9141de..f6b67c9 100644 --- a/auth.conf +++ b/auth.conf @@ -5,13 +5,14 @@ upstream protected { server { listen 8080; location / { - auth_request /auth; + auth_request /aaron/auth; set $original_full_url $scheme://$host$request_uri; error_page 401 =200 /login; proxy_set_header X-Original-URI $scheme://$host$request_uri; proxy_pass http://protected/; } - location = /auth { + location + location = /aaron/auth { internal; proxy_pass http://localhost:3000/auth; proxy_pass_request_body off; @@ -20,7 +21,7 @@ server { proxy_set_header X-Original-Remote-Addr $remote_addr; proxy_set_header X-Original-Host $host; } - location /login { + location /aaron/login { proxy_pass http://localhost:3000/login; proxy_set_header X-Original-Remote-Addr $remote_addr; proxy_set_header X-Original-Host $host; diff --git a/auth.db b/auth.db index 481218c..22b571f 100644 Binary files a/auth.db and b/auth.db differ diff --git a/loginpage.html b/loginpage.html index f8187bf..349a995 100644 --- a/loginpage.html +++ b/loginpage.html @@ -63,13 +63,15 @@