Skip to content

Commit 91542cd

Browse files
committedMay 20, 2023
Few fixes and tweaks
1 parent d2a68b2 commit 91542cd

File tree

5 files changed

+42
-16
lines changed

5 files changed

+42
-16
lines changed
 

‎Dockerfile

+7-2
Original file line numberDiff line numberDiff line change
@@ -73,7 +73,10 @@ ENV V_RISING_SERVER_UPDATE_MODE "0"
7373
# Setup environment variables for customizing the server
7474
ENV V_RISING_SERVER_NAME "V Rising Docker Server"
7575
ENV V_RISING_SERVER_DESCRIPTION "V Rising server running inside a Docker container."
76-
ENV V_RISING_SERVER_BIND_IP "127.0.0.1"
76+
# ENV V_RISING_SERVER_BIND_IP "127.0.0.1"
77+
ENV V_RISING_SERVER_BIND_IP "0.0.0.0"
78+
# ENV V_RISING_SERVER_BIND_IP ""
79+
ENV V_RISING_SERVER_BIND_IP_AUTO_DETECT true
7780
ENV V_RISING_SERVER_GAME_PORT 9876
7881
ENV V_RISING_SERVER_QUERY_PORT 9877
7982
ENV V_RISING_SERVER_RCON_PORT 9878
@@ -83,7 +86,9 @@ ENV V_RISING_SERVER_MAX_CONNECTED_USERS 40
8386
ENV V_RISING_SERVER_MAX_CONNECTED_ADMINS 4
8487
ENV V_RISING_SERVER_SAVE_NAME "docker"
8588
ENV V_RISING_SERVER_PASSWORD ""
86-
ENV V_RISING_SERVER_LIST_ON_MNASTER_SERVER true
89+
ENV V_RISING_SERVER_LIST_ON_MASTER_SERVER true
90+
ENV V_RISING_SERVER_LIST_ON_STEAM true
91+
ENV V_RISING_SERVER_LIST_ON_EOS true
8792
ENV V_RISING_SERVER_AUTO_SAVE_COUNT 50
8893
ENV V_RISING_SERVER_AUTO_SAVE_INTERVAL 600
8994
ENV V_RISING_SERVER_GAME_SETTINGS_PRESET "StandardPvE"

‎LICENSE

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
Copyright (c) 2022 Didstopia
1+
Copyright (c) 2022-2023 Didstopia
22

33
Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
44

‎docker-compose.yml

+3-1
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,9 @@ services:
3030
V_RISING_SERVER_MAX_CONNECTED_ADMINS: 1
3131
V_RISING_SERVER_SAVE_NAME: "test_server"
3232
V_RISING_SERVER_PASSWORD: "t35t"
33-
V_RISING_SERVER_LIST_ON_MNASTER_SERVER: false
33+
V_RISING_SERVER_LIST_ON_MASTER_SERVER: false
34+
V_RISING_SERVER_LIST_ON_STEAM: false
35+
V_RISING_SERVER_LIST_ON_EOS: false
3436
V_RISING_SERVER_AUTO_SAVE_COUNT: 5
3537
V_RISING_SERVER_AUTO_SAVE_INTERVAL: 10
3638
V_RISING_SERVER_GAME_SETTINGS_PRESET: "StandardPvE"

‎install.txt

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
@sSteamCmdForcePlatformType linux
2-
force_install_dir /steamcmd/vrising
32
login anonymous
3+
force_install_dir /steamcmd/vrising
44
app_info_update 1
55
app_update 1829350 validate
66
quit

‎start_vrising.sh

+30-11
Original file line numberDiff line numberDiff line change
@@ -146,9 +146,10 @@ V_RISING_SERVER_ADMIN_LIST_FILE="${V_RISING_SERVER_PERSISTENT_DATA_PATH}/adminli
146146
if [ ! -f "${V_RISING_SERVER_ADMIN_LIST_FILE}" ]; then
147147
echo "Admin list file not found, creating a new one.."
148148
cp ${V_RISING_SERVER_ADMIN_LIST_FILE_DEFAULT} ${V_RISING_SERVER_ADMIN_LIST_FILE}
149-
else
150-
echo "Applying custom admin list file.."
151-
cp -f ${V_RISING_SERVER_ADMIN_LIST_FILE} ${V_RISING_SERVER_ADMIN_LIST_FILE_DEFAULT}
149+
# else
150+
# ## TODO: Why would we copy over the defaults if we have the persistence path set?
151+
# echo "Applying custom admin list file.."
152+
# cp -f ${V_RISING_SERVER_ADMIN_LIST_FILE} ${V_RISING_SERVER_ADMIN_LIST_FILE_DEFAULT}
152153
fi
153154

154155
# Copy ban list file if one doesn't yet exist
@@ -157,9 +158,10 @@ V_RISING_SERVER_BAN_LIST_FILE="${V_RISING_SERVER_PERSISTENT_DATA_PATH}/banlist.t
157158
if [ ! -f "${V_RISING_SERVER_BAN_LIST_FILE}" ]; then
158159
echo "Ban list file not found, creating a new one.."
159160
cp ${V_RISING_SERVER_BAN_LIST_FILE_DEFAULT} ${V_RISING_SERVER_BAN_LIST_FILE}
160-
else
161-
echo "Applying custom ban list file.."
162-
cp -f ${V_RISING_SERVER_BAN_LIST_FILE} ${V_RISING_SERVER_BAN_LIST_FILE_DEFAULT}
161+
# else
162+
# ## TODO: Why would we copy over the defaults if we have the persistence path set?
163+
# echo "Applying custom ban list file.."
164+
# cp -f ${V_RISING_SERVER_BAN_LIST_FILE} ${V_RISING_SERVER_BAN_LIST_FILE_DEFAULT}
163165
fi
164166

