A simple discord bot and webpage to give you control in letting your users know when your services are down.
StatusPage is a simple node application which uses Express.JS for its homepage and API, and Discord.JS for its discord integration.
You can install it natively or in a docker container.
This guide will use Ubuntu 20.04 but it should work on most OSes with minor differences such as paths.
-
Clone this repository
git clone https://github.com/JackBailey/StatusPage
-
Enter the StatusPage Directory
cd StatusPage
-
Install the required packages
I recommend yarn for this but you can use npm if you'd prefer.
Requirements:
yarn install
-
Start the application
yarn start
-
Run it in the background If you'd like to be able to close your terminal and keep it running you can use forever
Install forever
npm install -g forever
Start StatusPage with forever
forever start index.js
This is my preferred method due to its ease of use and control.
-
Install Docker and Docker compose
curl -fsSL https://get.docker.com -o get-docker.sh sh get-docker.sh
-
Clone this repository
git clone https://github.com/JackBailey/StatusPage
-
Enter the StatusPage Directory
cd StatusPage
-
Start the container detached
docker compose up -d
-
Check the logs of the container to check it started correctly
docker logs --follow StatusPage
It should show both
Express.JS: Listening on port XXXXX
andDiscord: Logged in as XXXXX#1234
-
Copy the example files
Once you have cloned and entered repository run the following commands to create configuration files you can edit
cp .env.example .env cp config.example.json config.json cp services.example.json services.json
-
Create a Discord Application
Go to Discord Developer Applications and create a new application
Set your application's name and agree to the Terms of Service.
-
Create the bot
Go to the bot tab and click
Add Bot
And say
Yes, do it!
to the popup that comes up -
Get the required bot information
Reset the bot's token and make a note of the resulting token (Keep this to yourself and don't share it with anyone)
Go back to the General Information tab and make a note of the Application ID
-
Add the bot to your discord server
Go to the following link where
APPLICATION_ID
is the application ID you copied earlierhttps://discord.com/api/oauth2/authorize?client_id=APPLICATION_ID&permissions=2147483648&scope=bot
Then add it to whatever server you want the bot in.
-
Edit the configuration files
Replace
YourDiscordBotToken
with the token you copied earlier, it'll look likeMTA0MDk5MDU2MDM4MDUzNDg4NQ.GTvwe6.pbc10xV6A89L7g0yoJIAA1XsYSD1cjp-Q-ktJw
Set this to whatever you like, just make sure that you set the discord.statusChannel.id to the channel you want, leave the lastMessage as default - It'll send a new one and change it for you
Set authorizedRoles to the role ids you want to let change the status with slash commands
Set the client_id to the application ID you copied earlier
Set the guild_id to the discord server ID you've added the bot to
Edit the rest to your liking
Edit this to whatever you like - Just make sure at least one has
default: true
that the bot can set services to after a/status reset