From ffdb78107974c854d4fd3f4dab8b10463f292294 Mon Sep 17 00:00:00 2001 From: Anas Sheashaey Date: Thu, 14 Nov 2024 19:45:00 +0200 Subject: [PATCH] non-code changes --- README.md | 15 +++++---------- src/main.rs | 5 ++--- 2 files changed, 7 insertions(+), 13 deletions(-) diff --git a/README.md b/README.md index 3cacbfd..48a13db 100644 --- a/README.md +++ b/README.md @@ -9,8 +9,9 @@ I would be surprised if it worked for you. ## How to use it - Clone repo -- `cargo run --release` inside repo. -- On each Zotero instance, point your WebDAV URL to `http://:4918` +- `cargo build --release` inside repo. +- `./target/release/zync --host --port --` +- On each Zotero instance, point your WebDAV URL to `http://:` - Note: `http` not `https` ## Future Plans @@ -19,7 +20,7 @@ If I (or you!) ever had time, here is a list of things I plan to do: - [x] Basic WebDAV Support: `PROPFIND`, `GET`, `PUT`, `DELETE`. - Add logging - - To TTY + - [x] To TTY - To log file - Add username/password authentication. - Add a test suite: @@ -29,9 +30,7 @@ If I (or you!) ever had time, here is a list of things I plan to do: - Memory - Dynamic port binding - SSL/TLS -- argument parsing: - - `--data-dir` - - `--port` +- [x] argument parsing - Sync Status Monitoring - File Versioning and backup - Systemd service @@ -42,7 +41,3 @@ If I (or you!) ever had time, here is a list of things I plan to do: - etc - Configuration file - Docker container - -## Regrets - -Maybe Rust was an overkill. diff --git a/src/main.rs b/src/main.rs index 6a82a0d..da9a4a8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -29,11 +29,10 @@ struct Args { async fn main() -> Result<(), Box> { // Initialize the logger env_logger::Builder::from_env(Env::default().default_filter_or("info")).init(); - // Parse command-line arguments + let args = Args::parse(); - // Define the address to bind the server - let addr: SocketAddr = format!("{}:{}", args.host, args.port).parse()?; // let addr: SocketAddr = ([0, 0, 0, 0], 4918).into(); + let addr: SocketAddr = format!("{}:{}", args.host, args.port).parse()?; // Create the filesystem handler pointing to the specified directory let dav_fs = LocalFs::new(args.directory.clone(), false, false, false);