mirror of
https://github.com/mgerb/ServerStatus
synced 2026-01-12 12:12:48 +00:00
Compare commits
1 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 242f840180 |
@@ -1,2 +0,0 @@
|
|||||||
/vendor
|
|
||||||
/dist
|
|
||||||
17
Dockerfile
17
Dockerfile
@@ -1,17 +0,0 @@
|
|||||||
FROM golang:1.11.1-alpine
|
|
||||||
|
|
||||||
WORKDIR /go/src/github.com/mgerb/ServerStatus
|
|
||||||
ADD . .
|
|
||||||
RUN apk add --no-cache git alpine-sdk
|
|
||||||
RUN go get -u github.com/golang/dep/cmd/dep
|
|
||||||
RUN dep ensure
|
|
||||||
RUN make linux
|
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:3.8
|
|
||||||
|
|
||||||
RUN apk update && apk add ca-certificates && rm -rf /var/cache/apk/*
|
|
||||||
WORKDIR /server-status
|
|
||||||
COPY --from=0 /go/src/github.com/mgerb/ServerStatus/dist/ServerStatus-linux .
|
|
||||||
ENTRYPOINT ./ServerStatus-linux
|
|
||||||
|
|
||||||
@@ -3,7 +3,6 @@
|
|||||||
"RoomIDList":["room id list goes here"],
|
"RoomIDList":["room id list goes here"],
|
||||||
"RolesToNotify": ["<@&roleid>", "<@userid>"],
|
"RolesToNotify": ["<@&roleid>", "<@userid>"],
|
||||||
"GameStatus": "current playing game",
|
"GameStatus": "current playing game",
|
||||||
"PollingInterval": 10,
|
|
||||||
"Servers": [
|
"Servers": [
|
||||||
{
|
{
|
||||||
"Name": "Your awesome server",
|
"Name": "Your awesome server",
|
||||||
|
|||||||
@@ -6,7 +6,6 @@ import (
|
|||||||
"io/ioutil"
|
"io/ioutil"
|
||||||
"log"
|
"log"
|
||||||
"os"
|
"os"
|
||||||
"time"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// Variables used for command line parameters
|
// Variables used for command line parameters
|
||||||
@@ -18,7 +17,6 @@ type configStruct struct {
|
|||||||
RolesToNotify []string `json:"RolesToNotify"`
|
RolesToNotify []string `json:"RolesToNotify"`
|
||||||
Servers []server `json:"Servers"`
|
Servers []server `json:"Servers"`
|
||||||
GameStatus string `json:"GameStatus"`
|
GameStatus string `json:"GameStatus"`
|
||||||
PollingInterval time.Duration `json:"PollingInterval"`
|
|
||||||
}
|
}
|
||||||
|
|
||||||
type server struct {
|
type server struct {
|
||||||
@@ -45,8 +43,4 @@ func Configure() {
|
|||||||
log.Println(err)
|
log.Println(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
if Config.PollingInterval == 0 {
|
|
||||||
log.Fatal("Please set your PollingInterval > 0 in your config file.")
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,5 +0,0 @@
|
|||||||
version=$(git describe --tags)
|
|
||||||
|
|
||||||
docker build -t mgerb/server-status:latest .
|
|
||||||
docker tag mgerb/server-status:latest mgerb/server-status:$version
|
|
||||||
|
|
||||||
@@ -1,7 +0,0 @@
|
|||||||
version: "2"
|
|
||||||
|
|
||||||
services:
|
|
||||||
server-status:
|
|
||||||
image: mgerb/server-status:latest
|
|
||||||
volumes:
|
|
||||||
- ./config.json:/server-status/config.json
|
|
||||||
@@ -1,5 +0,0 @@
|
|||||||
version=$(git describe --tags)
|
|
||||||
|
|
||||||
docker push mgerb/server-status:latest;
|
|
||||||
docker push mgerb/server-status:$version;
|
|
||||||
|
|
||||||
28
readme.md
28
readme.md
@@ -5,7 +5,7 @@ This bot will send a chat notification when the status of a server changes (goes
|
|||||||
I originally made this bot to check if private World of Warcraft servers were up or not.
|
I originally made this bot to check if private World of Warcraft servers were up or not.
|
||||||
It's actually much more useful than that and can be used for most servers.
|
It's actually much more useful than that and can be used for most servers.
|
||||||
|
|
||||||
NOTE: This bot currently does not have any UDP support.
|
NOTE: This bot currently does not work for UDP servers.
|
||||||
|
|
||||||
## Configuration
|
## Configuration
|
||||||
- Download the latest release [here](https://github.com/mgerb/ServerStatus/releases)
|
- Download the latest release [here](https://github.com/mgerb/ServerStatus/releases)
|
||||||
@@ -17,32 +17,6 @@ NOTE: This bot currently does not have any UDP support.
|
|||||||
- for user `<@userid>`
|
- for user `<@userid>`
|
||||||
- for role `<@&roleid>`
|
- for role `<@&roleid>`
|
||||||
|
|
||||||
### Polling Interval
|
|
||||||
The polling interval is how often the bot will try to ping the servers.
|
|
||||||
A good interval is 10 seconds, but this may need some adjustment if
|
|
||||||
it happens to be spamming notifications.
|
|
||||||
|
|
||||||
- time in seconds
|
|
||||||
- configurable in `config.json`
|
|
||||||
|
|
||||||
## With Docker
|
|
||||||
|
|
||||||
```
|
|
||||||
docker run -it -v /path/to/your/config.json:/server-status/config.json:ro mgerb/server-status
|
|
||||||
```
|
|
||||||
|
|
||||||
### Docker Compose
|
|
||||||
|
|
||||||
```
|
|
||||||
version: "2"
|
|
||||||
|
|
||||||
services:
|
|
||||||
server-status:
|
|
||||||
image: mgerb/server-status:latest
|
|
||||||
volumes:
|
|
||||||
- /path/to/your/config.json:/server-status/config.json
|
|
||||||
```
|
|
||||||
|
|
||||||
## Usage
|
## Usage
|
||||||
To get the current status of your servers simply type `!ServerStatus` in chat.
|
To get the current status of your servers simply type `!ServerStatus` in chat.
|
||||||
|
|
||||||
|
|||||||
@@ -61,7 +61,7 @@ func scanServers() {
|
|||||||
config.Config.Servers[index].Online = serverUp
|
config.Config.Servers[index].Online = serverUp
|
||||||
}
|
}
|
||||||
|
|
||||||
time.Sleep(time.Second * config.Config.PollingInterval)
|
time.Sleep(time.Second * 5)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user