From cc45f5852970eec053574a319c02803ea1a61144 Mon Sep 17 00:00:00 2001 From: Alasdair Haig Date: Fri, 3 Jul 2020 00:12:35 +0200 Subject: [PATCH 1/6] Added missing beta password for steamcmd --- lgsm/config-default/config-lgsm/vhserver/_default.cfg | 1 + lgsm/functions/update_steamcmd.sh | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/_default.cfg b/lgsm/config-default/config-lgsm/vhserver/_default.cfg index 1d09a514c..78eab51cd 100644 --- a/lgsm/config-default/config-lgsm/vhserver/_default.cfg +++ b/lgsm/config-default/config-lgsm/vhserver/_default.cfg @@ -122,6 +122,7 @@ sleeptime="0.5" appid="896660" # SteamCMD Branch | https://docs.linuxgsm.com/steamcmd/branch branch="" +branchpassword="" # Master Server | https://docs.linuxgsm.com/steamcmd/steam-master-server steammaster="false" diff --git a/lgsm/functions/update_steamcmd.sh b/lgsm/functions/update_steamcmd.sh index 8a089c7f7..c5b19833f 100644 --- a/lgsm/functions/update_steamcmd.sh +++ b/lgsm/functions/update_steamcmd.sh @@ -30,7 +30,10 @@ fn_update_steamcmd_dl(){ # All other servers. else if [ -n "${branch}" ]; then - ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" + if [ -n "${branchpassword}" ]; then + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" -betapassword "${branchpassword}" +quit | tee -a "${lgsmlog}" + else + ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" -beta "${branch}" +quit | tee -a "${lgsmlog}" else ${unbuffer} ${steamcmdcommand} +login "${steamuser}" "${steampass}" +force_install_dir "${serverfiles}" +app_update "${appid}" +quit | tee -a "${lgsmlog}" fi From 5be1c44e7eb5a1790816af1d9dfabcdda0e32aec Mon Sep 17 00:00:00 2001 From: Alasdair Haig Date: Fri, 3 Jul 2020 17:25:49 +0200 Subject: [PATCH 2/6] Added Readme --- .../config-lgsm/vhserver/Valheim.md | 53 ++++++++++++++++++- 1 file changed, 52 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/Valheim.md b/lgsm/config-default/config-lgsm/vhserver/Valheim.md index e652aafb6..bd3c2ed1c 100644 --- a/lgsm/config-default/config-lgsm/vhserver/Valheim.md +++ b/lgsm/config-default/config-lgsm/vhserver/Valheim.md @@ -1 +1,52 @@ -A Saga of how a Viking wrote bashed some scripts runes together that led him on a journey to the missing tenth (or so) missing realm of Valheim! +A Saga of how a Viking wrote *bash*ed some scripts runes together that led him on a journey to the missing tenth (or so) missing realm of Valheim! +... *pausing for effect* ... + +Upon the whims of Odin, I was chosen to undergo the trial of Valheim, where, by chance, I met my liege, Sir Gloor, an outstanding burly Viking Warrior and Shaman (long beard, pointy hat), who had long discovered the secrets of Valheim, due to his divine connections. Blah blah blah ...etc. etc. etc., (skip the prologue)....booorrrriiinnngggg. Anyways, in order to be able to set out on adventures on dedicated servers, I'll point out some viking-ways to get you set up. First, you'll need 5 wood and 2 stones... + +I won't go into to much detail, as lot of the knowledge to run on a server is similar to the rest in Linuxgsm. So I will point to links to their site as I go along. +First the game has it's own parameters for starting that should be set. Like other games managed with Linuxgsm, these can be found in the corresponding game folder, in Valheim's case: lgsm/config-default/config-lgsm/vhserver/_default.cfg. You shouldn't edit this file, as a copy will be made elsewhere upon installing the server, at lgsm/conifg-lgsm/vhserver/_default.cfg. Note: this file is always checked by the code if it has been changed, and will always be reset to match the version of github. + +I will suggest setting the following in the common.cfg, which will apply to all game instances created: +- steamuser= + +(In the _default.cfg, I mention at the steam section, that you should login prior to install, as the default is to log on anonymously, which is, at the time of this writting, not allowed, as the server requires username and password. You should only need to set your username within the configuration file (common.cfg or '*instance*.cfg), and after logging on manually into steamcmd and entering your password once, it should remember the server as trustworthy. You may need to enter it manually again later, depending, otherwise you can add steampass="" in the file as well. It's just a matter of security, depending if you are willing to risk your steam account, should the server be compromised.) + +And then for specific game instances (i.e. vhserver, vhserver-2, etc.), you should +- name (server name as it appears in steam server list) +- world (the save name of the game world found under .config/unity3d/IronGate/Valheim/worlds/ ) +- password +- public (if you wish to change the default value: public) + +Technically, you can choose which settings are global for all servers (common.cfg) or localised for just a specific instance (*instance*.cfg). It is up to you to sharpen your axe and make the best choice for your situation. For example, I've chosen to make notification "global", turning them on in the common.cfg, so all games will be reported. + +Depending if you have a beta branch: +- branch +- branchpassword (this is presently lacking in the parent branch of Linuxgsm, but works for Valheim! Viking Power!) + +There are suggestions and steps to backing up the the entire server setup of Linuxgsm: https://docs.linuxgsm.com/commands/backup +I have done that, but I have also included, similarly, the automating backups of the actual world file (.config/unity3d/IronGate/Valheim/worlds/). Here is an example: +#!/bin/bash +cd /home//.config/unity3d/IronGate/Valheim/worlds/ + +files=`ls ./*.fwl` +for i in $files +do +file=`basename -s .fwl $i` +tar -czf "$1_$file.tar.gz" $file.fwl $file.db +done; + +This script combines to the files need for the world into one tar file, and does so for every unique world file. It takes a name as a parameter and places it in front of the world's name. So I have a monthly back up called Monthly_.tar.gz, that automatically overwrites itself every month. And similarly, the daily backup overwrites itself everyday. You can customize it as needed. This is an excerpt from cronjob: +# Valheim World Backups +0 0 * * * /home//.sh Daily >/dev/null 2>&1 +0 1 1 * * /home//.sh Monthly >/dev/null 2>&1 + +#$@&%*! *swearing after smashing a finger with the hammer while chiseling the words out* + +Presently, gamedig does not support Valheim, so I've set the default to check the session value, which is adequet. + +At this time in writing, I've added alert notification for rocketchat, which on the main repository is presently lacking. + + +All is as Odin wishes, + +A Saga, by the IT Viking From 8265aeb26817db7c044d55d95c91824fb25aa418 Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Fri, 3 Jul 2020 17:32:21 +0200 Subject: [PATCH 3/6] Rename Valheim.md to README.md --- .../config-default/config-lgsm/vhserver/{Valheim.md => README.md} | 0 1 file changed, 0 insertions(+), 0 deletions(-) rename lgsm/config-default/config-lgsm/vhserver/{Valheim.md => README.md} (100%) diff --git a/lgsm/config-default/config-lgsm/vhserver/Valheim.md b/lgsm/config-default/config-lgsm/vhserver/README.md similarity index 100% rename from lgsm/config-default/config-lgsm/vhserver/Valheim.md rename to lgsm/config-default/config-lgsm/vhserver/README.md From 3edc0ae7fa5b9e54ba9cb0f53062e04eeec46e43 Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Fri, 3 Jul 2020 17:39:00 +0200 Subject: [PATCH 4/6] Update README.md --- .../config-lgsm/vhserver/README.md | 22 ++++++++++--------- 1 file changed, 12 insertions(+), 10 deletions(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/README.md b/lgsm/config-default/config-lgsm/vhserver/README.md index bd3c2ed1c..b5822c478 100644 --- a/lgsm/config-default/config-lgsm/vhserver/README.md +++ b/lgsm/config-default/config-lgsm/vhserver/README.md @@ -7,24 +7,25 @@ I won't go into to much detail, as lot of the knowledge to run on a server is si First the game has it's own parameters for starting that should be set. Like other games managed with Linuxgsm, these can be found in the corresponding game folder, in Valheim's case: lgsm/config-default/config-lgsm/vhserver/_default.cfg. You shouldn't edit this file, as a copy will be made elsewhere upon installing the server, at lgsm/conifg-lgsm/vhserver/_default.cfg. Note: this file is always checked by the code if it has been changed, and will always be reset to match the version of github. I will suggest setting the following in the common.cfg, which will apply to all game instances created: -- steamuser= +`- steamuser=` (In the _default.cfg, I mention at the steam section, that you should login prior to install, as the default is to log on anonymously, which is, at the time of this writting, not allowed, as the server requires username and password. You should only need to set your username within the configuration file (common.cfg or '*instance*.cfg), and after logging on manually into steamcmd and entering your password once, it should remember the server as trustworthy. You may need to enter it manually again later, depending, otherwise you can add steampass="" in the file as well. It's just a matter of security, depending if you are willing to risk your steam account, should the server be compromised.) And then for specific game instances (i.e. vhserver, vhserver-2, etc.), you should -- name (server name as it appears in steam server list) -- world (the save name of the game world found under .config/unity3d/IronGate/Valheim/worlds/ ) -- password -- public (if you wish to change the default value: public) +- `name` (server name as it appears in steam server list) +- `world` (the save name of the game world found under .config/unity3d/IronGate/Valheim/worlds/ ) +- `password` +- `public` (if you wish to change the default value: public) Technically, you can choose which settings are global for all servers (common.cfg) or localised for just a specific instance (*instance*.cfg). It is up to you to sharpen your axe and make the best choice for your situation. For example, I've chosen to make notification "global", turning them on in the common.cfg, so all games will be reported. Depending if you have a beta branch: -- branch -- branchpassword (this is presently lacking in the parent branch of Linuxgsm, but works for Valheim! Viking Power!) +- `branch` +- `branchpassword` (this is presently lacking in the parent branch of Linuxgsm, but works for Valheim! Viking Power!) There are suggestions and steps to backing up the the entire server setup of Linuxgsm: https://docs.linuxgsm.com/commands/backup I have done that, but I have also included, similarly, the automating backups of the actual world file (.config/unity3d/IronGate/Valheim/worlds/). Here is an example: +```bash #!/bin/bash cd /home//.config/unity3d/IronGate/Valheim/worlds/ @@ -34,12 +35,13 @@ do file=`basename -s .fwl $i` tar -czf "$1_$file.tar.gz" $file.fwl $file.db done; - +``` This script combines to the files need for the world into one tar file, and does so for every unique world file. It takes a name as a parameter and places it in front of the world's name. So I have a monthly back up called Monthly_.tar.gz, that automatically overwrites itself every month. And similarly, the daily backup overwrites itself everyday. You can customize it as needed. This is an excerpt from cronjob: -# Valheim World Backups +``` +#Valheim World Backups 0 0 * * * /home//.sh Daily >/dev/null 2>&1 0 1 1 * * /home//.sh Monthly >/dev/null 2>&1 - +``` #$@&%*! *swearing after smashing a finger with the hammer while chiseling the words out* Presently, gamedig does not support Valheim, so I've set the default to check the session value, which is adequet. From a1082b1f6221030a6b827413a0c13097c3d7ec26 Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Fri, 3 Jul 2020 17:43:59 +0200 Subject: [PATCH 5/6] Update README.md --- lgsm/config-default/config-lgsm/vhserver/README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/README.md b/lgsm/config-default/config-lgsm/vhserver/README.md index b5822c478..ea53e5e94 100644 --- a/lgsm/config-default/config-lgsm/vhserver/README.md +++ b/lgsm/config-default/config-lgsm/vhserver/README.md @@ -1,4 +1,5 @@ -A Saga of how a Viking wrote *bash*ed some scripts runes together that led him on a journey to the missing tenth (or so) missing realm of Valheim! +A Saga of how a Viking wrote *bash*ed some scripts runes together that led him on a journey to the tenth (or so) missing realm of Valheim! + ... *pausing for effect* ... Upon the whims of Odin, I was chosen to undergo the trial of Valheim, where, by chance, I met my liege, Sir Gloor, an outstanding burly Viking Warrior and Shaman (long beard, pointy hat), who had long discovered the secrets of Valheim, due to his divine connections. Blah blah blah ...etc. etc. etc., (skip the prologue)....booorrrriiinnngggg. Anyways, in order to be able to set out on adventures on dedicated servers, I'll point out some viking-ways to get you set up. First, you'll need 5 wood and 2 stones... From 264d8d7373eb965034e6f0390d79bab85d584fda Mon Sep 17 00:00:00 2001 From: AlasdairHaig Date: Fri, 3 Jul 2020 17:54:27 +0200 Subject: [PATCH 6/6] Update README.md --- lgsm/config-default/config-lgsm/vhserver/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lgsm/config-default/config-lgsm/vhserver/README.md b/lgsm/config-default/config-lgsm/vhserver/README.md index ea53e5e94..56999581c 100644 --- a/lgsm/config-default/config-lgsm/vhserver/README.md +++ b/lgsm/config-default/config-lgsm/vhserver/README.md @@ -4,7 +4,7 @@ A Saga of how a Viking wrote *bash*ed some scripts. First the game has it's own parameters for starting that should be set. Like other games managed with Linuxgsm, these can be found in the corresponding game folder, in Valheim's case: lgsm/config-default/config-lgsm/vhserver/_default.cfg. You shouldn't edit this file, as a copy will be made elsewhere upon installing the server, at lgsm/conifg-lgsm/vhserver/_default.cfg. Note: this file is always checked by the code if it has been changed, and will always be reset to match the version of github. I will suggest setting the following in the common.cfg, which will apply to all game instances created: