Skip to content

Commit 71cd2cc

Browse files
committed
Add bot usage docs
1 parent 08f4997 commit 71cd2cc

File tree

1 file changed

+95
-0
lines changed

1 file changed

+95
-0
lines changed

README.md

Lines changed: 95 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,73 @@
22

33
Code for alerts.perl6.org and supporting IRC bot
44

5+
## POSTING ALERTS
6+
7+
The alerts are posted by addressing the `p6lert` bot. Four commands exist
8+
9+
### `add`
10+
11+
Adds a new alert, using your IRC for `created by` information.
12+
The bot will give a direct link to it on the site. While
13+
the direct link will show the alert right away, **it'll take 10 minutes** for
14+
the alert to show up on the main site's page, on its API endpoints, or to be
15+
tweeted. This is by-design, to allow for some editing or deleting of the alert,
16+
if needed.
17+
18+
```
19+
<Zoffix> p6lert, add some normal alert
20+
<Zoffix> p6lert, add severity:high some high alert
21+
<Zoffix> p6lert, add affects:[2017.12 and earlier] some normal alert
22+
<Zoffix> p6lert, add severity:high affects:[2017.12 and earlier] some high alert
23+
```
24+
25+
The brackets for `affects` are mandatory and `severity` must come before
26+
`affects`. Both are optional and `severity` defaults to `normal`, while
27+
`affects` defaults to an empty string. If you need a reminder, you can always
28+
issue `help` command to the bot:
29+
30+
```
31+
<Zoffix> p6lert: help
32+
<p6lert> Zoffix, https://github.com/perl6/alerts P6lert commands:
33+
[insta]?add ALERT, update ID ALERT, delete ID;
34+
ALERT format: ['severity:'\S+]? ['affects:['<-[\]]>+']']? ALERT_TEXT
35+
```
36+
37+
### `instadd`
38+
39+
Exactly the same as `add` command, except it does not have a 10-minute grace
40+
period and the alert will be distributed and tweeted immediately. This exists
41+
mostly for debugging and you should always use the `add` command.
42+
43+
```
44+
<Zoffix> p6lert, instaadd some normal alert
45+
```
46+
47+
### `update`
48+
49+
Syntax is the same as `add`, except it takes an alert ID as the first argument.
50+
Updates the alert content. **Note** that omitting `severity` or `affects`
51+
**WILL NOT** set them to default values and will leave them as they were
52+
before the update.
53+
54+
```
55+
<Zoffix> p6lert, update 5 severity:high actually, it's now a high alert
56+
```
57+
58+
The bot will tell you if this alert was already tweeted.
59+
60+
### `delete`
61+
62+
Takes an alert ID as the argument and deletes it from the database.
63+
The bot will tell you if this alert was already tweeted. The tweet will NOT
64+
be deleted by the bot.
65+
66+
```
67+
<Zoffix> p6lert, delete 5
68+
```
69+
70+
###
71+
572
## DEVELOPMENT
673

774
### Website styles
@@ -10,6 +77,34 @@ The styles are in `static/main.scss`. You'll need to run `./sassify` to
1077
have [SASS preprocessor](http://sass-lang.com/) watch for changes and
1178
generate CSS styles for the site.
1279

80+
### IRC Bot Admins
81+
82+
Admins are allowed to post/update/delete alerts. Their hosts are stored in
83+
`/home/p6lert/alerts/secret.json`, in `admin-list` property. When adding new
84+
hosts, please only add registered Freenode users (those who have a
85+
[cloak](https://freenode.net/kb/answer/cloaks) are even better, since we can
86+
see to whom the host belongs)
87+
88+
### Infrastructure
89+
90+
The server and bot are hosted on hack with Apache on www server reverse-proxying
91+
all the requests. The repo checkout lives in
92+
`/home/p6lert/alerts/` and two services exist: `p6lert-web` and `p6lert-irc`
93+
94+
To pull new changes, log in to hack, then run:
95+
96+
```bash
97+
sudo su -l p6lert
98+
cd alerts/
99+
git pull
100+
logout
101+
sudo service p6lert-web restart
102+
sudo service p6lert-irc restart
103+
```
104+
105+
The alerts database is in `/home/p6lert/alerts/alerts.sqlite.db` SQLite file.
106+
107+
Zoffix has the keys to `@p6lert` Twitter account.
13108

14109
----
15110

0 commit comments

Comments
 (0)