Skip to content

Commit

Permalink
Added EULA environment variable
Browse files Browse the repository at this point in the history
`-e EULA="true"` is now mandatory. Closes #59
  • Loading branch information
Phyremaster committed Sep 8, 2023
1 parent 5756aed commit 9fc3f7f
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 10 deletions.
1 change: 1 addition & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ FROM alpine:latest
# Environment variables
ENV MC_VERSION="latest" \
PAPER_BUILD="latest" \
EULA="false" \
MC_RAM="" \
JAVA_OPTS=""

Expand Down
7 changes: 6 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ It is assumed that the user has already acquired a working Docker installation.
## Command
With this image, you can create a new PaperMC Minecraft server with one command (note that running said command indicates agreement to the Minecraft EULA). Here is an example:

```sudo docker run -p 25565:25565 phyremaster/papermc```
```sudo docker run -p 25565:25565 -e EULA="true" phyremaster/papermc```

While this command will work just fine in many cases, it is only the bare minimum required to start a functional server and can be vastly improved by specifying some...
## Options
Expand Down Expand Up @@ -57,6 +57,11 @@ Environment variables are options that are specified in the format `-e <NAME>="<
- If this is not set, the latest PaperMC build for the specified `MC_VERSION` will be used.
- Changing this on an existing server will change the version *without wiping the server*.
- `-e PAPER_BUILD="<latest>"`
- EULA
- **Name:** `EULA`
- Set this to `true` to accept the Minecraft server EULA
- **The server will not start if this is not set to `true`**
- `-e EULA="true"`
- RAM
- **Name:** `MC_RAM`
- Set this to the amount of RAM the server can use.
Expand Down
12 changes: 3 additions & 9 deletions papermc.sh
Original file line number Diff line number Diff line change
Expand Up @@ -34,17 +34,11 @@ then
rm -f *.jar
# Download new server jar
wget "$URL" -O "$JAR_NAME"

# If this is the first run, accept the EULA
if [[ ! -e eula.txt ]]
then
# Run the server once to generate eula.txt
java -jar "$JAR_NAME"
# Edit eula.txt to accept the EULA
sed -i 's/false/true/g' eula.txt
fi
fi

# Update eula.txt with current setting
echo "eula=${EULA:-false}" > eula.txt

# Add RAM options to Java options if necessary
if [[ -n $MC_RAM ]]
then
Expand Down

0 comments on commit 9fc3f7f

Please sign in to comment.