mirror of
https://github.com/itzg/docker-minecraft-server.git
synced 2026-07-13 03:55:09 +00:00
Add clarifying information for CurseForge API keys (#3594)
This commit is contained in:
@@ -12,6 +12,7 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
|||||||
|
|
||||||
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
|
Example if your key is `$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa`:
|
||||||
```yaml
|
```yaml
|
||||||
|
# compose.yaml
|
||||||
environment:
|
environment:
|
||||||
CF_API_KEY: '$$11$$22$$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
CF_API_KEY: '$$11$$22$$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||||
```
|
```
|
||||||
@@ -21,12 +22,30 @@ To manage a CurseForge modpack automatically with upgrade support, pinned or lat
|
|||||||
docker run ... -e CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
docker run ... -e CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||||
```
|
```
|
||||||
|
|
||||||
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). `$`'s in the value still need to escaped with a second `$` and the variable needs to be referenced from the compose file, such as:
|
To avoid exposing the API key, it is highly recommended to use a `.env` file, which is [loaded automatically by docker compose](https://docs.docker.com/compose/environment-variables/set-environment-variables/#substitute-with-an-env-file). You **do not** need to escape `$`'s with a second `$` in the `.env` file **as long as the key is wrapped in single quotes**.
|
||||||
|
|
||||||
|
```
|
||||||
|
# .env
|
||||||
|
CF_API_KEY='$11$22$33aaaaaaaaaaaaaaaaaaaaaaaaaa'
|
||||||
|
```
|
||||||
|
|
||||||
|
The variable should to be referenced from the compose file, such as:
|
||||||
|
|
||||||
```yaml
|
```yaml
|
||||||
|
# compose.yaml
|
||||||
environment:
|
environment:
|
||||||
CF_API_KEY: ${CF_API_KEY}
|
CF_API_KEY: ${CF_API_KEY}
|
||||||
```
|
```
|
||||||
|
|
||||||
|
The .env file should be placed in the same directory as your compose file like so:
|
||||||
|
|
||||||
|
```
|
||||||
|
/minecraft-server
|
||||||
|
├── .env
|
||||||
|
├── compose.yaml
|
||||||
|
├── /data
|
||||||
|
```
|
||||||
|
|
||||||
To use the equivalent with `docker run` you need to specify the `.env` file explicitly:
|
To use the equivalent with `docker run` you need to specify the `.env` file explicitly:
|
||||||
```
|
```
|
||||||
docker run --env-file=.env itzg/minecraft-server
|
docker run --env-file=.env itzg/minecraft-server
|
||||||
|
|||||||
Reference in New Issue
Block a user