You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Check out [configuration.ts](https://github.com/Phalcode/gamevault-backend/blob/master/src/configuration.ts) for all possible environment variables in case we forgot to update this page.
9
9
:::
10
10
11
-
All configuration properties of your GameVault server are passed as environment variables or via a .env file. The following tables describe the available properties, their default values, explanations, and possible values.
11
+
## Three Ways to Configure GameVault
12
12
13
-
##Configuration Properties
13
+
### 1. Environment Variables (Most Common)
14
14
15
-
This page describes the various configuration properties used in the application. These properties can be configured in the environment variables or in a `.env`file.
15
+
Set variables directly via Docker Compose, `.env`files, or shell:
16
16
17
-
### SERVER
17
+
```yaml
18
+
# Docker Compose example
19
+
environment:
20
+
SERVER_PORT: 8080
21
+
DB_HOST: postgres
22
+
DB_PASSWORD: mypassword
23
+
```
24
+
25
+
```bash
26
+
# .env file example
27
+
SERVER_PORT=8080
28
+
DB_HOST=postgres
29
+
DB_PASSWORD=mypassword
30
+
```
31
+
32
+
### 2. Docker Secrets (`_FILE` method) — For Sensitive Values
33
+
34
+
Store secrets in files and reference them. Ideal for passwords, API keys, and tokens:
35
+
36
+
```yaml
37
+
# docker-compose.yml
38
+
secrets:
39
+
db_password:
40
+
file: ./secrets/db_password.txt
41
+
environment:
42
+
DB_PASSWORD_FILE: /run/secrets/db_password
43
+
```
44
+
45
+
GameVault reads the file at runtime, keeping secrets out of logs and configs.
46
+
47
+
### 3. YAML Configuration Files — For Complex Setups
48
+
49
+
Create `config.yaml` or `config.yml` in your config volume (`VOLUMES_CONFIG`) for organized, readable configuration:
50
+
51
+
```yaml
52
+
# config.yaml (case-insensitive, supports nested or flat syntax)
@@ -39,26 +137,26 @@ This page describes the various configuration properties used in the application
39
137
| `SERVER_HTTPS_CERT_PATH` | The file path to the TLS certificate used for HTTPS. | - | Any valid file path |
40
138
| `SERVER_HTTPS_CA_CERT_PATH` | The file path to the CA certificate used for HTTPS (e.g. for client certificate verification). | - | Any valid file path |
41
139
42
-
### WEB UI
140
+
### WEB UI — Web Interface Settings
43
141
44
142
| Property | Description | Default | Possible Values |
|`VOLUMES_CONFIG`| Folder inside container used for configuring GameVault. |`/config`| Any valid folder path |
151
+
| `VOLUMES_CONFIG` | Folder used for configuring GameVault (for example `news.md`, `config.yaml`, and `config.yml`). Relative paths are supported, but absolute paths are recommended. | `/config` | Any valid folder path |
54
152
| `VOLUMES_FILES` | Folder inside container used for game files. The server needs **write permissions** on this folder for the upload and delete game APIs to work. | `/files` | Any valid folder path |
55
153
| `VOLUMES_MEDIA` | Folder inside container used for media. | `/media` | Any valid folder path |
56
154
| `VOLUMES_SAVEFILES` | Folder inside container used for savefile uploads. | `/savefiles` | Any valid folder path |
57
155
| `VOLUMES_LOGS` | Folder inside container used for logs. | `/logs` | Any valid folder path |
58
156
| `VOLUMES_SQLITEDB` | Folder inside container used for `SQLITE` database. (Not needed if `DB_SYSTEM` is set to `POSTGRESQL`) | `/db` | Any valid folder path |
59
157
| `VOLUMES_PLUGINS` | Folder inside container used for plugins. | `/plugins` | Any valid folder path |
60
158
61
-
### DB
159
+
### DB — Database Configuration
62
160
63
161
| Property | Description | Default | Possible Values |
@@ -85,14 +183,14 @@ This page describes the various configuration properties used in the application
85
183
| `USERS_REQUIRE_LAST_NAME` | Require **Last Name** for new registrations. | `false` | `true`, `false` |
86
184
| `USERS_REQUIRE_BIRTH_DATE` | Require **Birth Date** for new registrations. (**Automatically set to `true` when `PARENTAL_AGE_RESTRICTION_ENABLED` is true**) | `false` | `true`, `false` |
87
185
88
-
### PARENTAL
186
+
### PARENTAL — Parental Control & Age Restrictions
89
187
90
188
| Property | Description | Default | Possible Values |
@@ -105,7 +203,7 @@ This page describes the various configuration properties used in the application
105
203
| `GAMES_WINDOWS_SETUP_DEFAULT_INSTALL_PARAMETERS` | Default command-line parameters used for Windows application setup files. These are used to attempt a silent installation. | `/D="%INSTALLDIR%" /S /DIR="%INSTALLDIR%" /SILENT /COMPONENTS=text` | Any string |
106
204
| `GAMES_MAX_UPLOAD_SIZE` | The maximum file size allowed for game uploads via the API. Set it to 0 to disable game uploads. | `50 gb` | e.g. "50 gb", "100 gb", "1 tb" |
107
205
108
-
### MEDIA
206
+
### MEDIA — Image & Media Upload Settings
109
207
110
208
| Property | Description | Default | Possible Values |
| `SAVEFILES_ENABLED` | Enables or disables savefile uploads. You may need to set up a volume for savefiles for them to persist. | `false` | `true`, `false` |
122
220
| `SAVEFILES_MAX_SIZE` | Sets the maximum size for savefile uploads. | `1 gb` | e.g. "10 mb", "5 gb", "300 kb" |
123
221
| `SAVEFILES_MAX_SAVES` | Sets the maximum number of savefiles per game and per user. Once this limit is reached, the oldest savefile will be deleted on the next upload. | `10` | Any number |
124
222
125
-
### METADATA
223
+
### METADATA — Game Information Providers
126
224
127
225
| Property | Description | Default | Possible Values |
@@ -161,25 +259,11 @@ This page describes the various configuration properties used in the application
161
259
| `TESTING_MOCK_PROVIDERS` | If `true`, the server will create two mock providers. (-9999 and 9999 Priority) Useful for testing metadata-merges. | `false` | `true`, `false` |
162
260
| `TESTING_LOG_HTTP_TRAFFIC_ENABLED` | If `true`, the server will log all incoming and outgoing HTTP traffic. (Except Healthchecks) | `false` | `true`, `false` |
163
261
164
-
## Docker Secrets Support
165
-
166
-
GameVault supports [Docker Secrets](https://docs.docker.com/compose/how-tos/use-secrets/) for **all** environment variables. Instead of passing a value directly as an environment variable, you can append `_FILE` to the variable name and set it to the path of a file containing the value.
167
-
168
-
For example, instead of:
169
-
170
-
```yaml
171
-
environment:
172
-
DB_PASSWORD: my-secret-password
173
-
```
174
-
175
-
You can use:
262
+
---
176
263
177
-
```yaml
178
-
secrets:
179
-
db_password:
180
-
file: ./secrets/db_password.txt
181
-
environment:
182
-
DB_PASSWORD_FILE: /run/secrets/db_password
183
-
```
264
+
## Tips & Troubleshooting
184
265
185
-
The server will read the file contents and use them as the value for the variable. If both the variable and its `_FILE` variant are set, the `_FILE` variant takes priority.
266
+
- **Confused about precedence?** See the real-world example under [Configuration Precedence](#configuration-precedence-priority-order) above.
267
+
- **Using relative paths?** Relative paths in `VOLUMES_CONFIG` work but absolute paths are recommended for clarity.
268
+
- **YAML not being read?** Ensure the file is named exactly `config.yaml` or `config.yml` and is in your `VOLUMES_CONFIG` folder.
269
+
- **Secrets not working?** Make sure the file path in `VARIABLE_FILE` exists and contains the secret value (with no extra whitespace).
0 commit comments