From fec933c5ecc3b007377f2c40d7841e35363725dc Mon Sep 17 00:00:00 2001 From: FixFromDarkness Date: Thu, 7 Jul 2022 20:08:29 +0300 Subject: [PATCH] * Revert default address to 0.0.0.0 due to docker usage & compatibility * Add --bind option to readme & change some examples --- README.MD | 11 +++++++++-- src/args.rs | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/README.MD b/README.MD index d9ea214..f303a05 100644 --- a/README.MD +++ b/README.MD @@ -105,11 +105,11 @@ Remember, MicroBin will create your database and file storage wherever you execu `cd ~/microbin/` -`microbin --port 8080 --highlightsyntax --editable` +`microbin --highlightsyntax --editable` ### Building MicroBin -Simply clone the repository, build it with `cargo build --release` and run the `microbin` executable in the created `target/release/` directory. It will start on port 8080. You can change the port with `-p` or `--port` CL arguments. For other arguments see [the Wiki](https://github.com/szabodanika/microbin/wiki). +Simply clone the repository, build it with `cargo build --release` and run the `microbin` executable in the created `target/release/` directory. It will start listening on 0.0.0.0:8080. You can change the port or bind address with CL arguments `-p (--port)` or `-b (--bind)` respectively . For other arguments see [the Wiki](https://github.com/szabodanika/microbin/wiki). ``` git clone https://github.com/szabodanika/microbin.git @@ -283,6 +283,13 @@ Default value: 8080 Sets the port for the server will be listening on. + +### -b, --bind [ADDRESS] + +Default value: 0.0.0.0 + +Sets the bind address for the server will be listening on. Both ipv4 and ipv6 are supported. + ### --private Enables private pastas. Adds a new checkbox to make your pasta private, which then won't show up on the pastalist page. With the URL to your pasta, it will still be accessible. diff --git a/src/args.rs b/src/args.rs index e36eb08..4a97f3b 100644 --- a/src/args.rs +++ b/src/args.rs @@ -39,7 +39,7 @@ pub struct Args { #[clap(short, long, default_value_t = 8080)] pub port: u16, - #[clap(short, long, default_value_t = IpAddr::from([127, 0, 0, 1]))] + #[clap(short, long, default_value_t = IpAddr::from([0, 0, 0, 0]))] pub bind: IpAddr, #[clap(long)]