├── .docker └── scripts │ ├── entrypoint.sh │ └── install.sh ├── .editorconfig ├── .github ├── assets │ ├── altv-hub-banner.jpg │ ├── logo-1024px.png │ ├── logo-128px.png │ ├── logo-256px.png │ └── logo-512px.png └── workflows │ ├── default.yml │ └── pr.yml ├── .idea ├── .gitignore ├── docker-altv-server.iml ├── modules.xml └── vcs.xml ├── Dockerfile ├── LICENSE ├── README.md ├── scripts ├── ci-build.sh ├── ci-push.sh ├── getVersion.sh ├── image-build.sh └── image-push.sh └── tools └── configurator ├── .dockerignore ├── .gitignore ├── .idea ├── .gitignore ├── configurator.iml ├── modules.xml ├── runConfigurations │ └── _DEBUG__go_build.xml └── vcs.xml ├── LICENSE ├── cmd ├── create.go ├── createExample.go └── root.go ├── config ├── config_suite_test.go ├── default.go ├── parser.go ├── server.go ├── server_test.go └── writer.go ├── configurator_suite_test.go ├── go.mod ├── go.sum ├── helpers ├── reference.go └── slice.go └── main.go /.docker/scripts/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | ALTV_SERVER_LOG_PATH=${ALTV_SERVER_LOG_PATH:-""} 4 | ALTV_SERVER_NO_LOGFILE=${ALTV_SERVER_NO_LOGFILE:-"true"} 5 | 6 | /opt/altv/configurator create --output server.toml 7 | ./altv-server --config=/opt/altv/server.toml $ALTV_SERVER_LOG_PATH $ALTV_SERVER_NO_LOGFILE ${@:1} 8 | -------------------------------------------------------------------------------- /.docker/scripts/install.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | BRANCH=${BRANCH:-"release"} 4 | 5 | INSTALL_VEHMODS=${INSTALL_VEHMODS:-"true"} 6 | INSTALL_VEHMODELS=${INSTALL_VEHMODELS:-"true"} 7 | INSTALL_CLOTHES=${INSTALL_CLOTHES:-"true"} 8 | INSTALL_PEDMODELS=${INSTALL_PEDMODELS:-"true"} 9 | INSTALL_RPFDATA=${INSTALL_RPFDATA:-"true"} 10 | INSTALL_WEAPONMODELS=${INSTALL_WEAPONMODELS:-"true"} 11 | 12 | INSTALL_JS_MODULE=${INSTALL_JS_MODULE:-"true"} 13 | INSTALL_CSHARP_MODULE=${INSTALL_CSHARP_MODULE:-"true"} 14 | 15 | LIBNODE_VERSION=${LIBNODE_VERSION:-"102"} 16 | 17 | apt-get update 18 | apt-get install -y wget gnupg libatomic1 libc-bin apt-transport-https 19 | 20 | # setup default altv-server files 21 | mkdir -p /opt/altv/modules /opt/altv/resources /opt/altv/data 22 | wget --no-cache -q -O /opt/altv/altv-server https://cdn.alt-mp.com/server/${BRANCH}/x64_linux/altv-server 23 | chmod +x /opt/altv/altv-server /root/entrypoint.sh 24 | 25 | # setup optional vehicle and clothing data 26 | [ "$INSTALL_VEHMODS" = "true" ] && wget --no-cache -q -O /opt/altv/data/vehmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/vehmodels.bin 27 | [ "$INSTALL_VEHMODELS" = "true" ] && wget --no-cache -q -O /opt/altv/data/vehmods.bin https://cdn.alt-mp.com/data/${BRANCH}/data/vehmods.bin 28 | [ "$INSTALL_CLOTHES" = "true" ] && wget --no-cache -q -O /opt/altv/data/clothes.bin https://cdn.alt-mp.com/data/${BRANCH}/data/clothes.bin 29 | [ "$INSTALL_PEDMODELS" = "true" ] && wget --no-cache -q -O /opt/altv/data/pedmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/pedmodels.bin 30 | [ "$INSTALL_RPFDATA" = "true" ] && wget --no-cache -q -O /opt/altv/data/rpfdata.bin https://cdn.alt-mp.com/data/${BRANCH}/data/rpfdata.bin 31 | [ "$INSTALL_WEAPONMODELS" = "true" ] && wget --no-cache -q -O /opt/altv/data/weaponmodels.bin https://cdn.alt-mp.com/data/${BRANCH}/data/weaponmodels.bin 32 | 33 | # setup optional js module 34 | if [ "$INSTALL_JS_MODULE" = "true" ]; then 35 | mkdir -p /opt/altv/modules/js-module/ 36 | wget --no-cache -q -O /opt/altv/modules/js-module/libnode.so.${LIBNODE_VERSION} https://cdn.alt-mp.com/js-module/${BRANCH}/x64_linux/modules/js-module/libnode.so.${LIBNODE_VERSION} 37 | wget --no-cache -q -O /opt/altv/modules/js-module/libjs-module.so https://cdn.alt-mp.com/js-module/${BRANCH}/x64_linux/modules/js-module/libjs-module.so 38 | wget --no-cache -q -O /opt/altv/modules/js-module/libjs-bytecode-module.so https://cdn.alt-mp.com/js-bytecode-module/${BRANCH}/x64_linux/modules/libjs-bytecode-module.so 39 | fi 40 | 41 | # setup optional csharp module 42 | if [ "$INSTALL_CSHARP_MODULE" = "true" ]; then 43 | wget https://packages.microsoft.com/config/debian/10/packages-microsoft-prod.deb -O packages-microsoft-prod.deb 44 | dpkg -i packages-microsoft-prod.deb 45 | rm -f packages-microsoft-prod.deb 46 | apt-get update 47 | apt-get install dotnet-runtime-6.0 -y 48 | # install altV module 49 | wget --no-cache -q -O /opt/altv/modules/libcsharp-module.so https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_linux/modules/libcsharp-module.so 50 | mkdir -p /usr/share/dotnet/host/fxr/ 51 | wget --no-cache -q -O /opt/altv/AltV.Net.Host.dll https://cdn.alt-mp.com/coreclr-module/${BRANCH}/x64_linux/AltV.Net.Host.dll 52 | cat </opt/altv/AltV.Net.Host.runtimeconfig.json 53 | { 54 | "runtimeOptions": { 55 | "tfm": "net6", 56 | "framework": { 57 | "name": "Microsoft.NETCore.App", 58 | "version": "6.0.0" 59 | } 60 | } 61 | } 62 | EOF 63 | fi 64 | 65 | # cleanup not needed packages 66 | apt-get purge -y wget gnupg apt-transport-https 67 | apt autoremove -y 68 | apt-get clean 69 | -------------------------------------------------------------------------------- /.editorconfig: -------------------------------------------------------------------------------- 1 | [*.sh] 2 | indent_size = 4 3 | indent_style = space 4 | insert_final_newline = true 5 | trim_trailing_whitespace = true 6 | -------------------------------------------------------------------------------- /.github/assets/altv-hub-banner.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eisengrind/docker-altv-server/87813d13916e5809b4ba218b6c5902c2e4c022a6/.github/assets/altv-hub-banner.jpg -------------------------------------------------------------------------------- /.github/assets/logo-1024px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eisengrind/docker-altv-server/87813d13916e5809b4ba218b6c5902c2e4c022a6/.github/assets/logo-1024px.png -------------------------------------------------------------------------------- /.github/assets/logo-128px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eisengrind/docker-altv-server/87813d13916e5809b4ba218b6c5902c2e4c022a6/.github/assets/logo-128px.png -------------------------------------------------------------------------------- /.github/assets/logo-256px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eisengrind/docker-altv-server/87813d13916e5809b4ba218b6c5902c2e4c022a6/.github/assets/logo-256px.png -------------------------------------------------------------------------------- /.github/assets/logo-512px.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/eisengrind/docker-altv-server/87813d13916e5809b4ba218b6c5902c2e4c022a6/.github/assets/logo-512px.png -------------------------------------------------------------------------------- /.github/workflows/default.yml: -------------------------------------------------------------------------------- 1 | name: DefaultCI 2 | 3 | on: 4 | push: 5 | branches: 6 | - master 7 | # Update the image every now and then 8 | schedule: 9 | - cron: "0 2 * * *" 10 | - cron: "0 14 * * *" 11 | 12 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 13 | jobs: 14 | # This workflow contains a single job called "build" 15 | default-build: 16 | if: ${{!startsWith(github.ref, 'refs/tags/')}} 17 | # The type of runner that the job will run on 18 | runs-on: ubuntu-latest 19 | env: 20 | IMAGE: eisengrind/altv-server 21 | 22 | # Steps represent a sequence of tasks that will be executed as part of the job 23 | steps: 24 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 25 | - uses: actions/checkout@v2 26 | name: checkout 27 | - name: install deps 28 | run: sudo apt-get update && sudo apt-get install -y jq wget 29 | - name: set script permissions 30 | run: chmod +x ./scripts/ci-push.sh ./scripts/image-build.sh ./scripts/image-push.sh ./scripts/getVersion.sh 31 | - name: login to DockerHub 32 | run: echo ${{ secrets.DOCKERHUB_PASSWORD }} | docker login --username ${{ secrets.DOCKERHUB_USERNAME }} --password-stdin 33 | - name: build dev 34 | run: ./scripts/ci-push.sh $IMAGE dev $(./scripts/getVersion.sh dev) 35 | - name: build rc 36 | run: ./scripts/ci-push.sh $IMAGE rc $(./scripts/getVersion.sh rc) 37 | - name: build release 38 | run: ./scripts/ci-push.sh $IMAGE release $(./scripts/getVersion.sh release) 39 | - name: logout from DockerHub 40 | run: docker logout 41 | -------------------------------------------------------------------------------- /.github/workflows/pr.yml: -------------------------------------------------------------------------------- 1 | name: PullRequestCI 2 | 3 | on: 4 | pull_request: 5 | types: [opened, reopened, edited, synchronize] 6 | 7 | # A workflow run is made up of one or more jobs that can run sequentially or in parallel 8 | jobs: 9 | # This workflow contains a single job called "build" 10 | default-build: 11 | # The type of runner that the job will run on 12 | runs-on: ubuntu-latest 13 | env: 14 | IMAGE: eisengrind/altv-server 15 | 16 | # Steps represent a sequence of tasks that will be executed as part of the job 17 | steps: 18 | # Checks-out your repository under $GITHUB_WORKSPACE, so your job can access it 19 | - uses: actions/checkout@v2 20 | name: checkout 21 | - name: install deps 22 | run: sudo apt-get update && sudo apt-get install -y jq wget 23 | - name: set script permissions 24 | run: chmod +x ./scripts/ci-build.sh ./scripts/image-build.sh ./scripts/getVersion.sh 25 | - name: build dev 26 | run: ./scripts/ci-build.sh $IMAGE dev $(./scripts/getVersion.sh dev) 27 | - name: build rc 28 | run: ./scripts/ci-build.sh $IMAGE rc $(./scripts/getVersion.sh rc) 29 | - name: build release 30 | run: ./scripts/ci-build.sh $IMAGE release $(./scripts/getVersion.sh release) 31 | -------------------------------------------------------------------------------- /.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /.idea/docker-altv-server.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM golang:bullseye AS configurator 2 | 3 | WORKDIR /usr/src/app/ 4 | 5 | COPY ./tools/configurator ./ 6 | RUN go mod download && go mod verify 7 | 8 | COPY ./tools/configurator ./ 9 | RUN go build -o /usr/src/app/configurator -ldflags "-s -w" -v ./main.go 10 | 11 | 12 | 13 | FROM ubuntu:focal AS final 14 | 15 | ARG BRANCH=release 16 | ARG LIBNODE_VERSION=108 17 | 18 | ARG INSTALL_VEHMODS=true 19 | ARG INSTALL_VEHMODELS=true 20 | ARG INSTALL_CLOTHES=true 21 | ARG INSTALL_JS_MODULE=true 22 | ARG INSTALL_CSHARP_MODULE=true 23 | 24 | ARG ALTV_SERVER_MODULES="csharp-module,js-module" 25 | ENV ALTV_SERVER_MODULES=${ALTV_SERVER_MODULES} 26 | 27 | COPY ./.docker/scripts/install.sh ./.docker/scripts/entrypoint.sh /root/ 28 | COPY --from=configurator /usr/src/app/configurator /opt/altv/configurator 29 | 30 | RUN chmod +x /root/install.sh && \ 31 | chmod +x /opt/altv/configurator && \ 32 | /root/install.sh && \ 33 | rm -f /root/install.sh 34 | 35 | WORKDIR /opt/altv/ 36 | 37 | # Meant are the default values provided by the entrypoint script. 38 | # Of course you can change the port as you like by using the 39 | # environment variable "ALTV_SERVER_PORT". 40 | EXPOSE 7788/udp 41 | EXPOSE 7788/tcp 42 | 43 | ENTRYPOINT [ "/root/entrypoint.sh" ] 44 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Vincent Heins and Eisengrind.de-Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 |

