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",
|
"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]]
|
[[package]]
|
||||||
name = "actix-http"
|
name = "actix-http"
|
||||||
version = "3.0.4"
|
version = "3.0.4"
|
||||||
|
@ -284,6 +307,12 @@ dependencies = [
|
||||||
"alloc-no-stdlib",
|
"alloc-no-stdlib",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "askama_escape"
|
||||||
|
version = "0.10.3"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "async-compression"
|
name = "async-compression"
|
||||||
version = "0.3.12"
|
version = "0.3.12"
|
||||||
|
@ -1269,6 +1298,12 @@ dependencies = [
|
||||||
"pin-project-lite",
|
"pin-project-lite",
|
||||||
]
|
]
|
||||||
|
|
||||||
|
[[package]]
|
||||||
|
name = "http-range"
|
||||||
|
version = "0.1.5"
|
||||||
|
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||||
|
checksum = "21dec9db110f5f872ed9699c3ecf50cf16f423502706ba5c72462e28d3157573"
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "httparse"
|
name = "httparse"
|
||||||
version = "1.7.1"
|
version = "1.7.1"
|
||||||
|
@ -2757,6 +2792,7 @@ dependencies = [
|
||||||
name = "starchart"
|
name = "starchart"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
|
"actix-files",
|
||||||
"actix-identity",
|
"actix-identity",
|
||||||
"actix-rt",
|
"actix-rt",
|
||||||
"actix-web",
|
"actix-web",
|
||||||
|
|
|
@ -25,6 +25,7 @@ members = [
|
||||||
actix-rt = "2.7"
|
actix-rt = "2.7"
|
||||||
actix-web = "4.0.1"
|
actix-web = "4.0.1"
|
||||||
actix-identity = "0.4.0"
|
actix-identity = "0.4.0"
|
||||||
|
actix-files = "0.6.0"
|
||||||
async-trait = "0.1.51"
|
async-trait = "0.1.51"
|
||||||
config = "0.13.0"
|
config = "0.13.0"
|
||||||
lazy_static = "1.4.0"
|
lazy_static = "1.4.0"
|
||||||
|
|
|
@ -17,6 +17,7 @@
|
||||||
*/
|
*/
|
||||||
use std::sync::Arc;
|
use std::sync::Arc;
|
||||||
|
|
||||||
|
use actix_files::Files;
|
||||||
use actix_web::{middleware, web::Data, App, HttpServer};
|
use actix_web::{middleware, web::Data, App, HttpServer};
|
||||||
use lazy_static::lazy_static;
|
use lazy_static::lazy_static;
|
||||||
|
|
||||||
|
@ -81,6 +82,7 @@ async fn main() {
|
||||||
middleware::DefaultHeaders::new().add(("Permissions-Policy", "interest-cohort=()")),
|
middleware::DefaultHeaders::new().add(("Permissions-Policy", "interest-cohort=()")),
|
||||||
)
|
)
|
||||||
.configure(routes::services)
|
.configure(routes::services)
|
||||||
|
.service(Files::new("/federate", &settings.repository.root).show_files_listing())
|
||||||
})
|
})
|
||||||
.bind(&socket_addr)
|
.bind(&socket_addr)
|
||||||
.unwrap()
|
.unwrap()
|
||||||
|
|
Loading…
Reference in a new issue