From 8df33be740f2af330f30a29ed36a583b5a007bf2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 22:26:10 +0100 Subject: [PATCH 01/25] refactor: shorten module update function names The commit renames the update functions for several game modules to shorter names. The new names are more concise and easier to remember, which should improve code readability and maintainability. --- lgsm/modules/core_modules.sh | 12 ++++++------ lgsm/modules/{update_factorio.sh => update_fctr.sh} | 0 .../modules/{update_jediknight2.sh => update_jk2.sh} | 0 lgsm/modules/{update_minecraft.sh => update_mc.sh} | 0 .../{update_minecraft_bedrock.sh => update_mcb.sh} | 0 lgsm/modules/{update_papermc.sh => update_pmc.sh} | 0 .../{update_vintagestory.sh => update_vints.sh} | 0 7 files changed, 6 insertions(+), 6 deletions(-) rename lgsm/modules/{update_factorio.sh => update_fctr.sh} (100%) rename lgsm/modules/{update_jediknight2.sh => update_jk2.sh} (100%) rename lgsm/modules/{update_minecraft.sh => update_mc.sh} (100%) rename lgsm/modules/{update_minecraft_bedrock.sh => update_mcb.sh} (100%) rename lgsm/modules/{update_papermc.sh => update_pmc.sh} (100%) rename lgsm/modules/{update_vintagestory.sh => update_vints.sh} (100%) diff --git a/lgsm/modules/core_modules.sh b/lgsm/modules/core_modules.sh index 35a919422b..afaa973b35 100644 --- a/lgsm/modules/core_modules.sh +++ b/lgsm/modules/core_modules.sh @@ -645,17 +645,17 @@ update_ts3.sh() { fn_fetch_module } -update_minecraft.sh() { +update_mc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_minecraft_bedrock.sh() { +update_mcb.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_papermc.sh() { +update_pmc.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -665,12 +665,12 @@ update_mta.sh() { fn_fetch_module } -update_factorio.sh() { +update_fctr.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } -update_jediknight2.sh() { +update_jk2.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } @@ -680,7 +680,7 @@ update_steamcmd.sh() { fn_fetch_module } -update_vintagestory.sh() { +update_vints.sh() { modulefile="${FUNCNAME[0]}" fn_fetch_module } diff --git a/lgsm/modules/update_factorio.sh b/lgsm/modules/update_fctr.sh similarity index 100% rename from lgsm/modules/update_factorio.sh rename to lgsm/modules/update_fctr.sh diff --git a/lgsm/modules/update_jediknight2.sh b/lgsm/modules/update_jk2.sh similarity index 100% rename from lgsm/modules/update_jediknight2.sh rename to lgsm/modules/update_jk2.sh diff --git a/lgsm/modules/update_minecraft.sh b/lgsm/modules/update_mc.sh similarity index 100% rename from lgsm/modules/update_minecraft.sh rename to lgsm/modules/update_mc.sh diff --git a/lgsm/modules/update_minecraft_bedrock.sh b/lgsm/modules/update_mcb.sh similarity index 100% rename from lgsm/modules/update_minecraft_bedrock.sh rename to lgsm/modules/update_mcb.sh diff --git a/lgsm/modules/update_papermc.sh b/lgsm/modules/update_pmc.sh similarity index 100% rename from lgsm/modules/update_papermc.sh rename to lgsm/modules/update_pmc.sh diff --git a/lgsm/modules/update_vintagestory.sh b/lgsm/modules/update_vints.sh similarity index 100% rename from lgsm/modules/update_vintagestory.sh rename to lgsm/modules/update_vints.sh From 4cc8f8de2eaa4f6275d4cc3bd0f3a15c215dc5f0 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 22:26:28 +0100 Subject: [PATCH 02/25] feat: Add Update Check workflow This commit adds a new GitHub Actions workflow that checks if LinuxGSM is picking up game server config and parameter variables. The workflow runs on push and manual triggers, with concurrency settings to cancel in-progress jobs. It downloads linuxgsm.sh, installs dependencies, grabs the server, enables developer mode, installs the server, and updates it. --- .github/workflows/update-check.yml | 38 ++++++++++++++++++++++++++++++ 1 file changed, 38 insertions(+) create mode 100644 .github/workflows/update-check.yml diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml new file mode 100644 index 0000000000..dcb38c3de5 --- /dev/null +++ b/.github/workflows/update-check.yml @@ -0,0 +1,38 @@ +name: Update Check +# This action will check that LinuxGSM is picking up game server config and parameter variables. +on: + workflow_dispatch: + push: + +concurrency: + group: ${{ github.ref_name }} + cancel-in-progress: true + +jobs: + + update-check: + continue-on-error: true + runs-on: ubuntu-latest + + strategy: + matrix: + shortname: [css, fctr, jk2, mc, mcb, mta, pmc, ts3, ut99, vints] + + steps: + - name: Download linuxgsm.sh + run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh + + - name: Install dependencies + run: sudo apt-get install libxml2-utils jq + + - name: Grab server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server + + - name: Enable developer mode + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + + - name: Install server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install + + - name: Update server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update From 215c9a5b9a82edff8b85ce4949ec6e456fee3f59 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 22:28:40 +0100 Subject: [PATCH 03/25] feat: Add concurrency group names to workflows The `details-check.yml` and `update-check.yml` workflows now have a concurrency group name that includes the branch or tag name. This will allow for better management of concurrent workflow runs. --- .github/workflows/details-check.yml | 2 +- .github/workflows/update-check.yml | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/details-check.yml b/.github/workflows/details-check.yml index 19376a15d5..e669812af6 100644 --- a/.github/workflows/details-check.yml +++ b/.github/workflows/details-check.yml @@ -5,7 +5,7 @@ on: push: concurrency: - group: ${{ github.ref_name }} + group: details-check-${{ github.ref_name }} cancel-in-progress: true jobs: diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index dcb38c3de5..39ee4f244d 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -5,7 +5,7 @@ on: push: concurrency: - group: ${{ github.ref_name }} + group: update-check${{ github.ref_name }} cancel-in-progress: true jobs: From d483c2a3de15aa59f481afc7854b80e0f58d5ae2 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 22:40:03 +0100 Subject: [PATCH 04/25] refactor: Update script names for Minecraft, Factorio, Jedi Knight 2 and Vintage Story This commit updates the script names for Minecraft, Factorio, Jedi Knight 2 and Vintage Story. The update includes changes to command_check_update.sh, command_update.sh, core_functions.sh and install_server_files.sh. The new script names are update_mc.sh (formerly update_minecraft.sh), update_fctr.sh (formerly update_factorio.sh), update_jk2.sh (formerly update_jediknight2.sh) and update_vints.sh (formerly update_vintagestory.sh). --- .github/workflows/update-check.yml | 2 +- lgsm/modules/command_check_update.sh | 12 ++++++------ lgsm/modules/command_update.sh | 12 ++++++------ lgsm/modules/core_functions.sh | 12 ++++++------ lgsm/modules/install_server_files.sh | 14 +++++++------- lgsm/modules/update_fctr.sh | 2 +- lgsm/modules/update_mc.sh | 2 +- lgsm/modules/update_mcb.sh | 2 +- lgsm/modules/update_pmc.sh | 2 +- lgsm/modules/update_vints.sh | 2 +- 10 files changed, 31 insertions(+), 31 deletions(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 39ee4f244d..4de06540f4 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -5,7 +5,7 @@ on: push: concurrency: - group: update-check${{ github.ref_name }} + group: update-check-${{ github.ref_name }} cancel-in-progress: true jobs: diff --git a/lgsm/modules/command_check_update.sh b/lgsm/modules/command_check_update.sh index c7780c3557..2e6855f7cb 100644 --- a/lgsm/modules/command_check_update.sh +++ b/lgsm/modules/command_check_update.sh @@ -17,19 +17,19 @@ core_logs.sh if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then - update_minecraft.sh + update_mc.sh elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh + update_mcb.sh elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh + update_fctr.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "jk2" ]; then - update_jediknight2.sh + update_jk2.sh elif [ "${shortname}" == "vints" ]; then - update_vintagestory.sh + update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh else diff --git a/lgsm/modules/command_update.sh b/lgsm/modules/command_update.sh index 5993609c0e..501ff079d8 100644 --- a/lgsm/modules/command_update.sh +++ b/lgsm/modules/command_update.sh @@ -18,19 +18,19 @@ check_last_update.sh if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then - update_minecraft.sh + update_mc.sh elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh + update_mcb.sh elif [ "${shortname}" == "pmc" ] || [ "${shortname}" == "vpmc" ] || [ "${shortname}" == "wmc" ]; then - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh + update_fctr.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "jk2" ]; then - update_jediknight2.sh + update_jk2.sh elif [ "${shortname}" == "vints" ]; then - update_vintagestory.sh + update_vints.sh elif [ "${shortname}" == "ut99" ]; then update_ut99.sh else diff --git a/lgsm/modules/core_functions.sh b/lgsm/modules/core_functions.sh index 446db1f86e..1894268233 100644 --- a/lgsm/modules/core_functions.sh +++ b/lgsm/modules/core_functions.sh @@ -640,17 +640,17 @@ update_ts3.sh() { fn_fetch_function } -update_minecraft.sh() { +update_mc.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } -update_minecraft_bedrock.sh() { +update_mcb.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } -update_papermc.sh() { +update_pmc.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } @@ -660,12 +660,12 @@ update_mta.sh() { fn_fetch_function } -update_factorio.sh() { +update_fctr.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } -update_jediknight2.sh() { +update_jk2.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } @@ -675,7 +675,7 @@ update_steamcmd.sh() { fn_fetch_function } -update_vintagestory.sh() { +update_vints.sh() { functionfile="${FUNCNAME[0]}" fn_fetch_function } diff --git a/lgsm/modules/install_server_files.sh b/lgsm/modules/install_server_files.sh index 717030df4d..a03bf52a31 100644 --- a/lgsm/modules/install_server_files.sh +++ b/lgsm/modules/install_server_files.sh @@ -220,23 +220,23 @@ if [ "${shortname}" == "ts3" ]; then update_ts3.sh elif [ "${shortname}" == "mc" ]; then install_eula.sh - update_minecraft.sh + update_mc.sh elif [ "${shortname}" == "mcb" ]; then - update_minecraft_bedrock.sh + update_mcb.sh elif [ "${shortname}" == "pmc" ]; then install_eula.sh - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "wmc" ] || [ "${shortname}" == "vpmc" ]; then - update_papermc.sh + update_pmc.sh elif [ "${shortname}" == "mta" ]; then update_mta.sh elif [ "${shortname}" == "fctr" ]; then - update_factorio.sh + update_fctr.sh install_factorio_save.sh elif [ "${shortname}" == "jk2" ]; then - update_jediknight2.sh + update_jk2.sh elif [ "${shortname}" == "vints" ]; then - update_vintagestory.sh + update_vints.sh elif [ "${shortname}" == "ut99" ]; then fn_install_server_files update_ut99.sh diff --git a/lgsm/modules/update_fctr.sh b/lgsm/modules/update_fctr.sh index 2af9916aa4..450f4eda68 100644 --- a/lgsm/modules/update_fctr.sh +++ b/lgsm/modules/update_fctr.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_factorio.sh module +# LinuxGSM update_fctr.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_mc.sh b/lgsm/modules/update_mc.sh index e764e846ec..16d00f6884 100644 --- a/lgsm/modules/update_mc.sh +++ b/lgsm/modules/update_mc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_minecraft.sh module +# LinuxGSM update_mc.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_mcb.sh b/lgsm/modules/update_mcb.sh index 3c3885a9d9..92150ed059 100644 --- a/lgsm/modules/update_mcb.sh +++ b/lgsm/modules/update_mcb.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_minecraft_bedrock.sh module +# LinuxGSM update_mcb.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_pmc.sh b/lgsm/modules/update_pmc.sh index b70a2d69db..605dbff1be 100644 --- a/lgsm/modules/update_pmc.sh +++ b/lgsm/modules/update_pmc.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_papermc.sh module +# LinuxGSM update_pmc.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com diff --git a/lgsm/modules/update_vints.sh b/lgsm/modules/update_vints.sh index 8fbc490448..83472c7ee9 100644 --- a/lgsm/modules/update_vints.sh +++ b/lgsm/modules/update_vints.sh @@ -1,5 +1,5 @@ #!/bin/bash -# LinuxGSM update_vintagestory.sh module +# LinuxGSM update_vints.sh module # Author: Daniel Gibbs # Contributors: http://linuxgsm.com/contrib # Website: https://linuxgsm.com From 8df9e5cbe847ad6b185176fb968b53dc90088d6d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 23:07:00 +0100 Subject: [PATCH 05/25] feat: Add support for 32-bit architecture This commit adds support for 32-bit architecture by running the command "sudo dpkg --add-architecture i386" instead of installing libxml2-utils and jq. --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 4de06540f4..5ee7e3fe8a 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo apt-get install libxml2-utils jq + run: sudo dpkg --add-architecture i386 - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From 00dc5ceab376cb81a853f93b31edc1a73bf6618a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 23:10:51 +0100 Subject: [PATCH 06/25] feat: Add i386 architecture and install libstdc++6 This commit adds the installation of libstdc++6:i386 package to support 32-bit applications. It also includes adding the i386 architecture to dpkg. --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 5ee7e3fe8a..b55b894ca7 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386 + run: sudo dpkg --add-architecture i386; sudo apt install libstdc++6:i386 - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From ebe76fbfd669a1653817a0c610c782c8c778dfcb Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 23:28:23 +0100 Subject: [PATCH 07/25] feat: Update dependencies for LinuxGSM Changed the dependency from libstdc++6:i386 to libgcc-s1:i386 in the update-check.yml file. This change was made to ensure compatibility with newer versions of LinuxGSM. --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index b55b894ca7..b4b9a907da 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386; sudo apt install libstdc++6:i386 + run: sudo dpkg --add-architecture i386; sudo apt-get update - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From eaeb2487a11ee2842e8727e6507fb602297771a7 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sat, 10 Jun 2023 23:42:46 +0100 Subject: [PATCH 08/25] feat: Add update and force-update server functionality This commit adds the ability to check for updates and force updates on a server. The update-check.yml file has been modified to include new jobs that run the LGSM_GITHUBBRANCH command with specific arguments. --- .github/workflows/update-check.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index b4b9a907da..901dc8b5ad 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -34,5 +34,12 @@ jobs: - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install + - name: Check Update server + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server check-update + - name: Update server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server update + + - name: Force Update server + if: matrix.shortname == 'css' + run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server force-update From 33eaf4892fcd4276fd30abb72a609a2b953d6249 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Jun 2023 00:59:54 +0100 Subject: [PATCH 09/25] feat: Add dependencies for server installation This commit adds the necessary dependencies to install a game server. The `update-check.yml` file has been updated to include the installation of `bsdmainutils`, `libsdl2-2.0-0:i386`, `libtinfo5:i386`, and `steamcmd`. --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 901dc8b5ad..92ebc73b3d 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386; sudo apt-get update + run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt install bsdmainutils libsdl2-2.0-0:i386 libtinfo5:i386 steamcmd - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From c4119b47aff1e02a136b458d96065da6af0ccd03 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Jun 2023 01:01:36 +0100 Subject: [PATCH 10/25] steamcmd only --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 92ebc73b3d..1ed2ec8c83 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt install bsdmainutils libsdl2-2.0-0:i386 libtinfo5:i386 steamcmd + run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt install steamcmd - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From 5519a63fda67087f220787e3d068a9629c859d51 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Jun 2023 01:05:34 +0100 Subject: [PATCH 11/25] steamcmd --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 1ed2ec8c83..abe16a3b64 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt install steamcmd + run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt upgrade -y; sudo apt install steamcmd - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From ae985fded769ba62a25ed2c2d7f9390994de4884 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Jun 2023 01:12:05 +0100 Subject: [PATCH 12/25] test --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index abe16a3b64..d33ae65496 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt upgrade -y; sudo apt install steamcmd + run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt --fix-broken install; sudo apt upgrade -y; sudo apt install steamcmd - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From a57880d7ecb6ef5d96395ab5b8c167540268260a Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Sun, 11 Jun 2023 01:20:15 +0100 Subject: [PATCH 13/25] test --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index d33ae65496..84b2f27713 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -23,7 +23,7 @@ jobs: run: wget https://raw.githubusercontent.com/GameServerManagers/LinuxGSM/${GITHUB_REF#refs/heads/}/linuxgsm.sh; chmod +x linuxgsm.sh - name: Install dependencies - run: sudo dpkg --add-architecture i386; sudo apt update; sudo apt --fix-broken install; sudo apt upgrade -y; sudo apt install steamcmd + run: sudo dpkg --add-architecture i386; sudo apt-get update; - name: Grab server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./linuxgsm.sh ${{ matrix.shortname }}server From 8a35f649a573cbbc5d033046dd4b7ae9860ff735 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Aug 2023 23:32:26 +0100 Subject: [PATCH 14/25] refactor: improve random password generation in install_config.sh The code change refactors the random password generation in the `install_config.sh` file. Instead of using `tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs`, it now uses `tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs`. This change improves the reliability and security of generating random passwords. --- lgsm/modules/install_config.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/install_config.sh b/lgsm/modules/install_config.sh index e868e9bf71..adf230e33f 100644 --- a/lgsm/modules/install_config.sh +++ b/lgsm/modules/install_config.sh @@ -64,7 +64,7 @@ fn_default_config_local() { # PASSWORD to random password fn_set_config_vars() { if [ -f "${servercfgfullpath}" ]; then - random=$(tr -dc A-Za-z0-9_ < /dev/urandom | head -c 8 | xargs) + random=$(tr -dc 'A-Za-z0-9_' < /dev/urandom 2>/dev/null | head -c 8 | xargs) servername="LinuxGSM" rconpass="admin${random}" echo -e "changing hostname." From 63840f2a5f307707f60aec87760039cce6a910c5 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Aug 2023 23:43:40 +0100 Subject: [PATCH 15/25] refactor: remove redundant code and set default branch The commit refactors the code by removing redundant code that sets the branch to "public" if no custom branch is specified. This change simplifies the logic and improves readability. --- lgsm/modules/core_steamcmd.sh | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 6d96a9e6c6..5fbd537de0 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -151,11 +151,6 @@ fn_update_steamcmd_localbuild() { # Uses appmanifest to find local build. localbuild=$(grep buildid "${appmanifestfile}" | tr '[:blank:]"' ' ' | tr -s ' ' | cut -d\ -f3) - # Set branch to public if no custom branch. - if [ -z "${branch}" ]; then - branch="public" - fi - # Checks if localbuild variable has been set. if [ -z "${localbuild}" ]; then fn_print_fail "Checking local build: ${remotelocation}: missing local build info" @@ -178,6 +173,11 @@ fn_update_steamcmd_remotebuild() { find "${HOME}" -type f -name "appinfo.vdf" -exec rm -f {} \; 2> /dev/null fi + # Set branch to public if no custom branch. + if [ -z "${branch}" ]; then + branch="public" + fi + # password for branch not needed to check the buildid remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') From e92ee6c607aa02865a0e4f43bc702e35bfe0975d Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Aug 2023 23:48:37 +0100 Subject: [PATCH 16/25] test --- lgsm/modules/core_steamcmd.sh | 1 + 1 file changed, 1 insertion(+) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 5fbd537de0..a47d2645d6 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -179,6 +179,7 @@ fn_update_steamcmd_remotebuild() { fi # password for branch not needed to check the buildid + ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then From 4a06a239c6c82341f1ac9184385f41a353d8b1d4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Mon, 28 Aug 2023 23:53:32 +0100 Subject: [PATCH 17/25] fix: fix steamcmd build version retrieval The code changes in this commit fix an issue with retrieving the build version from SteamCMD. The previous implementation was not correctly capturing the buildid. This has been resolved by adding additional echo statements for debugging purposes. --- lgsm/modules/core_steamcmd.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index a47d2645d6..ef84704612 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -179,7 +179,9 @@ fn_update_steamcmd_remotebuild() { fi # password for branch not needed to check the buildid + echo "TEST" ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit + echo "TEST" remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then From b0d243352e83942dea3843036033578a570bcc15 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 23:11:47 +0100 Subject: [PATCH 18/25] test fix: remove unnecessary app_info_print command The commit removes the unnecessary `app_info_print` command from the code. This command was not needed to check the buildid. --- lgsm/modules/core_steamcmd.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index ef84704612..b2b58d08fd 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -180,7 +180,7 @@ fn_update_steamcmd_remotebuild() { # password for branch not needed to check the buildid echo "TEST" - ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit + ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit echo "TEST" remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') From da02a55100de7744f2dc87096563089474fb9f76 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 23:17:36 +0100 Subject: [PATCH 19/25] fix: GitHub Actions test failure The code change fixes a failing GitHub Actions test by running SteamCMD twice. The first run is to update the app info, and the second run retrieves the build ID for the specified branch. --- lgsm/modules/core_steamcmd.sh | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index b2b58d08fd..1b8724d12b 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -178,10 +178,10 @@ fn_update_steamcmd_remotebuild() { branch="public" fi + + # added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it. + ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit 2> /dev/null # password for branch not needed to check the buildid - echo "TEST" - ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit - echo "TEST" remotebuildversion=$(${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +app_info_print "${appid}" +quit | sed -e '/"branches"/,/^}/!d' | sed -n "/\"${branch}\"/,/}/p" | grep -m 1 buildid | tr -cd '[:digit:]') if [ "${firstcommandname}" != "INSTALL" ]; then From 821e7984fba8f9c8f6dbbea1c664eddc51b2b73f Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 23:37:12 +0100 Subject: [PATCH 20/25] Add steam user and password secret for jk2 --- .github/workflows/update-check.yml | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 84b2f27713..363cd1cf3e 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -31,6 +31,14 @@ jobs: - name: Enable developer mode run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server developer + - name: Insert steamuser + if: matrix.shortname == 'jk2' + run: sed -i 's/steamuser=""/steamuser="${STEAMCMD_USER}"/g' lgsm/config-lgsm/cssserver/common.cfg + + - name: Insert steampass + if: matrix.shortname == 'jk2' + run: sed -i 's/steampass=""/steampass='${STEAMCMD_PASS}' lgsm/config-lgsm/cssserver/common.cfg + - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install From c308420f79a871be4a9e1b060d7597fb686dc355 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 23:41:03 +0100 Subject: [PATCH 21/25] refactor: update steamuser and steampass paths in jk2server config The code changes refactor the paths for `steamuser` and `steampass` in the configuration file of the `jk2server`. The previous paths were incorrect, so they have been updated to point to the correct location. --- .github/workflows/update-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 363cd1cf3e..ae6e5b50e2 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -33,11 +33,11 @@ jobs: - name: Insert steamuser if: matrix.shortname == 'jk2' - run: sed -i 's/steamuser=""/steamuser="${STEAMCMD_USER}"/g' lgsm/config-lgsm/cssserver/common.cfg + run: sed -i 's/steamuser=""/steamuser="${STEAMCMD_USER}"/g' lgsm/config-lgsm/jk2server/common.cfg - name: Insert steampass if: matrix.shortname == 'jk2' - run: sed -i 's/steampass=""/steampass='${STEAMCMD_PASS}' lgsm/config-lgsm/cssserver/common.cfg + run: sed -i 's/steampass=""/steampass='${STEAMCMD_PASS}' lgsm/config-lgsm/jk2server/common.cfg - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install From 0c610c785b82610a527898d4ffc57acb32f95190 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 23:49:51 +0100 Subject: [PATCH 22/25] refactor: update steamuser and steampass insertion in LGSM configuration The code changes refactor the way steamuser and steampass are inserted into the LGSM configuration file. Instead of hardcoding the values, they are now dynamically inserted using environment variables. This improves flexibility and security when setting up the server. --- .github/workflows/update-check.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index ae6e5b50e2..bccfc81ffe 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -33,11 +33,11 @@ jobs: - name: Insert steamuser if: matrix.shortname == 'jk2' - run: sed -i 's/steamuser=""/steamuser="${STEAMCMD_USER}"/g' lgsm/config-lgsm/jk2server/common.cfg + run: sed -i 's/steamuser=""/steamuser="${STEAMCMD_USER}"/g' lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Insert steampass if: matrix.shortname == 'jk2' - run: sed -i 's/steampass=""/steampass='${STEAMCMD_PASS}' lgsm/config-lgsm/jk2server/common.cfg + run: sed -i 's/steampass=""/steampass='${STEAMCMD_PASS}'/g' lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install From 452ce247881632cb0e16c6fe321f59d2bdee7aa4 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Wed, 30 Aug 2023 23:54:10 +0100 Subject: [PATCH 23/25] refactor: simplify steamuser and steampass insertion in update-check.yml The code changes remove unnecessary sed commands and replace them with a single echo command to insert the values of STEAMCMD_USER and STEAMCMD_PASS into the common.cfg file. This simplifies the code and improves readability. --- .github/workflows/update-check.yml | 6 +----- 1 file changed, 1 insertion(+), 5 deletions(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index bccfc81ffe..16bea4524a 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -33,11 +33,7 @@ jobs: - name: Insert steamuser if: matrix.shortname == 'jk2' - run: sed -i 's/steamuser=""/steamuser="${STEAMCMD_USER}"/g' lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - - - name: Insert steampass - if: matrix.shortname == 'jk2' - run: sed -i 's/steampass=""/steampass='${STEAMCMD_PASS}'/g' lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg + run: echo "steamuser="${STEAMCMD_USER}\nsteampass='${STEAMCMD_PASS}'" lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install From 384ff0d5112f8459e7578d1eacd0c1185573cb21 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 31 Aug 2023 00:08:09 +0100 Subject: [PATCH 24/25] feat: update steamuser and steampass in common.cfg The commit updates the code to properly insert the `steamuser` and `steampass` values in the `common.cfg` file. The previous code was not correctly formatting the values, which caused issues with server installation. This change ensures that the values are properly formatted using double quotes for `steamuser` and single quotes for `steampass`. --- .github/workflows/update-check.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 16bea4524a..4ba6099c9a 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -33,7 +33,7 @@ jobs: - name: Insert steamuser if: matrix.shortname == 'jk2' - run: echo "steamuser="${STEAMCMD_USER}\nsteampass='${STEAMCMD_PASS}'" lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg + run: echo -e "steamuser=\"${STEAMCMD_USER}\"\nsteampass='${STEAMCMD_PASS}'" lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install From c97b0f931616a5a2c2b57d717e120b6e8674dea3 Mon Sep 17 00:00:00 2001 From: Daniel Gibbs Date: Thu, 7 Sep 2023 23:07:12 +0100 Subject: [PATCH 25/25] display output --- .github/workflows/update-check.yml | 3 +-- lgsm/modules/core_steamcmd.sh | 1 - 2 files changed, 1 insertion(+), 3 deletions(-) diff --git a/.github/workflows/update-check.yml b/.github/workflows/update-check.yml index 4ba6099c9a..dfbc7dd580 100644 --- a/.github/workflows/update-check.yml +++ b/.github/workflows/update-check.yml @@ -9,7 +9,6 @@ concurrency: cancel-in-progress: true jobs: - update-check: continue-on-error: true runs-on: ubuntu-latest @@ -33,7 +32,7 @@ jobs: - name: Insert steamuser if: matrix.shortname == 'jk2' - run: echo -e "steamuser=\"${STEAMCMD_USER}\"\nsteampass='${STEAMCMD_PASS}'" lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg + run: echo -e "steamuser=\"${{ secrets.STEAMCMD_USER }}\"\nsteampass='${{ secrets.STEAMCMD_PASS }}'" > lgsm/config-lgsm/${{ matrix.shortname }}server/common.cfg - name: Install server run: LGSM_GITHUBBRANCH="${GITHUB_REF#refs/heads/}" ./${{ matrix.shortname }}server auto-install diff --git a/lgsm/modules/core_steamcmd.sh b/lgsm/modules/core_steamcmd.sh index 1b8724d12b..83fc6f5c39 100644 --- a/lgsm/modules/core_steamcmd.sh +++ b/lgsm/modules/core_steamcmd.sh @@ -178,7 +178,6 @@ fn_update_steamcmd_remotebuild() { branch="public" fi - # added as was failing GitHub Actions test. Running SteamCMD twice seems to fix it. ${steamcmdcommand} +login "${steamuser}" "${steampass}" +app_info_update 1 +quit 2> /dev/null # password for branch not needed to check the buildid