-
Notifications
You must be signed in to change notification settings - Fork 158
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Introduce to start or stop gameserver remotly via webho… #174
base: develop
Are you sure you want to change the base?
Conversation
…oks handled by the container. Rework of term_handler. Rework of webhook.sh.
#curl --ssl-no-revoke -H "Content-Type: application/json" -X POST -d "$(generate_post_data "$title" "$description" "$color")" "$WEBHOOK_URL" | ||
# Prod Curl | ||
curl --silent --ssl-no-revoke -H "Content-Type: application/json" -X POST -d "$(generate_post_data "$title" "$description" "$color")" "$WEBHOOK_URL" | ||
if [ ${WEBHOOK_ENABLED:false} == "true" ]; then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
make usage of webhooks more convienient - no mor need to check for the toogle before every call.
Hey @masonen thanks for the pull-request and for the time you took to try to improve this repo!
Do you mean ability? Possibilty sounds like, it works maybe 3 out of 30 calls 🤣
They get stuck when you are online and not in render range or even in render range too, so no changes here.
So is a solution like Portainer, that way they can stop, start, resume. pause?
Wait WHAT? You want me to add something that totally breaks the current server workflow AND ALSO everyone using it and dont want to offer a solution because its out of scope? What?! 😱
This is in now way really helpful, nor new-user friendly is it? However is an adaptation, to your current problem i guess?
Again isnt Portainer a solution? A non-admin friendly way, to just stop it and start it again if needed?
Docker in Docker with dedicated servers might be possible, but afaik it always comes with a heavy cost to responsetimes in ms. Would not recommend to do this.
Thanks for explaining the changes, but we have a very big PR that restructures the main repo, pretty sure, this would not be compatible. I will look into the review of the files, however is still dont understand whats the reasoning for adding this would be? Because what i read is, you dont want to change something on your end? So i should do it on my end? Why? Whats in for all of the users to use this? Why start the server via api and some scripts? Why isnt supervisord here a better or lesser solution? Update after Review: Could you please explain more around this? I would also offer a call around this, if you want @masonen maybe that way its easier to explain. |
@@ -65,7 +83,7 @@ ENV DEBIAN_FRONTEND=noninteractive \ | |||
STEAMCMD_VALIDATE_FILES=true \ | |||
SERVER_SETTINGS_MODE=manual \ | |||
WEBHOOK_ENABLED=false \ | |||
WEBHOOK_URL= \ | |||
WEBHOOK_URL="" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This introduces a bug with the SED scripts.
|
||
RUN apk add --update -t build-deps curl libc-dev gcc libgcc | ||
|
||
RUN curl -L --silent -o webhook.tar.gz https://github.com/adnanh/webhook/archive/${WEBHOOK_VERSION}.tar.gz && \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This neither a good nor secure way to install software and doesnt follow the Ansible way.
@@ -1,3 +1,17 @@ | |||
FROM golang:alpine AS build |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Not going to happen in any of my images, even in multistage builds.
@@ -133,10 +151,10 @@ ENV DEBIAN_FRONTEND=noninteractive \ | |||
ADMIN_PASSWORD=adminPasswordHere \ | |||
SERVER_PASSWORD=serverPasswordHere \ | |||
PUBLIC_PORT=8211 \ | |||
PUBLIC_IP= \ | |||
PUBLIC_IP="" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
RCON_ENABLED=false \ | ||
RCON_PORT=25575 \ | ||
REGION= \ | ||
REGION="" \ |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
here too
@@ -22,6 +22,7 @@ These settings control the behavior of the Docker container: | |||
| BACKUP_RETENTION_AMOUNT_TO_KEEP | Defines how many backups in numbers to keep | 30 | Integer | | |||
| SERVER_SETTINGS_MODE | Determines whether settings can be modified via environment variables or via file, except `COMMUNITY_SERVER` and `MULTITHREAD_ENABLED`! | `auto` | `auto`: Settings are modified only by environment variables, manual edits will be ignored<br>`manual`: Settings are modified only by editing the file directly, environment variables are ignored | | |||
| STEAMCMD_VALIDATE_FILES | Set to enabled SteamCMD will also validate the gameserver files, making sure nothing is corrupted and also overwrite any file changes of the source<br>See https://developer.valvesoftware.com/wiki/SteamCMD#Downloading_an_App | true | false/true | | |||
| REMOTE_CONTROL | If enabled server will not automatically start on container start and can be started/stopped via webhook call. Stop of the gameserver does not exit the container to allow external restart. | false | false/true | |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
If enabled gameserver ...
@@ -31,6 +32,15 @@ The `TZ` setting affects logging output and the backup function. [TZ identifiers | |||
|
|||
The `BACKUP_CRON_EXPRESSION` setting affects the backup function. In a Cron-Expression, you define an interval for when to run jobs. This image uses Supercronic for crons, see https://github.com/aptible/supercronic#crontab-format or https://crontab-generator.org | |||
|
|||
#### Remote Control | |||
If you enable the container setting the Container will not autostart the gameserver, it will however provide webhooks that allow you to control the server remotely. Hooks provided are |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Which setting again? Im a new user, why isnt this desribed here, its a readme right?
ALWAYS_UPDATE_ON_START=true | ||
MULTITHREAD_ENABLED=true | ||
COMMUNITY_SERVER=true | ||
BACKUP_ENABLED=true | ||
BACKUP_CRON_EXPRESSION=0 * * * * | ||
BACKUP_CRON_EXPRESSION="0 * * * *" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduces a "" bug
@@ -74,7 +80,7 @@ ENABLE_DEFENSE_OTHER_GUILD_PLAYER=false | |||
COOP_PLAYER_MAX_NUM=4 | |||
MAX_PLAYERS=32 | |||
SERVER_NAME=jammsen-docker-generated-###RANDOM### | |||
SERVER_DESCRIPTION=Palworld-Dedicated-Server running in Docker by jammsen | |||
SERVER_DESCRIPTION="Palworld-Dedicated-Server running in Docker by jammsen" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Introduces a bug ""
Hey. Thanks for your comments so far. I'll give an detail answer once I'm back from vacation end of this month. I'm aware of the big pr it should have priority. I would be happy to adapt my changes once this is merged. No hurry needed I was just doing that based on my personal use case right now and it's working fine for me. Just wanted to share the idea and check if it's maybe a desired feature to start and stop the server remotely via a webhook as this would allow to start stop and restart servers via Discord bots web integrations etc. reason why I'm was doing it was the described game bug and it helps to workaround them for my servers. However the feature of remotely controlling the servers running in the container might be a feature to consider. |
Hey @masonen sure take your time. Looking forward to it and dont think im mean, im just honest and direct in PRs, so its not meant harsh or mean, sorry if some comments might come around like that. Its just my direct and honest opinion. |
Summary
This PR introduces the possiblity to controll the gameserver status (start & stop the server) via a webhook
Motivation
Currently the dedicated servers still face a bug where pals are loosing sanity or starve when no player is connected and they get stuck. A current workaround is to stop the server while no one is active. While this bug is of course not in scope of this project i still consider the changes valuable to the project.
Since my servers are used by a small defined group of people which dont have direct CLI access to my host machines (and should not get it) an incomming webhook is a good solution to allow them to controll the serverstatus. Its not in the scope of this project how the webhook is accessed by the "outside world". The hoster can decide on how to make this webhooks availiable to the users/admins of the servers. In my case im currently building a discord bot to access the webhooks securely inside my network without publicly exposing the webhooks, other usecases might include direct web access, web integrations and many more (up to the server maintainer.
Just stoping the server via RCON is ofcourse working but this will also terminate (and restart) the container if its set to "unless-stopped". If restart policy is set to "on-error" the container will keep stopped, but without access to the host one can not start it.
Other scenarios i was considering was a docker in docker setup where i will have the webhooks handle in a container thet spawn the server container. Was working fine but it might overwhelm people to set up on their own.
Changes included