Skip to content

Commit

Permalink
Update documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
Planlos5000 committed Jan 17, 2025
1 parent a9093e5 commit 0b3245a
Show file tree
Hide file tree
Showing 4 changed files with 154 additions and 44 deletions.
48 changes: 39 additions & 9 deletions docs/src/content/docs/self-hosting/docker.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,41 +9,58 @@ Scrumlr can be deployed using a Docker Compose file. This is the easiest way to
We maintain a Docker Compose file in our Repository that you can use to deploy Scrumlr.

## Prerequisites

Clone the Scrumlr repository to your server and navigate to the deployment directory.

```sh
git clone https://github.com/inovex/scrumlr.io
cd scrumlr.io/deployment/docker
```

Copy the `.env.example` file to `.env` and adjust the variables to your needs.
After you cloned the repository and switched to the directory, copy the `.env.example` file to `.env` and adjust the
variables in the `.env` file to your needs.

```sh
cp .env.example .env
```

A description of all environment variables can be found [here](/self-hosting/env-vars/).
For a new deployment the mandatory variables to fill out are `POSTGRES_PASSWORD` and `SCRUMLR_PRIVATE_KEY`.

Some environment variables have a default value set in the Dockerfile.
If the variable is set in the `.env` file, the default value will be overwritten.
If an environment variable has no default value and is not set in the `.env` file, the value will be ignored.

## Generating needed secrets

### Postgres Password

Make sure to set the `POSTGRES_PASSWORD` variable in your `.env` file to a secure password. For example you can generate a 64 characters long one from the terminal with the following command (if you have `pwgen` installed):
Make sure to set the `POSTGRES_PASSWORD` variable in your `.env` file to a secure password. For example you can generate
a 64 characters long one from the terminal with the following command (if you have `pwgen` installed):

```sh
pwgen -s 64 1
```

### JWT Private Key

We use an ECDSA private key to sign the JWT tokens.
***Make sure to keep this key secure as it can be used to decrypt the tokens and generate new ones, potentially compromising your users' accounts.***

***Make sure to keep this key secure as it can be used to decrypt the tokens and generate new ones, potentially
compromising your users' accounts.***

```sh
openssl ecparam -genkey -name secp521r1 -noout -out jwt.key
```

Now we need to encode this key to be able to use it as a string in the `.env` file:

```sh
cat jwt.key | awk '{printf "%s\\n", $0}'
```

Copy the result of this command and paste it into your `.env` file (with `\n` line breaks included) like this, surrounded with quotes:
Copy the result of this command and paste it into your `.env` file (with `\n` line breaks included) like this,
surrounded with quotes:

```ini
SCRUMLR_PRIVATE_KEY="-----BEGIN EC PRIVATE KEY-----\n...\n-----END EC PRIVATE KEY-----\n"
Expand All @@ -59,22 +76,35 @@ pwgen -s 64 1
```

## Deployment

You can now start the deployment using the following command.

```sh
docker-compose up -d
docker compose up -d
```

After a few seconds you can check with `docker ps --all` to see if all the containers have started up. If one crashed or if there is an issue you can check logs with `docker logs (container name or id)`
After a few seconds you can check with `docker ps --all` to see if all the containers have started up.
The docker containers start in the following order

1. Postgres, nats and caddy
2. Scrumlr backend
3. Scrumlr frontend

If one crashed or if there is an issue you can check logs with `docker logs (container name or id)`

Once all container started you can vist `localhost:80` to access Scrumlr.

## Reverse Proxy

