diff --git a/.cargo/config b/.cargo/config new file mode 100644 index 0000000..bff29e6 --- /dev/null +++ b/.cargo/config @@ -0,0 +1,2 @@ +[build] +rustflags = ["--cfg", "tokio_unstable"] diff --git a/README.md b/README.md index 4cdccb1..9c38980 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,22 @@ Note: pict-rs-admin is not intended to be exposed to the internet. ## Running ```bash -$ pict-rs-admin -h +$ ./pict-rs-admin -h +Usage: pict-rs-admin [OPTIONS] --pict-rs-api-key + +Options: + -b, --bind-address + [env: PICTRS_ADMIN__BIND_ADDRESS=] [default: 127.0.0.0:8084] + --pict-rs-endpoint + [env: PICTRS_ADMIN__PICTRS_ENDPOINT=] [default: http://localhost:8080] + --pict-rs-api-key + [env: PICTRS_ADMIN__PICTRS_API_KEY=] + --opentelemetry-url + [env: PICTRS_ADMIN__OPENTELEMETRY_URL=] + --opentelemetry-event-buffer-size + [env: PICTRS_ADMIN__OPENTELEMETRY_EVENT_BUFFER_SIZE=] + -h, --help + Print help ``` ## Contributing diff --git a/pict-rs-admin.nix b/pict-rs-admin.nix index 04f4b52..b71cb29 100644 --- a/pict-rs-admin.nix +++ b/pict-rs-admin.nix @@ -13,6 +13,8 @@ rustPlatform.buildRustPackage { PROTOC = "${protobuf}/bin/protoc"; PROTOC_INCLUDE = "${protobuf}/include"; + RUSTFLAGS = "--cfg tokio_unstable"; + nativeBuildInputs = [ ]; passthru.tests = { inherit (nixosTests) pict-rs-admin; }; diff --git a/src/main.rs b/src/main.rs index ca98b23..f89ada9 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,9 +22,18 @@ use url::Url; #[derive(Debug, Parser)] struct Args { - #[clap(short, long, env = "PICTRS_ADMIN__BIND_ADDRESS")] + #[clap( + short, + long, + env = "PICTRS_ADMIN__BIND_ADDRESS", + default_value = "127.0.0.0:8084" + )] bind_address: SocketAddr, - #[clap(long, env = "PICTRS_ADMIN__PICTRS_ENDPOINT")] + #[clap( + long, + env = "PICTRS_ADMIN__PICTRS_ENDPOINT", + default_value = "http://localhost:8080" + )] pict_rs_endpoint: Url, #[clap(long, env = "PICTRS_ADMIN__PICTRS_API_KEY")] pict_rs_api_key: String,