Skip to content
This repository was archived by the owner on Apr 5, 2024. It is now read-only.

Commit d4f674d

Browse files
committed
Fixed logging and added steps to README
1 parent ff56830 commit d4f674d

File tree

4 files changed

+25
-10
lines changed

4 files changed

+25
-10
lines changed

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ clap = { version = "4.0.7", features = ["derive", "env"] }
1313
# ftp lib
1414
libunftp = "0.18.5"
1515
# own implementations
16-
unftp-filefighter = { path = "./server" }
16+
unftp-filefighter = { path = "server" }
1717
filefighter-api = { path = "api" }
1818
# async
1919
tokio = { version = "1", features = ["full"] }

README.org

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,20 @@
11
#+title: FileFighter FTP-Service
2+
#+options: toc:nil
23

34
A small rust service faking a FTP-server by forwarding the requests to the FileFighter Backend (FileSystemService)
5+
6+
* Run in Docker with local fss and fhs
7+
#+begin_src shell
8+
docker build . -t filefighter/ftp-service
9+
#+end_src
10+
11+
#+begin_src shell
12+
docker run \
13+
--name test \
14+
-p 2121:2121 \
15+
-p 10000-10010:10000-10010 \
16+
-e FTP_SERVICE_BACKEND_URL=http://$(hostname):8080 \
17+
-e FTP_SERVICE_FILEHANDLER_URL=http://$(hostname):5000 \
18+
-e FTP_SERVICE_LOG_LEVEL=debug \
19+
filefighter/ftp-service:latest
20+
#+end_src

src/cli.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -39,15 +39,9 @@ pub struct Args {
3939
/// Implement conversion between config and args
4040
impl From<Args> for ApiConfig {
4141
fn from(args: Args) -> Self {
42-
let mut backend_url = args.backend_url;
43-
backend_url.push_str("/api");
44-
45-
let mut filehandler_url = args.filehandler_url;
46-
filehandler_url.push_str("/data");
47-
4842
Self {
49-
fss_base_url: backend_url,
50-
fhs_base_url: filehandler_url,
43+
fss_base_url: args.backend_url,
44+
fhs_base_url: args.filehandler_url,
5145
}
5246
}
5347
}

src/lib.rs

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,11 @@ pub fn parse_cli_args() -> Args {
3636
// read from env
3737
dotenv().ok();
3838

39-
Args::parse()
39+
let mut args = Args::parse();
40+
// add missing uri components
41+
args.backend_url.push_str("/api");
42+
args.filehandler_url.push_str("/data");
43+
args
4044
}
4145

4246
pub async fn start_ftp_service(args: Args) -> Result<(), ServerError> {

0 commit comments

Comments
 (0)