Compare commits

..

No commits in common. "525b5389a1cf4cc2069448d71a2b0f3958346ae5" and "2f6be84a4375f698fdd59230f751e38d5eac85d0" have entirely different histories.

4 changed files with 6 additions and 16 deletions

1
.gitignore vendored
View File

@ -4,7 +4,6 @@ node_modules
dist
result
*.tgz
*.tar.gz
file-service/*.sqlite
file-service/*.sqlite-shm
file-service/*.sqlite-wal

View File

@ -6,6 +6,9 @@ edition = "2018"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[features]
auth-cli = [ "clap" ]
[lib]
name = "file_service"
path = "src/lib.rs"
@ -17,6 +20,7 @@ path = "src/main.rs"
[[bin]]
name = "auth-cli"
path = "src/bin/cli.rs"
required-features = [ "auth-cli" ]
[target.auth-cli.dependencies]
@ -25,7 +29,7 @@ base64ct = { version = "1", features = [ "alloc" ] }
build_html = { version = "2" }
bytes = { version = "1" }
chrono = { version = "0.4", features = ["serde"] }
clap = { version = "4", features = [ "derive" ] }
clap = { version = "4", features = [ "derive" ], optional = true }
cookie = { version = "0.17" }
futures-util = { version = "0.3" }
hex-string = "0.1.0"

View File

@ -1,13 +0,0 @@
#!/usr/bin/env bash
set -euo pipefail
VERSION=`cat Cargo.toml | grep "^version =" | sed -r 's/^version = "(.+)"$/\1/'`
mkdir -p dist
cp ../target/release/file-service dist
cp ../target/release/auth-cli dist
strip dist/file-service
strip dist/auth-cli
tar -cf file-service-${VERSION}.tar.gz dist/

View File

@ -68,7 +68,7 @@ pub async fn file(
old_etags: Option<String>,
) -> Result<Response<Vec<u8>>, Error> {
match app.get_file(&FileId::from(id)).await {
Ok(file) => serve_file(file.info.clone(), || file.content(), old_etags),
Ok(file) => serve_file(file.info.clone(), || file.thumbnail(), old_etags),
Err(_err) => Response::builder()
.status(StatusCode::NOT_FOUND)
.body(vec![]),