From c61a8844c6f9f40d9ad9f67a845d50518ccd961a Mon Sep 17 00:00:00 2001 From: Enola Knezevic Date: Mon, 4 Mar 2024 16:23:33 +0100 Subject: [PATCH] Readme --- README.md | 58 +++++++++++++++++++++++++++++++++++++++++++++++++++ src/config.rs | 2 +- 2 files changed, 59 insertions(+), 1 deletion(-) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..670a292 --- /dev/null +++ b/README.md @@ -0,0 +1,58 @@ +# Focus + +Prism is a Samply component ran centrally, which queries sites for criteria and number of results for these criteria in their Samply.Blaze stores. Prism is to be used by Samply.Lens for showing expected number of results next to criteria in the search tree. + +## Installation + +### Standalone Installation + +To run a standalone Prism, you need at least one running [Samply.Beam.Proxy](https://github.com/samply/beam/). +You can compile and run this application via Cargo.: + +```bash +cargo run -- --beam-proxy-url http://localhost:8082 --beam-app-id-long app2.proxy2.broker --api-key App1Secret --wait-count 5 --bind-addr 127.0.0.1:8066 --sites proxy1 --cors-origin any --project bbmri --target app1 +``` + +## Configuration + +The following environment variables are mandatory for the usage of Prism. + +``` +--beam-proxy-url + The beam proxy's base URL, e.g. https://proxy1.broker.samply.de [env: BEAM_PROXY_URL=] +--beam-app-id-long + This application's beam AppId, e.g. prism.proxy1.broker.samply.de [env: BEAM_APP_ID_LONG=] +--api-key + This application's beam API key [env: API_KEY=] +--sites + Sites to initially query, separated by ';' [env: SITES=] +--cors-origin + Credentials to use on the Beam Proxy [env: CORS_ORIGIN=] +--project + Project name [env: PROJECT=] +``` + +### Optional variables + +``` +--wait-count + Wait for results count [env: WAIT_COUNT=] [default: 32] +--target + Target_application_name [env: TARGET=] [default: focus] +--bind-addr + The socket address this server will bind to [env: BIND_ADDR=] [default: 0.0.0.0:8080] +``` + + + +## Usage + +Creating a sample prism query asking for criteria: + +```bash +curl -v -X POST -H "Content-Type: application/json" --data '{"sites": ["proxy1"]}' http://localhost:8066/criteria +``` + +## License + +This code is licensed under the Apache License 2.0. For details, please see [LICENSE](./LICENSE) diff --git a/src/config.rs b/src/config.rs index 5ad7326..0bcfd71 100644 --- a/src/config.rs +++ b/src/config.rs @@ -20,7 +20,7 @@ pub(crate) static CONFIG: Lazy = Lazy::new(|| { }) }); -const CLAP_FOOTER: &str = "For proxy support, environment variables HTTP_PROXY, HTTPS_PROXY, ALL_PROXY and NO_PROXY (and their lower-case variants) are supported. Usually, you want to set HTTP_PROXY *and* HTTPS_PROXY or set ALL_PROXY if both values are the same.\n\nFor updates and detailed usage instructions, visit https://github.com/samply/prism"; +const CLAP_FOOTER: &str = "For updates and detailed usage instructions, visit https://github.com/samply/prism"; #[derive(Parser, Debug)] #[clap(