Skip to content
Open
Show file tree
Hide file tree
Changes from 4 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
43 changes: 28 additions & 15 deletions docs/setup/server/configuration/env.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,18 +4,31 @@ Below is a list of environment variables used by Fosscord.
You can set environment variables easily by creating an `.env` file
in the `fosscord-server` folder, with the format `NAME=VALUE` with each on new lines.

| Name | Value | Description |
| -------------------------- | -------------- | -------------------------------------------------------------------------------------------------------------------- |
| THREADS | number | Number of threads to run Fosscord on when using bundle. Make sure you've enabled RabbitMQ if using more than one |
| PORT | number | Port to listen on. Used by all components, including bundle. If using bundle, all components run under the same port |
| DATABASE | string | Database connection string. Defaults to SQlite3 at project root |
| CONFIG_PATH | string | File path for JSON config, if not using `config` db table |
| WS_LOGEVENTS | boolean | If set, log websocket events except messages from gateway |
| WS_VERBOSE | boolean | If set, log websocket messages sent/received by gateway |
| WS_DUMP | boolean | If set, dump websocket messages sent/received to disk |
| CDN | string | Lowest priority value for public CDN annoucements |
| GATEWAY | string | Lowest priority value for public gateway annoucements |
| STORAGE_LOCATION | string | CDN storage location. File path or S3 bucktet |
| STORAGE_PROVIDER | "s3" or "file" | CDN storage provider |
| STORAGE_BUCKET | string | S3 bucket name |
| STORAGE_REGION | string | S3 storage region |
| Name | Value | Description |
| ---------------- | -------------- | -------------------------------------------------------------------------------------------------------------------- |
| THREADS | number | Number of threads to run Fosscord on when using bundle. Make sure you've enabled RabbitMQ if using more than one |
| PORT | number | Port to listen on. Used by all components, including bundle. If using bundle, all components run under the same port |
| DATABASE | string | Database connection string. Defaults to SQlite3 at project root |
| CONFIG_PATH | string | File path for JSON config, if not using `config` db table |
| WS_LOGEVENTS | boolean | If set, log websocket events except messages from gateway |
| WS_VERBOSE | boolean | If set, log websocket messages sent/received by gateway |
| WS_DUMP | boolean | If set, dump websocket messages sent/received to disk |
| CDN | string | Lowest priority value for public CDN annoucements |
| GATEWAY | string | Lowest priority value for public gateway annoucements |
| STORAGE_LOCATION | string | CDN storage location. File path or S3 bucktet |
| STORAGE_PROVIDER | "s3" or "file" | CDN storage provider |
| STORAGE_BUCKET | string | S3 bucket name |
| STORAGE_REGION | string | S3 storage region |

## Docker

These environment variables should be set in the environment `~/.profile` or with an `export`

| Name | Value | Description |
| ----------------- | ------ | --------------------------------------------------------------- |
| POSTGRES_USER | string | Postgressql database username |
| POSTGRES_PASSWORD | string | Postgressql database password |
| POSTGRES_DATABASE | string | Database connection string. Defaults to SQlite3 at project root |
| S3_BUCKET | string | CDN storage location. S3 bucktet |
| S3_BUCKET_NAME | string | S3 bucket |
| S3_BUCKET_REGION | string | S3 storage region |
38 changes: 38 additions & 0 deletions docs/setup/server/docker.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
# Docker

## Dev environment

This clones the master branch into a docker builder and runs a build before starting it.
To run it you need docker and docker-compose
`sudo docker compose up` or `sudo docker compose up -d`

## Prod environment with local file storage or with S3

Set the following environment variables in your environment (adapt POSTGRES_USER, POSTGRES_PASSWORD):

```
export POSTGRES_USER=postgres
export POSTGRES_PASSWORD=postgres
export POSTGRES_DATABASE=fosscord
```

This clones the master branch into a docker builder and runs a build before starting it.
To run it you need docker and docker-compose
`sudo docker-compose -f docker-compose.prod.yaml up` or `sudo docker-compose -f docker-compose.prod.yaml up -d`

Additional you can set S3 storage backend:

```
export S3_BUCKET=S3://...
export S3_BUCKET_NAME=test
export S3_BUCKET_REGION=eu-central-1
```

Then start it with: `docker-compose -f docker-compose.prod.s3.yaml up` or `docker-compose -f docker-compose.prod.s3.yaml up -d`

At first start, you get an. This error can be ignored due to first start.

```
db_1 | 2023-03-04 17:28:25.790 UTC [63] ERROR: relation "config" does not exist at character 31
db_1 | 2023-03-04 17:28:25.790 UTC [63] STATEMENT: SELECT COUNT(1) AS "cnt" FROM "config" "ConfigEntity"
```
6 changes: 6 additions & 0 deletions docs/setup/server/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,12 @@ You **must** have access to a terminal for this guide.

We do not recommend using Windows to run Fosscord.

## Docker

To use docker please read the following page:

- [Docker](docker.md)

## Dependencies

- [Git](https://git-scm.com/)
Expand Down