We strongly recommend using a reverse proxy to handle TLS termination and to provide a secure connection to your users.
Scrumlr should work with all major reverse proxies like [Nginx](https://nginx.org), [Traefik](https://traefik.io/traefik/) or [Caddy](https://caddyserver.com/docs/quick-starts/reverse-proxy).
Scrumlr should work with all major reverse proxies like [Nginx](https://nginx.org), [Traefik](https://traefik.io/traefik/)
or [Caddy](https://caddyserver.com/docs/quick-starts/reverse-proxy).
We automatically include a caddy deployment in the docker-compose file, which you can use as a reverse proxy.
All you need to do is updating the `Caddyfile` to include your host domain instead of `0.0.0.0:80`.
All you need to do is updating the `Caddyfile` to include your host domain instead of `:80`.
If you don't want TLS you can simply keep the specified port.
Keep in mind that running Scrumlr without TLS is **not recommended**.

```
```conf
your_domain {
}
```
Expand Down
113 changes: 84 additions & 29 deletions docs/src/content/docs/self-hosting/env-vars.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,192 +4,247 @@ description: A full list of all environment variables that can be used to config
sidebar:
order: 3
---

Full documentation of all environment variables that can be used to configure Scrumlr.

## Frontend

### Show legal documents

Toggle visibility of cookie policy, privacy policy, and terms & conditions in the footer.
Recommended for public instances.
```bash

```ini
SCRUMLR_SHOW_LEGAL_DOCUMENTS=''
```

### Server URL

Override the server address for API calls. This is the URL of the backend server.
```bash

```ini
SCRUMLR_SERVER_URL=''
```

### Websocket URL
Override the websocket address for API calls. This is the URL of the backend server but beginning with the `ws` or `wss` protocol.
```bash

Override the websocket address for API calls. This is the URL of the backend server but beginning with the `ws` or `wss`
protocol.

```ini
SCRUMLR_WEBSOCKET_URL=''
```

### Frontend Listen Port

The port on which the frontend should listen for incoming connections.
```bash

```ini
SCRUMLR_LISTEN_PORT='8080'
```

### Analytics variables
We provide the option to use [Plausible](https://plausible.io) for analytics. If you want to use Plausible, you need to set the following environment variables.
```bash

We provide the option to use [Plausible](https://plausible.io) for analytics. If you want to use Plausible, you need to
set the following environment variables.

```ini
SCRUMLR_ANALYTICS_DATA_DOMAIN=''
SCRUMLR_ANALYTICS_SRC=''
```

### Clarity id

The clarity id to use [Clarity](https://clarity.microsoft.com/).
```bash

```ini
SCRUMLR_CLARITY_ID=''
```

## Backend

### Server Port

The port on which the backend should listen for incoming connections.
```bash

```ini
SCRUMLR_SERVER_PORT='8080'
```

### NATS URL

The URL of the NATS server.
You can either use a NATS server or a Redis server for the backend communication.
Only configure one of the two.
```bash

```ini
SCRUMLR_SERVER_NATS_URL=''
```

### Redis Variables

You can either use a NATS server or a Redis server for the backend communication.
Only configure one of the two.
```bash

```ini
SCRUMLR_SERVER_REDIS_HOST=''
SCRUMLR_SERVER_REDIS_USERNAME=''
SCRUMLR_SERVER_REDIS_PASSWORD=''
```

### Insecure Mode

Uses the insecure private key for JWT token signing.
**Do not use in production!**
```bash

```ini
SCRUMLR_INSECURE=''
```

### Private Key

The private key used to sign the JWT tokens.
Please generate a new key for production use and keep it secure.
```bash

```ini
SCRUMLR_PRIVATE_KEY=''
```

### Database URL

The URL of the PostgreSQL database.
Credentials are passed in the URL.
If you havent configured postgres for TLS, you can use the `?sslmode=disable` parameter.
```bash

```ini
SCRUMLR_SERVER_DATABASE_URL='psql://user:password@host:port/database'
```

### Base Path

The base path of the API. The default is `/`.
```bash

```ini
SCRUMLR_BASE_PATH=''
```

### Disable Anonymous Login

If set to `true`, users won't be able to log in anonymously, forcing them to use a provider (any OAuth or OIDC).
Note that if this is set to `true`, and no valid providers are available, login won't be possible at all.
Default is `false`.
```bash

```ini
SCRUMLR_DISABLE_ANONYMOUS_LOGIN=false
```

### Enable Experimental File System Store
Enables an experimental file store for session cookies, which is used during OAuth authentication to store session info while on the provider page.

Enables an experimental file store for session cookies, which is used during OAuth authentication to store session info
while on the provider page.
Required for some OIDC providers, since their session cookies exceed the size limit of 4KB.
Default is `false`.
```bash

```ini
SCRUMLR_ENABLE_EXPERIMENTAL_AUTH_FILE_SYSTEM_STORE=false
```

### Auth Callback Host

The host to which the OAuth callback should redirect.
```bash

```ini
SCRUMLR_AUTH_CALLBACK_HOST=''
```

### Google OAuth

Required Google OAuth credentials.
Only configure if you wish to use Google OAuth.
```bash

```ini
SCRUMLR_AUTH_GOOGLE_CLIENT_ID=''
SCRUMLR_AUTH_GOOGLE_CLIENT_SECRET=''
```

### GitHub OAuth

Required GitHub OAuth credentials.
Only configure if you wish to use GitHub OAuth.
```bash

```ini
SCRUMLR_AUTH_GITHUB_CLIENT_ID=''
SCRUMLR_AUTH_GITHUB_CLIENT_SECRET=''
```

### Microsoft OAuth

Required Microsoft OAuth credentials.
Only configure if you wish to use Microsoft OAuth.
```bash

```ini
SCRUMLR_AUTH_MICROSOFT_CLIENT_ID=''
SCRUMLR_AUTH_MICROSOFT_CLIENT_SECRET=''
```

### Azure AD OAuth

Required Azure AD OAuth credentials.
Only configure if you wish to use Azure AD OAuth.
```bash

```ini
SCRUMLR_AUTH_AZURE_AD_TENANT_ID=''
SCRUMLR_AUTH_AZURE_AD_CLIENT_ID=''
SCRUMLR_AUTH_AZURE_AD_CLIENT_SECRET=''
```

### Apple OAuth

Required Apple OAuth credentials.
Only configure if you wish to use Apple OAuth.
```bash

```ini
SCRUMLR_AUTH_APPLE_CLIENT_ID=''
SCRUMLR_AUTH_APPLE_CLIENT_SECRET=''
```

### OpenID Connect OAuth

Required OIDC credentials.
Only configure if you wish to use generic OpenID Connect Authentication.
```bash

```ini
SCRUMLR_AUTH_OIDC_CLIENT_ID=''
SCRUMLR_AUTH_OIDC_CLIENT_SECRET=''
SCRUMLR_AUTH_OIDC_DISCOVERY_URL=''
SCRUMLR_AUTH_OIDC_USER_IDENT_SCOPE=''
SCRUMLR_AUTH_OIDC_USER_NAME_SCOPE=''
```

Note: Might require larger session store to be active, see [SCRUMLR_ENABLE_EXPERIMENTAL_AUTH_FILE_SYSTEM_STORE](#enable-experimental-file-system-store)

### Session Secret

The secret for the session. This secret is used by gothic.
This needs to be configured if you are using an authentication provider.
```bash

```ini
SESSION_SECRET=''
```

### Feedback Webhook URL

A webhook URL to which feedback should be sent.
This is not required.
```bash

```ini
SCRUMLR_FEEDBACK_WEBHOOK_URL=''
```

### Scrumlr Config Path

The path to the Scrumlr configuration file.
```bash

```ini
SCRUMLR_CONFIG_PATH=''
```

5 changes: 3 additions & 2 deletions docs/src/content/docs/self-hosting/intro.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,13 +8,14 @@ sidebar:
We currently offer two ways to self-host Scrumlr: using Docker Compose or a Kubernetes manifest.

Scrumlr is composed of 4 main services:

- **frontend**: Our React frontend that is served statically.
- **backend**: Our Go backend that serves the API and WebSocket.
- **database**: A PostgreSQL database that stores all data.
- **nats**: A NATS server which is used to keep our backend services in sync (Mainly used for multi-backend deployments).


### Getting started

-> [Docker Compose](/self-hosting/docker/)

-> [Kubernetes](/self-hosting/kubernetes/)
-> [Kubernetes](/self-hosting/kubernetes/)
Loading

0 comments on commit 0b3245a

Please sign in to comment.