[
  {
    "path": ".dockerignore",
    "content": "*\n!src\n!LICENSE\n!README.md\n"
  },
  {
    "path": ".github/FUNDING.yml",
    "content": "# These are supported funding model platforms\n\ngithub: [Renegade-Master] # Replace with up to 4 GitHub Sponsors-enabled usernames e.g., [user1, user2]\npatreon: # Replace with a single Patreon username\nopen_collective: # Replace with a single Open Collective username\nko_fi: # Replace with a single Ko-fi username\ntidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel\ncommunity_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry\nliberapay: # Replace with a single Liberapay username\nissuehunt: # Replace with a single IssueHunt username\notechie: # Replace with a single Otechie username\nlfx_crowdfunding: # Replace with a single LFX Crowdfunding project-name e.g., cloud-foundry\ncustom: # Replace with up to 4 custom sponsorship URLs e.g., ['link1', 'link2']\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/bug_report.md",
    "content": "---\nname: Bug report\nabout: Create a report to help us improve\ntitle: ''\nlabels: bug\nassignees: ''\n\n---\n\n**Describe the bug**\nA clear and concise description of what the bug is.\n\n**To Reproduce**\nSteps to reproduce the behavior:\n1. Cloned repository.\n2. Built image with ...\n3. Started image using ...\n4. See attached error:\n    ...\n\n**Expected behavior**\nA clear and concise description of what you expected to happen.\n\n**Screenshots**\nIf applicable, add screenshots to help explain your problem.\n\n**Desktop (please complete the following information):**\n - OS: [e.g. Ubuntu]\n - Docker Version [e.g. 20.10.12]\n - Image Version [e.g. 1.0.0]\n\n**Additional context**\nAdd any other context about the problem here.\n"
  },
  {
    "path": ".github/ISSUE_TEMPLATE/feature_request.md",
    "content": "---\nname: Feature request\nabout: Suggest an idea for this project\ntitle: ''\nlabels: enhancement\nassignees: ''\n\n---\n\n**Is your feature request related to a problem? Please describe.**\nA clear and concise description of what the problem is. Ex. I'm always frustrated when [...]\n\n**Describe the solution you'd like**\nA clear and concise description of what you want to happen.\n\n**Describe alternatives you've considered**\n(If applicable) A clear and concise description of any alternative solutions or features you've considered.\n\n**Additional context**\nAdd any other context or screenshots about the feature request here.\n"
  },
  {
    "path": ".github/workflows/docker-build.yml",
    "content": "#\n#   Project Zomboid Dedicated Server using SteamCMD Docker Image.\n#   Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n#\n#   This program is free software: you can redistribute it and/or modify\n#   it under the terms of the GNU General Public License as published by\n#   the Free Software Foundation, either version 3 of the License, or\n#   (at your option) any later version.\n#\n#   This program is distributed in the hope that it will be useful,\n#   but WITHOUT ANY WARRANTY; without even the implied warranty of\n#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#   GNU General Public License for more details.\n#\n#   You should have received a copy of the GNU General Public License\n#   along with this program.  If not, see <https://www.gnu.org/licenses/>.\n#\n\nname: Build and Test Server Image\n\non:\n  push:\n    branches: [ main ]\n  pull_request:\n    branches: [ main ]\n\ndefaults:\n  run:\n    shell: bash\n\njobs:\n\n  build-and-run:\n    name: Build and Run Server\n    runs-on: ubuntu-latest\n    strategy:\n      matrix:\n        system: [docker, docker-compose, podman]\n    steps:\n      - name: Checkout Repository\n        uses: actions/checkout@v3\n\n      - name: Set Variables\n        id: variables\n        run: |\n          echo \"::set-output name=datetime::$(date +%Y%m%dT%H%M%SZ)\"\n          echo \"::set-output name=userid::$(id -u)\"\n          echo \"::set-output name=groupid::$(id -g)\"\n\n      - name: Set Permissions on Executable Scripts\n        run: |\n          chmod +x src/install_server.scmd\n          chmod +x src/run_server.sh\n\n      - name: Make Directories\n        run: mkdir ZomboidConfig ZomboidDedicatedServer\n\n      #######################\n      # Docker Build System #\n      #######################\n      - name: Build the Docker Image\n        if: ${{ success() && matrix.system == 'docker' }}\n        run: |\n          docker build \\\n          --file docker/zomboid-dedicated-server.Dockerfile \\\n          --tag docker.io/renegademaster/zomboid-dedicated-server:${{ steps.variables.outputs.datetime }} \\\n          .\n\n      - name: Test Run the Docker Image\n        if: ${{ success() && matrix.system == 'docker' }}\n        continue-on-error: true\n        timeout-minutes: 10\n        run: |\n          # Start a timed shutdown signal\n          (sleep 360 && docker exec \\\n            zomboid-dedicated-server bash -c \\\n              \"rcon -a $(cat ZomboidConfig/ip.txt):\\${RCON_PORT} -p \\${RCON_PASSWORD} quit\") &\n\n          # Run the Docker Image\n          docker run \\\n            --rm \\\n            --name zomboid-dedicated-server \\\n            --mount type=bind,source=\"$(pwd)/ZomboidDedicatedServer\",target=/home/steam/ZomboidDedicatedServer \\\n            --mount type=bind,source=\"$(pwd)/ZomboidConfig\",target=/home/steam/Zomboid \\\n            --env=AUTOSAVE_INTERVAL=\"16\" \\\n            --env=DEFAULT_PORT=\"25496\" \\\n            --env=GC_CONFIG=\"G1GC\" \\\n            --env=MAP_NAMES=\"BedfordFalls;North;South;West\" \\\n            --env=MAX_PLAYERS=\"14\" \\\n            --env=MAX_RAM=\"6144m\" \\\n            --env=MOD_NAMES=\"BedfordFalls\" \\\n            --env=MOD_WORKSHOP_IDS=\"522891356\" \\\n            --env=PAUSE_ON_EMPTY=\"true\" \\\n            --env=PUBLIC_SERVER=\"false\" \\\n            --env=RCON_PASSWORD=\"github_action_test_rcon_password\" \\\n            --env=RCON_PORT=\"27025\" \\\n            --env=SERVER_NAME=\"GitHubActionTest\" \\\n            --env=SERVER_PASSWORD=\"github_action_test_password\" \\\n            --env=UDP_PORT=\"25499\" \\\n            docker.io/renegademaster/zomboid-dedicated-server:${{ steps.variables.outputs.datetime }} \\\n            2>&1 | tee ./docker-log.log\n\n      ###############################\n      # Docker-Compose Build System #\n      ###############################\n      - name: Update Docker-Compose File\n        if: ${{ success() && matrix.system == 'docker-compose' }}\n        run: |\n          sed -i \"s/AUTOSAVE_INTERVAL=.*\\\"/AUTOSAVE_INTERVAL=16\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/DEFAULT_PORT=.*\\\"/DEFAULT_PORT=25496\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/GC_CONFIG=.*\\\"/GC_CONFIG=G1GC\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/MAP_NAMES=.*\\\"/MAP_NAMES=BedfordFalls;North;South;West\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/MAX_PLAYERS=.*\\\"/MAX_PLAYERS=14\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/MAX_RAM=.*m\\\"/MAX_RAM=6144m\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/MOD_NAMES=.*\\\"/MOD_NAMES=BedfordFalls\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/MOD_WORKSHOP_IDS=.*\\\"/MOD_WORKSHOP_IDS=522891356\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/PUBLIC_SERVER=.*/PUBLIC_SERVER=false\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/RCON_PASSWORD=.*/RCON_PASSWORD=github_action_test_rcon_password\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/RCON_PORT=.*\\\"/RCON_PORT=27025\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/SERVER_NAME=.*/SERVER_NAME=GitHubActionTest\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/SERVER_PASSWORD=.*/SERVER_PASSWORD=github_action_test_password\\\"/g\" \"./docker-compose.yaml\"\n          sed -i \"s/UDP_PORT=.*\\\"/UDP_PORT=25499\\\"/g\" \"./docker-compose.yaml\"\n\n          cat docker-compose.yaml\n\n      - name: Build the Docker-Compose Image\n        if: ${{ success() && matrix.system == 'docker-compose' }}\n        run: |\n          docker-compose build\n\n      - name: Test Run the Docker-Compose Image\n        if: ${{ success() && matrix.system == 'docker-compose' }}\n        continue-on-error: true\n        timeout-minutes: 10\n        run: |\n          # Start a timed shutdown signal\n          (sleep 360 && docker exec \\\n            zomboid-dedicated-server bash -c \\\n              \"rcon -a $(cat ZomboidConfig/ip.txt):\\${RCON_PORT} -p \\${RCON_PASSWORD} quit\") &\n\n          # Run the Docker-Compose Image\n          docker-compose up \\\n            2>&1 | tee ./docker-log.log\n\n      #######################\n      # Podman Build System #\n      #######################\n      - name: Build the Podman Image\n        if: ${{ success() && matrix.system == 'podman' }}\n        run: |\n          BUILDAH_LAYERS=true buildah bud \\\n          --file docker/zomboid-dedicated-server.Dockerfile \\\n          --tag docker.io/renegademaster/zomboid-dedicated-server:${{ steps.variables.outputs.datetime }} \\\n          .\n\n      - name: Test Run the Podman Image\n        if: ${{ success() && matrix.system == 'podman' }}\n        continue-on-error: true\n        timeout-minutes: 10\n        run: |\n          # Start a timed shutdown signal\n          (sleep 360 && podman exec \\\n            zomboid-dedicated-server bash -c \\\n              \"rcon -a $(cat ZomboidConfig/ip.txt):\\${RCON_PORT} -p \\${RCON_PASSWORD} quit\") &\n\n          # Run the Podman Image\n          podman run \\\n            --rm \\\n            --name zomboid-dedicated-server \\\n            --mount type=bind,source=\"$(pwd)/ZomboidDedicatedServer\",target=/home/steam/ZomboidDedicatedServer \\\n            --mount type=bind,source=\"$(pwd)/ZomboidConfig\",target=/home/steam/Zomboid \\\n            --env=AUTOSAVE_INTERVAL=\"16\" \\\n            --env=DEFAULT_PORT=\"25496\" \\\n            --env=GC_CONFIG=\"G1GC\" \\\n            --env=MAP_NAMES=\"BedfordFalls;North;South;West\" \\\n            --env=MAX_PLAYERS=\"14\" \\\n            --env=MAX_RAM=\"6144m\" \\\n            --env=MOD_NAMES=\"BedfordFalls\" \\\n            --env=MOD_WORKSHOP_IDS=\"522891356\" \\\n            --env=PAUSE_ON_EMPTY=\"true\" \\\n            --env=PUBLIC_SERVER=\"false\" \\\n            --env=RCON_PASSWORD=\"github_action_test_rcon_password\" \\\n            --env=RCON_PORT=\"27025\" \\\n            --env=SERVER_NAME=\"GitHubActionTest\" \\\n            --env=SERVER_PASSWORD=\"github_action_test_password\" \\\n            --env=UDP_PORT=\"25499\" \\\n            docker.io/renegademaster/zomboid-dedicated-server:${{ steps.variables.outputs.datetime }} \\\n            2>&1 | tee ./docker-log.log\n\n      - name: Investigate File Structure\n        run: |\n          pwd\n          echo ''\n          ls -lAuhFn ./ZomboidDedicatedServer/ > ./dedicated-server-install-listing.txt\n          echo ''\n          ls -lAuhFn ./ZomboidConfig/ > ./dedicated-server-config-listing.txt\n          echo ''\n          tree -aL 10 ./ZomboidDedicatedServer/ > ./dedicated-server-install-tree.txt\n          echo ''\n          tree -aL 10 ./ZomboidConfig/ > ./dedicated-server-config-tree.txt\n\n      - name: Upload Docker Logs\n        if: ${{ always() }}\n        uses: actions/upload-artifact@v2\n        with:\n          name: docker-logs-${{ matrix.system }}\n          path: |\n            docker-log.log\n\n      - name: Upload Server Configuration\n        if: ${{ always() }}\n        uses: actions/upload-artifact@v2\n        with:\n          name: server-configs-${{ matrix.system }}\n          path: |\n            docker-compose.yaml\n            ZomboidConfig/Server/GitHubActionTest.ini\n            ZomboidConfig/Server/GitHubActionTest_SandboxVars.lua\n            ZomboidDedicatedServer/ProjectZomboid64.json\n            dedicated-server-install-listing.txt\n            dedicated-server-config-listing.txt\n            dedicated-server-install-tree.txt\n            dedicated-server-config-tree.txt\n\n  test-docker:\n    name: Test Server\n    runs-on: ubuntu-latest\n    needs:\n      - build-and-run\n    strategy:\n      matrix:\n        system: [docker, docker-compose, podman]\n    steps:\n      - name: Checkout Repository\n        uses: actions/checkout@v3\n\n      - name: Download Docker Logs\n        uses: actions/download-artifact@v2\n        with:\n          name: docker-logs-${{ matrix.system }}\n\n      - name: Download Server Configs\n        uses: actions/download-artifact@v2\n        with:\n          name: server-configs-${{ matrix.system }}\n\n      - name: Test - Server Started\n        run: |\n          check_for_config() {\n            if ! grep -q -iE \"$1\" \"./docker-log.log\"; then\n              printf \"Could not find [%s] in [%s]\\n\" \"$1\" \"./docker-log.log\"\n              exit 1\n            else\n              printf \"Found [%s] in [%s]\\n\" \"$1\" \"./docker-log.log\"\n            fi\n          }\n\n          check_for_config \"LuaNet: Initialization \\[DONE\\]\"\n\n      - name: Test - Server Stopped Gracefully\n        run: |\n          check_for_config() {\n            if ! grep -q -iE \"$1\" \"./docker-log.log\"; then\n              printf \"Could not find [%s] in [%s]\\n\" \"$1\" \"./docker-log.log\"\n              exit 1\n            else\n              printf \"Found [%s] in [%s]\\n\" \"$1\" \"./docker-log.log\"\n            fi\n          }\n\n          check_for_config \"ZNet: SZombienet -> SSteamSDK: LogOff\"\n\n      - name: Test - Configuration Completed\n        run: |\n          check_for_config() {\n            if ! grep -q -iE \"$1\" \"./docker-log.log\"; then\n              printf \"Could not find [%s] in [%s]\\n\" \"$1\" \"./docker-log.log\"\n            else\n              printf \"Found [%s] in [%s]\\n\" \"$1\" \"./docker-log.log\"\n              exit 1\n            fi\n          }\n\n          check_for_config \"sed: can't read\"\n          check_for_config \"not found!\"\n\n      - name: Test - Server JVM Configuration Applied\n        run: |\n          check_for_config() {\n            if ! grep -q -iE \"$1\" \"./ZomboidDedicatedServer/ProjectZomboid64.json\"; then\n              printf \"Could not find [%s] in [%s]\\n\" \"$1\" \"./ZomboidDedicatedServer/ProjectZomboid64.json\"\n              exit 1\n            else\n              printf \"Found [%s] in [%s]\\n\" \"$1\" \"./ZomboidDedicatedServer/ProjectZomboid64.json\"\n            fi\n          }\n\n          check_for_config \"\\-Xmx6144m\"\n          check_for_config \"\\-XX:\\+UseG1GC\"\n\n      - name: Test - Server Configuration Applied\n        run: |\n          install_directory=\"./ZomboidDedicatedServer\"\n          workshop_directory=\"${install_directory}/steamapps/workshop\"\n          mods_directory=\"${workshop_directory}/content/108600/522891356/mods\"\n          bedford_maps=\"${mods_directory}/Bedford Falls/media/maps\"\n\n          map_search_string=\"$(cat << EOF\n          │       ├── content\n          │       │   └── 108600\n          │       │       └── 522891356\n          │       │           └── mods\n          │       │               └── Bedford Falls\n          │       │                   ├── media\n          │       │                   │   ├── lua\n          │       │                   │   │   ├── client\n          EOF\n          )\"\n\n          py_script=\"$(cat << EOF\n          to_find = \"\"\"${map_search_string}\"\"\"\n\n          with open(\"dedicated-server-install-tree.txt\", \"r\") as file:\n              file_string = file.read()\n\n              if (to_find in file_string):\n                  print(\"FOUND\")\n              else:\n                  print(\"NOT_FOUND\")\n          EOF\n          )\"\n\n          check_for_config() {\n            if ! grep -q -iE \"$1\" \"./ZomboidConfig/Server/GitHubActionTest.ini\"; then\n              printf \"Could not find [%s] in [%s]\\n\" \"$1\" \"./ZomboidConfig/Server/GitHubActionTest.ini\"\n              exit 1\n            else\n              printf \"Found [%s] in [%s]\\n\" \"$1\" \"./ZomboidConfig/Server/GitHubActionTest.ini\"\n            fi\n          }\n\n          check_for_directory() {\n            if [[ $(python3 -c \"${py_script}\") == \"FOUND\" ]]; then\n              printf \"Found map directory in [%s]\\n\" \"${bedford_maps}\"\n            else\n              printf \"Could not find map directory in [%s]\\n\" \"${bedford_maps}\"\n              exit 1\n            fi\n          }\n\n          check_for_config \"DefaultPort=25496\"\n          check_for_config \"Map=BedfordFalls;North;South;West\"\n          check_for_config \"MaxPlayers=14\"\n          check_for_config \"Open=false\"\n          check_for_config \"Password=github_action_test_password\"\n          check_for_config \"PauseEmpty=true\"\n          check_for_config \"PublicName=GitHubActionTest\"\n          check_for_config \"RCONPassword=github_action_test_rcon_password\"\n          check_for_config \"RCONPort=27025\"\n          check_for_config \"SaveWorldEveryMinutes=16\"\n          check_for_config \"UDPPort=25499\"\n\n          check_for_directory\n"
  },
  {
    "path": ".github/workflows/push_new_version.yml",
    "content": "name: Push New Version\n\non:\n  workflow_dispatch:\n    inputs:\n      tag:\n        description: \"The semantic version to assign to the new Tag\"\n        required: true\n        type: string\n      dryrun:\n        description: \"Run the action without pushing anything\"\n        required: true\n        type: boolean\n        default: true\n      builder:\n        description: \"The builder to use for the new Tag\"\n        required: true\n        type: choice\n        options:\n          - buildah\n          - docker\n        default: \"buildah\"\n\ndefaults:\n  run:\n    shell: bash\n\njobs:\n  tag_repo:\n    name: \"Add a Tag to the Repo\"\n    runs-on: ubuntu-latest\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: GitHub Tag\n        uses: mathieudutour/github-tag-action@v6.0\n        with:\n          github_token: ${{ secrets.GITHUB_TOKEN }}\n          custom_tag: ${{ github.event.inputs.tag }}\n          create_annotated_tag: true\n          dry_run: ${{ github.event.inputs.dryrun }}\n\n  build_and_push_image:\n    name: \"Build the new Image\"\n    runs-on: ubuntu-latest\n    needs:\n      - tag_repo\n    steps:\n      - uses: actions/checkout@v3\n\n      - name: Set Variables\n        id: variables\n        run: |\n          echo \"::set-output name=dkimagepath::renegademaster/zomboid-dedicated-server\"\n          echo \"::set-output name=ghimagepath::renegade-master/zomboid-dedicated-server\"\n          echo \"::set-output name=qyimagepath::renegade_master/zomboid-dedicated-server\"\n          echo \"::set-output name=datetime::$(date +%Y%m%dT%H%M%SZ)\"\n\n      - name: Login to Image Repositories\n        run: |\n          docker login -u ${{ secrets.GH_USER }} -p ${{ secrets.GITHUB_TOKEN }} ghcr.io\n          docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_TOKEN }} docker.io\n          docker login -u ${{ secrets.QUAY_USER }} -p ${{ secrets.QUAY_TOKEN }} quay.io\n\n      - name: Start Local Container Registry\n        run: podman run --rm --detach --publish 5000:5000 --name registry docker.io/registry\n\n      - name: Build the Image\n        run: |\n          if [[ ${{ github.event.inputs.builder }} == \"buildah\" ]]; then\n            BUILDAH_LAYERS=true buildah bud \\\n              --file docker/zomboid-dedicated-server.Dockerfile \\\n              --tag localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              .\n          elif [[ ${{ github.event.inputs.builder }} == \"docker\" ]]; then\n            docker build \\\n              --file docker/zomboid-dedicated-server.Dockerfile \\\n              --tag localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              .\n          fi\n\n      - name: Push the Image to Local Container Registry\n        run: |\n          if [[ ${{ github.event.inputs.builder }} == \"buildah\" ]]; then\n            buildah push localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }}\n          elif [[ ${{ github.event.inputs.builder }} == \"docker\" ]]; then\n            docker push localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }}\n          fi\n\n      - name: Inspect the Image\n        run: skopeo inspect --tls-verify=false docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }}\n\n      - name: Push new Image Tags\n        run: |\n          if [[ \"${{ github.event.inputs.dryrun }}\" == \"false\" ]]; then\n            printf \"Pushing Image Tags\\n\"\n\n            printf \"\\nPushing GitHub Image...\\n\"\n            skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.GH_USER }}:${{ secrets.GITHUB_TOKEN }} \\\n              docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              docker://ghcr.io/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }}\n            skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.GH_USER }}:${{ secrets.GITHUB_TOKEN }} \\\n              docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              docker://ghcr.io/${{ steps.variables.outputs.ghimagepath }}:latest\n\n            printf \"\\nPushing DockerHub Image...\\n\"\n            skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.DOCKER_USER }}:${{ secrets.DOCKER_TOKEN }} \\\n              docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              docker://docker.io/${{ steps.variables.outputs.dkimagepath }}:${{ github.event.inputs.tag }}\n            skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.DOCKER_USER }}:${{ secrets.DOCKER_TOKEN }} \\\n              docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              docker://docker.io/${{ steps.variables.outputs.dkimagepath }}:latest\n\n            printf \"\\nPushing Quay Image...\\n\"\n            skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.QUAY_USER }}:${{ secrets.QUAY_TOKEN }} \\\n              docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              docker://quay.io/${{ steps.variables.outputs.qyimagepath }}:${{ github.event.inputs.tag }}\n            skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.QUAY_USER }}:${{ secrets.QUAY_TOKEN }} \\\n              docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n              docker://quay.io/${{ steps.variables.outputs.qyimagepath }}:latest\n          else\n            printf \"DryRun. Not pushing Git Tags. Printing commands...\\n\"\n\n            command=$(cat << EOF\n          printf \"\\nPushing GitHub Image...\\n\"\n          skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.GH_USER }}:${{ secrets.GITHUB_TOKEN }} \\\n            docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n            docker://ghcr.io/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }}\n          skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.GH_USER }}:${{ secrets.GITHUB_TOKEN }} \\\n            docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n            docker://ghcr.io/${{ steps.variables.outputs.ghimagepath }}:latest\n\n          printf \"\\nPushing DockerHub Image...\\n\"\n          skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.DOCKER_USER }}:${{ secrets.DOCKER_TOKEN }} \\\n            docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n            docker://docker.io/${{ steps.variables.outputs.dkimagepath }}:${{ github.event.inputs.tag }}\n          skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.DOCKER_USER }}:${{ secrets.DOCKER_TOKEN }} \\\n            docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n            docker://docker.io/${{ steps.variables.outputs.dkimagepath }}:latest\n\n          printf \"\\nPushing Quay Image...\\n\"\n          skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.QUAY_USER }}:${{ secrets.QUAY_TOKEN }} \\\n            docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n            docker://quay.io/${{ steps.variables.outputs.qyimagepath }}:${{ github.event.inputs.tag }}\n          skopeo copy --src-tls-verify=false --dest-creds ${{ secrets.QUAY_USER }}:${{ secrets.QUAY_TOKEN }} \\\n            docker://localhost:5000/${{ steps.variables.outputs.ghimagepath }}:${{ github.event.inputs.tag }} \\\n            docker://quay.io/${{ steps.variables.outputs.qyimagepath }}:latest\n          EOF\n          )\n\n            printf \"%s\\n\" \"${command}\"\n          fi\n\n      - name: Stop the Local Container Registry\n        run: podman stop registry\n"
  },
  {
    "path": ".gitignore",
    "content": "### User Additions ###\nZomboidConfig/\nZomboidDedicatedServer/\n\n\n# Created by https://www.toptal.com/developers/gitignore/api/intellij+all,visualstudiocode\n# Edit at https://www.toptal.com/developers/gitignore?templates=intellij+all,visualstudiocode\n\n### Intellij+all ###\n# Covers JetBrains IDEs: IntelliJ, RubyMine, PhpStorm, AppCode, PyCharm, CLion, Android Studio, WebStorm and Rider\n# Reference: https://intellij-support.jetbrains.com/hc/en-us/articles/206544839\n\n# User-specific stuff\n.idea/**/workspace.xml\n.idea/**/tasks.xml\n.idea/**/usage.statistics.xml\n.idea/**/dictionaries\n.idea/**/shelf\n\n# AWS User-specific\n.idea/**/aws.xml\n\n# Generated files\n.idea/**/contentModel.xml\n\n# Sensitive or high-churn files\n.idea/**/dataSources/\n.idea/**/dataSources.ids\n.idea/**/dataSources.local.xml\n.idea/**/sqlDataSources.xml\n.idea/**/dynamic.xml\n.idea/**/uiDesigner.xml\n.idea/**/dbnavigator.xml\n\n# Gradle\n.idea/**/gradle.xml\n.idea/**/libraries\n\n# Gradle and Maven with auto-import\n# When using Gradle or Maven with auto-import, you should exclude module files,\n# since they will be recreated, and may cause churn.  Uncomment if using\n# auto-import.\n# .idea/artifacts\n# .idea/compiler.xml\n# .idea/jarRepositories.xml\n# .idea/modules.xml\n# .idea/*.iml\n# .idea/modules\n# *.iml\n# *.ipr\n\n# CMake\ncmake-build-*/\n\n# Mongo Explorer plugin\n.idea/**/mongoSettings.xml\n\n# File-based project format\n*.iws\n\n# IntelliJ\nout/\n\n# mpeltonen/sbt-idea plugin\n.idea_modules/\n\n# JIRA plugin\natlassian-ide-plugin.xml\n\n# Cursive Clojure plugin\n.idea/replstate.xml\n\n# Crashlytics plugin (for Android Studio and IntelliJ)\ncom_crashlytics_export_strings.xml\ncrashlytics.properties\ncrashlytics-build.properties\nfabric.properties\n\n# Editor-based Rest Client\n.idea/httpRequests\n\n# Android studio 3.1+ serialized cache file\n.idea/caches/build_file_checksums.ser\n\n### Intellij+all Patch ###\n# Ignores the whole .idea folder and all .iml files\n# See https://github.com/joeblau/gitignore.io/issues/186 and https://github.com/joeblau/gitignore.io/issues/360\n\n.idea/\n\n# Reason: https://github.com/joeblau/gitignore.io/issues/186#issuecomment-249601023\n\n*.iml\nmodules.xml\n.idea/misc.xml\n*.ipr\n\n# Sonarlint plugin\n.idea/sonarlint\n\n### VisualStudioCode ###\n.vscode/*\n!.vscode/settings.json\n!.vscode/tasks.json\n!.vscode/launch.json\n!.vscode/extensions.json\n*.code-workspace\n\n# Local History for Visual Studio Code\n.history/\n\n### VisualStudioCode Patch ###\n# Ignore all local history of files\n.history\n.ionide\n\n# Support for Project snippet scope\n!.vscode/*.code-snippets\n\n# End of https://www.toptal.com/developers/gitignore/api/intellij+all,visualstudiocode\nn\n"
  },
  {
    "path": "LICENSE",
    "content": "                    GNU GENERAL PUBLIC LICENSE\n                       Version 3, 29 June 2007\n\n Project Zomboid Dedicated Server using SteamCMD Docker Image.\n Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n\n Copyright (C) 2007 Free Software Foundation, Inc. <https://fsf.org/>\n Everyone is permitted to copy and distribute verbatim copies\n of this license document, but changing it is not allowed.\n\n                            Preamble\n\n  The GNU General Public License is a free, copyleft license for\nsoftware and other kinds of works.\n\n  The licenses for most software and other practical works are designed\nto take away your freedom to share and change the works.  By contrast,\nthe GNU General Public License is intended to guarantee your freedom to\nshare and change all versions of a program--to make sure it remains free\nsoftware for all its users.  We, the Free Software Foundation, use the\nGNU General Public License for most of our software; it applies also to\nany other work released this way by its authors.  You can apply it to\nyour programs, too.\n\n  When we speak of free software, we are referring to freedom, not\nprice.  Our General Public Licenses are designed to make sure that you\nhave the freedom to distribute copies of free software (and charge for\nthem if you wish), that you receive source code or can get it if you\nwant it, that you can change the software or use pieces of it in new\nfree programs, and that you know you can do these things.\n\n  To protect your rights, we need to prevent others from denying you\nthese rights or asking you to surrender the rights.  Therefore, you have\ncertain responsibilities if you distribute copies of the software, or if\nyou modify it: responsibilities to respect the freedom of others.\n\n  For example, if you distribute copies of such a program, whether\ngratis or for a fee, you must pass on to the recipients the same\nfreedoms that you received.  You must make sure that they, too, receive\nor can get the source code.  And you must show them these terms so they\nknow their rights.\n\n  Developers that use the GNU GPL protect your rights with two steps:\n(1) assert copyright on the software, and (2) offer you this License\ngiving you legal permission to copy, distribute and/or modify it.\n\n  For the developers' and authors' protection, the GPL clearly explains\nthat there is no warranty for this free software.  For both users' and\nauthors' sake, the GPL requires that modified versions be marked as\nchanged, so that their problems will not be attributed erroneously to\nauthors of previous versions.\n\n  Some devices are designed to deny users access to install or run\nmodified versions of the software inside them, although the manufacturer\ncan do so.  This is fundamentally incompatible with the aim of\nprotecting users' freedom to change the software.  The systematic\npattern of such abuse occurs in the area of products for individuals to\nuse, which is precisely where it is most unacceptable.  Therefore, we\nhave designed this version of the GPL to prohibit the practice for those\nproducts.  If such problems arise substantially in other domains, we\nstand ready to extend this provision to those domains in future versions\nof the GPL, as needed to protect the freedom of users.\n\n  Finally, every program is threatened constantly by software patents.\nStates should not allow patents to restrict development and use of\nsoftware on general-purpose computers, but in those that do, we wish to\navoid the special danger that patents applied to a free program could\nmake it effectively proprietary.  To prevent this, the GPL assures that\npatents cannot be used to render the program non-free.\n\n  The precise terms and conditions for copying, distribution and\nmodification follow.\n\n                       TERMS AND CONDITIONS\n\n  0. Definitions.\n\n  \"This License\" refers to version 3 of the GNU General Public License.\n\n  \"Copyright\" also means copyright-like laws that apply to other kinds of\nworks, such as semiconductor masks.\n\n  \"The Program\" refers to any copyrightable work licensed under this\nLicense.  Each licensee is addressed as \"you\".  \"Licensees\" and\n\"recipients\" may be individuals or organizations.\n\n  To \"modify\" a work means to copy from or adapt all or part of the work\nin a fashion requiring copyright permission, other than the making of an\nexact copy.  The resulting work is called a \"modified version\" of the\nearlier work or a work \"based on\" the earlier work.\n\n  A \"covered work\" means either the unmodified Program or a work based\non the Program.\n\n  To \"propagate\" a work means to do anything with it that, without\npermission, would make you directly or secondarily liable for\ninfringement under applicable copyright law, except executing it on a\ncomputer or modifying a private copy.  Propagation includes copying,\ndistribution (with or without modification), making available to the\npublic, and in some countries other activities as well.\n\n  To \"convey\" a work means any kind of propagation that enables other\nparties to make or receive copies.  Mere interaction with a user through\na computer network, with no transfer of a copy, is not conveying.\n\n  An interactive user interface displays \"Appropriate Legal Notices\"\nto the extent that it includes a convenient and prominently visible\nfeature that (1) displays an appropriate copyright notice, and (2)\ntells the user that there is no warranty for the work (except to the\nextent that warranties are provided), that licensees may convey the\nwork under this License, and how to view a copy of this License.  If\nthe interface presents a list of user commands or options, such as a\nmenu, a prominent item in the list meets this criterion.\n\n  1. Source Code.\n\n  The \"source code\" for a work means the preferred form of the work\nfor making modifications to it.  \"Object code\" means any non-source\nform of a work.\n\n  A \"Standard Interface\" means an interface that either is an official\nstandard defined by a recognized standards body, or, in the case of\ninterfaces specified for a particular programming language, one that\nis widely used among developers working in that language.\n\n  The \"System Libraries\" of an executable work include anything, other\nthan the work as a whole, that (a) is included in the normal form of\npackaging a Major Component, but which is not part of that Major\nComponent, and (b) serves only to enable use of the work with that\nMajor Component, or to implement a Standard Interface for which an\nimplementation is available to the public in source code form.  A\n\"Major Component\", in this context, means a major essential component\n(kernel, window system, and so on) of the specific operating system\n(if any) on which the executable work runs, or a compiler used to\nproduce the work, or an object code interpreter used to run it.\n\n  The \"Corresponding Source\" for a work in object code form means all\nthe source code needed to generate, install, and (for an executable\nwork) run the object code and to modify the work, including scripts to\ncontrol those activities.  However, it does not include the work's\nSystem Libraries, or general-purpose tools or generally available free\nprograms which are used unmodified in performing those activities but\nwhich are not part of the work.  For example, Corresponding Source\nincludes interface definition files associated with source files for\nthe work, and the source code for shared libraries and dynamically\nlinked subprograms that the work is specifically designed to require,\nsuch as by intimate data communication or control flow between those\nsubprograms and other parts of the work.\n\n  The Corresponding Source need not include anything that users\ncan regenerate automatically from other parts of the Corresponding\nSource.\n\n  The Corresponding Source for a work in source code form is that\nsame work.\n\n  2. Basic Permissions.\n\n  All rights granted under this License are granted for the term of\ncopyright on the Program, and are irrevocable provided the stated\nconditions are met.  This License explicitly affirms your unlimited\npermission to run the unmodified Program.  The output from running a\ncovered work is covered by this License only if the output, given its\ncontent, constitutes a covered work.  This License acknowledges your\nrights of fair use or other equivalent, as provided by copyright law.\n\n  You may make, run and propagate covered works that you do not\nconvey, without conditions so long as your license otherwise remains\nin force.  You may convey covered works to others for the sole purpose\nof having them make modifications exclusively for you, or provide you\nwith facilities for running those works, provided that you comply with\nthe terms of this License in conveying all material for which you do\nnot control copyright.  Those thus making or running the covered works\nfor you must do so exclusively on your behalf, under your direction\nand control, on terms that prohibit them from making any copies of\nyour copyrighted material outside their relationship with you.\n\n  Conveying under any other circumstances is permitted solely under\nthe conditions stated below.  Sublicensing is not allowed; section 10\nmakes it unnecessary.\n\n  3. Protecting Users' Legal Rights From Anti-Circumvention Law.\n\n  No covered work shall be deemed part of an effective technological\nmeasure under any applicable law fulfilling obligations under article\n11 of the WIPO copyright treaty adopted on 20 December 1996, or\nsimilar laws prohibiting or restricting circumvention of such\nmeasures.\n\n  When you convey a covered work, you waive any legal power to forbid\ncircumvention of technological measures to the extent such circumvention\nis effected by exercising rights under this License with respect to\nthe covered work, and you disclaim any intention to limit operation or\nmodification of the work as a means of enforcing, against the work's\nusers, your or third parties' legal rights to forbid circumvention of\ntechnological measures.\n\n  4. Conveying Verbatim Copies.\n\n  You may convey verbatim copies of the Program's source code as you\nreceive it, in any medium, provided that you conspicuously and\nappropriately publish on each copy an appropriate copyright notice;\nkeep intact all notices stating that this License and any\nnon-permissive terms added in accord with section 7 apply to the code;\nkeep intact all notices of the absence of any warranty; and give all\nrecipients a copy of this License along with the Program.\n\n  You may charge any price or no price for each copy that you convey,\nand you may offer support or warranty protection for a fee.\n\n  5. Conveying Modified Source Versions.\n\n  You may convey a work based on the Program, or the modifications to\nproduce it from the Program, in the form of source code under the\nterms of section 4, provided that you also meet all of these conditions:\n\n    a) The work must carry prominent notices stating that you modified\n    it, and giving a relevant date.\n\n    b) The work must carry prominent notices stating that it is\n    released under this License and any conditions added under section\n    7.  This requirement modifies the requirement in section 4 to\n    \"keep intact all notices\".\n\n    c) You must license the entire work, as a whole, under this\n    License to anyone who comes into possession of a copy.  This\n    License will therefore apply, along with any applicable section 7\n    additional terms, to the whole of the work, and all its parts,\n    regardless of how they are packaged.  This License gives no\n    permission to license the work in any other way, but it does not\n    invalidate such permission if you have separately received it.\n\n    d) If the work has interactive user interfaces, each must display\n    Appropriate Legal Notices; however, if the Program has interactive\n    interfaces that do not display Appropriate Legal Notices, your\n    work need not make them do so.\n\n  A compilation of a covered work with other separate and independent\nworks, which are not by their nature extensions of the covered work,\nand which are not combined with it such as to form a larger program,\nin or on a volume of a storage or distribution medium, is called an\n\"aggregate\" if the compilation and its resulting copyright are not\nused to limit the access or legal rights of the compilation's users\nbeyond what the individual works permit.  Inclusion of a covered work\nin an aggregate does not cause this License to apply to the other\nparts of the aggregate.\n\n  6. Conveying Non-Source Forms.\n\n  You may convey a covered work in object code form under the terms\nof sections 4 and 5, provided that you also convey the\nmachine-readable Corresponding Source under the terms of this License,\nin one of these ways:\n\n    a) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by the\n    Corresponding Source fixed on a durable physical medium\n    customarily used for software interchange.\n\n    b) Convey the object code in, or embodied in, a physical product\n    (including a physical distribution medium), accompanied by a\n    written offer, valid for at least three years and valid for as\n    long as you offer spare parts or customer support for that product\n    model, to give anyone who possesses the object code either (1) a\n    copy of the Corresponding Source for all the software in the\n    product that is covered by this License, on a durable physical\n    medium customarily used for software interchange, for a price no\n    more than your reasonable cost of physically performing this\n    conveying of source, or (2) access to copy the\n    Corresponding Source from a network server at no charge.\n\n    c) Convey individual copies of the object code with a copy of the\n    written offer to provide the Corresponding Source.  This\n    alternative is allowed only occasionally and noncommercially, and\n    only if you received the object code with such an offer, in accord\n    with subsection 6b.\n\n    d) Convey the object code by offering access from a designated\n    place (gratis or for a charge), and offer equivalent access to the\n    Corresponding Source in the same way through the same place at no\n    further charge.  You need not require recipients to copy the\n    Corresponding Source along with the object code.  If the place to\n    copy the object code is a network server, the Corresponding Source\n    may be on a different server (operated by you or a third party)\n    that supports equivalent copying facilities, provided you maintain\n    clear directions next to the object code saying where to find the\n    Corresponding Source.  Regardless of what server hosts the\n    Corresponding Source, you remain obligated to ensure that it is\n    available for as long as needed to satisfy these requirements.\n\n    e) Convey the object code using peer-to-peer transmission, provided\n    you inform other peers where the object code and Corresponding\n    Source of the work are being offered to the general public at no\n    charge under subsection 6d.\n\n  A separable portion of the object code, whose source code is excluded\nfrom the Corresponding Source as a System Library, need not be\nincluded in conveying the object code work.\n\n  A \"User Product\" is either (1) a \"consumer product\", which means any\ntangible personal property which is normally used for personal, family,\nor household purposes, or (2) anything designed or sold for incorporation\ninto a dwelling.  In determining whether a product is a consumer product,\ndoubtful cases shall be resolved in favor of coverage.  For a particular\nproduct received by a particular user, \"normally used\" refers to a\ntypical or common use of that class of product, regardless of the status\nof the particular user or of the way in which the particular user\nactually uses, or expects or is expected to use, the product.  A product\nis a consumer product regardless of whether the product has substantial\ncommercial, industrial or non-consumer uses, unless such uses represent\nthe only significant mode of use of the product.\n\n  \"Installation Information\" for a User Product means any methods,\nprocedures, authorization keys, or other information required to install\nand execute modified versions of a covered work in that User Product from\na modified version of its Corresponding Source.  The information must\nsuffice to ensure that the continued functioning of the modified object\ncode is in no case prevented or interfered with solely because\nmodification has been made.\n\n  If you convey an object code work under this section in, or with, or\nspecifically for use in, a User Product, and the conveying occurs as\npart of a transaction in which the right of possession and use of the\nUser Product is transferred to the recipient in perpetuity or for a\nfixed term (regardless of how the transaction is characterized), the\nCorresponding Source conveyed under this section must be accompanied\nby the Installation Information.  But this requirement does not apply\nif neither you nor any third party retains the ability to install\nmodified object code on the User Product (for example, the work has\nbeen installed in ROM).\n\n  The requirement to provide Installation Information does not include a\nrequirement to continue to provide support service, warranty, or updates\nfor a work that has been modified or installed by the recipient, or for\nthe User Product in which it has been modified or installed.  Access to a\nnetwork may be denied when the modification itself materially and\nadversely affects the operation of the network or violates the rules and\nprotocols for communication across the network.\n\n  Corresponding Source conveyed, and Installation Information provided,\nin accord with this section must be in a format that is publicly\ndocumented (and with an implementation available to the public in\nsource code form), and must require no special password or key for\nunpacking, reading or copying.\n\n  7. Additional Terms.\n\n  \"Additional permissions\" are terms that supplement the terms of this\nLicense by making exceptions from one or more of its conditions.\nAdditional permissions that are applicable to the entire Program shall\nbe treated as though they were included in this License, to the extent\nthat they are valid under applicable law.  If additional permissions\napply only to part of the Program, that part may be used separately\nunder those permissions, but the entire Program remains governed by\nthis License without regard to the additional permissions.\n\n  When you convey a copy of a covered work, you may at your option\nremove any additional permissions from that copy, or from any part of\nit.  (Additional permissions may be written to require their own\nremoval in certain cases when you modify the work.)  You may place\nadditional permissions on material, added by you to a covered work,\nfor which you have or can give appropriate copyright permission.\n\n  Notwithstanding any other provision of this License, for material you\nadd to a covered work, you may (if authorized by the copyright holders of\nthat material) supplement the terms of this License with terms:\n\n    a) Disclaiming warranty or limiting liability differently from the\n    terms of sections 15 and 16 of this License; or\n\n    b) Requiring preservation of specified reasonable legal notices or\n    author attributions in that material or in the Appropriate Legal\n    Notices displayed by works containing it; or\n\n    c) Prohibiting misrepresentation of the origin of that material, or\n    requiring that modified versions of such material be marked in\n    reasonable ways as different from the original version; or\n\n    d) Limiting the use for publicity purposes of names of licensors or\n    authors of the material; or\n\n    e) Declining to grant rights under trademark law for use of some\n    trade names, trademarks, or service marks; or\n\n    f) Requiring indemnification of licensors and authors of that\n    material by anyone who conveys the material (or modified versions of\n    it) with contractual assumptions of liability to the recipient, for\n    any liability that these contractual assumptions directly impose on\n    those licensors and authors.\n\n  All other non-permissive additional terms are considered \"further\nrestrictions\" within the meaning of section 10.  If the Program as you\nreceived it, or any part of it, contains a notice stating that it is\ngoverned by this License along with a term that is a further\nrestriction, you may remove that term.  If a license document contains\na further restriction but permits relicensing or conveying under this\nLicense, you may add to a covered work material governed by the terms\nof that license document, provided that the further restriction does\nnot survive such relicensing or conveying.\n\n  If you add terms to a covered work in accord with this section, you\nmust place, in the relevant source files, a statement of the\nadditional terms that apply to those files, or a notice indicating\nwhere to find the applicable terms.\n\n  Additional terms, permissive or non-permissive, may be stated in the\nform of a separately written license, or stated as exceptions;\nthe above requirements apply either way.\n\n  8. Termination.\n\n  You may not propagate or modify a covered work except as expressly\nprovided under this License.  Any attempt otherwise to propagate or\nmodify it is void, and will automatically terminate your rights under\nthis License (including any patent licenses granted under the third\nparagraph of section 11).\n\n  However, if you cease all violation of this License, then your\nlicense from a particular copyright holder is reinstated (a)\nprovisionally, unless and until the copyright holder explicitly and\nfinally terminates your license, and (b) permanently, if the copyright\nholder fails to notify you of the violation by some reasonable means\nprior to 60 days after the cessation.\n\n  Moreover, your license from a particular copyright holder is\nreinstated permanently if the copyright holder notifies you of the\nviolation by some reasonable means, this is the first time you have\nreceived notice of violation of this License (for any work) from that\ncopyright holder, and you cure the violation prior to 30 days after\nyour receipt of the notice.\n\n  Termination of your rights under this section does not terminate the\nlicenses of parties who have received copies or rights from you under\nthis License.  If your rights have been terminated and not permanently\nreinstated, you do not qualify to receive new licenses for the same\nmaterial under section 10.\n\n  9. Acceptance Not Required for Having Copies.\n\n  You are not required to accept this License in order to receive or\nrun a copy of the Program.  Ancillary propagation of a covered work\noccurring solely as a consequence of using peer-to-peer transmission\nto receive a copy likewise does not require acceptance.  However,\nnothing other than this License grants you permission to propagate or\nmodify any covered work.  These actions infringe copyright if you do\nnot accept this License.  Therefore, by modifying or propagating a\ncovered work, you indicate your acceptance of this License to do so.\n\n  10. Automatic Licensing of Downstream Recipients.\n\n  Each time you convey a covered work, the recipient automatically\nreceives a license from the original licensors, to run, modify and\npropagate that work, subject to this License.  You are not responsible\nfor enforcing compliance by third parties with this License.\n\n  An \"entity transaction\" is a transaction transferring control of an\norganization, or substantially all assets of one, or subdividing an\norganization, or merging organizations.  If propagation of a covered\nwork results from an entity transaction, each party to that\ntransaction who receives a copy of the work also receives whatever\nlicenses to the work the party's predecessor in interest had or could\ngive under the previous paragraph, plus a right to possession of the\nCorresponding Source of the work from the predecessor in interest, if\nthe predecessor has it or can get it with reasonable efforts.\n\n  You may not impose any further restrictions on the exercise of the\nrights granted or affirmed under this License.  For example, you may\nnot impose a license fee, royalty, or other charge for exercise of\nrights granted under this License, and you may not initiate litigation\n(including a cross-claim or counterclaim in a lawsuit) alleging that\nany patent claim is infringed by making, using, selling, offering for\nsale, or importing the Program or any portion of it.\n\n  11. Patents.\n\n  A \"contributor\" is a copyright holder who authorizes use under this\nLicense of the Program or a work on which the Program is based.  The\nwork thus licensed is called the contributor's \"contributor version\".\n\n  A contributor's \"essential patent claims\" are all patent claims\nowned or controlled by the contributor, whether already acquired or\nhereafter acquired, that would be infringed by some manner, permitted\nby this License, of making, using, or selling its contributor version,\nbut do not include claims that would be infringed only as a\nconsequence of further modification of the contributor version.  For\npurposes of this definition, \"control\" includes the right to grant\npatent sublicenses in a manner consistent with the requirements of\nthis License.\n\n  Each contributor grants you a non-exclusive, worldwide, royalty-free\npatent license under the contributor's essential patent claims, to\nmake, use, sell, offer for sale, import and otherwise run, modify and\npropagate the contents of its contributor version.\n\n  In the following three paragraphs, a \"patent license\" is any express\nagreement or commitment, however denominated, not to enforce a patent\n(such as an express permission to practice a patent or covenant not to\nsue for patent infringement).  To \"grant\" such a patent license to a\nparty means to make such an agreement or commitment not to enforce a\npatent against the party.\n\n  If you convey a covered work, knowingly relying on a patent license,\nand the Corresponding Source of the work is not available for anyone\nto copy, free of charge and under the terms of this License, through a\npublicly available network server or other readily accessible means,\nthen you must either (1) cause the Corresponding Source to be so\navailable, or (2) arrange to deprive yourself of the benefit of the\npatent license for this particular work, or (3) arrange, in a manner\nconsistent with the requirements of this License, to extend the patent\nlicense to downstream recipients.  \"Knowingly relying\" means you have\nactual knowledge that, but for the patent license, your conveying the\ncovered work in a country, or your recipient's use of the covered work\nin a country, would infringe one or more identifiable patents in that\ncountry that you have reason to believe are valid.\n\n  If, pursuant to or in connection with a single transaction or\narrangement, you convey, or propagate by procuring conveyance of, a\ncovered work, and grant a patent license to some of the parties\nreceiving the covered work authorizing them to use, propagate, modify\nor convey a specific copy of the covered work, then the patent license\nyou grant is automatically extended to all recipients of the covered\nwork and works based on it.\n\n  A patent license is \"discriminatory\" if it does not include within\nthe scope of its coverage, prohibits the exercise of, or is\nconditioned on the non-exercise of one or more of the rights that are\nspecifically granted under this License.  You may not convey a covered\nwork if you are a party to an arrangement with a third party that is\nin the business of distributing software, under which you make payment\nto the third party based on the extent of your activity of conveying\nthe work, and under which the third party grants, to any of the\nparties who would receive the covered work from you, a discriminatory\npatent license (a) in connection with copies of the covered work\nconveyed by you (or copies made from those copies), or (b) primarily\nfor and in connection with specific products or compilations that\ncontain the covered work, unless you entered into that arrangement,\nor that patent license was granted, prior to 28 March 2007.\n\n  Nothing in this License shall be construed as excluding or limiting\nany implied license or other defenses to infringement that may\notherwise be available to you under applicable patent law.\n\n  12. No Surrender of Others' Freedom.\n\n  If conditions are imposed on you (whether by court order, agreement or\notherwise) that contradict the conditions of this License, they do not\nexcuse you from the conditions of this License.  If you cannot convey a\ncovered work so as to satisfy simultaneously your obligations under this\nLicense and any other pertinent obligations, then as a consequence you may\nnot convey it at all.  For example, if you agree to terms that obligate you\nto collect a royalty for further conveying from those to whom you convey\nthe Program, the only way you could satisfy both those terms and this\nLicense would be to refrain entirely from conveying the Program.\n\n  13. Use with the GNU Affero General Public License.\n\n  Notwithstanding any other provision of this License, you have\npermission to link or combine any covered work with a work licensed\nunder version 3 of the GNU Affero General Public License into a single\ncombined work, and to convey the resulting work.  The terms of this\nLicense will continue to apply to the part which is the covered work,\nbut the special requirements of the GNU Affero General Public License,\nsection 13, concerning interaction through a network will apply to the\ncombination as such.\n\n  14. Revised Versions of this License.\n\n  The Free Software Foundation may publish revised and/or new versions of\nthe GNU General Public License from time to time.  Such new versions will\nbe similar in spirit to the present version, but may differ in detail to\naddress new problems or concerns.\n\n  Each version is given a distinguishing version number.  If the\nProgram specifies that a certain numbered version of the GNU General\nPublic License \"or any later version\" applies to it, you have the\noption of following the terms and conditions either of that numbered\nversion or of any later version published by the Free Software\nFoundation.  If the Program does not specify a version number of the\nGNU General Public License, you may choose any version ever published\nby the Free Software Foundation.\n\n  If the Program specifies that a proxy can decide which future\nversions of the GNU General Public License can be used, that proxy's\npublic statement of acceptance of a version permanently authorizes you\nto choose that version for the Program.\n\n  Later license versions may give you additional or different\npermissions.  However, no additional obligations are imposed on any\nauthor or copyright holder as a result of your choosing to follow a\nlater version.\n\n  15. Disclaimer of Warranty.\n\n  THERE IS NO WARRANTY FOR THE PROGRAM, TO THE EXTENT PERMITTED BY\nAPPLICABLE LAW.  EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT\nHOLDERS AND/OR OTHER PARTIES PROVIDE THE PROGRAM \"AS IS\" WITHOUT WARRANTY\nOF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO,\nTHE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR\nPURPOSE.  THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE PROGRAM\nIS WITH YOU.  SHOULD THE PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF\nALL NECESSARY SERVICING, REPAIR OR CORRECTION.\n\n  16. Limitation of Liability.\n\n  IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING\nWILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MODIFIES AND/OR CONVEYS\nTHE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, INCLUDING ANY\nGENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE\nUSE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED TO LOSS OF\nDATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD\nPARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS),\nEVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF\nSUCH DAMAGES.\n\n  17. Interpretation of Sections 15 and 16.\n\n  If the disclaimer of warranty and limitation of liability provided\nabove cannot be given local legal effect according to their terms,\nreviewing courts shall apply local law that most closely approximates\nan absolute waiver of all civil liability in connection with the\nProgram, unless a warranty or assumption of liability accompanies a\ncopy of the Program in return for a fee.\n\n                     END OF TERMS AND CONDITIONS\n\n            How to Apply These Terms to Your New Programs\n\n  If you develop a new program, and you want it to be of the greatest\npossible use to the public, the best way to achieve this is to make it\nfree software which everyone can redistribute and change under these terms.\n\n  To do so, attach the following notices to the program.  It is safest\nto attach them to the start of each source file to most effectively\nstate the exclusion of warranty; and each file should have at least\nthe \"copyright\" line and a pointer to where the full notice is found.\n\n    Project Zomboid Dedicated Server using SteamCMD Docker Image.\n    Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n\n    This program is free software: you can redistribute it and/or modify\n    it under the terms of the GNU General Public License as published by\n    the Free Software Foundation, either version 3 of the License, or\n    (at your option) any later version.\n\n    This program is distributed in the hope that it will be useful,\n    but WITHOUT ANY WARRANTY; without even the implied warranty of\n    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n    GNU General Public License for more details.\n\n    You should have received a copy of the GNU General Public License\n    along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\nAlso add information on how to contact you by electronic and paper mail.\n\n  If the program does terminal interaction, make it output a short\nnotice like this when it starts in an interactive mode:\n\n    Project Zomboid Dedicated Server using SteamCMD Docker Image.\n    Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n\n    This program comes with ABSOLUTELY NO WARRANTY; for details type `show w'.\n    This is free software, and you are welcome to redistribute it\n    under certain conditions; type `show c' for details.\n\nThe hypothetical commands `show w' and `show c' should show the appropriate\nparts of the General Public License.  Of course, your program's commands\nmight be different; for a GUI interface, you would use an \"about box\".\n\n  You should also get your employer (if you work as a programmer) or school,\nif any, to sign a \"copyright disclaimer\" for the program, if necessary.\nFor more information on this, and how to apply and follow the GNU GPL, see\n<https://www.gnu.org/licenses/>.\n\n  The GNU General Public License does not permit incorporating your program\ninto proprietary programs.  If your program is a subroutine library, you\nmay consider it more useful to permit linking proprietary applications with\nthe library.  If this is what you want to do, use the GNU Lesser General\nPublic License instead of this License.  But first, please read\n<https://www.gnu.org/licenses/why-not-lgpl.html>.\n"
  },
  {
    "path": "README.md",
    "content": "# Project Zomboid Dedicated Server\n\n## Disclaimer\n\n**Note:** This image is not officially supported by Valve, nor by The Indie Stone.\n\nIf issues are encountered, please report them on\nthe [GitHub repository](https://github.com/Renegade-Master/zomboid-dedicated-server/issues/new/choose)\n\n## Badges\n\n[![Build and Test Server Image](https://github.com/Renegade-Master/zomboid-dedicated-server/actions/workflows/docker-build.yml/badge.svg?branch=main)](https://github.com/Renegade-Master/zomboid-dedicated-server/actions/workflows/docker-build.yml)\n[![Docker Repository on Quay](https://quay.io/repository/renegade_master/zomboid-dedicated-server/status \"Docker Repository on Quay\")](https://quay.io/repository/renegade_master/zomboid-dedicated-server)\n\n![Docker Image Version (latest by date)](https://img.shields.io/docker/v/renegademaster/zomboid-dedicated-server?label=Latest%20Version)\n![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/renegademaster/zomboid-dedicated-server?label=Image%20Size)\n![DockerHub Pulls](https://img.shields.io/docker/pulls/renegademaster/zomboid-dedicated-server?label=DockerHub%20Pull%20Count)\n\n## Description\n\nDedicated Server for Project Zomboid using Docker, and optionally Docker-Compose.\nBuilt almost from scratch to be the smallest Project Zomboid Dedicated Server around!\n\n**Note:** This Image is \"rootless\", and therefore should not be run as the `root` user.\nAttempting to do so will prevent the server from starting (\nsee [#8](https://github.com/Renegade-Master/zomboid-dedicated-server/issues/8)\n, [#14](https://github.com/Renegade-Master/zomboid-dedicated-server/issues/14)).\n\nBare-Minimum instructions to get a server running:\n\n```shell\n# Pull the latest image:\ndocker pull renegademaster/zomboid-dedicated-server:latest\n\n# Make two folders\nmkdir ZomboidConfig ZomboidDedicatedServer\n\n# Run the server (with bare minimum options):\ndocker run --detach \\\n    --mount type=bind,source=\"$(pwd)/ZomboidDedicatedServer\",target=/home/steam/ZomboidDedicatedServer \\\n    --mount type=bind,source=\"$(pwd)/ZomboidConfig\",target=/home/steam/Zomboid \\\n    --publish 16261:16261/udp --publish 16262:16262/udp \\\n    --name zomboid-server \\\n    docker.io/renegademaster/zomboid-dedicated-server:latest\n```\n\nThe default behaviour of the Container is not to automatically restart after a crash to give the user time to investigate the cause of the issue. You may however want to change the [restart policy](https://docs.docker.com/engine/reference/run/#restart-policies---restart) to automatically recover from an unexpected failure. The following options will help to recover from such a situation:\n\n- `--restart=unless-stopped` will restart the container every time that it exits unless the Container is stopped using the Docker/Podman API.\n- `--restart=on-failure[:max-retries]` will restart the container only if it exits with a non-zero exit code. Optionally, it can also be configured to only restart a fixed number of times to help prevent crash-loops.\n\nThese same options can be set in the `docker-compose.yaml` file.\n\n### Assurance / Testing\n\nFor every commit, the server is built and started briefly using GitHub Actions. This is to ensure that the server always\nworks, and makes it less likely that there will be a version released that does not function. The main configurations\nare changed and checked after starting the server to verify that it is possible for a user to configure their instance.\nCustom Ports and Remote RCON commands are also used during the validation to ensure that the user can host the server\nusing any Port combination of their choice. You can view the previous Action\nruns [here](https://github.com/Renegade-Master/zomboid-dedicated-server/actions/workflows/docker-build.yml).\n\n## Links\n\n### Source:\n\n- [GitHub Repository](https://github.com/Renegade-Master/zomboid-dedicated-server)\n\n### Images:\n\n| Provider                                                                                                               | Image                                               | Pull Command                                                                                                                                     |\n| ---------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------ |\n| [GitHub Packages](https://github.com/Renegade-Master/zomboid-dedicated-server/pkgs/container/zomboid-dedicated-server) | `ghcr.io/renegade-master/zomboid-dedicated-server`  | `docker pull ghcr.io/renegade-master/zomboid-dedicated-server:x.y.z`<br/>`docker pull ghcr.io/renegade-master/zomboid-dedicated-server:latest`   |\n| [DockerHub](https://hub.docker.com/r/renegademaster/zomboid-dedicated-server)                                          | `docker.io/renegademaster/zomboid-dedicated-server` | `docker pull docker.io/renegademaster/zomboid-dedicated-server:x.y.z`<br/>`docker pull docker.io/renegademaster/zomboid-dedicated-server:latest` |\n| [Red Hat Quay](https://quay.io/repository/renegade_master/zomboid-dedicated-server)                                    | `quay.io/renegade_master/zomboid-dedicated-server`  | `docker pull quay.io/renegade_master/zomboid-dedicated-server:x.y.z`<br/>`docker pull quay.io/renegade_master/zomboid-dedicated-server:latest`   |\n\n### External Resources:\n\n- [Dedicated Server Wiki](https://pzwiki.net/wiki/Dedicated_Server)\n- [Dedicated Server Configuration](https://pzwiki.net/wiki/Server_Settings)\n- [Steam DB Page](https://steamdb.info/app/380870/)\n\n## Prerequisites\n\n### Directories\n\nTwo directories are required to be present on the host:\n\n| Name               | Directory                | Description                                          |\n| ------------------ | ------------------------ | ---------------------------------------------------- |\n| Configuration Data | `ZomboidConfig`          | For storing the server configuration and save files. |\n| Installation Data  | `ZomboidDedicatedServer` | For storing the server game data.                    |\n\nThese folders must be created in the directory that you intend to run the Docker image from. This could be a folder that\nyou have created in some kind of \"server directory\", or it could be the root of this repository after you have cloned it\ndown. **_If these folders are not present when the Docker image starts, you will get permissions errors_** (\nsee [#8](https://github.com/Renegade-Master/zomboid-dedicated-server/issues/8)\n, [#14](https://github.com/Renegade-Master/zomboid-dedicated-server/issues/14)\n, [#17](https://github.com/Renegade-Master/zomboid-dedicated-server/issues/17)) because the Docker engine will create\nthe folders at Container runtime. This creates them under the `root` user on the host which causes permissions\nconflicts.\n\nThe 'Configuration Data' folder is where the server configuration and save files are stored. This folder can be opened\nand edited just like if you were running the server without Docker. You can backup your save files, or edit the server\nconfiguration files. You should start the server once successfully before attempting to edit files in the 'Configuration\nData' folder. Once the files are generated, it is safe to edit them. Most configuration option changes will require a\nrestart of the server to properly take effect. Most of these settings are also configurable from the in-game Admin menu.\n\nThe 'Installation Data' folder is where the server game data is stored. This folder can be opened and edited, but a full\nrestart of the server can sometimes reset changes to this folder during file verification. Therefore, the recommended\nway to change files that would be stored in this folder is to use the Environment Variables in the 'Optional Arguments'\ntable provided by the Docker image.\n\n### Ports\n\nThere are a total of three ports that can be utilised by the server, but only two are strictly required:\n\n| Name           | Default Port | Description                                                          | Required |\n|----------------|--------------|----------------------------------------------------------------------| -------- |\n| `DEFAULT_PORT` | `16261`      | Port used by the server to listen for connections.                   | yes      |\n| `RCON_PORT`    | `27015`      | Port used by the server to listen for RCON connections/commands.     | no       |\n| `UDP_PORT`     | `16262`      | Additional Port used by the server to facilitate Client connections. | yes      |\n\nAll Ports are configurable to use different Port numbers, however you must be aware that by changing a Port in the game\nconfiguration files, that you must also expose the changed (or default) Port in the Docker run command `--publish ...`\nor present under the `services.zomboid-server.ports` configuration key of the Docker-Compose file. Also, _**it is\nessential that these Ports are not blocked by a firewall**_. If you are behind a router and/or firewall, you will almost\ndefinitely need to open these Ports in order for anyone else outside your network to connect to the server. Port\nforwarding, and opening Ports in hosted servers is not within the scope of this project. To get instructions for your\nspecific use case you will need to ask your ISP, Server Provider, or consult the instructions on your Third-Party\nRouter.\n\nThe strictly required Ports (`QUERY_PORT` and `GAME_PORT`) are used by the server to listen for connections and\ncommunicate with connected clients. These Ports must be assigned a value, and must be accessible from the Internet\n(i.e. \"forwarded\").\n\nIf you intend to use RCON to interact with the server, then it follows that that Port (`RCON_PORT`) must also be open\nfor connections. This is not required if you do not intend to use RCON, and in this scenario, keeping it closed enhances\nthe security of your server. If you do not wish to use RCON, then it does not need to be present in the Docker run\ncommand, nor in the Docker-Compose file.\n\n## Instructions\n\nThe server can be run using plain Docker, or using Docker-Compose. The end-result is the same, but Docker-Compose is\nrecommended for ease of configuration.\n\n### Optional environment variables\n\n| Argument         | Description                                  | Values            | Default       |\n| ---------------- | -------------------------------------------- | ----------------- | ------------- |\n| `ADMIN_PASSWORD` | Server Admin account password                | [a-zA-Z0-9]+      | changeme      |\n| `ADMIN_USERNAME` | Server Admin account username                | [a-zA-Z0-9]+      | superuser     |\n| `BIND_IP`        | IP to bind the server to                     | 0.0.0.0           | 0.0.0.0       |\n| `GAME_VERSION`   | Game version to serve                        | [a-zA-Z0-9_]+     | `public`      |\n| `GC_CONFIG`      | Specifices Java GC to use                    | [a-zA-Z0-9_]+     | ZGC           |\n| `MAP_NAMES`      | Map Names (e.g. North;South)                 | map1;map2;map3    | Muldraugh, KY |\n| `MAX_RAM`        | Maximum amount of RAM to be used             | ([0-9]+)m         | 4096m         |\n| `STEAM_VAC`      | Use Steam VAC anti-cheat                     | (true&vert;false) | true          |\n| `TZ`             | Set the timezone for the container           | [A-Z]+            | UTC           |\n| `USE_STEAM`      | Create a Steam Server, or a Non-Steam Server | (true&vert;false) | true          |\n\n### Config file environment variables\n\nThe following environment variables will automatically overwrite values in the server's config.ini file (located\nat `/home/steam/Zomboid/Server/[name].ini`).\nEditing these values directly in the .ini file will result in them being overwritten with either the default value, or\nthe configured environment variable.\n\nAny other values *can* and *should* be edited directly in the .ini file.\n\n| Argument            | Description                                                                                                                             | .ini variable         | Values                 | Default       |\n|---------------------|-----------------------------------------------------------------------------------------------------------------------------------------| --------------------- | ---------------------- | ------------- |\n| `AUTOSAVE_INTERVAL` | Interval between autosaves in minutes                                                                                                   | SaveWorldEveryMinutes | [0-9]+                 | 15m           |\n| `DEFAULT_PORT`      | Port for other players to connect to                                                                                                    | DefaultPort           | 1000 - 65535           | 16261         |\n| `MAX_PLAYERS`       | Maximum players allowed in the Server                                                                                                   | MaxPlayers            | [0-9]+                 | 16            |\n| `MOD_NAMES`         | Workshop Mod Names (e.g. ClaimNonResidential;MoreDescriptionForTraits)                                                                  | Mods                  | mod1;mod2;mod          |               |\n| `MOD_WORKSHOP_IDS`  | Workshop Mod IDs (e.g. 2160432461;2685168362)                                                                                           | WorkshopItems         | 2160432461;2685168362; |               |\n| `PAUSE_ON_EMPTY`    | Pause the Server when no Players are connected                                                                                          | PauseEmpty            | (true&vert;false)      | true          |\n| `PUBLIC_SERVER`     | If set to `false` only Pre-Approved/Allowed players can join the server (**NOTE:** Do not confuse with the `Public` option in the .ini) | Open                  | (true&vert;false)      | true          |\n| `RCON_PASSWORD`     | Password for authenticating incoming RCON commands                                                                                      | RCONPassword          | [a-zA-Z0-9]+           | changeme_rcon |\n| `RCON_PORT`         | Port to listen on for RCON commands                                                                                                     | RCONPort              | (true&vert;false)      | 27015         |\n| `SERVER_NAME`       | Publicly visible Server Name                                                                                                            | PublicName            | [a-zA-Z0-9]+           | ZomboidServer |\n| `SERVER_PASSWORD`   | Server password                                                                                                                         | Password              | [a-zA-Z0-9]+           |               |\n| `UDP_PORT`          | Additional Port for facilitating Client connections                                                                                     | SteamPort1            | 1000 - 65535           | 8766          |\n\n### Docker\n\nThe following are instructions for running the server using the Docker image.\n\n1. Acquire the image locally:\n\n    - Pull the image from DockerHub:\n\n      ```shell\n      docker pull renegademaster/zomboid-dedicated-server:<tagname>\n      ```\n\n    - Or alternatively, build the image:\n\n      ```shell\n      git clone https://github.com/Renegade-Master/zomboid-dedicated-server.git \\\n          && cd zomboid-dedicated-server\n\n      docker build -t docker.io/renegademaster/zomboid-dedicated-server:<tag> -f docker/zomboid-dedicated-server.Dockerfile .\n      ```\n\n2. Run the container:\n\n   **\\*Note**: Arguments inside square brackets are optional. If the default ports are to be overridden, then the\n   `published` ports below must also be changed\\*\n\n   ```shell\n   mkdir ZomboidConfig ZomboidDedicatedServer\n\n   docker run --detach \\\n       --mount type=bind,source=\"$(pwd)/ZomboidDedicatedServer\",target=/home/steam/ZomboidDedicatedServer \\\n       --mount type=bind,source=\"$(pwd)/ZomboidConfig\",target=/home/steam/Zomboid \\\n       --publish 16261:16261/udp --publish 16262:16262/udp [--publish 27015:27015/tcp] \\\n       --name zomboid-server \\\n       [--restart=no] \\\n       [--env=ADMIN_PASSWORD=<value>] \\\n       [--env=ADMIN_USERNAME=<value>] \\\n       [--env=AUTOSAVE_INTERVAL=<value>] \\\n       [--env=BIND_IP=<value>] \\\n       [--env=GAME_PORT=<value>] \\\n       [--env=GAME_VERSION=<value>] \\\n       [--env=GC_CONFIG=<value>] \\\n       [--env=MAP_NAMES=<value>] \\\n       [--env=MAX_PLAYERS=<value>] \\\n       [--env=MAX_RAM=<value>] \\\n       [--env=MOD_NAMES=<value>] \\\n       [--env=MOD_WORKSHOP_IDS=<value>] \\\n       [--env=PAUSE_ON_EMPTY=<value>] \\\n       [--env=PUBLIC_SERVER=<value>] \\\n       [--env=QUERY_PORT=<value>] \\\n       [--env=RCON_PASSWORD=<value>] \\\n       [--env=RCON_PORT=<value>] \\\n       [--env=SERVER_NAME=<value>] \\\n       [--env=SERVER_PASSWORD=<value>] \\\n       [--env=STEAM_VAC=<value>] \\\n       [--env=TZ=<value>] \\\n       [--env=USE_STEAM=<value>] \\\n       docker.io/renegademaster/zomboid-dedicated-server[:<tagname>]\n   ```\n\n3. Optionally, reattach the terminal to the log output (**\\*Note**: this is not an Interactive Terminal\\*)\n\n   ```shell\n   docker logs --follow zomboid-server\n   ```\n\n4. Once you see `LuaNet: Initialization [DONE]` in the console, people can start to join the server.\n\n### Docker-Compose\n\nThe following are instructions for running the server using Docker-Compose.\n\n1. Download the repository:\n\n   ```shell\n   git clone https://github.com/Renegade-Master/zomboid-dedicated-server.git \\\n       && cd zomboid-dedicated-server\n   ```\n\n2. Make any configuration changes you want to in the `docker-compose.yaml` file. In\n   the `services.zomboid-server.environment` section, you can change values for the server configuration.\n\n   **\\*Note**: If the default ports are to be overridden, then the `published` ports must also be changed\\*\n\n3. Run the following commands:\n\n    - Make the data and configuration directories:\n\n      ```shell\n      mkdir ZomboidConfig ZomboidDedicatedServer\n      ```\n\n    - Pull the image from DockerHub:\n\n      ```shell\n      docker-compose up --detach\n      ```\n\n    - Or alternatively, build the image:\n\n      ```shell\n      docker-compose up --build --detach\n      ```\n\n4. Optionally, reattach the terminal to the log output (**\\*Note**: this is not an Interactive Terminal\\*)\n\n   ```shell\n   docker-compose logs --follow\n   ```\n\n5. Once you see `LuaNet: Initialization [DONE]` in the console, people can start to join the server.\n"
  },
  {
    "path": "docker/zomboid-dedicated-server.Dockerfile",
    "content": "#   Project Zomboid Dedicated Server using SteamCMD Docker Image.\n#   Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n#\n#   This program is free software: you can redistribute it and/or modify\n#   it under the terms of the GNU General Public License as published by\n#   the Free Software Foundation, either version 3 of the License, or\n#   (at your option) any later version.\n#\n#   This program is distributed in the hope that it will be useful,\n#   but WITHOUT ANY WARRANTY; without even the implied warranty of\n#   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#   GNU General Public License for more details.\n#\n#   You should have received a copy of the GNU General Public License\n#   along with this program.  If not, see <https://www.gnu.org/licenses/>.\n\n#######################################################################\n#   Author: Renegade-Master\n#   Description: Base image for running a Dedicated Project Zomboid\n#       server.\n#   License: GNU General Public License v3.0 (see LICENSE)\n#######################################################################\n\n# Base Image\nARG BASE_IMAGE=\"docker.io/renegademaster/steamcmd-minimal:2.0.0-root\"\n\nFROM ${BASE_IMAGE}\n\n# Add metadata labels\nLABEL com.renegademaster.zomboid-dedicated-server.authors=\"Renegade-Master\" \\\n    com.renegademaster.zomboid-dedicated-server.contributors=\"JohnEarle, ramielrowe\" \\\n    com.renegademaster.zomboid-dedicated-server.source-repository=\"https://github.com/Renegade-Master/zomboid-dedicated-server\" \\\n    com.renegademaster.zomboid-dedicated-server.image-repository=\"https://hub.docker.com/renegademaster/zomboid-dedicated-server\"\n\n# Copy the source files\nCOPY src /home/steam/\n\n# Install Python, and take ownership of rcon binary\nRUN sed -i 's|http://[^ ]*|http://old-releases.ubuntu.com/ubuntu|g' /etc/apt/sources.list \\\n    && apt-get update && apt-get upgrade -y \\\n    && apt-get install -y --no-install-recommends \\\n        python3-minimal iputils-ping tzdata \\\n    && apt-get autoremove -y \\\n    && rm -rf /var/lib/apt/lists/*\n\n# Run the setup script\nENTRYPOINT [\"/bin/bash\", \"/home/steam/run_server.sh\"]\n"
  },
  {
    "path": "docker-compose.yaml",
    "content": "#\n#  Project Zomboid Dedicated Server using SteamCMD Docker Image.\n#  Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n#\n#  This program is free software: you can redistribute it and/or modify\n#  it under the terms of the GNU General Public License as published by\n#  the Free Software Foundation, either version 3 of the License, or\n#  (at your option) any later version.\n#\n#  This program is distributed in the hope that it will be useful,\n#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#  GNU General Public License for more details.\n#\n#  You should have received a copy of the GNU General Public License\n#  along with this program.  If not, see <https://www.gnu.org/licenses/>.\n#\n\nversion: \"3.8\"\n\nservices:\n  zomboid-dedicated-server:\n    build:\n      context: .\n      dockerfile: docker/zomboid-dedicated-server.Dockerfile\n    image: \"docker.io/renegademaster/zomboid-dedicated-server:latest\"\n    container_name: zomboid-dedicated-server\n    restart: \"no\"\n    environment:\n      - \"ADMIN_PASSWORD=changeme\"\n      - \"ADMIN_USERNAME=superuser\"\n      - \"AUTOSAVE_INTERVAL=15\"\n      - \"BIND_IP=0.0.0.0\"\n      - \"DEFAULT_PORT=16261\"\n      - \"GAME_VERSION=public\"\n      - \"GC_CONFIG=ZGC\"\n      - \"MAP_NAMES=Muldraugh, KY\"\n      - \"MAX_PLAYERS=16\"\n      - \"MAX_RAM=4096m\"\n      - \"MOD_NAMES=\"\n      - \"MOD_WORKSHOP_IDS=\"\n      - \"PAUSE_ON_EMPTY=true\"\n      - \"PUBLIC_SERVER=true\"\n      - \"RCON_PASSWORD=changeme_rcon\"\n      - \"RCON_PORT=27015\"\n      - \"SERVER_NAME=ZomboidServer\"\n      - \"SERVER_PASSWORD=\"\n      - \"STEAM_VAC=true\"\n      - \"UDP_PORT=16262\"\n      - \"USE_STEAM=true\"\n      - \"TZ=UTC\"\n    ports:\n      - target: 16261\n        published: 16261\n        protocol: udp\n      - target: 16262\n        published: 16262\n        protocol: udp\n      - target: 27015\n        published: 27015\n        protocol: tcp\n    volumes:\n      - ./ZomboidDedicatedServer:/home/steam/ZomboidDedicatedServer\n      - ./ZomboidConfig:/home/steam/Zomboid/\n"
  },
  {
    "path": "src/edit_server_config.py",
    "content": "#!/usr/bin/env python3\n\n#\n#  Project Zomboid Dedicated Server using SteamCMD Docker Image.\n#  Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n#\n#  This program is free software: you can redistribute it and/or modify\n#  it under the terms of the GNU General Public License as published by\n#  the Free Software Foundation, either version 3 of the License, or\n#  (at your option) any later version.\n#\n#  This program is distributed in the hope that it will be useful,\n#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#  GNU General Public License for more details.\n#\n#  You should have received a copy of the GNU General Public License\n#  along with this program.  If not, see <https://www.gnu.org/licenses/>.\n#\n\n\"\"\"\nAuthor: Renegade-Master\nDescription:\n    Script for editing the Project Zomboid Dedicated Server\n    configuration file\n\"\"\"\n\nimport sys\nfrom configparser import RawConfigParser\n\n\ndef save_config(config: RawConfigParser, config_file: str) -> None:\n    \"\"\"\n    Saves the server config file\n    :param config: Dictionary of the values\n    :param config_file: Path to the server config file\n    :return: None\n    \"\"\"\n\n    # Overwrite the file value with the new value\n    with open(config_file, \"w\") as file:\n        config.write(file, space_around_delimiters=False)\n\n\ndef load_config(config_file: str) -> RawConfigParser:\n    \"\"\"\n    Loads the server config file\n    :param config_file: Path to the server config file\n    :return: ConfigParser Object containing the values\n    \"\"\"\n\n    # Ensure that the file starts with a Section\n    with open(config_file, \"r+\") as file:\n        lines = file.readlines()\n        if lines[0] != \"[ServerConfig]\\n\":\n            file.seek(0)\n            file.write(\"[ServerConfig]\\n\")\n            for line in lines:\n                file.write(line)\n\n    cp: RawConfigParser = RawConfigParser()\n    cp.optionxform = lambda option: option\n\n    if cp.read(config_file) is not None:\n        return cp\n    else:\n        raise TypeError(\"Config file is invalid!\")\n\n\ndef check_server_config_file(config_file: str) -> bool:\n    \"\"\"\n    Checks if the server config file exists\n    :param config_file: Path to the server config file\n    :return: True if the file exists, False if not\n    \"\"\"\n\n    try:\n        with open(config_file, \"r\") as file:\n            return True\n    except FileNotFoundError:\n        sys.stderr.write(f\"{config_file} not found!\\n\")\n        return False\n\n\nif __name__ == \"__main__\":\n    if len(sys.argv) < 3 or len(sys.argv) > 4:\n        print(\"Usage: edit_server_config.py <config_file> <key> [<value>]\")\n        sys.exit(1)\n\n    config_file: str = sys.argv[1]\n    key: str = sys.argv[2]\n\n    if check_server_config_file(config_file):\n        config: RawConfigParser = load_config(config_file)\n\n        if len(sys.argv) == 3:\n            # Return the value of the given key\n            if 'ServerConfig' in config:\n                if key in config['ServerConfig']:\n                    print(f\"{config['ServerConfig'][key]}\")\n        else:\n            # Assign a new value\n            value: str = sys.argv[3]\n\n            # Set the desired value\n            config['ServerConfig'][key] = value\n\n            # Save the config file\n            save_config(config, config_file)\n"
  },
  {
    "path": "src/install_server.scmd",
    "content": "///////////////////////////////////////////////////////////////////////\n// Author: Renegade-Master\n// Description: SteamCMD installation script for Project Zomboid\n//   Dedicated Server\n// License: GNU General Public License v3.0 (see LICENSE)\n///////////////////////////////////////////////////////////////////////\n\n// Do not shutdown on a failed command\n@ShutdownOnFailedCommand 0\n\n//No password as this is unattended\n@NoPromptForPassword 1\n\n// Set the game installation directory\nforce_install_dir /home/steam/ZomboidDedicatedServer\n\nlogin anonymous\n\n// Install/Update the Project Zomboid Dedicated Server\napp_update 380870 -beta GAME_VERSION validate\n\nquit\n"
  },
  {
    "path": "src/run_server.sh",
    "content": "#!/usr/bin/env bash\n\n#\n#  Project Zomboid Dedicated Server using SteamCMD Docker Image.\n#  Copyright (C) 2021-2022 Renegade-Master [renegade.master.dev@protonmail.com]\n#\n#  This program is free software: you can redistribute it and/or modify\n#  it under the terms of the GNU General Public License as published by\n#  the Free Software Foundation, either version 3 of the License, or\n#  (at your option) any later version.\n#\n#  This program is distributed in the hope that it will be useful,\n#  but WITHOUT ANY WARRANTY; without even the implied warranty of\n#  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the\n#  GNU General Public License for more details.\n#\n#  You should have received a copy of the GNU General Public License\n#  along with this program.  If not, see <https://www.gnu.org/licenses/>.\n#\n\n#######################################################################\n#   Author: Renegade-Master\n#   Contributors: JohnEarle, ramielrowe\n#   Description: Install, update, and start a Dedicated Project Zomboid\n#       instance.\n#######################################################################\n\n# Set to `-x` for Debug logging\nset +x -o pipefail\n\n# Handle shutting down the server, with optional RCON quit for graceful shutdown\nfunction shutdown() {\n    if [[ \"$RCON_ENABLED\" == \"true\" ]]; then\n        printf \"\\n### Sending RCON quit command\\n\"\n        rcon --address \"$BIND_IP:$RCON_PORT\" --password \"$RCON_PASSWORD\" quit\n    else\n        printf \"\\n### RCON not enabled: cannot issue quit command.\\nSending SIGTERM...\\n\"\n        pkill -P $$\n    fi\n}\n\n# Start the Server\nfunction start_server() {\n    printf \"\\n### Starting Project Zomboid Server...\\n\"\n    timeout \"$TIMEOUT\" \"$BASE_GAME_DIR\"/start-server.sh \\\n        -cachedir=\"$CONFIG_DIR\" \\\n        -adminusername \"$ADMIN_USERNAME\" \\\n        -adminpassword \"$ADMIN_PASSWORD\" \\\n        -ip \"$BIND_IP\" -port \"$DEFAULT_PORT\" \\\n        -servername \"$SERVER_NAME\" \\\n        -steamvac \"$STEAM_VAC\" \"$USE_STEAM\" &\n\n    server_pid=$!\n    wait $server_pid\n\n    # NOTE(ramielrowe): Apparently the first wait will return immediately after\n    #   the trap handler returns. The server can take a couple seconds to fully\n    #   shutdown after the `quit` command. So, call wait once more to ensure\n    #   the server is fully stopped.\n    wait $server_pid\n\n    printf \"\\n### Project Zomboid Server stopped.\\n\"\n}\n\nfunction apply_postinstall_config() {\n    printf \"\\n### Applying Post Install Configuration...\\n\"\n\n    # Set the Autosave Interval\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"SaveWorldEveryMinutes\" \"$AUTOSAVE_INTERVAL\"\n\n    # Set the default Server Port\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"DefaultPort\" \"$DEFAULT_PORT\"\n\n    # Set the default extra UDP Port\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"UDPPort\" \"$UDP_PORT\"\n\n    # Set the Max Players\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"MaxPlayers\" \"$MAX_PLAYERS\"\n\n    # Set the Mod names\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"Mods\" \"$MOD_NAMES\"\n\n    # Set the Map names\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"Map\" \"$MAP_NAMES\"\n\n    # Set the Mod Workshop IDs\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"WorkshopItems\" \"$MOD_WORKSHOP_IDS\"\n\n    # Set the Pause on Empty Server\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"PauseEmpty\" \"$PAUSE_ON_EMPTY\"\n\n    # Set the Server Publicity status\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"Open\" \"$PUBLIC_SERVER\"\n\n    # Set the Server RCON Password\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"RCONPassword\" \"$RCON_PASSWORD\"\n\n    # Set the Server RCON Port\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"RCONPort\" \"$RCON_PORT\"\n\n    # Set the Server Name\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"PublicName\" \"$SERVER_NAME\"\n\n    # Set the Server Password\n    \"$EDIT_CONFIG\" \"$SERVER_CONFIG\" \"Password\" \"$SERVER_PASSWORD\"\n\n    # Set the maximum amount of RAM for the JVM\n    sed -i \"s/-Xmx.*/-Xmx${MAX_RAM}\\\",/g\" \"${SERVER_VM_CONFIG}\"\n\n    # Set the GC for the JVM (advanced, some crashes can be fixed with a different GC algorithm)\n    sed -i \"s/-XX:+Use.*/-XX:+Use${GC_CONFIG}\\\",/g\" \"${SERVER_VM_CONFIG}\"\n\n    printf \"\\n### Post Install Configuration applied.\\n\"\n}\n\n# Test if this is the the first time the server has run\nfunction test_first_run() {\n    printf \"\\n### Checking if this is the first run...\\n\"\n\n    if [[ ! -f \"$SERVER_CONFIG\" ]] || [[ ! -f \"$SERVER_RULES_CONFIG\" ]]; then\n        printf \"\\n### This is the first run.\\nStarting server for %s seconds\\n\" \"$TIMEOUT\"\n        start_server\n        TIMEOUT=0\n    else\n        printf \"\\n### This is not the first run.\\n\"\n        TIMEOUT=0\n    fi\n\n    printf \"\\n### First run check complete.\\n\"\n}\n\n# Update the server\nfunction update_server() {\n    printf \"\\n### Updating Project Zomboid Server...\\n\"\n\n    steamcmd.sh +runscript \"$STEAM_INSTALL_FILE\"\n\n    printf \"\\n### Project Zomboid Server updated.\\n\"\n}\n\n# Apply user configuration to the server\nfunction apply_preinstall_config() {\n    printf \"\\n### Applying Pre Install Configuration...\\n\"\n\n    # Set the selected game version\n    sed -i \"s/beta .* /beta $GAME_VERSION /g\" \"$STEAM_INSTALL_FILE\"\n\n    printf \"\\n### Pre Install Configuration applied.\\n\"\n}\n\n# Set variables for use in the script\nfunction set_variables() {\n    printf \"\\n### Setting variables...\\n\"\n\n    TIMEOUT=\"60\"\n    EDIT_CONFIG=\"/home/steam/edit_server_config.py\"\n    STEAM_INSTALL_FILE=\"/home/steam/install_server.scmd\"\n    BASE_GAME_DIR=\"/home/steam/ZomboidDedicatedServer\"\n    CONFIG_DIR=\"/home/steam/Zomboid\"\n\n    # Set the Server Admin Password variable\n    ADMIN_USERNAME=${ADMIN_USERNAME:-\"admin\"}\n\n    # Set the Server Admin Password variable\n    ADMIN_PASSWORD=${ADMIN_PASSWORD:-\"changeme\"}\n\n    # Set the Autosave Interval variable\n    AUTOSAVE_INTERVAL=${AUTOSAVE_INTERVAL:-\"15\"}\n\n    # Set the IP address variable\n    # NOTE: Project Zomboid cannot handle the IN_ANY address\n    if [[ -z \"$BIND_IP\" ]] || [[ \"$BIND_IP\" == \"0.0.0.0\" ]]; then\n        BIND_IP=($(hostname -I))\n        BIND_IP=\"${BIND_IP[0]}\"\n    else\n        BIND_IP=\"$BIND_IP\"\n    fi\n    echo \"$BIND_IP\" > \"$CONFIG_DIR/ip.txt\"\n\n    # Set the IP Game Port variable\n    DEFAULT_PORT=${DEFAULT_PORT:-\"16261\"}\n\n    # Set the extra UDP Game Port variable\n    UDP_PORT=${UDP_PORT:-\"16262\"}\n\n    # Set the game version variable\n    GAME_VERSION=${GAME_VERSION:-\"public\"}\n\n    # Set the Max Players variable\n    MAX_PLAYERS=${MAX_PLAYERS:-\"16\"}\n\n    # Set the Maximum RAM variable\n    MAX_RAM=${MAX_RAM:-\"4096m\"}\n\n    # Sets GC\n    GC_CONFIG=${GC_CONFIG:-\"ZGC\"}\n\n    # Set the Mods to use from workshop\n    MOD_NAMES=${MOD_NAMES:-\"\"}\n    MOD_WORKSHOP_IDS=${MOD_WORKSHOP_IDS:-\"\"}\n\n    # Set the Maps to use\n    MAP_NAMES=${MAP_NAMES:-\"Muldraugh, KY\"}\n\n    # Set the Pause on Empty variable\n    PAUSE_ON_EMPTY=${PAUSE_ON_EMPTY:-\"true\"}\n\n    # Set the Server Publicity variable\n    PUBLIC_SERVER=${PUBLIC_SERVER:-\"true\"}\n\n    # Set the IP Query Port variable\n    DEFAULT_PORT=${DEFAULT_PORT:-\"16261\"}\n\n    # Set the Server name variable\n    SERVER_NAME=${SERVER_NAME:-\"ZomboidServer\"}\n\n    # Set the Server Password variable\n    SERVER_PASSWORD=${SERVER_PASSWORD:-\"\"}\n\n    # Set Steam VAC Protection variable\n    STEAM_VAC=${STEAM_VAC:-\"true\"}\n\n    # Set server type variable\n    if [[ -z \"$USE_STEAM\" ]] || [[ \"$USE_STEAM\" == \"true\" ]]; then\n        USE_STEAM=\"\"\n    else\n        USE_STEAM=\"-nosteam\"\n    fi\n\n    # Set RCON configuration\n    if [[ -z \"$RCON_PORT\" ]] || [[ \"$RCON_PORT\" == \"0\" ]]; then\n        RCON_ENABLED=\"false\"\n    else\n        RCON_ENABLED=\"true\"\n        RCON_PORT=${RCON_PORT:-\"27015\"}\n        RCON_PASSWORD=${RCON_PASSWORD:-\"changeme_rcon\"}\n    fi\n\n    SERVER_CONFIG=\"$CONFIG_DIR/Server/$SERVER_NAME.ini\"\n    SERVER_VM_CONFIG=\"$BASE_GAME_DIR/ProjectZomboid64.json\"\n    SERVER_RULES_CONFIG=\"$CONFIG_DIR/Server/${SERVER_NAME}_SandboxVars.lua\"\n}\n\n## Main\nset_variables\napply_preinstall_config\nupdate_server\ntest_first_run\napply_postinstall_config\n\n# Intercept termination signals to stop the server gracefully\ntrap shutdown SIGTERM SIGINT\n\nstart_server\n"
  }
]