项目作者: huntie

项目描述 :
Simple status notifier utility for Minecraft Server on Supervisord
高级语言: JavaScript
项目地址: git://github.com/huntie/minecraft-status-notifier.git
创建时间: 2017-02-05T23:16:46Z
项目社区:https://github.com/huntie/minecraft-status-notifier

开源协议:GNU General Public License v3.0

下载


Minecraft server status notifier

A small Node.js utility to listen to Supervisord events and publish status messages to a webhook receiver such as Discord, Telegram or Slack.

Usage

  1. npm install

Edit .env to specify a target webhook URL and Supervisor process group name to match.

Next, define a event listener in your Supervisor configuration (under /etc/supervisor/conf.d/). A subset of event types can be matched.

  1. [eventlistener:minecraft_status]
  2. command=node app.js
  3. directory=/home/minecraft/minecraft-status-notifier
  4. user=minecraft
  5. events=PROCESS_STATE

Finally, load the updated configuration.

  1. supervisorctl update

To match additional event types and customise broadcasted messages, edit config/messages.json.

Maintenance mode

Maintenance mode can be set from the package directory. When enabled, new event messages will be suppressed.

  1. npm run down

This creates a MAINTENANCE_MODE file which can be deleted manually, or is removed when maintenance mode is disabled.

  1. npm run up

Sidenote

This implementation can easily be generalised for any Supervisor-managed process, however was created as a quick personal tool and serves for reference purposes.