Skip to content

Commit 5d614eb

Browse files
committed
Added endpoints, Added postman docs, Fixed bugs and more!
1 parent f6f9a56 commit 5d614eb

16 files changed

+853
-371
lines changed

.eslintrc.json

+139
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,139 @@
1+
{
2+
"parserOptions": {
3+
"ecmaVersion": 9
4+
},
5+
"ignorePatterns": ["**/sdk/**", "**/gitlab-ci/**"],
6+
"extends": ["prettier"],
7+
"plugins": ["prettier"],
8+
"env": {
9+
"node": true,
10+
"jest": true
11+
},
12+
"rules": {
13+
"comma-dangle": ["error", "never"],
14+
"no-cond-assign": 2,
15+
"no-constant-condition": 2,
16+
"no-control-regex": 2,
17+
"no-debugger": 2,
18+
"no-dupe-args": 2,
19+
"no-dupe-keys": 2,
20+
"no-duplicate-case": 2,
21+
"no-empty-character-class": 2,
22+
"no-extra-semi": 2,
23+
"no-func-assign": 2,
24+
"no-invalid-regexp": 2,
25+
"no-irregular-whitespace": 2,
26+
"no-negated-in-lhs": 2,
27+
"no-obj-calls": 2,
28+
"no-unreachable": 2,
29+
"use-isnan": 2,
30+
"no-unexpected-multiline": 2,
31+
"curly": 2,
32+
"dot-location": [2, "property"],
33+
"no-alert": 2,
34+
"no-caller": 1,
35+
"no-eval": 1,
36+
"no-multi-spaces": 2,
37+
"no-unused-vars": [
38+
2,
39+
{
40+
"vars": "all",
41+
"args": "none"
42+
}
43+
],
44+
"array-bracket-spacing": [2, "never"],
45+
"block-spacing": [2, "never"],
46+
"brace-style": [
47+
2,
48+
"1tbs",
49+
{
50+
"allowSingleLine": true
51+
}
52+
],
53+
"camelcase": [
54+
"error",
55+
{
56+
"properties": "never"
57+
}
58+
],
59+
"comma-spacing": [
60+
2,
61+
{
62+
"before": false,
63+
"after": true
64+
}
65+
],
66+
"comma-style": [2, "last"],
67+
"computed-property-spacing": [2, "never"],
68+
"consistent-this": [2, "self"],
69+
"eol-last": 2,
70+
"func-style": [2, "declaration", { "allowArrowFunctions": true }],
71+
"indent": [
72+
2,
73+
2,
74+
{
75+
"SwitchCase": 1
76+
}
77+
],
78+
"key-spacing": [
79+
2,
80+
{
81+
"beforeColon": false,
82+
"afterColon": true
83+
}
84+
],
85+
"keyword-spacing": 2,
86+
"lines-around-comment": [
87+
2,
88+
{
89+
"beforeBlockComment": true,
90+
"beforeLineComment": false,
91+
"allowBlockStart": true
92+
}
93+
],
94+
"linebreak-style": [2, "unix"],
95+
"new-cap": 2,
96+
"new-parens": 2,
97+
"newline-after-var": [2, "always"],
98+
"no-array-constructor": 2,
99+
"no-inline-comments": 2,
100+
"no-lonely-if": 2,
101+
"no-mixed-spaces-and-tabs": 2,
102+
"no-multiple-empty-lines": [
103+
2,
104+
{
105+
"max": 1
106+
}
107+
],
108+
"no-nested-ternary": 0,
109+
"no-new-object": 2,
110+
"no-spaced-func": 2,
111+
"no-trailing-spaces": 2,
112+
"object-curly-spacing": [2, "always"],
113+
"one-var": [2, "never"],
114+
"operator-linebreak": [2, "after"],
115+
"quote-props": [2, "as-needed"],
116+
"quotes": [2, "single", "avoid-escape"],
117+
"semi-spacing": 2,
118+
"semi": [2, "always"],
119+
"sort-vars": 2,
120+
"space-before-blocks": 2,
121+
"space-before-function-paren": [
122+
2,
123+
{
124+
"anonymous": "never",
125+
"named": "never",
126+
"asyncArrow": "always"
127+
}
128+
],
129+
"space-in-parens": [2, "never"],
130+
"space-infix-ops": 2,
131+
"space-unary-ops": [
132+
2,
133+
{
134+
"words": true,
135+
"nonwords": false
136+
}
137+
]
138+
}
139+
}

.gitignore

+2
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,5 @@
11
package-lock.json
22
node_modules
33
.DS_Store
4+
!test/sky-puppy-config.json
5+
sky-puppy-config.json

.prettierrc.js

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
module.exports = {
2+
tabWidth: 2,
3+
singleQuote: true,
4+
};

README.nbs

+120-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,124 @@
11
# Sky Puppy
2-
A easy to use reliable health checking service with Prometheus export
2+
A easy to use reliable endpoint coordinator / health checking service with Prometheus export
33

