Skip to content

Commit

Permalink
feat: introduced MANUAL_CONFIG to control if config file generation s…
Browse files Browse the repository at this point in the history
…hould be used
  • Loading branch information
Johnny-Knighten committed Nov 30, 2023
1 parent 3559baf commit 3b72b1f
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 9 deletions.
3 changes: 2 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,8 @@ ENV DEBUG=False \
SCHEDULED_BACKUP=False \
BACKUP_CRON="0 6 * * *" \
ZIP_BACKUPS=False \
RETAIN_BACKUPS=
RETAIN_BACKUPS= \
MANUAL_CONFIG=False

RUN set -x && \
apt-get update && \
Expand Down
22 changes: 14 additions & 8 deletions bin/ark-sa-bootstrap.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,15 +35,21 @@ launch_update_service() {
generate_config_files() {
mkdir -p "${SERVER_DIR}/ShooterGame/Saved/Config/WindowsServer"

export CONFIG_GameUserSettings_SessionSettings_SessionName="${SERVER_NAME}"
export CONFIG_GameUserSettings_ServerSettings_RCONEnabled="${ENABLE_RCON}"
export CONFIG_GameUserSettings_ServerSettings_RCONPort="${RCON_PORT}"
export CONFIG_GameUserSettings_SLASH_Script_SLASH_Engine_DOT_GameSession_MaxPlayers="${MAX_PLAYERS}"
export CONFIG_GameUserSettings_ServerSettings_ServerPassword="${SERVER_PASSWORD}"
export CONFIG_GameUserSettings_ServerSettings_ServerAdminPassword="${ADMIN_PASSWORD}"
export CONFIG_GameUserSettings_ServerSettings_ServerPVE="${ENABLE_PVE}"
if [[ ! -f "${SERVER_DIR}/ShooterGame/Saved/Config/WindowsServer/GameUserSettings.ini" || "$MANUAL_CONFIG" = "False"]]; then
echo "ARK SA Bootstrap - Generating GameUserSettings.ini"

python3 /usr/local/bin/config_from_env_vars/main.py --path "${SERVER_DIR}/ShooterGame/Saved/Config/WindowsServer"
export CONFIG_GameUserSettings_SessionSettings_SessionName="${SERVER_NAME}"
export CONFIG_GameUserSettings_ServerSettings_RCONEnabled="${ENABLE_RCON}"
export CONFIG_GameUserSettings_ServerSettings_RCONPort="${RCON_PORT}"
export CONFIG_GameUserSettings_SLASH_Script_SLASH_Engine_DOT_GameSession_MaxPlayers="${MAX_PLAYERS}"
export CONFIG_GameUserSettings_ServerSettings_ServerPassword="${SERVER_PASSWORD}"
export CONFIG_GameUserSettings_ServerSettings_ServerAdminPassword="${ADMIN_PASSWORD}"
export CONFIG_GameUserSettings_ServerSettings_ServerPVE="${ENABLE_PVE}"

python3 /usr/local/bin/config_from_env_vars/main.py --path "${SERVER_DIR}/ShooterGame/Saved/Config/WindowsServer"
else
echo "ARK SA Bootstrap - Skipping GameUserSettings.ini Generation MANAUL_CONFIG is True"
fi
}

# -eq 1 below because we assume the single config file is generate at this point
Expand Down

0 comments on commit 3b72b1f

Please sign in to comment.