165167
## TODO: This is a bit dumb at the moment, as it's always replacing the file,
@@ -168,28 +170,45 @@ fi
168170
cat "${V_RISING_SERVER_CONFIG_FILE}" | jq '.Rcon = { "Enabled": env.V_RISING_SERVER_RCON_ENABLED|test("true"), "Password": env.V_RISING_SERVER_RCON_PASSWORD, "Port": env.V_RISING_SERVER_RCON_PORT|tonumber }' > "/tmp/ServerHostSettings.json.tmp"
169171
cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
170172

173+
# If V_RISING_SERVER_BIND_IP_AUTO_DETECT is set to true, try to detect the public IP address,
174+
# overriding the V_RISING_SERVER_BIND_IP setting if we get a valid IP address back
175+
if [ "$V_RISING_SERVER_BIND_IP_AUTO_DETECT" = "true" ]; then
176+
echo "Auto-detecting public IP address.."
177+
V_RISING_SERVER_BIND_IP="$(curl -s https://api.ipify.org)"
178+
if [ $? -ne 0 ]; then
179+
echo "Failed to auto-detect public IP address, exiting.."
180+
exit 1
181+
fi
182+
echo "Public IP address detected as: $V_RISING_SERVER_BIND_IP"
183+
fi
184+
171185
## FIXME: We should likely ONLY apply these when we first copy the the defaults,
172186
## so that users are given the option of manually being able to persist edits to the files?
173187
## TODO: This should be refactored to use functions, to cut down on boilerplate etc.
174188
# Apply the server settings
175189
jq '.Name |= env.V_RISING_SERVER_NAME' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
176190
jq '.Description |= env.V_RISING_SERVER_DESCRIPTION' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
191+
jq '.Address |= env.V_RISING_SERVER_BIND_IP' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
177192
jq '.Port |= env.V_RISING_SERVER_GAME_PORT|tonumber' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
178193
jq '.QueryPort |= env.V_RISING_SERVER_QUERY_PORT|tonumber' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
179194
jq '.MaxConnectedUsers |= env.V_RISING_SERVER_MAX_CONNECTED_USERS|tonumber' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
180195
jq '.MaxConnectedAdmins |= env.V_RISING_SERVER_MAX_CONNECTED_ADMINS|tonumber' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
181196
jq '.SaveName |= env.V_RISING_SERVER_SAVE_NAME' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
182197
jq '.Password |= env.V_RISING_SERVER_PASSWORD' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
183-
jq '.ListOnMasterServer |= env.V_RISING_SERVER_LIST_ON_MNASTER_SERVER|test("true")' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
198+
jq '.ListOnMasterServer |= env.V_RISING_SERVER_LIST_ON_MASTER_SERVER|test("true")' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
199+
jq '.ListOnSteam |= env.V_RISING_SERVER_LIST_ON_STEAM|test("true")' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
200+
jq '.ListOnEOS |= env.V_RISING_SERVER_LIST_ON_EOS|test("true")' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
184201
jq '.AutoSaveCount |= env.V_RISING_SERVER_AUTO_SAVE_COUNT|tonumber' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
185202
jq '.AutoSaveInterval |= env.V_RISING_SERVER_AUTO_SAVE_INTERVAL|tonumber' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
186203
jq '.GameSettingsPreset |= env.V_RISING_SERVER_GAME_SETTINGS_PRESET' "${V_RISING_SERVER_CONFIG_FILE}" > "/tmp/ServerHostSettings.json.tmp" && cp -f "/tmp/ServerHostSettings.json.tmp" "${V_RISING_SERVER_CONFIG_FILE}"
187204

188-
echo "Applying custom server configuration file.."
189-
cp -f ${V_RISING_SERVER_CONFIG_FILE} ${V_RISING_SERVER_CONFIG_FILE_DEFAULT}
205+
## TODO: Why would we copy over the defaults if we have the persistence path set?
206+
# echo "Applying custom server configuration file.."
207+
# cp -f ${V_RISING_SERVER_CONFIG_FILE} ${V_RISING_SERVER_CONFIG_FILE_DEFAULT}
190208

191-
echo "Applying custom game configuration file.."
192-
cp -f ${V_RISING_SERVER_GAME_CONFIG_FILE} ${V_RISING_SERVER_GAME_CONFIG_FILE_DEFAULT}
209+
## TODO: Why would we copy over the defaults if we have the persistence path set?
210+
# echo "Applying custom game configuration file.."
211+
# cp -f ${V_RISING_SERVER_GAME_CONFIG_FILE} ${V_RISING_SERVER_GAME_CONFIG_FILE_DEFAULT}
193212

194213
# Start mode 1 means we only want to update
195214
if [ "$V_RISING_SERVER_START_MODE" = "1" ]; then

0 commit comments

Comments
 (0)