4+
[Sky Puppy Postman Collection](https://documenter.getpostman.com/view/208035/TVYKawgU)
5+
6+
## Install
7+
8+
```bash
9+
npm install -g sky-puppy
10+
```
11+
12+
## Run
13+
14+
```bash
15+
sky-puppy
16+
```
17+
18+
## Sample Config
19+
20+
Sky Puppy looks for a file called `sky-puppy-config.json` in the folder it is ran at.
21+
22+
```json
23+
{
24+
"alerters": {
25+
"discord_down": {
26+
"uri": "http://discord.com",
27+
"json": true,
28+
"method": "PUT",
29+
"body": {
30+
"embeds": [
31+
{
32+
"title": "{{service_name}} is {{alert_type}}!",
33+
"description": "This service was healthy for {{last_healthy_total_duration}} seconds!",
34+
"color": 14828098,
35+
"footer": {
36+
"text": ""
37+
},
38+
"timestamp": "{{timestamp}}"
39+
}
40+
],
41+
"username": "Sky Puppy",
42+
"avatar_url": "https://i.imgur.com/J5vIVSt.png"
43+
}
44+
},
45+
"discord_unhealthy": {
46+
"uri": "http://discord.com",
47+
"json": true,
48+
"method": "PUT",
49+
"body": {
50+
"embeds": [
51+
{
52+
"title": "{{service_name}} is {{alert_type}}!",
53+
"description": "This service was healthy for {{last_healthy_total_duration}} seconds!",
54+
"color": 14852674,
55+
"footer": {
56+
"text": ""
57+
},
58+
"timestamp": "{{timestamp}}"
59+
}
60+
],
61+
"username": "Sky Puppy",
62+
"avatar_url": "https://i.imgur.com/J5vIVSt.png"
63+
}
64+
},
65+
"discord_healthy": {
66+
"uri": "http://discord.com",
67+
"json": true,
68+
"method": "PUT",
69+
"body": {
70+
"embeds": [
71+
{
72+
"title": "{{service_name}} is {{alert_type}}!",
73+
"description": "Carry on, looks like things are back! We were down for {{last_unhealthy_total_duration}} seconds.",
74+
"color": 6480450,
75+
"footer": {
76+
"text": ""
77+
},
78+
"timestamp": "{{timestamp}}"
79+
}
80+
],
81+
"username": "Sky Puppy",
82+
"avatar_url": "https://i.imgur.com/3rfFeOu.png"
83+
}
84+
}
85+
},
86+
"services": {
87+
"your_service": {
88+
"interval": 3,
89+
"start_delay": 2,
90+
"request": {
91+
"uri": "http://127.0.0.1/a/cool/endpoint",
92+
"timeout": 2,
93+
"json": true,
94+
"method": "PUT",
95+
"body": {
96+
"test": "sweet"
97+
},
98+
},
99+
"alerts": [
100+
{
101+
"type": "down",
102+
"alerter": "discord_down"
103+
},
104+
{
105+
"type": "unhealthy",
106+
"alerter": "discord_unhealthy"
107+
},
108+
{
109+
"type": "healthy",
110+
"alerter": "discord_healthy"
111+
}
112+
]
113+
}
114+
},
115+
"skypuppy": {
116+
"version": "1.0.0"
117+
}
118+
}
119+
120+
```
121+
122+
## Changelog
4123

5124
{{doc1}}

changelog-template.hbs

-2
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
### Changelog
2-
31
All notable changes to this project will be documented in this file. Dates are displayed in UTC.
42

53
{{#each releases}}

package.json

+16-6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,9 @@
1313
"type": "git",
1414
"url": "git+https://github.com/Phara0h/sky-puppy.git"
1515
},
16+
"bin": {
17+
"sky-puppy": "./src/index.js"
18+
},
1619
"keywords": [
1720
"prometheus",
1821
"health",
@@ -27,13 +30,20 @@
2730
},
2831
"homepage": "https://github.com/Phara0h/sky-puppy#readme",
2932
"dependencies": {
30-
"auto-changelog": "^2.2.0",
31-
"fasquest": "^2.4.0",
32-
"fastify": "^2.15.3",
33+
"fasquest": "^3.0.1",
34+
"fastify": "^3.7.0",
35+
"nbars": "^1.0.1",
36+
"nstats": "^4.1.2"
37+
},
38+
"devDependencies": {
39+
"eslint": "^7.8.1",
40+
"eslint-config-prettier": "^6.11.0",
41+
"eslint-plugin-prettier": "^3.1.4",
42+
"prettier": "^2.0.5",
43+
"prettier-eslint": "^11.0.0",
3344
"jsdoc-to-markdown": "^6.0.1",
45+
"auto-changelog": "^2.2.0",
3446
"mdsquash": "^1.0.5",
35-
"nbars": "^1.0.1",
36-
"nstats": "^2.1.5",
37-
"postgen": "^4.1.5"
47+
"postgen": "^4.6.0"
3848
}
3949
}

0 commit comments

Comments
 (0)