diff --git a/README.md b/README.md index 63a9051..f8a111b 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ You need `wget`, `go`, and `yarn` in your path to start the demo. The demo will ```sh git clone git@github.com:ClusterCockpit/cc-backend.git - +cd ./cc-backend ./startDemo.sh ``` You can access the web interface at http://localhost:8080. @@ -88,6 +88,7 @@ Having no jobs in the job-archive at all is fine. ### Configuration A config file in the JSON format can be provided using `--config` to override the defaults. +By default, if there is a `config.json` file in the current directory of the `cc-backend` process, it will be loaded even without the `--config` flag. You find documentation of all supported configuration and command line options [here](./configs.README.md). ### Update GraphQL schema diff --git a/configs/README.md b/configs/README.md index 143406a..f04fb5a 100644 --- a/configs/README.md +++ b/configs/README.md @@ -6,6 +6,7 @@ config file location using the command line option `--config `. All security relevant configuration. e.g., keys and passwords, are set using environment variables. It is supported to specify these by means of an `.env` file located in the project root. ## Configuration Options + * `addr`: Type string. Address where the http (or https) server will listen on (for example: 'localhost:80'). Default `:8080`. * `user`: Type string. Drop root permissions once .env was read and the port was taken. Only applicable if using privileged port. * `group`: Type string. Drop root permissions once .env was read and the port was taken. Only applicable if using privileged port. @@ -52,6 +53,7 @@ All security relevant configuration. e.g., keys and passwords, are set using env An example env file is found in this directory. Copy it to `.env` in the project root and adapt it for your needs. -* `JWT_PUBLIC_KEY` and `JWT_PRIVATE_KEY`: Base64 encoded Ed25519 keys used for JSON Web Token (JWT) authentication . TODO: Details! You can generate your own keypair using `go run utils/gen-keypair.go` +* `JWT_PUBLIC_KEY` and `JWT_PRIVATE_KEY`: Base64 encoded Ed25519 keys used for JSON Web Token (JWT) authentication. You must generate your own keypair using `go run tools/gen-keypair.go`. Next to the `gen-keypair.go` utility, you will find a README with more information about how to use these keys and where to put tokens. * `SESSION_KEY`: Some random bytes used as secret for cookie-based sessions. * `LDAP_ADMIN_PASSWORD`: The LDAP admin user password (optional). +* `LOGLEVEL`: Can be `err`, `warn`, `info` or `debug` (optional, `debug` by default). Can be used to reduce logging. diff --git a/startDemo.sh b/startDemo.sh index 6e3cf7b..9a581cb 100755 --- a/startDemo.sh +++ b/startDemo.sh @@ -13,8 +13,8 @@ yarn install yarn build cd ../.. +# Use your own keys in production! cp ./configs/env-template.txt .env -go get go build ./cmd/cc-backend ./cc-backend --init-db --add-user demo:admin:AdminDev