feat: setup file listing for download
This commit is contained in:
parent
f78a331e9c
commit
0a4b5dd62c
3 changed files with 39 additions and 0 deletions
36
Cargo.lock
generated
36
Cargo.lock
generated
|
@ -19,6 +19,29 @@ dependencies = [
|
|||
"tokio-util 0.7.1",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "actix-files"
|
||||
version = "0.6.0"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d81bde9a79336aa51ebed236e91fc1a0528ff67cfdf4f68ca4c61ede9fd26fb5"
|
||||
dependencies = [
|
||||
"actix-http",
|
||||
"actix-service",
|
||||
"actix-utils",
|
||||
"actix-web",
|
||||
"askama_escape",
|
||||
"bitflags",
|
||||
"bytes",
|
||||
"derive_more",
|
||||
"futures-core",
|
||||
"http-range",
|
||||
"log",
|
||||
"mime",
|
||||
"mime_guess",
|
||||
"percent-encoding",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "actix-http"
|
||||
version = "3.0.4"
|
||||
|
@ -284,6 +307,12 @@ dependencies = [
|
|||
"alloc-no-stdlib",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "askama_escape"
|
||||
version = "0.10.3"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341"
|
||||
|
||||
[[package]]
|
||||
name = "async-compression"
|
||||
version = "0.3.12"
|
||||
|
@ -1269,6 +1298,12 @@ dependencies = [
|
|||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
name = "http-range"
|
||||
version = "0.1.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
|
||||
|
||||
[[package]]
|
||||
name = "httparse"
|
||||
version = "1.7.1"
|
||||
|
@ -2757,6 +2792,7 @@ dependencies = [
|
|||
name = "starchart"
|
||||
version = "0.1.0"
|
||||
dependencies = [
|
||||
"actix-files",
|
||||
"actix-identity",
|
||||
"actix-rt",
|
||||
"actix-web",
|
||||
|
|
|
@ -25,6 +25,7 @@ members = [
|
|||
actix-rt = "2.7"
|
||||
actix-web = "4.0.1"
|
||||
actix-identity = "0.4.0"
|
||||
actix-files = "0.6.0"
|
||||
async-trait = "0.1.51"
|
||||
config = "0.13.0"
|
||||
lazy_static = "1.4.0"
|
||||
|
|
|
@ -17,6 +17,7 @@
|
|||
*/
|
||||
use std::sync::Arc;
|
||||
|
||||
use actix_files::Files;
|
||||
use actix_web::{middleware, web::Data, App, HttpServer};
|
||||
use lazy_static::lazy_static;
|
||||
|
||||
|
@ -81,6 +82,7 @@ async fn main() {
|
|||
middleware::DefaultHeaders::new().add(("Permissions-Policy", "interest-cohort=()")),
|
||||
)
|
||||
.configure(routes::services)
|
||||
.service(Files::new("/federate", &settings.repository.root).show_files_listing())
|
||||
})
|
||||
.bind(&socket_addr)
|
||||
.unwrap()
|
||||
|
|
Loading…
Reference in a new issue