Skip to content

Commit

Permalink
Merge pull request #17 from jsknnr/dev
Browse files Browse the repository at this point in the history
fix for special characters in password and server name across the board
  • Loading branch information
jsknnr authored Jan 24, 2024
2 parents 6a9a7c9 + 34b6dc9 commit 75013e1
Show file tree
Hide file tree
Showing 5 changed files with 22 additions and 20 deletions.
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -39,9 +39,9 @@ docker run \
--mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
--publish 15636:15636/udp \
--publish 15637:15637/udp \
--env=SERVER_NAME="Enshrouded Containerized Server" \
--env=SERVER_NAME='Enshrouded Containerized Server' \
--env=SERVER_SLOTS=16 \
--env=SERVER_PASSWORD="ChangeThisPlease" \
--env=SERVER_PASSWORD='ChangeThisPlease' \
--env=GAME_PORT=15636 \
--env=QUERY_PORT=15637 \
sknnr/enshrouded-dedicated-server:latest
Expand Down Expand Up @@ -73,9 +73,9 @@ podman run \
--mount type=volume,source=enshrouded-persistent-data,target=/home/steam/enshrouded/savegame \
--publish 15636:15636/udp \
--publish 15637:15637/udp \
--env=SERVER_NAME="Enshrouded Containerized Server" \
--env=SERVER_NAME='Enshrouded Containerized Server' \
--env=SERVER_SLOTS=16 \
--env=SERVER_PASSWORD="ChangeThisPlease" \
--env=SERVER_PASSWORD='ChangeThisPlease' \
--env=GAME_PORT=15636 \
--env=QUERY_PORT=15637 \
docker.io/sknnr/enshrouded-dedicated-server:latest
Expand Down
10 changes: 5 additions & 5 deletions container/default.env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
SERVER_NAME="Enshrouded Containerized"
SERVER_PASSWORD="PleaseChangeMe"
GAME_PORT="15636"
QUERY_PORT="15637"
SERVER_SLOTS="16"
SERVER_NAME='Enshrouded Containerized'
SERVER_PASSWORD='PleaseChangeMe'
GAME_PORT='15636'
QUERY_PORT='15637'
SERVER_SLOTS='16'
10 changes: 6 additions & 4 deletions container/entrypoint.sh
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

# Validate arguments
if [ -z "$SERVER_NAME" ]; then
SERVER_NAME="Enshrouded Containerized"
SERVER_NAME='Enshrouded Containerized'
echo "WARN: SERVER_NAME not set, using default: Enshrouded Containerized"
fi

Expand All @@ -12,17 +12,17 @@ if [ -z "$SERVER_PASSWORD" ]; then
fi

if [ -z "$GAME_PORT" ]; then
GAME_PORT="15636"
GAME_PORT='15636'
echo "WARN: GAME_PORT not set, using default: 15636"
fi

if [ -z "$QUERY_PORT" ]; then
QUERY_PORT="15637"
QUERY_PORT='15637'
echo "WARN: QUERY_PORT not set, using default: 15637"
fi

if [ -z "$SERVER_SLOTS" ]; then
SERVER_SLOTS="16"
SERVER_SLOTS='16'
echo "WARN: SERVER_SLOTS not set, using default: 16"
fi

Expand All @@ -37,6 +37,7 @@ if ! [ -f "${ENSHROUDED_PATH}/enshrouded_server.json" ]; then
fi

# Modify server config to match our arguments
echo "INFO: Updating Enshrouded Server configuration"
tmpfile=$(mktemp)
jq --arg n "$SERVER_NAME" '.name = $n' ${ENSHROUDED_CONFIG} > "$tmpfile" && mv "$tmpfile" $ENSHROUDED_CONFIG
jq --arg p "$SERVER_PASSWORD" '.password = $p' ${ENSHROUDED_CONFIG} > "$tmpfile" && mv "$tmpfile" $ENSHROUDED_CONFIG
Expand All @@ -48,4 +49,5 @@ jq --arg s "$SERVER_SLOTS" '.slotCount = $s' ${ENSHROUDED_CONFIG} > "$tmpfile" &
export WINEDEBUG=-all

# Launch Enshrouded
echo "INFO: Starting Enshrouded Dedicated Server"
wine ${ENSHROUDED_PATH}/enshrouded_server.exe
10 changes: 5 additions & 5 deletions helm/templates/deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -27,15 +27,15 @@ spec:
{{ toYaml .Values.resources | indent 10 }}
env:
- name: SERVER_NAME
value: {{ .Values.env.serverName | quote }}
value: {{ .Values.env.serverName | squote }}
- name: SERVER_PASSWORD
value: {{ .Values.env.serverPassword | quote }}
value: {{ .Values.env.serverPassword | squote }}
- name: GAME_PORT
value: {{ .Values.env.gamePort | quote }}
value: {{ .Values.env.gamePort | squote }}
- name: QUERY_PORT
value: {{ .Values.env.queryPort | quote }}
value: {{ .Values.env.queryPort | squote }}
- name: SERVER_SLOTS
value: {{ .Values.env.serverSlots | quote }}
value: {{ .Values.env.serverSlots | squote }}
ports:
- name: game-port
containerPort: {{ .Values.env.gamePort | int }}
Expand Down
4 changes: 2 additions & 2 deletions helm/values.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,8 @@ volumes:
size: 50Gi
storageClassName: ""
env:
serverName: "Enshrouded Server"
serverPassword: "picksomethingawesome"
serverName: 'Enshrouded Server'
serverPassword: 'picksomethingawesome'
gamePort: 15636
queryPort: 15637
serverSlots: 16

0 comments on commit 75013e1

Please sign in to comment.