@@ -11,7 +11,20 @@ Checkup was created by Matt Holt, author of the [Caddy web server](https://caddy
1111
1212This tool is a work-in-progress. Please use liberally (with discretion) and report any bugs!
1313
14+ ## Recent changes
1415
16+ Due to recent development, some breaking changes have been introduced:
17+
18+ - providers: the json config field ` provider ` was renamed to ` type ` for consistency,
19+ - notifiers: the json config field ` name ` was renamed to ` type ` for consistency,
20+ - sql: by default the sqlite storage engine is disabled (needs build with ` -tags sql ` to enable),
21+
22+ If you want to build the latest version, it's best to run:
23+
24+ - ` make build ` - builds checkup without sql support,
25+ - ` make build-sql ` - builds checkup with pgsql/sqlite;
26+
27+ The resulting binary will be placed into ` builds/checkup ` .
1528
1629## Intro
1730
@@ -76,9 +89,9 @@ You can configure Checkup entirely with a simple JSON document. You should confi
7689 // storage configuration goes here
7790 },
7891
79- " notifier " : {
92+ " notifiers " : [
8093 // notifier configuration goes here
81- }
94+ ]
8295}
8396```
8497
@@ -90,7 +103,7 @@ Here are the configuration structures you can use, which are explained fully [in
90103
91104#### HTTP Checkers
92105
93- ** [ godoc: HTTPChecker] ( https://godoc.org/github.com/sourcegraph/checkup#HTTPChecker ) **
106+ ** [ godoc: HTTPChecker] ( https://godoc.org/github.com/sourcegraph/checkup/check/http ) **
94107
95108``` js
96109{
@@ -104,7 +117,7 @@ Here are the configuration structures you can use, which are explained fully [in
104117
105118#### TCP Checkers
106119
107- ** [ godoc: TCPChecker] ( https://godoc.org/github.com/sourcegraph/checkup#TCPChecker ) **
120+ ** [ godoc: TCPChecker] ( https://godoc.org/github.com/sourcegraph/checkup/check/tcp ) **
108121
109122``` js
110123{
@@ -116,7 +129,7 @@ Here are the configuration structures you can use, which are explained fully [in
116129
117130#### DNS Checkers
118131
119- ** [ godoc: DNSChecker] ( https://godoc.org/github.com/sourcegraph/checkup#DNSChecker ) **
132+ ** [ godoc: DNSChecker] ( https://godoc.org/github.com/sourcegraph/checkup/check/dns ) **
120133
121134``` js
122135{
@@ -129,7 +142,7 @@ Here are the configuration structures you can use, which are explained fully [in
129142
130143#### TLS Checkers
131144
132- ** [ godoc: TLSChecker] ( https://godoc.org/github.com/sourcegraph/checkup#TLSChecker ) **
145+ ** [ godoc: TLSChecker] ( https://godoc.org/github.com/sourcegraph/checkup/check/tls ) **
133146
134147``` js
135148{
@@ -142,11 +155,11 @@ Here are the configuration structures you can use, which are explained fully [in
142155
143156#### Amazon S3 Storage
144157
145- ** [ godoc: S3] ( https://godoc.org/github.com/sourcegraph/checkup#S3 ) **
158+ ** [ godoc: S3] ( https://godoc.org/github.com/sourcegraph/checkup/check/s3 ) **
146159
147160``` js
148161{
149- " provider " : " s3" ,
162+ " type " : " s3" ,
150163 " access_key_id" : " <yours>" ,
151164 " secret_access_key" : " <yours>" ,
152165 " bucket" : " <yours>" ,
@@ -159,11 +172,11 @@ S3 is the default storage provider assumed by the status page, so the only chang
159172
160173#### File System Storage
161174
162- ** [ godoc: FS] ( https://godoc.org/github.com/sourcegraph/checkup#FS ) **
175+ ** [ godoc: FS] ( https://godoc.org/github.com/sourcegraph/checkup/storage/fs ) **
163176
164177``` js
165178{
166- " provider " : " fs" ,
179+ " type " : " fs" ,
167180 " dir" : " /path/to/your/check_files" ,
168181 " url" : " http://127.0.0.1:2015/check_files"
169182}
@@ -180,11 +193,11 @@ Then fill out [config.js](https://github.com/sourcegraph/checkup/blob/master/sta
180193
181194#### GitHub Storage
182195
183- ** [ godoc: GitHub] ( https://godoc.org/github.com/sourcegraph/checkup#GitHub ) **
196+ ** [ godoc: GitHub] ( https://godoc.org/github.com/sourcegraph/checkup/storage/github ) **
184197
185198``` js
186199{
187- " provider " : " github" ,
200+ " type " : " github" ,
188201 " access_token" : " some_api_access_token_with_repo_scope" ,
189202 " repository_owner" : " owner" ,
190203 " repository_name" : " repo" ,
@@ -209,22 +222,22 @@ Where "dir" is a subdirectory within the repo to push all the check files. Setup
209222
210223#### SQL Storage (sqlite3/PostgreSQL)
211224
212- ** [ godoc: SQL] ( https://godoc.org/github.com/sourcegraph/checkup#SQL ) **
225+ ** [ godoc: SQL] ( https://godoc.org/github.com/sourcegraph/checkup/storage/sql ) **
213226
214227Postgres or sqlite3 databases can be used as storage backends.
215228
216229sqlite database file configuration:
217230``` js
218231{
219- " provider " : " sql" ,
232+ " type " : " sql" ,
220233 " sqlite_db_file" : " /path/to/your/sqlite.db"
221234}
222235```
223236
224237postgresql database file configuration:
225238``` js
226239{
227- " provider " : " sql" ,
240+ " type " : " sql" ,
228241 " postgresql" : {
229242 " user" : " postgres" ,
230243 " dbname" : " dbname" ,
@@ -251,7 +264,7 @@ Currently the status page does not support SQL storage.
251264Enable notifications in Slack with this Notifier configuration:
252265``` js
253266{
254- " name " : " slack" ,
267+ " type " : " slack" ,
255268 " username" : " username" ,
256269 " channel" : " #channel-name" ,
257270 " webhook" : " webhook-url"
@@ -260,6 +273,26 @@ Enable notifications in Slack with this Notifier configuration:
260273
261274Follow these instructions to [ create a webhook] ( https://get.slack.help/hc/en-us/articles/115005265063-Incoming-WebHooks-for-Slack ) .
262275
276+ #### Mail notifier
277+
278+ Enable E-mail notifications with this Notifier configuration:
279+ ``` js
280+ {
281+ " type" : " mail" ,
282+ " from" : " from@example.com" ,
283+ " to" : [ " support1@examiple.com" , " support2@example.com" ],
284+ " subject" : " Custom subject line" ,
285+ " smtp" : {
286+ " server" : " smtp.example.com" ,
287+ " port" : 25 ,
288+ " username" : " username" ,
289+ " password" : " password"
290+ }
291+ }
292+ ```
293+
294+ The settings for ` subject ` , ` smtp.port ` (default to 25), ` smtp.username ` and ` smtp.password ` are optional.
295+
263296## Setting up storage on S3
264297
265298The easiest way to do this is to give an IAM user these two privileges (keep the credentials secret):
@@ -453,34 +486,18 @@ You can implement your own Checker and Storage types. If it's general enough, fe
453486
454487### Building Locally
455488
456- Requires Go v1.10 or newer.
489+ Requires Go v1.13 or newer.
457490
458491``` bash
459492git clone git@github.com:sourcegraph/checkup.git
460- cd checkup/cmd/checkup/
461-
462- # Install dependencies
463- go get -v -d
464-
465- # Build binary
466- go build -v -ldflags ' -s' -o ../../checkup
467-
468- # Run tests
469- go test -race ../../
493+ cd checkup
494+ make
470495```
471496
472- ### Building with Docker
497+ Building the SQL enabled version is done with ` make build-sql ` .
473498
474- Linux binary:
475-
476- ``` bash
477- git clone git@github.com:sourcegraph/checkup.git
478- cd checkup
479- docker pull golang:latest
480- docker run --net=host --rm \
481- -v ` pwd` :/project \
482- -w /project golang bash \
483- -c " cd cmd/checkup; go get -v -d; go build -v -ldflags '-s' -o ../../checkup"
484- ```
499+ ### Building a Docker image
485500
486- This will create a checkup binary in the root project folder.
501+ If you would like to run checkup in a docker container, building it is done by running ` make docker ` .
502+ It will build the version without sql support. An SQL supported docker image is currently not provided,
503+ but there's a plan to do that in the future.
0 commit comments