scraketools

administrative aid for hosting multiple Killing Floor 1 dedicated servers
git clone git://git.boymiasma.net/scraketools
Log | Files | Refs | README

README.md (9031B)


      1 # This software is experimental!
      2 As is currently, scraketools suffers from several limitations that require manual intervention.
      3 Numerous helper scripts and helpful behaviours have yet to be added before the software reaches
      4 a usable Beta state. Nevertheless, the scraketools is programmed as a user-facing application,
      5 and contains safeguards against accidental data deletion. Still; never run scraketools
      6 as root, and consider creating a backup of your server installation before migrating it to a
      7 scrake instance.
      8 
      9 As of 2025-10-27, boymiasma.net's Killing Floor 1 servers are administrated through scrake.sh
     10 
     11 # Intro
     12 scraketools is a growing suite of bourne-again shell scripts designed to ease the burden of administrating multiple
     13 Killing Floor 1 dedicated servers in tandem.
     14 
     15 Amongst its features are
     16 - Creation and management of individual server instances derived from a single server base install
     17 - Per-instance map/mutator installation
     18 - Global and per-instance base game and mutator configuration through a single file, `scrake.ini`
     19 - Automatic installation of the base server software through `steamcmd`
     20 - Automatic application of the linux server discoverablity prefix
     21 
     22 # Installation
     23 ```
     24 git clone git://git.boymiasma.net/scraketools
     25 chmod +x scraketools/scrake.sh
     26 ```
     27 
     28 Furthermore, scraketools requires `steamcmd` to exist within your path.
     29 
     30 # Quickstart (fresh server installation)
     31 Never copy-paste commands. This is but a reference. Keep reading.
     32 ```
     33 # install the base server software. You will be prompted to log in by steamcmd.
     34 # NOTE: if you plan to migrate an existing server, skip this step and consult the "Existing server migration" header below
     35 scraketools/scrake.sh init <steam_username>
     36 
     37 # NOTE: because of a limitation in Killing Floor's default config generation, the rest of this
     38 # quickstart guide will leave you without map or kick-voting. If you need these functionalities,
     39 # enable the web server for the base server installation (~/.steam/SteamApps/common/Killing Floor Dedicated Server - Linux/System/KillingFloor.ini by default on ArchLinux)
     40 # and set an admin password, and enable WebAdmin. Run the server as `./ucc-bin server KF-Wyre.rom?game=KFmod.KFGameType -nohomedir`, and enable Map Voting through the interface.
     41 # You might also want to define your maplist here, as there is no way to accomplish this through standard scraketools configuration (yet).
     42 # Save the configuration, shut down the server, proceed as normal, and heed the warning under 'Configuration' down below.
     43 
     44 # create three server instances; which can then be found in ~/Scrake/Servers
     45 scraketools/scrake.sh create Normal Hard Suicidal
     46 
     47 # (Optionally) Install maps/mutators (see below)
     48 for INSTANCE in Normal Hard Suicidal; do
     49 	scraketools/scrake.sh mod $INSTANCE mutator add <mut1> <mut2> ...
     50 	scraketools/scrake.sh mod $INSTANCE map add <mut1> <mut2> ...
     51 done
     52 
     53 # Edit the default configuration in Scrake/scrake.ini (see below)
     54 cp scraketools/scrake.ini Scrake/scrake.ini
     55 
     56 # Apply scraketools/scrake.ini to each instance
     57 scraketools/scrake.sh sync Normal Hard Suicidal
     58 
     59 # Run servers
     60 for INSTANCE in Normal Hard Suicidal; do
     61 	scraketools/scrake.sh run $INSTANCE KF-Wyre.rom &
     62 done
     63 ```
     64 From here, you may make changes to Scrake/scrake.ini and re-sync them to each instance.
     65 Note that the server must not be running while you run the `sync` command; it has been known
     66 to overwrite the active configuration file while up, undoing the changes applied by `sync`.
     67 
     68 # Configuration
     69 What follows is an incomplete copy of the example configuration file bundled with scraketools
     70 ```
     71 [Scrake]
     72 Engine.AccessControl/AdminPassword=Admin123
     73 +Engine.GameInfo/bVACSecured=True
     74 -Engine.GameEngine/ServerActors=IpDrv.MasterServerUplink
     75 
     76 [Scrake.Normal]
     77 URL/Port=7707
     78 IpDrv.UdpGamespyQuery/OldQueryPortNumber=7717
     79 Engine.GameInfo/GameDifficulty=2
     80 
     81 [Scrake.Hard]
     82 URL/Port=7807
     83 IpDrv.UdpGamespyQuery/OldQueryPortNumber=7817
     84 Engine.GameInfo/GameDifficulty=4
     85 
     86 [Scrake.Suicidal]
     87 URL/Port=7907
     88 IpDrv.UdpGamespyQuery/OldQueryPortNumber=7917
     89 Engine.GameInfo/GameDifficulty=5
     90 ```
     91 scrake.ini defines overrides applied to an individual instance's System/*.ini files.
     92 Each override takes the form:
     93 [modifier]Section/Key=Value
     94 Where modifier may be one of '+', '-', or unspecified.
     95 scrake.sh alters the value of any matching configuration key in the specified section to
     96 the new value specified in scrake.ini. The overrides are applied to each System/*.ini file.
     97 If the override specifies a section/key that does not appear in the configuration file, it is silently ignored.
     98 
     99 The '+' modifier instructs scrake.sh to add a new key-value pair to the specified section
    100 The '-' modifier makes scrake.sh remove a key-value pair from the specified action if the given value matches exactly.
    101 
    102 Overrides from the [Scrake] section are applied to any and all instances supplied to the `sync` command.
    103 Overrides from any section that takes the form [Scrake.<instance>] are only applied to the corresponding instance.
    104 
    105 LIMITATION: the order of the sections in scrake.ini matters; the last encountered override will be applied last.
    106 LIMITATION: there MUST be a blank line between the any given final key-value pair and next section.
    107 
    108 CONFIGURATION NOTE (if you followed the extra steps in the Quickstart):
    109 	By default, some values like Engine.GameInfo/bVACSecured and Engine.GameInfo/GameDifficulty do not appear in the default
    110 	configuration, and so they must possess the '+' modifier in scrake.ini in order to be added.
    111 	However, if you ran the webadmin console on the base installation and pressed 'Save', Killing Floor will have
    112 	added these values to KillingFloor.ini itself, which leads to the '+' modifier creating duplicate values,
    113 	most likely ignoring your overrides. You must instead override these values with no modifier, so that
    114 	scrake.sh alters the default, instead of adding a duplicate. I am working on fixing this.
    115 
    116 # Migrating from an existing setup (Untested)
    117 scrake.sh's behaviour may be modified by changing various configuration variables. Amongst these is SCRAKE_BASE, which
    118 points to the default server installation path out of the box (~/.steam/SteamApps/common/Killing Floor Dedicated Server - Linux)
    119 
    120 After changing SCRAKE_BASE to the root directory of your existing server installation, scrake.sh will create new instances
    121 using the specified installation as the base.
    122 
    123 In testing, scrake.sh has never corrupted or altered the base server installation (besides alterations made by `init`, which,
    124 if you're consulting this section, you wouldn't execute). Regardless, consider making a copy of your server installation while
    125 testing out this experimental software.
    126 
    127 # Adding or removing maps and mutators
    128 Add mutators or maps to Scrake/Mutators/<Mutname> or Scrake/Maps/<Mapname>. The contents of <Mutname> and <Mapname> should correspond
    129 to the directory structure of the base installation. For example:
    130 	Scrake/Maps/
    131 		Affairs/
    132 			Maps/
    133 				KF-Affairs.rom
    134 		Arcade-Hardcore/
    135 			Maps/
    136 				KF-Arcade-Hardcore.rom
    137 or:
    138 	Scrake/Mutators/
    139 		CustomServerDetails/
    140 			System/
    141 				CustomServerDetails.ini
    142 				CustomServerDetails.u
    143 etc.
    144 
    145 TODO: write a script to 'install' maps and mutators to the corresponding directories with the correct directory structure.
    146 
    147 Now the maps and mutators can be installed by executing:
    148 scraketools/scrake.sh mod Normal mutator add CustomServerDetails
    149 scraketools/scrake.sh mod Normal map add Affairs Arcade-Hardcore
    150 
    151 # Finally... how does it work?
    152 scrake.sh creates instances by re-creating the directory structure of the base server software, and then symbolically linking
    153 every single file over. The links to configuration files in System are renamed from *.ini to *.ini.defaults. The `sync` command
    154 then applies the configuration overrides from scrake.ini to each *.ini.defaults file, writing them to the 'real' configuration file,
    155 KillingFloor.ini . This allows for several server instances to run in tandem from only a single base server installation.
    156 
    157 One might imagine that, through the help of a tool such as `sshfs`, one could run an arbitrary number of Killing Floor servers
    158 spread across a variety of machines on a DMZ, all from one installation.
    159 
    160 # Next on the chopping block
    161 - There needs to be a more robust solution for applying overrides from scrake.ini to the individual server configurations. Currently,
    162 	defining map lists or custom sections is just straight up out of the question.
    163 - I'm currently tearing my hair out about whether to ship a sane default KillingFloor.ini with scraketools, or whether to continue
    164 	trying to programmatically wrangle the server binary to just cough up the "full" configuration during setup. I'm not quite
    165 	decided on that yet.
    166 - It should not be difficult at all to write a script to install maps/mutators to Scrake and 'guess' the correct directory structure
    167 	from the contents of the zip/rar/7z/whatever.
    168 
    169 # Features beyond the horizon
    170 - Automatic synchronisation of banlists
    171 - systemd unit file generation
    172 - FastDL manager
    173 - Status watchdog & log analyser
    174