update to axum 0.7

This commit is contained in:
Paul Zinselmeyer 2023-12-08 13:29:53 +01:00
parent defa769dd2
commit b92eef2e00
Signed by: pfzetto
GPG key ID: 4EEF46A5B276E648
4 changed files with 385 additions and 206 deletions

549
Cargo.lock generated

File diff suppressed because it is too large Load diff

View file

@ -13,15 +13,15 @@ thiserror = "1.0.50"
tokio = { version = "1.33", features = ["full"] } tokio = { version = "1.33", features = ["full"] }
tokio-util = "0.7" tokio-util = "0.7"
futures-util = "0.3" futures-util = "0.3"
axum = { version = "0.6", features = ["multipart"] } axum = { version = "0.7", features = ["multipart"] }
axum-oidc = "0.1.0" axum-oidc = "0.2"
axum-htmx = "0.4" axum-htmx = "0.5"
tower-http = { version= "0.4", features = ["fs"] }
sailfish = "0.8" sailfish = "0.8"
serde = "1.0" serde = "1.0"
toml = "0.8" toml = "0.8"
rand = "0.8" rand = "0.8"
qrcode = "0.12" qrcode = "0.12"
tower = "0.4.13" tower = "0.4.13"
tower-sessions = "0.4.1" tower-sessions = "0.7"
tower-http = { version= "0.5", features = ["fs"] }
prometheus-client = "0.22.0" prometheus-client = "0.22.0"

View file

@ -7,11 +7,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1699548976, "lastModified": 1701622587,
"narHash": "sha256-xnpxms0koM8mQpxIup9JnT0F7GrKdvv0QvtxvRuOYR4=", "narHash": "sha256-o3XhxCCyrUHZ0tlta2W7/MuXzy+n0+BUt3rKFK3DIK4=",
"owner": "ipetkov", "owner": "ipetkov",
"repo": "crane", "repo": "crane",
"rev": "6849911446e18e520970cc6b7a691e64ee90d649", "rev": "c09d2cbe84cc2adfe1943cb2a0b55a71c835ca9a",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -25,11 +25,11 @@
"systems": "systems" "systems": "systems"
}, },
"locked": { "locked": {
"lastModified": 1694529238, "lastModified": 1701680307,
"narHash": "sha256-zsNZZGTGnMOf9YpHKJqMSsa0dXbfmxeoJ7xHlrt+xmY=", "narHash": "sha256-kAuep2h5ajznlPMD9rnQyffWG8EM/C73lejGofXvdM8=",
"owner": "numtide", "owner": "numtide",
"repo": "flake-utils", "repo": "flake-utils",
"rev": "ff7b65b44d01cf9ba6a71320833626af21126384", "rev": "4022d587cbbfd70fe950c1e2083a02621806a725",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -40,11 +40,11 @@
}, },
"nixpkgs": { "nixpkgs": {
"locked": { "locked": {
"lastModified": 1699099776, "lastModified": 1701718080,
"narHash": "sha256-X09iKJ27mGsGambGfkKzqvw5esP1L/Rf8H3u3fCqIiU=", "narHash": "sha256-6ovz0pG76dE0P170pmmZex1wWcQoeiomUZGggfH9XPs=",
"owner": "NixOS", "owner": "NixOS",
"repo": "nixpkgs", "repo": "nixpkgs",
"rev": "85f1ba3e51676fa8cc604a3d863d729026a6b8eb", "rev": "2c7f3c0fb7c08a0814627611d9d7d45ab6d75335",
"type": "github" "type": "github"
}, },
"original": { "original": {
@ -72,11 +72,11 @@
] ]
}, },
"locked": { "locked": {
"lastModified": 1699582387, "lastModified": 1702001829,
"narHash": "sha256-sPmUXPDl+cEi+zFtM5lnAs7dWOdRn0ptZ4a/qHwvNDk=", "narHash": "sha256-6gEVidNVqzTb06zIy2Gxhz9m6/jXyAgViRxfgEpZkQ8=",
"owner": "oxalica", "owner": "oxalica",
"repo": "rust-overlay", "repo": "rust-overlay",
"rev": "41f7b0618052430d3a050e8f937030d00a2fcced", "rev": "c2a1dd067a928624c1aab36f976758c0722c79bd",
"type": "github" "type": "github"
}, },
"original": { "original": {

View file

@ -30,7 +30,7 @@ use question::{single_choice::SingleChoiceQuestion, Question};
use sailfish::TemplateOnce; use sailfish::TemplateOnce;
use serde::{Deserialize, Serialize}; use serde::{Deserialize, Serialize};
use stream::{PlayerBroadcastStream, ViewerBroadcastStream}; use stream::{PlayerBroadcastStream, ViewerBroadcastStream};
use tokio::{sync::RwLock, task::spawn_blocking}; use tokio::{net::TcpListener, sync::RwLock, task::spawn_blocking};
use tower::ServiceBuilder; use tower::ServiceBuilder;
use tower_http::services::ServeDir; use tower_http::services::ServeDir;
use tower_sessions::{cookie::SameSite, MemoryStore, SessionManagerLayer}; use tower_sessions::{cookie::SameSite, MemoryStore, SessionManagerLayer};
@ -143,8 +143,10 @@ pub async fn main() {
.layer(oidc_auth_service) .layer(oidc_auth_service)
.layer(session_service); .layer(session_service);
axum::Server::bind(&"[::]:8080".parse().expect("valid listen address")) let listener = TcpListener::bind("[::]:8080")
.serve(app.into_make_service()) .await
.expect("valid listen address");
axum::serve(listener, app.into_make_service())
.await .await
.expect("axum server"); .expect("axum server");
} }