Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
13 changes: 13 additions & 0 deletions .github/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,3 +2,16 @@ changelog:
exclude:
authors:
- dependabot
categories:
- title: Enhancements
labels:
- enhancement
- title: Bug Fixes
labels:
- bug
- title: Documentation
labels:
- documentation
- title: Other Changes
labels:
- "*"
8 changes: 1 addition & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -960,13 +960,7 @@ CraftingTweaks Json:

By default, the server configuration will be created and set based on the following environment variables, but only the first time the server is started. If the `server.properties` file already exists, the values in them will not be changed.

If you would like to override the server configuration each time the container starts up, you can set the `OVERRIDE_SERVER_PROPERTIES` environment variable like:

docker run -d -e OVERRIDE_SERVER_PROPERTIES=true ...

This will reset any manual configuration of the `server.properties` file, so if you want to make any persistent configuration changes you will need to make sure you have properly set the proper environment variables in your container configuration.

In the opposite case, you can skip the startup script's creation of `server.properties`, by setting `SKIP_SERVER_PROPERTIES` to "true".
If you prefer to manually manage the `server.properties` file, set `OVERRIDE_SERVER_PROPERTIES` to "false". Similarly, you can entirely skip the startup script's creation of `server.properties` by setting `SKIP_SERVER_PROPERTIES` to "true".

> NOTE: to clear a server property, set the variable to an empty string, such as `-e RESOURCE_PACK=""`. A variables that maps to a server property that is unset, is ignored and the existing `server.property` is left unchanged.

Expand Down
18 changes: 6 additions & 12 deletions scripts/start-setupServerProperties
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,8 @@

: "${SERVER_PROPERTIES:=/data/server.properties}"
: "${ENABLE_RCON:=true}"
: "${OVERRIDE_SERVER_PROPERTIES:=true}"
: "${SKIP_SERVER_PROPERTIES:=false}"

# FUNCTIONS
function setServerPropValue {
Expand Down Expand Up @@ -208,22 +210,14 @@ if [[ ${TYPE} == "CURSEFORGE" ]]; then
log "detected FTB, changing properties path to ${SERVER_PROPERTIES}"
fi

if ! isTrue "${SKIP_SERVER_PROPERTIES:-false}"; then
if ! isTrue "${SKIP_SERVER_PROPERTIES}"; then
if [ ! -e "$SERVER_PROPERTIES" ]; then
log "Creating server properties in ${SERVER_PROPERTIES}"
customizeServerProps
elif [ -n "${OVERRIDE_SERVER_PROPERTIES}" ]; then
case ${OVERRIDE_SERVER_PROPERTIES^^} in
TRUE|1)
log "Updating server properties in ${SERVER_PROPERTIES}"
customizeServerProps
;;
*)
log "server.properties already created, skipping"
;;
esac
elif isTrue "${OVERRIDE_SERVER_PROPERTIES}"; then
customizeServerProps
else
log "server.properties already created, skipping"
log "server.properties already created and managed manually"
fi
else
log "Skipping setup of server.properties"
Expand Down