2 | 3 |

4 | 5 |

6 | 7 |

Unofficial alt:V server Docker image

8 |

Searching for the alt:V voice server image? Click here

9 | 10 | The unofficial alt:V server Docker image. 11 | 12 |
13 |

Breaking Change with alt:V 9.x

14 |

Removed support for .NET versions older than .NET 6

15 |
16 | 17 | ## Usage 18 | 19 | To get started just run the Docker image as follows: 20 | 21 | ```sh 22 | docker run -it --rm eisengrind/altv-server:release 23 | ``` 24 | 25 | ### Configuring the alt:V server 26 | 27 | Since we can not provide a file to the alt:V without adding a volume, you can configure the alt:V server using container environment variables. 28 | 29 | See `.docker/scripts/entrypoint.sh` for all available environment variables. 30 | 31 | Before the server starts, the entrypoint script writes the alt:V server configuration using the input environment variables, so you don't have to provide a configuration file. 32 | 33 | ## Build 34 | 35 | For the `$build` and `$branch` variables you have to enter the regarding alt:V versioning values. 36 | 37 | **`$build`** represents the build number of the server source files. E.g. **`$build=1098`** 38 | 39 | **`$branch`** represents the branch where the server build was released. E.g. **`$branch=release`** 40 | 41 | ## Using custom vehicle data 42 | 43 | To use custom vehicle data, you can mount a volume to the directory `/opt/altv/data/`. By using the volume you can then overwrite the `vehmodels.bin` and `vehmods.bin` files. 44 | 45 | You ofc also can just copy the vehicle data to a new `Dockerfile` that inherits from the base `eisengrind/altv-server` image. 46 | 47 | ## Usage with a custom Dockerfile 48 | 49 | Most of the time if you are using containers, especially images, correctly, you will create a customized Docker image. For example by adding resources to a container which will represent a current version of your files. 50 | 51 | You can use this images as a base for your future customizations: 52 | 53 | ```Dockerfile 54 | FROM eisengrind/altv-server:release 55 | 56 | RUN mkdir -p /opt/altv/resources/test-resource 57 | ``` 58 | 59 | This example, however, just creates an empty folder within the alt:V resources folder. 60 | 61 | ### Note on Docker caching 62 | 63 | We provide two different kinds of tags for the alt:V Docker images: specific and non-specific image tags. 64 | 65 | In general, this means that specific tags represent a unique alt:V build version whereas a non-specific tag such as `release...` or `dev...` represents the latest build number of the regarding branch. 66 | 67 | Thus, once an image with a non-specific tag is pulled, this image will not automatically get updated by Docker unless you remove and pull the image again from Docker Hub. 68 | 69 | This is why we provide specific tags. Those kind of tags do explicitly not lead to a caching problem, because specific tags are not meant to be, once they are published, changed. 70 | 71 | **tl;dr Keep in mind that you should always specify a specific tag in a Dockerfile.** 72 | 73 | ### Note on Docker image security 74 | 75 | Since this images inherits from the `debian:buster-slim` image, we schedule nightly builds every 24 hours to reduce security invulnerabilities. 76 | 77 | We highly recommend to update the altv-server image as frequent as possible. 78 | 79 | Keep in mind that, because of the frequent updates, we overwrite the image tags `release`, `dev`, `rc` aswell as their build versions. 80 | 81 | To use a specific image, we recommend using their Sha-256 digest hash as an image selector. 82 | 83 | ## License 84 | 85 | See the [LICENSE](https://github.com/eisengrind/docker-altv-server/blob/master/LICENSE)-file for further information. 86 | -------------------------------------------------------------------------------- /scripts/ci-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export IMAGE=$1 4 | export BRANCH=$2 5 | export BUILD=$3 6 | export HASH=$(echo "$BRANCH-$BUILD-$(date --iso-8601=minutes)" | sha1sum | head -c 40) 7 | export SHORT_HASH=$(echo $HASH | cut -c1-8) 8 | 9 | $(dirname "$0")/image-build.sh 10 | -------------------------------------------------------------------------------- /scripts/ci-push.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | export IMAGE=$1 4 | export BRANCH=$2 5 | export BUILD=$3 6 | export HASH=$(echo "$BRANCH-$BUILD-$(date --iso-8601=minutes)" | sha1sum | head -c 40) 7 | export SHORT_HASH=$(echo $HASH | cut -c1-8) 8 | 9 | $(dirname "$0")/image-build.sh 10 | $(dirname "$0")/image-push.sh 11 | -------------------------------------------------------------------------------- /scripts/getVersion.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | wget --no-cache -qO- http://cdn.alt-mp.com/server/$1/x64_linux/update.json > /tmp/update.json 4 | 5 | if [ $(cat /tmp/update.json | jq '.version') == 'null' ] 6 | then 7 | jq '.latestBuildNumber' < /tmp/update.json 8 | else 9 | jq -r '.version' < /tmp/update.json 10 | fi 11 | -------------------------------------------------------------------------------- /scripts/image-build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | 3 | echo "building image" 4 | docker build . --build-arg BRANCH=$BRANCH -t $IMAGE:$BUILD 5 | 6 | docker tag $IMAGE:$BUILD $IMAGE:$BRANCH 7 | docker tag $IMAGE:$BUILD $IMAGE:$BRANCH-$BUILD 8 | docker tag $IMAGE:$BUILD $IMAGE:$HASH 9 | docker tag $IMAGE:$BUILD $IMAGE:$BRANCH-$BUILD-$SHORT_HASH 10 | 11 | docker tag $IMAGE:$BUILD $IMAGE:csharp.js-$BRANCH 12 | docker tag $IMAGE:$BUILD $IMAGE:csharp.js-$BRANCH-$BUILD 13 | docker tag $IMAGE:$BUILD $IMAGE:csharp.js-$HASH 14 | docker tag $IMAGE:$BUILD $IMAGE:csharp.js-$BRANCH-$BUILD-$SHORT_HASH 15 | 16 | echo "building js-only image" 17 | docker build . --build-arg BRANCH=$BRANCH --build-arg INSTALL_CSHARP_MODULE="false" --build-arg ALTV_SERVER_MODULES="js-module" -t $IMAGE:js-$BUILD 18 | 19 | docker tag $IMAGE:js-$BUILD $IMAGE:js-$BRANCH 20 | docker tag $IMAGE:js-$BUILD $IMAGE:js-$BRANCH-$BUILD 21 | docker tag $IMAGE:js-$BUILD $IMAGE:js-$HASH 22 | docker tag $IMAGE:js-$BUILD $IMAGE:js-$BRANCH-$BUILD-$SHORT_HASH 23 | 24 | echo "building csharp-only image" 25 | docker build . --build-arg BRANCH=$BRANCH --build-arg INSTALL_JS_MODULE="false" --build-arg ALTV_SERVER_MODULES="csharp-module" -t $IMAGE:csharp-$BUILD 26 | 27 | docker tag $IMAGE:csharp-$BUILD $IMAGE:csharp-$BRANCH 28 | docker tag $IMAGE:csharp-$BUILD $IMAGE:csharp-$BRANCH-$BUILD 29 | docker tag $IMAGE:csharp-$BUILD $IMAGE:csharp-$HASH 30 | docker tag $IMAGE:csharp-$BUILD $IMAGE:csharp-$BRANCH-$BUILD-$SHORT_HASH 31 | -------------------------------------------------------------------------------- /scripts/image-push.sh: -------------------------------------------------------------------------------- 1 | 2 | # push it! 3 | 4 | echo "pushing base image" 5 | docker push $IMAGE:$BUILD 6 | docker push $IMAGE:$BRANCH 7 | docker push $IMAGE:$BRANCH-$BUILD 8 | docker push $IMAGE:$HASH 9 | docker push $IMAGE:$BRANCH-$BUILD-$SHORT_HASH 10 | 11 | docker push $IMAGE:csharp.js-$BRANCH 12 | docker push $IMAGE:csharp.js-$BRANCH-$BUILD 13 | docker push $IMAGE:csharp.js-$HASH 14 | docker push $IMAGE:csharp.js-$BRANCH-$BUILD-$SHORT_HASH 15 | 16 | echo "pushing js-only image" 17 | docker push $IMAGE:js-$BUILD 18 | docker push $IMAGE:js-$BRANCH 19 | docker push $IMAGE:js-$BRANCH-$BUILD 20 | docker push $IMAGE:js-$HASH 21 | docker push $IMAGE:js-$BRANCH-$BUILD-$SHORT_HASH 22 | 23 | echo "pushing csharp-only image" 24 | docker push $IMAGE:csharp-$BUILD 25 | docker push $IMAGE:csharp-$BRANCH 26 | docker push $IMAGE:csharp-$BRANCH-$BUILD 27 | docker push $IMAGE:csharp-$HASH 28 | docker push $IMAGE:csharp-$BRANCH-$BUILD-$SHORT_HASH 29 | -------------------------------------------------------------------------------- /tools/configurator/.dockerignore: -------------------------------------------------------------------------------- 1 | server.yaml 2 | server.toml 3 | *.exe 4 | main 5 | -------------------------------------------------------------------------------- /tools/configurator/.gitignore: -------------------------------------------------------------------------------- 1 | server.toml 2 | server.yaml 3 | *.exe 4 | main 5 | -------------------------------------------------------------------------------- /tools/configurator/.idea/.gitignore: -------------------------------------------------------------------------------- 1 | # Default ignored files 2 | /shelf/ 3 | /workspace.xml 4 | # Editor-based HTTP Client requests 5 | /httpRequests/ 6 | # Datasource local storage ignored files 7 | /dataSources/ 8 | /dataSources.local.xml 9 | -------------------------------------------------------------------------------- /tools/configurator/.idea/configurator.iml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | -------------------------------------------------------------------------------- /tools/configurator/.idea/modules.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | -------------------------------------------------------------------------------- /tools/configurator/.idea/runConfigurations/_DEBUG__go_build.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 10 | 11 | 12 | 13 | 14 | 15 | 16 | 17 | 18 | 19 | -------------------------------------------------------------------------------- /tools/configurator/.idea/vcs.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 5 | 6 | -------------------------------------------------------------------------------- /tools/configurator/LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) Vincent Heins and Eisengrind.de-Team 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /tools/configurator/cmd/create.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/eisengrind/docker-altv-server/tools/configurator/config" 5 | "github.com/spf13/cobra" 6 | "log" 7 | ) 8 | 9 | // createCmd represents the create command 10 | var createCmd = &cobra.Command{ 11 | Use: "create", 12 | Short: "Creates an alt:V config file using environment variables.", 13 | Run: func(cmd *cobra.Command, args []string) { 14 | output, err := cmd.Flags().GetString("output") 15 | if err != nil { 16 | log.Fatalln(err) 17 | } 18 | 19 | cfg, err := config.ParseEnv(envPrefix) 20 | if err != nil { 21 | log.Fatalln(err) 22 | } 23 | 24 | if err := config.Write(output, cfg); err != nil { 25 | log.Fatalln(err) 26 | } 27 | }, 28 | } 29 | 30 | func init() { 31 | rootCmd.AddCommand(createCmd) 32 | } 33 | -------------------------------------------------------------------------------- /tools/configurator/cmd/createExample.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "github.com/eisengrind/docker-altv-server/tools/configurator/config" 5 | "github.com/spf13/cobra" 6 | "log" 7 | ) 8 | 9 | // createExampleCmd represents the createExample command 10 | var createExampleCmd = &cobra.Command{ 11 | Use: "createExample", 12 | Short: "Creates an example config file.", 13 | Run: func(cmd *cobra.Command, args []string) { 14 | output, err := cmd.Flags().GetString("output") 15 | if err != nil { 16 | log.Fatalln(err) 17 | } 18 | 19 | if err := config.Write(output, config.Default()); err != nil { 20 | log.Fatalln(err) 21 | } 22 | }, 23 | } 24 | 25 | func init() { 26 | rootCmd.AddCommand(createExampleCmd) 27 | } 28 | -------------------------------------------------------------------------------- /tools/configurator/cmd/root.go: -------------------------------------------------------------------------------- 1 | package cmd 2 | 3 | import ( 4 | "os" 5 | 6 | "github.com/spf13/cobra" 7 | ) 8 | 9 | const envPrefix = "ALTV_SERVER_" 10 | 11 | // rootCmd represents the base command when called without any subcommands 12 | var rootCmd = &cobra.Command{ 13 | Use: "configurator", 14 | Short: "Allows for creation of an alt:V config file using ENV args or just an example config.", 15 | } 16 | 17 | // Execute adds all child commands to the root command and sets flags appropriately. 18 | // This is called by main.main(). It only needs to happen once to the rootCmd. 19 | func Execute() { 20 | err := rootCmd.Execute() 21 | if err != nil { 22 | os.Exit(1) 23 | } 24 | } 25 | 26 | func init() { 27 | rootCmd.PersistentFlags().StringP("output", "o", "server.yaml", "Output filename. Only .yml, .yaml, .cfg, .toml file extension can be specified.") 28 | } 29 | -------------------------------------------------------------------------------- /tools/configurator/config/config_suite_test.go: -------------------------------------------------------------------------------- 1 | package config_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestConfig(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Config Suite") 13 | } 14 | -------------------------------------------------------------------------------- /tools/configurator/config/default.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "github.com/pelletier/go-toml/v2" 4 | 5 | func Default() Server { 6 | tomlBs := []byte(defaultTomlConfig) 7 | 8 | var cfg Server 9 | 10 | if err := toml.Unmarshal(tomlBs, &cfg); err != nil { 11 | panic(err) 12 | } 13 | 14 | return cfg 15 | } 16 | 17 | var defaultTomlConfig = ` 18 | name = "My server name" 19 | host = "0.0.0.0" 20 | port = 7788 21 | players = 256 22 | password = "mySecretPassword" 23 | announce = true 24 | token = "superSecretToken" 25 | gamemode = "Freeroam" 26 | website = "https://example.com" 27 | language = "English" 28 | description = "My cool server" 29 | debug = false 30 | streamingDistance = 400 31 | migrationDistance = 150 32 | timeout = 1 33 | announceRetryErrorDelay = 10000 34 | announceRetryErrorAttempts = 50 35 | duplicatePlayers = 4096 36 | 37 | mapBoundsMinX = 10000 38 | mapBoundsMinY = 10000 39 | mapBoundsMaxX = 65536 40 | mapBoundsMaxY = 65536 41 | mapCellAreaSize = 100 42 | 43 | colShapeTickRate = 200 44 | 45 | logStreams = [ "console", "file" ] 46 | 47 | entityWorkerCount = 8 48 | 49 | tags = [ 50 | "Freeroam", 51 | "Cool" 52 | ] 53 | 54 | connectionQueue = false 55 | useEarlyAuth = false 56 | earlyAuthUrl = "https://example.com/login" 57 | useCdn = false 58 | cdnUrl = "https://cdn.example.com" 59 | 60 | sendPlayerNames = true 61 | 62 | resources = [ 63 | "myResource", 64 | "vehicles/firstVehicle", 65 | "vehicles/secondVehicle" 66 | ] 67 | 68 | modules = [ 69 | "js-module", 70 | "csharp-module" 71 | ] 72 | 73 | [worldProfiler] 74 | port = 7797 75 | host = "0.0.0.0" 76 | 77 | [js-module] 78 | source-maps = true 79 | heap-profiler = true 80 | profiler = true 81 | global-fetch = true 82 | global-webcrypto = true 83 | network-imports = true 84 | extra-cli-args = ["--inspect=127.0.0.1:9229", "--max-old-space-size=8192"] 85 | [js-module.inspector] 86 | host = "127.0.0.1" 87 | port = 9229 88 | 89 | [csharp-module] 90 | disableDependencyDownload= true 91 | 92 | [voice] 93 | bitrate = 64000 94 | externalSecret = "1234567890" 95 | externalHost = "127.0.0.1" 96 | externalPort = 7798 97 | externalPublicHost = "xx.xx.xx.xx" 98 | externalPublicPort = 7799 99 | ` 100 | -------------------------------------------------------------------------------- /tools/configurator/config/parser.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import "github.com/caarlos0/env/v6" 4 | 5 | func ParseEnv(prefix string) (Server, error) { 6 | var cfg Server 7 | 8 | if err := env.Parse(&cfg, env.Options{ 9 | Prefix: prefix, 10 | }); err != nil { 11 | return cfg, err 12 | } 13 | 14 | return cfg, nil 15 | } 16 | -------------------------------------------------------------------------------- /tools/configurator/config/server.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | type WorldProfiler struct { 4 | Host *string `env:"HOST" toml:"host" yaml:"host,omitempty" json:"host,omitempty"` 5 | Port *uint16 `env:"PORT" toml:"port" yaml:"port,omitempty" json:"port,omitempty"` 6 | } 7 | 8 | type JsModuleInspector struct { 9 | Host *string `env:"HOST" toml:"host" yaml:"host,omitempty" json:"host,omitempty"` 10 | Port *uint16 `env:"PORT" toml:"port" yaml:"port,omitempty" json:"port,omitempty"` 11 | } 12 | 13 | type JsModule struct { 14 | SourceMaps *bool `env:"SOURCE_MAPS" toml:"source-maps" yaml:"sourceMaps,omitempty" json:"sourceMaps,omitempty"` 15 | HeapProfiler *bool `env:"HEAP_PROFILER" toml:"heap-profiler" yaml:"heapProfiler,omitempty" json:"heapProfiler,omitempty"` 16 | Profiler *bool `env:"PROFILER" toml:"profiler" yaml:"profiler,omitempty" json:"profiler,omitempty"` 17 | GlobalFetch *bool `env:"GLOBAL_FETCH" toml:"global-fetch" yaml:"globalFetch,omitempty" json:"globalFetch,omitempty"` 18 | GlobalWebCrypto *bool `env:"GLOBAL_WEB_CRYPTO" toml:"global-webcrypto" yaml:"globalWebcrypto,omitempty" json:"globalWebcrypto,omitempty"` 19 | NetworkImports *bool `env:"NETWORK_IMPORTS" toml:"network-imports" yaml:"networkImports,omitempty" json:"networkImports,omitempty"` 20 | ExtraCliArgs []string `env:"EXTRA_CLI_ARGS" toml:"extra-cli-args" yaml:"extraCliArgs,omitempty,flow" json:"extraCliArgs,omitempty"` 21 | Inspector JsModuleInspector `envPrefix:"INSPECTOR_" toml:"inspector,omitempty" yaml:"inspector,omitempty" json:"inspector,omitempty"` 22 | } 23 | 24 | type CsharpModule struct { 25 | DisableDependencyDownload *bool `env:"DISABLE_DEPENDENCY_DOWNLOAD" toml:"disableDependencyDownload" yaml:"disableDependencyDownload,omitempty" json:"disableDependencyDownload,omitempty"` 26 | } 27 | 28 | type Voice struct { 29 | Bitrate *uint `env:"BITRATE" toml:"bitrate" yaml:"bitrate,omitempty" json:"bitrate,omitempty"` 30 | ExternalSecret *string `env:"EXTERNAL_SECRET" toml:"externalSecret" yaml:"externalSecret,omitempty" json:"externalSecret,omitempty"` 31 | ExternalHost *string `env:"EXTERNAL_HOST" toml:"externalHost" yaml:"externalHost,omitempty" json:"externalHost,omitempty"` 32 | ExternalPort *uint16 `env:"EXTERNAL_PORT" toml:"externalPort" yaml:"externalPort,omitempty" json:"externalPort,omitempty"` 33 | ExternalPublicHost *string `env:"EXTERNAL_PUBLIC_HOST" toml:"externalPublicHost" yaml:"externalPublicHost,omitempty" json:"externalPublicHost,omitempty"` 34 | ExternalPublicPort *uint16 `env:"EXTERNAL_PUBLIC_PORT" toml:"externalPublicPort" yaml:"externalPublicPort,omitempty" json:"externalPublicPort,omitempty"` 35 | } 36 | 37 | type Server struct { 38 | Name *string `env:"NAME" toml:"name" yaml:"name,omitempty" json:"name,omitempty"` 39 | Host *string `env:"HOST" toml:"host" yaml:"host,omitempty" json:"host,omitempty"` 40 | Port *uint16 `env:"PORT" toml:"port" yaml:"port,omitempty" json:"port,omitempty"` 41 | Players *uint `env:"PLAYERS" toml:"players" yaml:"players,omitempty" json:"players,omitempty"` 42 | Password *string `env:"PASSWORD" toml:"password" yaml:"password,omitempty" json:"password,omitempty"` 43 | Announce *bool `env:"ANNOUNCE" toml:"announce" yaml:"announce,omitempty" json:"announce,omitempty"` 44 | Token *string `env:"TOKEN" toml:"token" yaml:"token,omitempty" json:"token,omitempty"` 45 | Gamemode *string `env:"GAMEMODE" toml:"gamemode" yaml:"gamemode,omitempty" json:"gamemode,omitempty"` 46 | Website *string `env:"WEBSITE" toml:"website" yaml:"website,omitempty" json:"website,omitempty"` 47 | Language *string `env:"LANGUAGE" toml:"language" yaml:"language,omitempty" json:"language,omitempty"` 48 | Description *string `env:"DESCRIPTION" toml:"description" yaml:"description,omitempty" json:"description,omitempty"` 49 | Debug *bool `env:"DEBUG" toml:"debug" yaml:"debug,omitempty" json:"debug,omitempty"` 50 | StreamingDistance *uint `env:"STREAMING_DISTANCE" toml:"streamingDistance" yaml:"streamingDistance,omitempty" json:"streamingDistance,omitempty"` 51 | MigrationDistance *uint `env:"MIGRATION_DISTANCE" toml:"migrationDistance" yaml:"migrationDistance,omitempty" json:"migrationDistance,omitempty"` 52 | Timeout *uint `env:"TIMEOUT" toml:"timeout" yaml:"timeout,omitempty" json:"timeout,omitempty"` 53 | AnnounceRetryErrorDelay *uint `env:"ANNOUNCE_RETRY_ERROR_DELAY" toml:"announceRetryErrorDelay" yaml:"announceRetryErrorDelay,omitempty" json:"announceRetryErrorDelay,omitempty"` 54 | AnnounceRetryErrorAttempts *uint `env:"ANNOUNCE_RETRY_ERROR_ATTEMPTS" toml:"announceRetryErrorAttempts" yaml:"announceRetryErrorAttempts,omitempty" json:"announceRetryErrorAttempts,omitempty"` 55 | DuplicatePlayers *uint `env:"DUPLICATE_PLAYERS" toml:"duplicatePlayers" yaml:"duplicatePlayers,omitempty" json:"duplicatePlayers,omitempty"` 56 | 57 | MapBoundsMinX *uint `env:"MAP_BOUNDS_MIN_X" toml:"mapBoundsMinX" yaml:"mapBoundsMinX,omitempty" json:"mapBoundsMinX,omitempty"` 58 | MapBoundsMinY *uint `env:"MAP_BOUNDS_MIN_Y" toml:"mapBoundsMinY" yaml:"mapBoundsMinY,omitempty" json:"mapBoundsMinY,omitempty"` 59 | MapBoundsMaxX *uint `env:"MAP_BOUNDS_MAX_X" toml:"mapBoundsMaxX" yaml:"mapBoundsMaxX,omitempty" json:"mapBoundsMaxX,omitempty"` 60 | MapBoundsMaxY *uint `env:"MAP_BOUNDS_MAX_Y" toml:"mapBoundsMaxY" yaml:"mapBoundsMaxY,omitempty" json:"mapBoundsMaxY,omitempty"` 61 | 62 | ColShapeTickRate *uint `env:"COL_SHAPE_TICK_RATE" toml:"colShapeTickRate" yaml:"colShapeTickRate,omitempty" json:"colShapeTickRate,omitempty"` 63 | LogStreams []string `env:"LOG_STREAMS" toml:"logStreams" yaml:"logStreams,omitempty,flow" json:"logStreams,omitempty,flow"` 64 | EntityWorkerCount *uint `env:"ENTITY_WORKER_COUNT" toml:"entityWorkerCount" yaml:"entityWorkerCount,omitempty" json:"entityWorkerCount,omitempty"` 65 | Tags []string `env:"TAGS" toml:"tags" yaml:"tags,omitempty,flow" json:"tags,omitempty,flow"` 66 | ConnectionQueue *bool `env:"CONNECTION_QUEUE" toml:"connectionQueue" yaml:"connectionQueue,omitempty" json:"connectionQueue,omitempty"` 67 | UseEarlyAuth *bool `env:"USE_EARLY_AUTH" toml:"useEarlyAuth" yaml:"useEarlyAuth,omitempty" json:"useEarlyAuth,omitempty"` 68 | EarlyAuthUrl *string `env:"EARLY_AUTH_URL" toml:"earlyAuthUrl" yaml:"earlyAuthUrl,omitempty" json:"earlyAuthUrl,omitempty"` 69 | UseCDN *bool `env:"USE_CDN" toml:"useCdn" yaml:"useCdn,omitempty" json:"useCdn,omitempty"` 70 | CDNUrl *string `env:"CDN_URL" toml:"cdnUrl" yaml:"cdnUrl,omitempty" json:"cdnUrl,omitempty"` 71 | SendPlayerNames *bool `env:"SEND_PLAYER_NAMES" toml:"sendPlayerNames" yaml:"sendPlayerNames,omitempty" json:"sendPlayerNames,omitempty"` 72 | Resources []string `env:"RESOURCES" toml:"resources" yaml:"resources,omitempty,flow" json:"resources,omitempty,flow"` 73 | Modules []string `env:"MODULES" toml:"modules" yaml:"modules,omitempty,flow" json:"modules,omitempty,flow"` 74 | WorldProfiler WorldProfiler `envPrefix:"WORLD_PROFILER_" toml:"worldProfiler,omitempty" yaml:"worldProfiler,omitempty,flow" json:"worldProfiler,omitempty"` 75 | JsModule JsModule `envPrefix:"JS_MODULE_" toml:"js-module,omitempty" yaml:"jsModule,omitempty,flow" json:"jsModule,omitempty"` 76 | CsharpModule CsharpModule `envPrefix:"CSHARP_MODULE_" toml:"csharp-module,omitempty" yaml:"csharpModule,omitempty,flow" json:"csharpModule,omitempty"` 77 | Voice Voice `envPrefix:"VOICE_" toml:"voice,omitempty" yaml:"voice,omitempty,flow" json:"voice,omitempty"` 78 | } 79 | -------------------------------------------------------------------------------- /tools/configurator/config/server_test.go: -------------------------------------------------------------------------------- 1 | package config_test 2 | 3 | import ( 4 | . "github.com/onsi/ginkgo/v2" 5 | ) 6 | 7 | var _ = Describe("Server", func() { 8 | }) 9 | -------------------------------------------------------------------------------- /tools/configurator/config/writer.go: -------------------------------------------------------------------------------- 1 | package config 2 | 3 | import ( 4 | "errors" 5 | "github.com/eisengrind/docker-altv-server/tools/configurator/helpers" 6 | "github.com/pelletier/go-toml/v2" 7 | "gopkg.in/yaml.v2" 8 | "io/ioutil" 9 | "path" 10 | ) 11 | 12 | var validFileExtensions = []string{".yaml", ".yml", ".toml", ".cfg"} 13 | 14 | func Write(filepath string, cfg Server) (err error) { 15 | ext := path.Ext(filepath) 16 | 17 | if !helpers.Contains(validFileExtensions, ext) { 18 | return errors.New("invalid file extension provided") 19 | } 20 | 21 | var bs []byte 22 | 23 | switch ext { 24 | case ".cfg": 25 | fallthrough 26 | case ".yml": 27 | fallthrough 28 | case ".yaml": 29 | bs, err = yaml.Marshal(cfg) 30 | if err != nil { 31 | return err 32 | } 33 | case ".toml": 34 | bs, err = toml.Marshal(cfg) 35 | if err != nil { 36 | return err 37 | } 38 | } 39 | 40 | return ioutil.WriteFile(filepath, bs, 0770) 41 | } 42 | -------------------------------------------------------------------------------- /tools/configurator/configurator_suite_test.go: -------------------------------------------------------------------------------- 1 | package main_test 2 | 3 | import ( 4 | "testing" 5 | 6 | . "github.com/onsi/ginkgo/v2" 7 | . "github.com/onsi/gomega" 8 | ) 9 | 10 | func TestConfigurator(t *testing.T) { 11 | RegisterFailHandler(Fail) 12 | RunSpecs(t, "Configurator Suite") 13 | } 14 | -------------------------------------------------------------------------------- /tools/configurator/go.mod: -------------------------------------------------------------------------------- 1 | module github.com/eisengrind/docker-altv-server/tools/configurator 2 | 3 | go 1.18 4 | 5 | require ( 6 | github.com/caarlos0/env/v6 v6.10.1 7 | github.com/onsi/ginkgo/v2 v2.6.1 8 | github.com/onsi/gomega v1.24.2 9 | github.com/pelletier/go-toml/v2 v2.0.6 10 | github.com/spf13/cobra v1.6.1 11 | gopkg.in/yaml.v2 v2.4.0 12 | ) 13 | 14 | require ( 15 | github.com/go-logr/logr v1.2.3 // indirect 16 | github.com/google/go-cmp v0.5.9 // indirect 17 | github.com/inconshreveable/mousetrap v1.1.0 // indirect 18 | github.com/spf13/pflag v1.0.5 // indirect 19 | golang.org/x/net v0.4.0 // indirect 20 | golang.org/x/sys v0.3.0 // indirect 21 | golang.org/x/text v0.5.0 // indirect 22 | gopkg.in/yaml.v3 v3.0.1 // indirect 23 | ) 24 | -------------------------------------------------------------------------------- /tools/configurator/go.sum: -------------------------------------------------------------------------------- 1 | github.com/caarlos0/env/v6 v6.10.1 h1:t1mPSxNpei6M5yAeu1qtRdPAK29Nbcf/n3G7x+b3/II= 2 | github.com/caarlos0/env/v6 v6.10.1/go.mod h1:hvp/ryKXKipEkcuYjs9mI4bBCg+UI0Yhgm5Zu0ddvwc= 3 | github.com/cpuguy83/go-md2man/v2 v2.0.2/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o= 4 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 5 | github.com/davecgh/go-spew v1.1.1 h1:vj9j/u1bqnvCEfJOwUhtlOARqs3+rkHYY13jYWTU97c= 6 | github.com/davecgh/go-spew v1.1.1/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 7 | github.com/go-logr/logr v1.2.3 h1:2DntVwHkVopvECVRSlL5PSo9eG+cAkDCuckLubN+rq0= 8 | github.com/go-logr/logr v1.2.3/go.mod h1:jdQByPbusPIv2/zmleS9BjJVeZ6kBagPoEUsqbVz/1A= 9 | github.com/golang/protobuf v1.5.2 h1:ROPKBNFfQgOUMifHyP+KYbvpjbdoFNs+aK7DXlji0Tw= 10 | github.com/google/go-cmp v0.5.9 h1:O2Tfq5qg4qc4AmwVlvv0oLiVAGB7enBSJ2x2DqQFi38= 11 | github.com/google/go-cmp v0.5.9/go.mod h1:17dUlkBOakJ0+DkrSSNjCkIjxS6bF9zb3elmeNGIjoY= 12 | github.com/inconshreveable/mousetrap v1.0.1/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 13 | github.com/inconshreveable/mousetrap v1.1.0 h1:wN+x4NVGpMsO7ErUn/mUI3vEoE6Jt13X2s0bqwp9tc8= 14 | github.com/inconshreveable/mousetrap v1.1.0/go.mod h1:vpF70FUmC8bwa3OWnCshd2FqLfsEA9PFc4w1p2J65bw= 15 | github.com/onsi/ginkgo/v2 v2.6.1 h1:1xQPCjcqYw/J5LchOcp4/2q/jzJFjiAOc25chhnDw+Q= 16 | github.com/onsi/ginkgo/v2 v2.6.1/go.mod h1:yjiuMwPokqY1XauOgju45q3sJt6VzQ/Fict1LFVcsAo= 17 | github.com/onsi/gomega v1.24.2 h1:J/tulyYK6JwBldPViHJReihxxZ+22FHs0piGjQAvoUE= 18 | github.com/onsi/gomega v1.24.2/go.mod h1:gs3J10IS7Z7r7eXRoNJIrNqU4ToQukCJhFtKrWgHWnk= 19 | github.com/pelletier/go-toml/v2 v2.0.6 h1:nrzqCb7j9cDFj2coyLNLaZuJTLjWjlaz6nvTvIwycIU= 20 | github.com/pelletier/go-toml/v2 v2.0.6/go.mod h1:eumQOmlWiOPt5WriQQqoM5y18pDHwha2N+QD+EUNTek= 21 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 22 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 23 | github.com/russross/blackfriday/v2 v2.1.0/go.mod h1:+Rmxgy9KzJVeS9/2gXHxylqXiyQDYRxCVz55jmeOWTM= 24 | github.com/spf13/cobra v1.6.1 h1:o94oiPyS4KD1mPy2fmcYYHHfCxLqYjJOhGsCHFZtEzA= 25 | github.com/spf13/cobra v1.6.1/go.mod h1:IOw/AERYS7UzyrGinqmz6HLUo219MORXGxhbaJUqzrY= 26 | github.com/spf13/pflag v1.0.5 h1:iy+VFUOCP1a+8yFto/drg2CJ5u0yRoB7fZw3DKv/JXA= 27 | github.com/spf13/pflag v1.0.5/go.mod h1:McXfInJRrz4CZXVZOBLb0bTZqETkiAhM9Iw0y3An2Bg= 28 | github.com/stretchr/objx v0.1.0/go.mod h1:HFkY916IF+rwdDfMAkV7OtwuqBVzrE8GR6GFx+wExME= 29 | github.com/stretchr/objx v0.4.0/go.mod h1:YvHI0jy2hoMjB+UWwv71VJQ9isScKT/TqJzVSSt89Yw= 30 | github.com/stretchr/objx v0.5.0/go.mod h1:Yh+to48EsGEfYuaHDzXPcE3xhTkx73EhmCGUpEOglKo= 31 | github.com/stretchr/testify v1.7.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 32 | github.com/stretchr/testify v1.8.0/go.mod h1:yNjHg4UonilssWZ8iaSj1OCr/vHnekPRkoO+kdMU+MU= 33 | github.com/stretchr/testify v1.8.1 h1:w7B6lhMri9wdJUVmEZPGGhZzrYTPvgJArz7wNPgYKsk= 34 | github.com/stretchr/testify v1.8.1/go.mod h1:w2LPCIKwWwSfY2zedu0+kehJoqGctiVI29o6fzry7u4= 35 | golang.org/x/net v0.4.0 h1:Q5QPcMlvfxFTAPV0+07Xz/MpK9NTXu2VDUuy0FeMfaU= 36 | golang.org/x/net v0.4.0/go.mod h1:MBQ8lrhLObU/6UmLb4fmbmk5OcyYmqtbGd/9yIeKjEE= 37 | golang.org/x/sys v0.3.0 h1:w8ZOecv6NaNa/zC8944JTU3vz4u6Lagfk4RPQxv92NQ= 38 | golang.org/x/sys v0.3.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg= 39 | golang.org/x/text v0.5.0 h1:OLmvp0KP+FVG99Ct/qFiL/Fhk4zp4QQnZ7b2U+5piUM= 40 | golang.org/x/text v0.5.0/go.mod h1:mrYo+phRRbMaCq/xk9113O4dZlRixOauAjOtrjsXDZ8= 41 | google.golang.org/protobuf v1.28.0 h1:w43yiav+6bVFTBQFZX0r7ipe9JQ1QsbMgHwbBziscLw= 42 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405 h1:yhCVgyC4o1eVCa2tZl7eS0r+SDo693bJlVdllGtEeKM= 43 | gopkg.in/check.v1 v0.0.0-20161208181325-20d25e280405/go.mod h1:Co6ibVJAznAaIkqp8huTwlJQCZ016jof/cbN4VW5Yz0= 44 | gopkg.in/yaml.v2 v2.4.0 h1:D8xgwECY7CYvx+Y2n4sBz93Jn9JRvxdiyyo8CTfuKaY= 45 | gopkg.in/yaml.v2 v2.4.0/go.mod h1:RDklbk79AGWmwhnvt/jBztapEOGDOx6ZbXqjP6csGnQ= 46 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 47 | gopkg.in/yaml.v3 v3.0.1 h1:fxVm/GzAzEWqLHuvctI91KS9hhNmmWOoWu0XTYJS7CA= 48 | gopkg.in/yaml.v3 v3.0.1/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 49 | -------------------------------------------------------------------------------- /tools/configurator/helpers/reference.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | func Ref[T any](t T) *T { 4 | return &t 5 | } 6 | -------------------------------------------------------------------------------- /tools/configurator/helpers/slice.go: -------------------------------------------------------------------------------- 1 | package helpers 2 | 3 | func Contains[T comparable](ts []T, t T) bool { 4 | for _, x := range ts { 5 | if x == t { 6 | return true 7 | } 8 | } 9 | 10 | return false 11 | } 12 | -------------------------------------------------------------------------------- /tools/configurator/main.go: -------------------------------------------------------------------------------- 1 | package main 2 | 3 | import "github.com/eisengrind/docker-altv-server/tools/configurator/cmd" 4 | 5 | func main() { 6 | cmd.Execute() 7 | } 8 | --------------------------------------------------------------------------------