From ad6bbb5602689a900337105645e2f377a2fe21e1 Mon Sep 17 00:00:00 2001 From: Smith Date: Sun, 27 Aug 2023 21:43:00 +0200 Subject: [PATCH 1/6] adds bots/discord/game-server-watcher --- README.md | 1 + bots/discord/README.md | 5 + bots/discord/game-server-watcher/README.md | 18 +++ .../egg-game-server-watcher.json | 114 ++++++++++++++++++ 4 files changed, 138 insertions(+) create mode 100644 bots/discord/game-server-watcher/README.md create mode 100644 bots/discord/game-server-watcher/egg-game-server-watcher.json diff --git a/README.md b/README.md index 84756656..a0dfc883 100644 --- a/README.md +++ b/README.md @@ -33,6 +33,7 @@ If you are reading this it looks like you are looking to add an egg to your serv * [CorpBot](/bots/discord/corpbot) Python * [Dynamica](/bots/discord/dynamica) Node JS * [fragbot](/bots/discord/fragbot) Golang +* [Game Server Watcher](/bots/discord/game-server-watcher) Node JS * [JMusicBot](/bots/discord/jmusicbot) Java * [Muse](/bots/discord/muse) Node JS * [parkertron](/bots/discord/parkertron) Golang diff --git a/bots/discord/README.md b/bots/discord/README.md index 1793f497..070b5148 100644 --- a/bots/discord/README.md +++ b/bots/discord/README.md @@ -22,6 +22,11 @@ A very clumsy python bot for discord [fragforce/fragbot](https://github.com/fragforce/fragbot) The bot that runs as the fragforce `@Fragbot` offering looking-for-group services for now +### [Game Server Watcher](game-server-watcher) + +[a-sync/game-server-watcher](https://github.com/a-sync/game-server-watcher) +A simple discord/telegram/slack bot that can be hosted on a free service to monitor your game servers and players in style. 😎 + ### [JMusicBot](jmusicbot) [jagrosh/MusicBot](https://github.com/jagrosh/MusicBot) diff --git a/bots/discord/game-server-watcher/README.md b/bots/discord/game-server-watcher/README.md new file mode 100644 index 00000000..7e668c4c --- /dev/null +++ b/bots/discord/game-server-watcher/README.md @@ -0,0 +1,18 @@ +# Game Server Watcher + +## From [Github](https://github.com/a-sync/game-server-watcher#readme) +A simple discord/telegram/slack bot that can be hosted on a free service to monitor your game servers and players in style. 😎 + +## Screenshots + + +## Running the bot +Refer to the wiki on how to acquire tokens for: + * [steam](https://github.com/a-sync/game-server-watcher/wiki/Steam-Web-API-key) + * [discord](https://github.com/a-sync/game-server-watcher/wiki/Discord-bot-token) + * [telegram](https://github.com/a-sync/game-server-watcher/wiki/Telegram-bot-token) + * [slack](https://github.com/a-sync/game-server-watcher/wiki/Slack-bot-token) + +## Server Ports +GSW Control Panel requires one port for http traffic. +(It can be any port.) diff --git a/bots/discord/game-server-watcher/egg-game-server-watcher.json b/bots/discord/game-server-watcher/egg-game-server-watcher.json new file mode 100644 index 00000000..d503199f --- /dev/null +++ b/bots/discord/game-server-watcher/egg-game-server-watcher.json @@ -0,0 +1,114 @@ +{ + "_comment": "DO NOT EDIT: FILE GENERATED AUTOMATICALLY BY PTERODACTYL PANEL - PTERODACTYL.IO", + "meta": { + "version": "PTDL_v2", + "update_url": null + }, + "exported_at": "2023-08-15T04:20:09+02:00", + "name": "Game Server Watcher", + "author": "a-sync@devs.space", + "description": "A simple discord\/telegram\/slack bot that can be hosted on a free service to monitor your game servers and players in style. 😎", + "features": null, + "docker_images": { + "Node.js 20": "ghcr.io\/parkervcp\/yolks:nodejs_20" + }, + "file_denylist": [], + "startup": "env PORT={{SERVER_PORT}} \/usr\/local\/bin\/node \/home\/container\/dist\/server.js", + "config": { + "files": "{}", + "startup": "{\r\n \"done\": \"starting loop...\"\r\n}", + "logs": "{}", + "stop": "^^C" + }, + "scripts": { + "installation": { + "script": "#!\/bin\/bash\r\napt-get update && apt-get install ca-certificates git -yq --no-install-suggests --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages\r\ncd \/mnt\/server\r\ngit config --global --add safe.directory \/mnt\/server\r\ngit clone https:\/\/github.com\/a-sync\/game-server-watcher.git . || git pull\r\nnpm install && npm run build\r\nnpm prune --omit=dev", + "container": "node:20-bookworm-slim", + "entrypoint": "bash" + } + }, + "variables": [ + { + "name": "SECRET", + "description": "Admin secret", + "env_variable": "SECRET", + "default_value": "secret", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|min:1|max:255" + }, + { + "name": "DATA_PATH", + "description": "Writable folder for data storage", + "env_variable": "DATA_PATH", + "default_value": ".\/data\/", + "user_viewable": true, + "user_editable": true, + "rules": "required|string|min:1|max:255" + }, + { + "name": "REFRESH_TIME_MINUTES", + "description": "Game server info refresh interval in minutes", + "env_variable": "REFRESH_TIME_MINUTES", + "default_value": "2", + "user_viewable": true, + "user_editable": true, + "field_type": "integer", + "rules": "required|integer|min:1" + }, + { + "name": "DISCORD_BOT_TOKEN", + "description": "Discord bot token", + "env_variable": "DISCORD_BOT_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "TELEGRAM_BOT_TOKEN", + "description": "Telegram bot token", + "env_variable": "TELEGRAM_BOT_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "SLACK_BOT_TOKEN", + "description": "Slack bot token", + "env_variable": "SLACK_BOT_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "SLACK_APP_TOKEN", + "description": "Slack app token", + "env_variable": "SLACK_APP_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "STEAM_WEB_API_KEY", + "description": "Steam web API key", + "env_variable": "STEAM_WEB_API_KEY", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string" + }, + { + "name": "Debug Mode", + "description": "Enable or disable debug mode.", + "env_variable": "DBG", + "default_value": "0", + "user_viewable": true, + "user_editable": true, + "rules": "required|in:0,1" + } + ] +} From 916a81a4e595801d9f701bed6ad4c7fdebc01819 Mon Sep 17 00:00:00 2001 From: Smith Date: Tue, 12 Sep 2023 20:38:17 +0200 Subject: [PATCH 2/6] use the yolks base image for the installer --- bots/discord/game-server-watcher/egg-game-server-watcher.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/discord/game-server-watcher/egg-game-server-watcher.json b/bots/discord/game-server-watcher/egg-game-server-watcher.json index d503199f..3699b492 100644 --- a/bots/discord/game-server-watcher/egg-game-server-watcher.json +++ b/bots/discord/game-server-watcher/egg-game-server-watcher.json @@ -23,7 +23,7 @@ "scripts": { "installation": { "script": "#!\/bin\/bash\r\napt-get update && apt-get install ca-certificates git -yq --no-install-suggests --no-install-recommends --allow-downgrades --allow-remove-essential --allow-change-held-packages\r\ncd \/mnt\/server\r\ngit config --global --add safe.directory \/mnt\/server\r\ngit clone https:\/\/github.com\/a-sync\/game-server-watcher.git . || git pull\r\nnpm install && npm run build\r\nnpm prune --omit=dev", - "container": "node:20-bookworm-slim", + "container": "node:20-bullseye-slim", "entrypoint": "bash" } }, From d89a95494eb0217ef16a1daea2f0c2c65e19f321 Mon Sep 17 00:00:00 2001 From: Smith Date: Wed, 13 Sep 2023 20:37:52 +0200 Subject: [PATCH 3/6] re-export json --- .../egg-game-server-watcher.json | 66 +++++++++++-------- 1 file changed, 37 insertions(+), 29 deletions(-) diff --git a/bots/discord/game-server-watcher/egg-game-server-watcher.json b/bots/discord/game-server-watcher/egg-game-server-watcher.json index 3699b492..820675ce 100644 --- a/bots/discord/game-server-watcher/egg-game-server-watcher.json +++ b/bots/discord/game-server-watcher/egg-game-server-watcher.json @@ -4,10 +4,10 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-08-15T04:20:09+02:00", + "exported_at": "2023-09-13T18:34:19+00:00", "name": "Game Server Watcher", "author": "a-sync@devs.space", - "description": "A simple discord\/telegram\/slack bot that can be hosted on a free service to monitor your game servers and players in style. 😎", + "description": "A simple discord\/telegram\/slack bot that can be hosted on a free service to monitor your game servers and players in style. \ud83d\ude0e", "features": null, "docker_images": { "Node.js 20": "ghcr.io\/parkervcp\/yolks:nodejs_20" @@ -35,7 +35,8 @@ "default_value": "secret", "user_viewable": true, "user_editable": true, - "rules": "required|string|min:1|max:255" + "rules": "required|string|min:1|max:255", + "field_type": "text" }, { "name": "DATA_PATH", @@ -44,7 +45,8 @@ "default_value": ".\/data\/", "user_viewable": true, "user_editable": true, - "rules": "required|string|min:1|max:255" + "rules": "required|string|min:1|max:255", + "field_type": "text" }, { "name": "REFRESH_TIME_MINUTES", @@ -53,8 +55,8 @@ "default_value": "2", "user_viewable": true, "user_editable": true, - "field_type": "integer", - "rules": "required|integer|min:1" + "rules": "required|integer|min:1", + "field_type": "text" }, { "name": "DISCORD_BOT_TOKEN", @@ -63,7 +65,8 @@ "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string" + "rules": "nullable|string", + "field_type": "text" }, { "name": "TELEGRAM_BOT_TOKEN", @@ -72,25 +75,8 @@ "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string" - }, - { - "name": "SLACK_BOT_TOKEN", - "description": "Slack bot token", - "env_variable": "SLACK_BOT_TOKEN", - "default_value": "", - "user_viewable": true, - "user_editable": true, - "rules": "nullable|string" - }, - { - "name": "SLACK_APP_TOKEN", - "description": "Slack app token", - "env_variable": "SLACK_APP_TOKEN", - "default_value": "", - "user_viewable": true, - "user_editable": true, - "rules": "nullable|string" + "rules": "nullable|string", + "field_type": "text" }, { "name": "STEAM_WEB_API_KEY", @@ -99,7 +85,8 @@ "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "nullable|string" + "rules": "nullable|string", + "field_type": "text" }, { "name": "Debug Mode", @@ -108,7 +95,28 @@ "default_value": "0", "user_viewable": true, "user_editable": true, - "rules": "required|in:0,1" + "rules": "required|in:0,1", + "field_type": "text" + }, + { + "name": "SLACK_BOT_TOKEN", + "description": "Slack bot token", + "env_variable": "SLACK_BOT_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string", + "field_type": "text" + }, + { + "name": "SLACK_APP_TOKEN", + "description": "Slack app token", + "env_variable": "SLACK_APP_TOKEN", + "default_value": "", + "user_viewable": true, + "user_editable": true, + "rules": "nullable|string", + "field_type": "text" } ] -} +} \ No newline at end of file From f87a17f0a54bdfe3f55139d5f2c2caa923d7eac1 Mon Sep 17 00:00:00 2001 From: Smith Date: Tue, 24 Oct 2023 17:07:31 +0200 Subject: [PATCH 4/6] enforce user to create min. 8 char secret --- bots/discord/game-server-watcher/egg-game-server-watcher.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bots/discord/game-server-watcher/egg-game-server-watcher.json b/bots/discord/game-server-watcher/egg-game-server-watcher.json index 820675ce..0907c466 100644 --- a/bots/discord/game-server-watcher/egg-game-server-watcher.json +++ b/bots/discord/game-server-watcher/egg-game-server-watcher.json @@ -32,10 +32,10 @@ "name": "SECRET", "description": "Admin secret", "env_variable": "SECRET", - "default_value": "secret", + "default_value": "", "user_viewable": true, "user_editable": true, - "rules": "required|string|min:1|max:255", + "rules": "required|string|min:8|max:255", "field_type": "text" }, { From a94274972b72a339cd59724f225b7ee4c91f523e Mon Sep 17 00:00:00 2001 From: Smith Date: Tue, 24 Oct 2023 18:34:57 +0200 Subject: [PATCH 5/6] upd. readme; re-export from panel --- bots/discord/game-server-watcher/README.md | 4 ++++ bots/discord/game-server-watcher/egg-game-server-watcher.json | 2 +- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/bots/discord/game-server-watcher/README.md b/bots/discord/game-server-watcher/README.md index 7e668c4c..76a877ad 100644 --- a/bots/discord/game-server-watcher/README.md +++ b/bots/discord/game-server-watcher/README.md @@ -16,3 +16,7 @@ Refer to the wiki on how to acquire tokens for: ## Server Ports GSW Control Panel requires one port for http traffic. (It can be any port.) + +| Port | default | +|---------|---------| +| Web | 8080 | diff --git a/bots/discord/game-server-watcher/egg-game-server-watcher.json b/bots/discord/game-server-watcher/egg-game-server-watcher.json index 0907c466..47cbaee8 100644 --- a/bots/discord/game-server-watcher/egg-game-server-watcher.json +++ b/bots/discord/game-server-watcher/egg-game-server-watcher.json @@ -4,7 +4,7 @@ "version": "PTDL_v2", "update_url": null }, - "exported_at": "2023-09-13T18:34:19+00:00", + "exported_at": "2023-10-24T16:33:47+00:00", "name": "Game Server Watcher", "author": "a-sync@devs.space", "description": "A simple discord\/telegram\/slack bot that can be hosted on a free service to monitor your game servers and players in style. \ud83d\ude0e", From 0c5ddb6ada4bb717973d435c5858622bfca7f1fa Mon Sep 17 00:00:00 2001 From: Smith Date: Tue, 24 Oct 2023 19:55:07 +0200 Subject: [PATCH 6/6] upd. default port: 8081 --- bots/discord/game-server-watcher/README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/bots/discord/game-server-watcher/README.md b/bots/discord/game-server-watcher/README.md index 76a877ad..5134102b 100644 --- a/bots/discord/game-server-watcher/README.md +++ b/bots/discord/game-server-watcher/README.md @@ -19,4 +19,4 @@ GSW Control Panel requires one port for http traffic. | Port | default | |---------|---------| -| Web | 8080 | +| Web | 8081 |