├── .ansible-lint
├── .gitattributes
├── .githooks
└── pre-commit
├── .github
├── FUNDING.yml
└── workflows
│ ├── almalinux-8.yml
│ ├── almalinux-9.yml
│ ├── fedora-40.yml
│ ├── fedora-41.yml
│ ├── lint.yml
│ ├── ubuntu-22.04.yml
│ └── ubuntu-24.04.yml
├── .gitignore
├── .yamllint
├── CHANGELOG.md
├── LICENSE
├── README.md
├── ansible.cfg
├── common.sh
├── group_vars
└── all
│ └── vars.yml
├── hosts
└── placeholder
├── img
├── install.png
├── logo-small.png
├── logo.png
└── uninstall.png
├── install.sh
├── install.yml
├── requirements.yml
├── roles
├── install
│ ├── files
│ │ ├── Config
│ │ │ ├── My-Cycles.csv
│ │ │ ├── My-KFWeb.ini
│ │ │ ├── My-KFWebAdmin.ini
│ │ │ ├── My-LinuxServer-KFEngine.ini
│ │ │ ├── My-LinuxServer-KFGame.ini
│ │ │ ├── My-Maps.csv
│ │ │ ├── My-Mutators.csv
│ │ │ ├── My-Startup.conf
│ │ │ └── autokick.json
│ │ ├── check-log-throttling
│ │ ├── firewalld-denied.conf
│ │ ├── kf2-sudo
│ │ ├── kf2autokick-sudo
│ │ ├── kf2watchdog-sudo
│ │ ├── killinuxfloor.te
│ │ ├── sedeploy.sh
│ │ └── serveradmin.patch
│ ├── handlers
│ │ └── main.yml
│ ├── tasks
│ │ ├── autokick.yml
│ │ ├── config.yml
│ │ ├── epel.yml
│ │ ├── firewalld.yml
│ │ ├── flavor.yml
│ │ ├── init.yml
│ │ ├── kf2-classic.yml
│ │ ├── kf2-retail.yml
│ │ ├── kf2.yml
│ │ ├── killinuxfloor.yml
│ │ ├── main.yml
│ │ ├── os.yml
│ │ ├── steam.yml
│ │ ├── sudo.yml
│ │ ├── systemd.yml
│ │ └── user.yml
│ ├── templates
│ │ ├── kf2.service.j2
│ │ ├── kf2autokick.service.j2
│ │ ├── kf2watchdog.service.j2
│ │ ├── killinuxfloor.cil.j2
│ │ ├── yarn.list.j2
│ │ └── yarn.repo.j2
│ └── vars
│ │ └── main.yml
└── uninstall
│ ├── handlers
│ └── main.yml
│ ├── tasks
│ ├── autokick.yml
│ ├── config.yml
│ ├── firewalld.yml
│ ├── kf2.yml
│ ├── killinuxfloor.yml
│ ├── main.yml
│ ├── selinux.yml
│ ├── sudo.yml
│ └── systemd.yml
│ └── vars
│ └── main.yml
├── share
├── kf2watchdog
└── killinuxfloor
├── test.sh
├── uninstall.sh
├── uninstall.yml
└── update.sh
/.ansible-lint:
--------------------------------------------------------------------------------
1 | ---
2 | skip_list:
3 | - git-latest
4 | - package-latest
5 | - fqcn[action]
6 | - fqcn[action-core]
7 | - yaml[comments] # TODO how do I restrict this to just require-starting-space?
8 | - yaml[line-length]
9 | - name # this is covered by yamllint with exceptions on include_role
10 | - risky-shell-pipe
11 | - schema[tasks] # TODO ansible-lint randomly complains, e.g. it/tftpd
12 | - role-name
13 | - schema[meta] # TODO ansible-lint believes the official dependency syntax is wrong
14 | - meta-no-info # we leave platform empty
15 | - var-naming[no-role-prefix] # TODO
16 | - var-naming[no-reserved] # TODO
17 | - partial-become[task] # become is defined at the playbook level
18 |
--------------------------------------------------------------------------------
/.gitattributes:
--------------------------------------------------------------------------------
1 | *.yml linguist-detectable=true
2 |
--------------------------------------------------------------------------------
/.githooks/pre-commit:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | yamllint --strict .
4 | ansible-lint --strict --offline
5 |
--------------------------------------------------------------------------------
/.github/FUNDING.yml:
--------------------------------------------------------------------------------
1 | ---
2 | # These are supported funding model platforms
3 |
4 | github: # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]
5 | patreon: Noobient
6 | open_collective: # Replace with a single Open Collective username
7 | ko_fi: # Replace with a single Ko-fi username
8 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel
9 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry
10 | liberapay: # Replace with a single Liberapay username
11 | issuehunt: # Replace with a single IssueHunt username
12 | otechie: # Replace with a single Otechie username
13 | lfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry
14 | custom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']
15 |
--------------------------------------------------------------------------------
/.github/workflows/almalinux-8.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: AlmaLinux 8
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | ansible-ci:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Test Galaxy role
19 | run: >
20 | CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro
21 | --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-almalinux:8) &&
22 | podman exec ${CONT_ID} /bin/bash -c
23 | "./install.sh --extra-vars 'skip_kfgame=true' <<< y &&
24 | ./uninstall.sh <<< y &&
25 | ./install.sh --extra-vars 'skip_kfgame=true kf2_classic=true' <<< y" &&
26 | podman stop ${CONT_ID}
27 |
--------------------------------------------------------------------------------
/.github/workflows/almalinux-9.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: AlmaLinux 9
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | ansible-ci:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Test Galaxy role
19 | run: >
20 | CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro
21 | --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-almalinux:9) &&
22 | podman exec ${CONT_ID} /bin/bash -c
23 | "./install.sh --extra-vars 'skip_kfgame=true' <<< y &&
24 | ./uninstall.sh <<< y &&
25 | ./install.sh --extra-vars 'skip_kfgame=true kf2_classic=true' <<< y" &&
26 | podman stop ${CONT_ID}
27 |
--------------------------------------------------------------------------------
/.github/workflows/fedora-40.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Fedora 40
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | ansible-ci:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Test Galaxy role
19 | run: >
20 | CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro
21 | --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-fedora:40) &&
22 | podman exec ${CONT_ID} /bin/bash -c
23 | "./install.sh --extra-vars 'skip_kfgame=true' <<< y &&
24 | ./uninstall.sh <<< y &&
25 | ./install.sh --extra-vars 'skip_kfgame=true kf2_classic=true' <<< y" &&
26 | podman stop ${CONT_ID}
27 |
--------------------------------------------------------------------------------
/.github/workflows/fedora-41.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Fedora 41
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | ansible-ci:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Test Galaxy role
19 | run: >
20 | CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro
21 | --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-fedora:41) &&
22 | podman exec ${CONT_ID} /bin/bash -c
23 | "./install.sh --extra-vars 'skip_kfgame=true' <<< y &&
24 | ./uninstall.sh <<< y &&
25 | ./install.sh --extra-vars 'skip_kfgame=true kf2_classic=true' <<< y" &&
26 | podman stop ${CONT_ID}
27 |
--------------------------------------------------------------------------------
/.github/workflows/lint.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Lint
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | lint:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Lint sources
19 | run: >
20 | podman run --rm -v ${{ github.workspace }}:/repo bviktor/ansible-systemd-lint:latest /bin/bash -c
21 | "git config --global --add safe.directory /repo &&
22 | yamllint --strict . &&
23 | ansible-lint --strict"
24 |
--------------------------------------------------------------------------------
/.github/workflows/ubuntu-22.04.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Ubuntu 22.04
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | ansible-ci:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Test Galaxy role
19 | run: >
20 | CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro
21 | --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-ubuntu:22.04) &&
22 | podman exec ${CONT_ID} /bin/bash -c
23 | "./install.sh --extra-vars 'skip_kfgame=true' <<< y &&
24 | ./uninstall.sh <<< y &&
25 | ./install.sh --extra-vars 'skip_kfgame=true kf2_classic=true' <<< y" &&
26 | podman stop ${CONT_ID}
27 |
--------------------------------------------------------------------------------
/.github/workflows/ubuntu-24.04.yml:
--------------------------------------------------------------------------------
1 | ---
2 | name: Ubuntu 24.04
3 |
4 | on: # yamllint disable-line rule:truthy
5 | push:
6 | branches:
7 | - main
8 | - master
9 | pull_request:
10 | branches: []
11 |
12 | jobs:
13 | ansible-ci:
14 | runs-on: ubuntu-latest
15 | steps:
16 | - name: Obtain sources
17 | uses: actions/checkout@v3
18 | - name: Test Galaxy role
19 | run: >
20 | CONT_ID=$(podman run --rm -v ${{ github.workspace }}:/repo -v /sys/fs/cgroup:/sys/fs/cgroup:ro
21 | --tmpfs /tmp --tmpfs /run --privileged --detach bviktor/ansible-systemd-ubuntu:24.04) &&
22 | podman exec ${CONT_ID} /bin/bash -c
23 | "./install.sh --extra-vars 'skip_kfgame=true' <<< y &&
24 | ./uninstall.sh <<< y &&
25 | ./install.sh --extra-vars 'skip_kfgame=true kf2_classic=true' <<< y" &&
26 | podman stop ${CONT_ID}
27 |
--------------------------------------------------------------------------------
/.gitignore:
--------------------------------------------------------------------------------
1 | ansible.log
2 | hosts/*.host
3 |
--------------------------------------------------------------------------------
/.yamllint:
--------------------------------------------------------------------------------
1 | ---
2 | extends: default
3 |
4 | rules:
5 | braces:
6 | max-spaces-inside: 1
7 | comments:
8 | min-spaces-from-content: 1
9 | require-starting-space: false
10 | line-length: disable
11 |
--------------------------------------------------------------------------------
/CHANGELOG.md:
--------------------------------------------------------------------------------
1 | ## killinuxfloor 3.0 (2023-03-07)
2 |
3 | * Add DDoS protection
4 | * Add optional DDoS stats via `klf ddos` command
5 | * Add many details to `klf workshop` report
6 | * Add Unofficial Killing Floor 2 Patch
7 | * Add `update.sh` script to update killinuxfloor installation
8 | * Fix Steam Workshop downloads
9 | * Fix KF2 restart loop when startup includes workshop items not downloaded yet
10 | * Fix various issues when installing in a container
11 | * Fix missing workshop items when trailing newline is missing in config files
12 | * Fix various commands overriding symlinks in config
13 | * Fix SELinux deny actions on startup config
14 | * Fix Ansible Galaxy dependencies being downloaded twice during install
15 |
16 | ## killinuxfloor 2.0 (2022-12-22)
17 |
18 | * Add option to install KF2 in Classic mode (Infinite Onslaught update)
19 | * Add AlmaLinux, Fedora, Ubuntu support
20 | * Add watchdog support via `killinuxfloor watchdog`
21 | * Add GeoIP and Steam profile links in webadmin player list
22 | * Add `killinuxfloor apply` command
23 | * Port installer and uninstaller to Ansible
24 | * Update Node.js to 18
25 | * Update .NET to 6
26 | * Remove CentOS support
27 |
28 | ## killinuxfloor 1.1 (2019-05-15)
29 |
30 | * Add support for bans via `killinuxfloor ban` command
31 | * Fix failing Workshop downloads caused by old Steam libraries shipped with KF2
32 | * Fix failing `killinuxfloor status` when KF2 isn't running
33 | * Fix webadmin erroneously allowing changes to automatically generated map cycles
34 |
35 | ## killinuxfloor 1.0 (2019-01-11)
36 |
37 | * Initial release
38 |
--------------------------------------------------------------------------------
/LICENSE:
--------------------------------------------------------------------------------
1 | MIT License
2 |
3 | Copyright (c) 2017-2023 Viktor Berke
4 |
5 | Permission is hereby granted, free of charge, to any person obtaining a copy
6 | of this software and associated documentation files (the "Software"), to deal
7 | in the Software without restriction, including without limitation the rights
8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9 | copies of the Software, and to permit persons to whom the Software is
10 | furnished to do so, subject to the following conditions:
11 |
12 | The above copyright notice and this permission notice shall be included in all
13 | copies or substantial portions of the Software.
14 |
15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21 | SOFTWARE.
22 |
--------------------------------------------------------------------------------
/README.md:
--------------------------------------------------------------------------------
1 | 
2 |
3 | | Platform | Support | Status |
4 | |---|---|---|
5 | | Linter | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/lint.yml) |
6 | | AlmaLinux 8 | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/almalinux-8.yml) |
7 | | AlmaLinux 9 | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/almalinux-9.yml) |
8 | | Fedora 40 | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/fedora-40.yml) |
9 | | Fedora 41 | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/fedora-41.yml) |
10 | | Ubuntu 22.04 | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/ubuntu-22.04.yml) |
11 | | Ubuntu 24.04 | ✅ | [](https://github.com/noobient/killinuxfloor/actions/workflows/ubuntu-24.04.yml) |
12 |
13 | # Documentation
14 |
15 | * **[killinuxfloor – Killing Floor 2 Server on Linux](https://noobient.com/2019/01/11/killinuxfloor-killing-floor-2-server-on-linux/)**
16 | * [Playing on the Noobient Killing Floor 2 Servers](https://noobient.com/2018/08/09/playing-on-the-noobient-killing-floor-2-servers/)
17 |
--------------------------------------------------------------------------------
/ansible.cfg:
--------------------------------------------------------------------------------
1 | [defaults]
2 | host_key_checking = false
3 | inventory = hosts/
4 | localhost_warning = false
5 | log_path = ansible.log
6 | force_color= true
7 |
--------------------------------------------------------------------------------
/common.sh:
--------------------------------------------------------------------------------
1 | function check_os ()
2 | {
3 | apt --version &> /dev/null && export PKG_MGR='apt' || export PKG_MGR='dnf'
4 | }
5 |
6 | function check_sudo ()
7 | {
8 | CAN_SUDO=0
9 | sudo --version > /dev/null 2>&1 && CAN_SUDO=1
10 |
11 | if [ ${CAN_SUDO} -ne 1 ]
12 | then
13 | RUNNER=$(id --user)
14 | if [ ${RUNNER} -ne 0 ]
15 | then
16 | echo "Error! You are not root and sudo is unavailable!"
17 | exit 1
18 | else
19 | "${PKG_MGR}" -y -q install sudo > /dev/null
20 | fi
21 | fi
22 | }
23 |
24 | function check_epel ()
25 | {
26 | FEDORA=0
27 | grep 'ID=fedora' /etc/os-release > /dev/null && FEDORA=1 || true
28 |
29 | if [ "${FEDORA}" -ne 1 ] && [ "${PKG_MGR}" != 'apt' ]
30 | then
31 | sudo "${PKG_MGR}" -y -q install epel-release > /dev/null
32 | fi
33 | }
34 |
35 | function install_ansible ()
36 | {
37 | if [ "${PKG_MGR}" == 'apt' ]
38 | then
39 | sudo "${PKG_MGR}" -y -q install software-properties-common > /dev/null
40 | sudo add-apt-repository -y ppa:ansible/ansible > /dev/null
41 | fi
42 |
43 | sudo DEBIAN_FRONTEND=noninteractive "${PKG_MGR}" -y -q install ansible > /dev/null
44 | ansible-galaxy install --force -r requirements.yml
45 | }
46 |
47 | function find_ip ()
48 | {
49 | if [ "${PKG_MGR}" == 'apt' ]
50 | then
51 | IP_PKG='iproute2'
52 | else
53 | IP_PKG='iproute'
54 | fi
55 |
56 | sudo DEBIAN_FRONTEND=noninteractive "${PKG_MGR}" -y -q install "${IP_PKG}" > /dev/null
57 |
58 | export IP_ADDR=$(ip -4 a s | grep inet | grep -v '127\.0\.0' | awk '{print $2}' | cut -d'/' -f1)
59 | }
60 |
61 | function init_klf ()
62 | {
63 | check_os
64 | check_sudo
65 | check_epel
66 | install_ansible
67 | find_ip
68 | }
69 |
--------------------------------------------------------------------------------
/group_vars/all/vars.yml:
--------------------------------------------------------------------------------
1 | ---
2 | steam_home: /home/steam
3 | kf2_classic: false
4 | skip_kfgame: false
5 | semodule_dir: /usr/local/etc/selinux/modules
6 |
--------------------------------------------------------------------------------
/hosts/placeholder:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noobient/killinuxfloor/cdebb297ffbcf97132eb57588d7bef76c4180672/hosts/placeholder
--------------------------------------------------------------------------------
/img/install.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noobient/killinuxfloor/cdebb297ffbcf97132eb57588d7bef76c4180672/img/install.png
--------------------------------------------------------------------------------
/img/logo-small.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noobient/killinuxfloor/cdebb297ffbcf97132eb57588d7bef76c4180672/img/logo-small.png
--------------------------------------------------------------------------------
/img/logo.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noobient/killinuxfloor/cdebb297ffbcf97132eb57588d7bef76c4180672/img/logo.png
--------------------------------------------------------------------------------
/img/uninstall.png:
--------------------------------------------------------------------------------
https://raw.githubusercontent.com/noobient/killinuxfloor/cdebb297ffbcf97132eb57588d7bef76c4180672/img/uninstall.png
--------------------------------------------------------------------------------
/install.sh:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | set -eu
4 |
5 | read -p $'This will install killinuxfloor on this machine. Press \e[36my\e[0m to continue: ' -n 1 -r
6 | echo
7 | if [[ ! $REPLY =~ ^[Yy]$ ]]
8 | then
9 | echo 'Installation cancelled.'
10 | exit
11 | fi
12 |
13 | export ROOT="${BASH_SOURCE%/*}"
14 | source "${ROOT}/common.sh"
15 |
16 | init_klf
17 |
18 | if [ $# -ge 1 ] && [ $1 == '--classic' ]
19 | then
20 | shift
21 | ansible-playbook "${ROOT}/install.yml" --extra-vars "kf2_classic=True" "$@"
22 | else
23 | ansible-playbook "${ROOT}/install.yml" "$@"
24 | fi
25 |
26 | echo -e "\e[32mkillinuxfloor successfully installed!\e[0m"
27 | echo
28 | echo -e "You may now manage your KF2 server with the \e[36msteam\e[0m user."
29 | echo -e "To switch to the steam user, use \e[36msudo -iu steam\e[0m. Switch back with \e[36mexit\e[0m."
30 | echo -e "The configuration files can be found under \e[36m/home/steam/Config\e[0m."
31 | echo "If you have previous config backed up, you may restore them now."
32 | echo
33 | echo "List of config files:"
34 | echo -e "\e[36mMy-Cycles.csv\e[0m - User defined map cycles"
35 | echo -e "\e[33mMy-KFWeb.ini\e[0m - Webadmin settings"
36 | echo -e "\e[33mMy-KFWebAdmin.ini\e[0m - Webadmin settings"
37 | echo -e "\e[33mMy-LinuxServer-KFEngine.ini\e[0m - Starting map, takeover, etc."
38 | echo -e "\e[33mMy-LinuxServer-KFGame.ini\e[0m - Password, difficulty, length, etc."
39 | echo -e "\e[36mMy-Maps.csv\e[0m - Subscribed workshop maps"
40 | echo -e "\e[36mMy-Mutators.csv\e[0m - Subscribed workshop mutators"
41 | echo -e "\e[36mMy-Startup.conf\e[0m - Mutators to load at startup"
42 | echo -e "\e[36mautokick.json\e[0m - Auto-kick bot settings"
43 | echo
44 | echo -e "Files marked in \e[33myellow\e[0m are for all the game/server options provided by Tripwire."
45 | echo "Now they contain a few cherry-picked settings, but you can add any internal option here."
46 | echo
47 | echo -e "\e[36mkillinuxfloor\e[35m Command Reference:\e[0m run \e[36mklf help\e[0m."
48 | echo -e "\e[35mKF2 Options Reference:\e[0m see the \e[36m/home/steam/Config/Internal\e[0m counterparts (but don't edit those)."
49 | echo -e "\e[35mApplying KF2 Changes:\e[0m edit the \e[36mMy-*\e[0m files, then run \e[36mklf apply\e[0m."
50 | echo -e "\e[35mApplying Auto-Kick Changes:\e[0m edit \e[36mautokick.json\e[0m, then run \e[36mklf autokick restart\e[0m."
51 | echo
52 | echo -e "\e[35mWebadmin Access:\e[0m"
53 | echo -e "* Address:\e[36m http://${IP_ADDR}:8080/\e[0m (IP auto-detected, might differ)"
54 | echo -e "* Username:\e[36m Admin\e[0m"
55 | echo -e "* Password:\e[36m YOURPASSWORDHERE\e[0m"
56 | echo
57 | echo -e "\e[31mDon't forget to change \e[36mAdminPassword\e[31m in \e[33mMy-LinuxServer-KFGame.ini\e[31m, then \e[36mklf apply\e[31m!\e[0m"
58 |
--------------------------------------------------------------------------------
/install.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - hosts: "{{ target | default('127.0.0.1') }}"
3 | connection: "{% if target is defined %}ssh{% else %}local{% endif %}"
4 | become: true
5 | roles:
6 | - install
7 |
--------------------------------------------------------------------------------
/requirements.yml:
--------------------------------------------------------------------------------
1 | ---
2 | - src: noobient.firewalld
3 | - src: noobient.github_release
4 | - src: noobient.logrotate
5 | - src: noobient.selinux_cil
6 | - src: noobient.servicecheck
7 | - src: noobient.thirdparty
8 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-Cycles.csv:
--------------------------------------------------------------------------------
1 | # Maps on the same line will be in the same cycle.
2 | # Separate maps with a comma.
3 | # Don't add spaces before or after commas.
4 | # Lines starting with # will be ignored.
5 | # Run "killinuxfloor apply" to apply your changes.
6 |
7 | KF-HorzineArenaRMEdition,KF-KrampusLair
8 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-KFWeb.ini:
--------------------------------------------------------------------------------
1 | # Uncomment the lines that you want to have applied to your server's config.
2 | # Run "killinuxfloor apply" to apply your changes.
3 | # For an explanation on the various options, refer to:
4 | # https://wiki.tripwireinteractive.com/index.php?title=Dedicated_Server_%28Killing_Floor_2%29
5 |
6 | [IpDrv.WebServer]
7 | # This setting enables webadmin. Don't forget to set AdminPassword in My-LinuxServer-KFGame.ini, too.
8 | # Make sure you also open port 8080 on the firewall:
9 | # sudo firewall-cmd --add-port=8080/tcp --permanent
10 | # sudo firewall-cmd --reload
11 | # You have to issue the above command with your regular user, not with 'steam'.
12 | # Then you can access your webadmin via http://YOUR_IP:8080/
13 | bEnabled=true
14 |
15 | # Setting this too low will cause webadmin to stop responding after a while.
16 | # 64 seems to work pretty well.
17 | MaxConnections=64
18 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-KFWebAdmin.ini:
--------------------------------------------------------------------------------
1 | # Uncomment the lines that you want to have applied to your server's config.
2 | # Run "killinuxfloor apply" to apply your changes.
3 | # For an explanation on the various options, refer to:
4 | # https://wiki.tripwireinteractive.com/index.php?title=Dedicated_Server_%28Killing_Floor_2%29
5 |
6 | [WebAdmin.WebAdmin]
7 | # HTTP auth is required for the auto-kick bot to work.
8 | bHttpAuth=True
9 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-LinuxServer-KFEngine.ini:
--------------------------------------------------------------------------------
1 | # Uncomment the lines that you want to have applied to your server's config.
2 | # Run "killinuxfloor apply" to apply your changes.
3 | # For an explanation on the various options, refer to:
4 | # https://wiki.tripwireinteractive.com/index.php?title=Dedicated_Server_%28Killing_Floor_2%29
5 |
6 | [URL]
7 | # Map to start KF2 server with. Ignored if you set the map in My-Startup.conf.
8 | #ServerLocalMap=KF-KrampusLair
9 |
10 | [Engine.GameEngine]
11 | # Enable or disable server takeover.
12 | bUsedForTakeover=FALSE
13 |
14 | [IpDrv.TcpNetDriver]
15 | # required for workshop downloads, you shouldn't touch this
16 | DownloadManagers=OnlineSubsystemSteamworks.SteamWorkshopDownload
17 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-LinuxServer-KFGame.ini:
--------------------------------------------------------------------------------
1 | # Uncomment the lines that you want to have applied to your server's config.
2 | # Run "killinuxfloor apply" to apply your changes.
3 | # For an explanation on the various options, refer to:
4 | # https://wiki.tripwireinteractive.com/index.php?title=Dedicated_Server_%28Killing_Floor_2%29
5 |
6 | [Engine.GameInfo]
7 | # 0 = Normal, 1 = Hard, 2 = Suicidal, 3 = HoE
8 | #GameDifficulty=2.000000
9 |
10 | [Engine.AccessControl]
11 | # Webadmin is disabled until you set AdminPassword.
12 | AdminPassword=YOURPASSWORDHERE
13 | #GamePassword=foobar
14 |
15 | [KFGame.KFGameInfo]
16 | # 0 = 4 waves, 1 = 7 waves, 2 = 10 waves
17 | #GameLength=1
18 | #ActiveMapCycle=0
19 | BannerLink=https://i.imgur.com/GoiGeCH.png
20 | ServerMOTD=Welcome to another Killing Floor 2 server proudly hosted by killinuxfloor!
21 | WebsiteLink=https://github.com/noobient/killinuxfloor
22 | #ClanMotto=
23 | #bDisableTeamCollision=True
24 |
25 | [Engine.GameReplicationInfo]
26 | ServerName=killinuxfloor KF2 Server
27 | ShortName=killinuxfloor
28 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-Maps.csv:
--------------------------------------------------------------------------------
1 | # List of maps you want to have installed.
2 | # Add entries in "id,name" format, one map per line, without quotes.
3 | #
4 | # - name = filename of the map without the .kfm extension
5 | # - id = displayed on the workshop page in the url as ?id=
6 | #
7 | # Don't add spaces before or after commas.
8 | # Lines starting with # will be ignored.
9 | # Run "killinuxfloor apply" to apply your changes.
10 | # When new maps finish downloading, the server restarts automatically once more.
11 |
12 | 838775511,KF-HorzineArenaRMEdition
13 | 1210703659,KF-KillingPool
14 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-Mutators.csv:
--------------------------------------------------------------------------------
1 | # List of mutators you want to have installed.
2 | # This won't load the mutators, just installs them.
3 | # Add entries in "id" format, one mutator per line, without quotes.
4 | #
5 | # id = displayed on the workshop page in the url as ?id=
6 | #
7 | # Don't add spaces before or after.
8 | # Lines starting with # will be ignored.
9 | # Run "killinuxfloor apply" to apply your changes.
10 | # When new mutators finish downloading, the server restarts once more automatically.
11 |
12 | # Maxplayers Mutator - replaced by UKFP
13 | #2143104493
14 |
15 | # Classic Scoreboard - deleted from workshop due to bug
16 | #1132884083
17 |
18 | # Display Damage
19 | 2625647922
20 |
21 | # UKFP
22 | 2875147606
23 |
--------------------------------------------------------------------------------
/roles/install/files/Config/My-Startup.conf:
--------------------------------------------------------------------------------
1 | # This is your Killing Floor 2 startup command line. This controls what mutators
2 | # and game modes are loaded automatically during startup. You can also change
3 | # your mutators in webadmin on-the-fly via "Change Map / Additional URL Variables".
4 | #
5 | # Please note that if you're trying to load workshop items here that have not
6 | # been downloaded yet, the command line will be ignored. Otherwise the server
7 | # would just enter a restart loop as it'd keep trying to load files that are not
8 | # present. Just check download status with 'klf status workshop', and once the
9 | # downloads have finished, restart with 'klf restart'.
10 | #
11 | # Example to start with KF-KillingPool, plus enable Display Damage and UKFP mutators, finally add some UKFP options:
12 | #
13 | # KF-KillingPool?game=KFGameContent.KFGameInfo_Endless?Mutator=DamageDisplay.DmgMut,UnofficialKFPatch.UKFPMutator?MaxPlayers=32?LoadFHUD=1?LoadYAS=1?LoadAAL=1?NoEventSkins=1?NoEDARs=1?BroadcastPickups=1?CurrentWeekly=19
14 | #
15 | # For a list of UKFP options, see:
16 | #
17 | # https://steamcommunity.com/sharedfiles/filedetails/?id=2875577642
18 | #
19 | # For more examples, please refer to:
20 | #
21 | # https://wiki.killingfloor2.com/index.php?title=Dedicated_Server_(Killing_Floor_2)#Game_Modes
22 | #
23 | # This file must contain only one line that does not start with a comment (#).
24 | # If more than one line is present, the first one is used.
25 | #
26 | # IMPORTANT NOTE: due to KF2 bug, your server might become deranked when loading
27 | # mutators, even if they're whitelisted. If this happens, check if the
28 | #
29 | # /home/steam/Steam/KF2Server/Binaries/Win64/balance_tweaks.bin
30 | #
31 | # file exists. If not, grab a fresh copy from
32 | #
33 | # C:\Program Files (x86)\Steam\steamapps\common\killingfloor2\Binaries\Win64\balance_tweaks.bin
34 | #
35 | # and it should become ranked again.
36 |
37 | KF-KillingPool?game=KFGameContent.KFGameInfo_Endless
38 |
--------------------------------------------------------------------------------
/roles/install/files/Config/autokick.json:
--------------------------------------------------------------------------------
1 | {
2 | "servers": ["http://127.0.0.1:8080"],
3 | "basicAuthorization": "Admin:YOURPASSWORDHERE",
4 | "intervalCheck": 5000,
5 | "action": "kick",
6 | "minLevel": 0,
7 | "warnings": true,
8 | "warningPeriod": 20000,
9 | "warningMessage": "Minimum level is 0. Please switch perk or you'll be auto-kicked in 20 seconds."
10 | }
11 |
--------------------------------------------------------------------------------
/roles/install/files/check-log-throttling:
--------------------------------------------------------------------------------
1 | #!/bin/bash
2 |
3 | /bin/grep -m 1 'messages lost due to rate-limiting' /var/log/messages | awk -F'[()]' '{print $2}'
4 |
--------------------------------------------------------------------------------
/roles/install/files/firewalld-denied.conf:
--------------------------------------------------------------------------------
1 | :msg, regex, ".*_DROP: .* DPT=7777 .*" {
2 | action(type="omfile" file="/var/log/firewalld-denied-kf2.log" fileOwner="steam" fileGroup="steam")
3 | stop
4 | }
5 |
6 | :msg, regex, ".*_REJECT: .* DPT=7777 .*" {
7 | action(type="omfile" file="/var/log/firewalld-denied-kf2.log" fileOwner="steam" fileGroup="steam")
8 | stop
9 | }
10 |
11 | :msg, contains, "_DROP: " {
12 | action(type="omfile" file="/var/log/firewalld-denied.log" fileOwner="steam" fileGroup="steam")
13 | stop
14 | }
15 |
16 | :msg, contains, "_REJECT: " {
17 | action(type="omfile" file="/var/log/firewalld-denied.log" fileOwner="steam" fileGroup="steam")
18 | stop
19 | }
20 |
--------------------------------------------------------------------------------
/roles/install/files/kf2-sudo:
--------------------------------------------------------------------------------
1 | %steam ALL=NOPASSWD: /bin/systemctl start kf2.service
2 | %steam ALL=NOPASSWD: /bin/systemctl stop kf2.service
3 | %steam ALL=NOPASSWD: /bin/systemctl restart kf2.service
4 | %steam ALL=NOPASSWD: /bin/systemctl status kf2.service
5 | %steam ALL=NOPASSWD: /bin/journalctl --system --unit=kf2.service --follow
6 | %steam ALL=NOPASSWD: /bin/systemctl daemon-reload
7 | %steam ALL=NOPASSWD: /usr/bin/firewall-cmd --get-log-denied
8 | %steam ALL=NOPASSWD: /usr/bin/firewall-cmd --set-log-denied=all
9 | %steam ALL=NOPASSWD: /usr/bin/firewall-cmd --set-log-denied=off
10 | %steam ALL=NOPASSWD: /usr/local/bin/check-log-throttling
11 |
--------------------------------------------------------------------------------
/roles/install/files/kf2autokick-sudo:
--------------------------------------------------------------------------------
1 | %steam ALL=NOPASSWD: /bin/systemctl start kf2autokick.service
2 | %steam ALL=NOPASSWD: /bin/systemctl stop kf2autokick.service
3 | %steam ALL=NOPASSWD: /bin/systemctl restart kf2autokick.service
4 | %steam ALL=NOPASSWD: /bin/systemctl status kf2autokick.service
5 | %steam ALL=NOPASSWD: /bin/journalctl --system --unit=kf2autokick.service --follow
6 |
--------------------------------------------------------------------------------
/roles/install/files/kf2watchdog-sudo:
--------------------------------------------------------------------------------
1 | %steam ALL=NOPASSWD: /bin/systemctl start kf2watchdog.service
2 | %steam ALL=NOPASSWD: /bin/systemctl stop kf2watchdog.service
3 | %steam ALL=NOPASSWD: /bin/systemctl restart kf2watchdog.service
4 | %steam ALL=NOPASSWD: /bin/systemctl status kf2watchdog.service
5 | %steam ALL=NOPASSWD: /bin/journalctl --system --unit=kf2watchdog.service --follow
6 | %steam ALL=NOPASSWD: /bin/systemctl enable kf2watchdog.service
7 | %steam ALL=NOPASSWD: /bin/systemctl disable kf2watchdog.service
8 |
--------------------------------------------------------------------------------
/roles/install/files/killinuxfloor.te:
--------------------------------------------------------------------------------
1 | module killinuxfloor 1.0;
2 |
3 | require {
4 | type init_t;
5 | type user_home_t;
6 | type http_port_t;
7 | type unreserved_port_t;
8 | class file { open read rename execute execute_no_trans map create write append lock };
9 | class dir { create rename rmdir reparent };
10 | class lnk_file { open read };
11 | class tcp_socket { name_connect };
12 | }
13 |
14 | # allow systemd to access config files in steam's home
15 | allow init_t user_home_t:file { open read rename };
16 |
17 | # allow systemd to read links in steam's home
18 | allow init_t user_home_t:lnk_file { open read };
19 |
20 | # allow systemd to run KFGameSteamServer in steam's home
21 | allow init_t user_home_t:file { execute execute_no_trans map };
22 |
23 | # allow systemd to create log files in steam's home
24 | allow init_t user_home_t:file { create write append lock };
25 |
26 | # allow systemd to manage folders in steam's home
27 | allow init_t user_home_t:dir { create rename rmdir reparent };
28 |
29 | # allow systemd to run webadmin and kf2 server
30 | allow init_t http_port_t:tcp_socket { name_connect };
31 | allow init_t unreserved_port_t:tcp_socket { name_connect };
32 |
--------------------------------------------------------------------------------
/roles/install/files/sedeploy.sh:
--------------------------------------------------------------------------------
1 | #!/bin/sh
2 |
3 | set -eu
4 |
5 | MODULE=${1}
6 |
7 | # this will create a .mod file
8 | checkmodule -M -m -o ${MODULE}.mod ${MODULE}.te
9 |
10 | # this will create a compiled semodule
11 | semodule_package -m ${MODULE}.mod -o ${MODULE}.pp
12 |
13 | # this will install the module
14 | semodule -i ${MODULE}.pp
15 |
--------------------------------------------------------------------------------
/roles/install/files/serveradmin.patch:
--------------------------------------------------------------------------------
1 | diff -ruN ServerAdmin.orig/current_player_row.inc ServerAdmin/current_player_row.inc
2 | --- ServerAdmin.orig/current_player_row.inc 2022-12-22 01:43:19.509416046 +0100
3 | +++ ServerAdmin/current_player_row.inc 2022-12-22 01:43:52.990541726 +0100
4 | @@ -1,7 +1,7 @@
5 |
6 | <%player.teamid%> |
7 | <%player.name%> |
8 | - <%player.perk.name%> |
9 | + <%player.perk.name%>;<%player.perk.level%>;<%player.playerkey%> |
10 | <%player.score%> |
11 | <%player.pawn.health%> |
12 | <%player.kills%> |
13 | diff -ruN ServerAdmin.orig/current_players_row.inc ServerAdmin/current_players_row.inc
14 | --- ServerAdmin.orig/current_players_row.inc 2022-12-22 01:43:19.509416046 +0100
15 | +++ ServerAdmin/current_players_row.inc 2022-12-22 03:03:42.614832917 +0100
16 | @@ -2,9 +2,9 @@
17 | <%player.teamid%> |
18 | <%player.name%> |
19 | <%player.ping%> |
20 | - <%player.ip%> |
21 | + <%player.ip%> |
22 | <%player.uniqueid%> |
23 | - <%player.steamid%> |
24 | + <%player.steamid%> |
25 | <%player.steamname%> |
26 | <%player.admin%> |
27 | <%player.spectator%> |
28 | diff -ruN ServerAdmin.orig/current_rules.inc ServerAdmin/current_rules.inc
29 | --- ServerAdmin.orig/current_rules.inc 2022-12-22 01:43:19.509416046 +0100
30 | +++ ServerAdmin/current_rules.inc 2022-12-22 01:43:52.990541726 +0100
31 | @@ -1,3 +1,7 @@
32 | +Wave
33 | +<%wave.num%>
34 | +Difficulty
35 | +<%rules.difficulty.text%>
36 | Players
37 | <%rules.numplayers%>/<%rules.maxplayers%>
38 | Minimum to Start
39 | diff -ruN ServerAdmin.orig/default_maplist.html ServerAdmin/default_maplist.html
40 | --- ServerAdmin.orig/default_maplist.html 2022-12-22 01:43:19.509416046 +0100
41 | +++ ServerAdmin/default_maplist.html 2022-12-22 01:43:52.990541726 +0100
42 | @@ -2,6 +2,8 @@
43 |
44 |
45 |
46 | +
Note: the first 2 map cycles are generated, so you cannot make changes to them.
47 | +
48 |
59 |
60 | @@ -34,8 +36,8 @@
61 | <%maplist_editor%>
62 |
63 |
64 | -
65 | -
66 | +
67 | +
68 |
69 |
70 |
71 | @@ -53,6 +55,24 @@
72 | $('#maplistidx').change(function(){
73 | $('#maplistselect').submit();
74 | });
75 | +
76 | + /* we generate 2 fixed cycles, prohibit changes on those as they'll be overriden with the next klf config */
77 | + document.getElementById("simpleEditBtn").hidden = true;
78 | + cycleId = "<%maplistidx%>";
79 | + if (cycleId <= 1)
80 | + {
81 | + document.getElementById("mlactions.save").hidden = true;
82 | + document.getElementById("mlactions.delete").hidden = true;
83 | + document.getElementById("jsmlctrls").hidden = true;
84 | + document.getElementById("jsmapcycle").readOnly = true;
85 | +
86 | + /* remove the delete buttons reactively
87 | + * ugly, but this way we can avoid touching js files */
88 | + [].forEach.call(document.querySelectorAll('.deleteButton'), function (el)
89 | + {
90 | + el.style.visibility = 'hidden';
91 | + });
92 | + }
93 | });
94 |
95 | //]]>
96 | diff -ruN ServerAdmin.orig/gamesummary.inc ServerAdmin/gamesummary.inc
97 | --- ServerAdmin.orig/gamesummary.inc 2022-12-22 01:43:19.509416046 +0100
98 | +++ ServerAdmin/gamesummary.inc 2022-12-22 01:43:52.990541726 +0100
99 | @@ -4,6 +4,8 @@
100 |
<%map.title.safe%>
101 |
Players
102 |
<%rules.numplayers%>/<%rules.maxplayers%>
103 | -
Time
104 | -
<%time.elapsed%>/<%time.timelimit%>
105 | +
107 | +
Wave <%wave.num%>
108 | +
<%wave.monsters.dead%>/<%wave.monsters.total%>
109 |
110 | \ No newline at end of file
111 | diff -ruN ServerAdmin.orig/policy_bans.html ServerAdmin/policy_bans.html
112 | --- ServerAdmin.orig/policy_bans.html 2022-12-22 01:43:19.509416046 +0100
113 | +++ ServerAdmin/policy_bans.html 2022-12-22 01:43:52.990541726 +0100
114 | @@ -2,6 +2,8 @@
115 |
116 |
117 |
118 | +
List of the currently applied bans. Use the killinuxfloor ban
command to add or remove bans. Apply your changes with killinuxfloor apply
.
119 | +
120 |
<%page.title%>
121 |
122 |
123 | @@ -13,7 +15,7 @@
124 |
Steam ID |
125 | Community ID |
126 |
127 | - |
128 | +
129 |
130 |
131 |
132 | @@ -21,7 +23,7 @@
133 |
134 |
135 |
136 | -