Skip to content

Commit 6a56a18

Browse files
committed
feat: added more checks for insecure passwords
1 parent 366701f commit 6a56a18

File tree

6 files changed

+14
-14
lines changed

6 files changed

+14
-14
lines changed

lgsm/config-default/config-lgsm/inssserver/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ ip="0.0.0.0"
1313
port="27102"
1414
queryport="27131"
1515
rconport="27015"
16-
rconpassword=""
16+
rconpassword="CHANGE_ME"
1717
servername="LinuxGSM"
1818
defaultmap="Oilfield"
1919
defaultscenario="Scenario_Refinery_Push_Security"

lgsm/config-default/config-lgsm/ns2cserver/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@ defaultmap="co_core"
1515
maxplayers="24"
1616
servername="LinuxGSM"
1717
httpuser="admin"
18-
httppassword="admin"
18+
httppassword="CHANGE_ME"
1919
httpport="8080"
2020
mods=""
2121
serverpassword=""

lgsm/config-default/config-lgsm/ns2server/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ maxplayers="20"
1616
maxspectators="5"
1717
servername="LinuxGSM"
1818
httpuser="admin"
19-
httppassword="admin"
19+
httppassword="CHANGE_ME"
2020
httpport="8080"
2121
modserverport="27031"
2222
serverpassword=""

lgsm/config-default/config-lgsm/wurmserver/_default.cfg

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ homekingdom="4"
2727

2828
# Unlocks the admin commands from within the game, that can be used to change
2929
# the gameplay settings of the server, such as skill gain rate and field growth time.
30-
adminpassword="ADMINPASSWORD"
30+
adminpassword="CHANGE_ME"
3131

3232
# If true the server will follow the rules from the Epic servers in Wurm Online.
3333
# For instance it will use the skill curve.

lgsm/modules/check_config.sh

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,15 @@ if [ "${shortname}" == "rust" ] && [ -v rconpassword ] && [ -z "${rconpassword}"
1919
fn_print_fail_nl "RCON password is not set"
2020
fn_script_log_warn "RCON password is not set"
2121
elif [ -v rconpassword ] && [ "${rconpassword}" == "CHANGE_ME" ]; then
22-
fn_print_warn_nl "Default RCON Password detected"
23-
fn_script_log_warn "Default RCON Password detected"
22+
fn_print_warn_nl "Default RCON password detected"
23+
fn_script_log_warn "Default RCON password detected"
24+
elif [ -v httppassword ] && [ "${httppassword}" == "CHANGE_ME" ]; then
25+
fn_print_warn_nl "Default Web password detected"
26+
fn_script_log_warn "Default Web password detected"
27+
elif [ -v adminpassword ] && [ "${adminpassword}" == "CHANGE_ME" ]; then
28+
fn_print_warn_nl "Default Admin password detected"
29+
fn_script_log_warn "Default Admin password detected"
30+
2431
fi
2532

2633
if [ "${shortname}" == "vh" ] && [ -z "${serverpassword}" ]; then

lgsm/modules/info_game.sh

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1832,14 +1832,7 @@ fn_info_game_rw() {
18321832
# example: hostname "SERVERNAME"
18331833
# filetypes: cfg
18341834
fn_info_game_samp() {
1835-
# Config
1836-
if [ ! -f "${servercfgfullpath}" ]; then
1837-
servername="unnamed server"
1838-
rconpassword="${unavailable}"
1839-
port="7777"
1840-
rconport="${port}"
1841-
maxplayers="50"
1842-
else
1835+
if [ -f "${servercfgfullpath}" ]; then
18431836
servername=$(grep "hostname" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^\//d' -e 's/hostname//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
18441837
rconpassword=$(grep "rcon_password" "${servercfgfullpath}" | sed -e 's/^[ \t]*//g' -e '/^#/d' -e 's/^rcon_password//g' | tr -d '=\";,:' | sed -e 's/^[ \t]*//' -e 's/[ \t]*$//')
18451838
port=$(grep "port" "${servercfgfullpath}" | grep -v "#" | tr -cd '[:digit:]')

0 commit comments

Comments
 (0)