Skip to content

Commit c2c09e9

Browse files
committed
Initial port to mysql + reworked layout
1 parent c9960c7 commit c2c09e9

17 files changed

+1161
-928
lines changed

README.md

+5-6
Original file line numberDiff line numberDiff line change
@@ -25,18 +25,17 @@ To install the software run:
2525

2626
Once installed you'll be able to launch the server like so:
2727

28-
~ $ purppura
28+
~ $ purppura serve
2929
Listening on http://localhost:8080/
3030

3131
**NOTE** however that the server presents a web interface which requires a login, so you'll need to add at least one user to the system. This can be done while the server is running, or before you launch it:
3232

33-
~ $ purppura -user-add steve
34-
Enter Password for user steve: secret
33+
~ $ purppura add-user
34+
Enter Username: moi
35+
Enter Password: kissa
3536
~ $
3637

37-
You should now be able to login to the web interface with username `steve` and password `secret`.
38-
39-
The usernames and passwords which will grant access to the web interface are stored inside the same SQLite file that is used to hold event-details.
38+
You should now be able to login to the web interface with username `steve` and password `secret`. You can use the `del-user` sub-command to remove the user in the future, or the "list-users" sub-command to see the users.
4039

4140

4241
# Alerts

TODO

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
* Recreate tables with autoinc-ids
2+
3+
* Move the test-code.
4+
5+
* Test the notification.
6+
7+
* Rethink logic of notify/renotify

alert/alert.go

+43
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,43 @@
1+
package alert
2+
3+
//
4+
// This structure describes a single event.
5+
//
6+
type Alert struct {
7+
//
8+
// The detail of the event.
9+
//
10+
Detail string
11+
12+
//
13+
// The ID of the event, e.g. "heartbeat", "backup"
14+
//
15+
// The ID should be unique per-source.
16+
//
17+
ID string
18+
19+
//
20+
// The time the alert should raise, which will be submitted
21+
// as "+5m", "now", "clear", and be translated to an absolute
22+
// time - in seconds past the epoch.
23+
//
24+
Raise string
25+
26+
//
27+
// The subject/summary of the event.
28+
//
29+
Subject string
30+
31+
//
32+
// The source (IP address) of the event.
33+
//
34+
Source string
35+
36+
//
37+
// Sigh - these are private fields, used when we output
38+
// our list of events to JSON.
39+
//
40+
Status string
41+
RaiseAt string
42+
NotifiedAt string
43+
}

0 commit comments

Comments
 (0)