Compare commits

..

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

3 changed files with 11 additions and 7 deletions

View File

@ -7,5 +7,5 @@ mkdir -p dist
cp dashboard.desktop dist cp dashboard.desktop dist
cp ../target/release/dashboard dist cp ../target/release/dashboard dist
strip dist/dashboard strip dist/dashboard
tar -czf dashboard.tgz dist/ tar -cf dashboard.tgz dist/

View File

@ -9,5 +9,5 @@ cp ../target/release/file-service dist
cp ../target/release/auth-cli dist cp ../target/release/auth-cli dist
strip dist/file-service strip dist/file-service
strip dist/auth-cli strip dist/auth-cli
tar -czf file-service-${VERSION}.tgz dist/ tar -cf file-service-${VERSION}.tar.gz dist/

View File

@ -1,24 +1,28 @@
#[macro_use] #[macro_use]
extern crate log; extern crate log;
use cookie::Cookie;
use handlers::{file, handle_auth, handle_upload, thumbnail}; use handlers::{file, handle_auth, handle_upload, thumbnail};
use http::status::StatusCode;
// use mustache::{compile_path, Template};
// use orizentic::{Permissions, ResourceName, Secret};
use bytes::Buf;
use cookie::Cookie;
use futures_util::StreamExt;
use std::{ use std::{
collections::{HashMap, HashSet}, collections::{HashMap, HashSet},
convert::Infallible, convert::Infallible,
io::Read,
net::{IpAddr, Ipv4Addr, SocketAddr}, net::{IpAddr, Ipv4Addr, SocketAddr},
path::PathBuf, path::PathBuf,
sync::Arc, sync::Arc,
}; };
use tokio::sync::RwLock; use tokio::sync::RwLock;
use warp::{Filter, Rejection}; use warp::{filters::multipart::Part, Filter, Rejection};
mod handlers; mod handlers;
mod html; mod html;
mod pages; mod pages;
const MAX_UPLOAD: u64 = 15 * 1024 * 1024;
pub use file_service::{ pub use file_service::{
AuthDB, AuthError, AuthToken, FileHandle, FileId, FileInfo, ReadFileError, SessionToken, Store, AuthDB, AuthError, AuthToken, FileHandle, FileId, FileInfo, ReadFileError, SessionToken, Store,
Username, WriteFileError, Username, WriteFileError,
@ -133,7 +137,7 @@ pub async fn main() {
.and(warp::post()) .and(warp::post())
.and(with_app(app.clone())) .and(with_app(app.clone()))
.and(with_session()) .and(with_session())
.and(warp::multipart::form().max_length(MAX_UPLOAD)) .and(warp::multipart::form())
.then(handle_upload); .then(handle_upload);
let thumbnail = warp::path!(String / "tn") let thumbnail = warp::path!(String / "tn")