thijsvanloef / palworld-server-docker

A Docker Container to easily run a Palworld dedicated server.
https://hub.docker.com/r/thijsvanloef/palworld-server-docker
MIT License
2.43k stars 295 forks source link

Flexible discord notification #324

Closed Torotin closed 8 months ago

Torotin commented 9 months ago

Greetings. I suggest introducing separate variables for Discord messages about working with backups.

DISCORD_BACKUP={true|false} DISCORD_BACKUP_WEBHOOK_URL="{STRING}" DISCORD_PRE_BACKUP_MSG="{STRING}" DISCORD_BACKUP_OK_MSG="{STRING}" DISCORD_BACKUP_ERROR_MSG="{STRING}" DISCORD_PRE_BACKUP_DELETE_MSG="{STRING}" DISCORD_BACKUP_OK_DELETE_MSG="{STRING}" DISCORD_BACKUP_BACKUP_ERROR_DELETE_MSG="{STRING}"

This change will allow for more flexible notification flows: for users (players) - only server status, and for admins - variable enabling/disabling of notifications with the possibility of directing them to a separate admin channel.

jiannystein commented 8 months ago

Just to share and gather any additional insights on how others are doing their things on this topic

My Docker webhook is configured to notify the admin's channel. Here's what it looks like at the moment for backup: image

Script for notifying the public channel and broadcasting via RCON, as well as restarting the server when memory usage exceeds 90%, to prevent unexpected interruptions: image

Script for notifying the public join/leave channel and broadcasting via RCON when a player joins or leaves: image

thijsvanloef commented 8 months ago
@Torotin @jiannystein I'm currently working on this enhancement, if you could, could you test this image? thijsvanloef/palworld-server-docker:pr-490 Variable Info Default Values Allowed Values
DISCORD_PRE_UPDATE_BOOT_MESSAGE Discord message sent when server begins updating Server is updating... "string"
DISCORD_PRE_UPDATE_BOOT_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_UPDATE_BOOT_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_UPDATE_BOOT_MESSAGE Discord message sent when server completes updating Server update complete! "string"
DISCORD_POST_UPDATE_BOOT_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_UPDATE_BOOT_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_START_MESSAGE Discord message sent when server begins to start Server has been started! "string"
DISCORD_PRE_START_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_START_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_SHUTDOWN_MESSAGE Discord message sent when server begins to shutdown Server is shutting down... "string"
DISCORD_PRE_SHUTDOWN_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_SHUTDOWN_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_SHUTDOWN_MESSAGE Discord message sent when server has stopped Server is stopped! "string"
DISCORD_POST_SHUTDOWN_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_SHUTDOWN_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PLAYER_JOIN_MESSAGE Discord message sent when player joins the server \${player_name} has joined Palworld! "string"
DISCORD_PLAYER_JOIN_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PLAYER_JOIN_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PLAYER_LEAVE_MESSAGE Discord message sent when player leaves the server \${player_name} has left Palworld. "string"
DISCORD_PLAYER_LEAVE_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PLAYER_LEAVE_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_BACKUP_MESSAGE Discord message when starting to create a backup Creating backup... "string"
DISCORD_PRE_BACKUP_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_BACKUP_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_BACKUP_MESSAGE Discord message when a backup has been made Backup created at \${FILE_PATH} "string"
DISCORD_POST_BACKUP_MESSAGE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_BACKUP_MESSAGE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_PRE_BACKUP_DELETE_MESSAGE Discord message when starting to remove older backups Removing backups older than \${OLD_BACKUP_DAYS} days "string"
DISCORD_PRE_BACKUP_DELETE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_PRE_BACKUP_DELETE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_POST_BACKUP_DELETE_MESSAGE Discord message when successfully removed older backups Removed backups older than \${OLD_BACKUP_DAYS} days "string"
DISCORD_POST_BACKUP_DELETE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_POST_BACKUP_DELETE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL) "string"
DISCORD_ERR_BACKUP_DELETE_MESSAGE Discord message when there has been an error removing older backups Unable to delete old backups, OLD_BACKUP_DAYS is not an integer. OLD_BACKUP_DAYS=\${OLD_BACKUP_DAYS} "string"
DISCORD_ERR_BACKUP_DELETE_ENABLED If the Discord message is enabled for this message true boolean
DISCORD_ERR_BACKUP_DELETE_URL Discord Webhook URL for this message (if left empty will use DISCORD_WEBHOOK_URL)