@hyperwatch/hyperwatch 4.2.0 → 5.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (57) hide show
  1. package/README.md +9 -4
  2. package/config/apache_syslog_example.js +29 -0
  3. package/config/default.js +2 -2
  4. package/config/example.js +5 -5
  5. package/config/express_websocket_example.js +28 -0
  6. package/config/websocket_client_example.js +52 -0
  7. package/docs/configuration.md +67 -6
  8. package/docs/express-embedding.md +137 -0
  9. package/docs/input.md +50 -24
  10. package/docs/tutorials/apache_input.md +16 -14
  11. package/docs/tutorials/express_input.md +10 -8
  12. package/package.json +42 -35
  13. package/scripts/fetch-anthropic-ips.js +60 -0
  14. package/scripts/fetch-cloudflare-ips.js +27 -0
  15. package/scripts/fetch-cloudfront-ips.js +29 -0
  16. package/scripts/fetch-openai-ips.js +34 -0
  17. package/src/app/api.js +149 -8
  18. package/src/app/index.js +8 -4
  19. package/src/app/mount.js +115 -0
  20. package/src/app/websocket.js +39 -10
  21. package/src/app/ws-server.js +123 -0
  22. package/src/constants.js +17 -5
  23. package/src/data/amazon-searchbot-ips.json +818 -0
  24. package/src/data/amazon-user-ips.json +1025 -0
  25. package/src/data/amazonbot-ips.json +1294 -0
  26. package/src/data/chatgpt-user-ips.json +231 -0
  27. package/src/data/claude-bot-ips.json +28 -0
  28. package/src/data/cloudflare-ips.json +24 -0
  29. package/src/data/cloudfront-ips.json +245 -0
  30. package/src/data/gptbot-ips.json +20 -0
  31. package/src/data/openai-searchbot-ips.json +41 -0
  32. package/src/index.js +24 -3
  33. package/src/input/http.js +4 -0
  34. package/src/input/syslog.js +5 -1
  35. package/src/input/websocket.js +35 -19
  36. package/src/lib/aggregator.js +169 -20
  37. package/src/lib/formatter.js +10 -1
  38. package/src/lib/index.js +2 -0
  39. package/src/lib/log-buffer.js +45 -0
  40. package/src/lib/persistence.js +82 -0
  41. package/src/lib/pipeline.js +122 -11
  42. package/src/lib/recent-map.js +23 -0
  43. package/src/lib/speed.js +43 -3
  44. package/src/lib/util.js +17 -1
  45. package/src/modules/address.js +59 -2
  46. package/src/modules/agent.js +1 -1
  47. package/src/modules/dnsbl.js +11 -1
  48. package/src/modules/history.js +62 -0
  49. package/src/modules/identity.js +154 -26
  50. package/src/modules/index.js +16 -5
  51. package/src/modules/language.js +1 -1
  52. package/src/modules/signature.js +64 -18
  53. package/src/modules/sparkline.js +7 -3
  54. package/src/modules/status.js +13 -8
  55. package/src/plugins/proxy.js +10 -203
  56. package/src/script.js +0 -1
  57. package/scripts/cloudfront-ips.js +0 -56
@@ -0,0 +1,231 @@
1
+ [
2
+ "104.208.184.192/28",
3
+ "104.210.139.192/28",
4
+ "104.210.139.224/28",
5
+ "128.85.198.32/28",
6
+ "13.65.138.112/28",
7
+ "13.67.72.16/28",
8
+ "13.71.2.208/28",
9
+ "13.76.116.80/28",
10
+ "13.76.32.208/28",
11
+ "13.83.167.128/28",
12
+ "13.83.237.176/28",
13
+ "132.196.82.48/28",
14
+ "134.138.52.128/28",
15
+ "134.138.52.16/28",
16
+ "134.138.52.64/28",
17
+ "134.138.52.96/28",
18
+ "134.138.57.176/28",
19
+ "134.138.57.64/28",
20
+ "134.138.57.80/28",
21
+ "134.138.58.32/28",
22
+ "134.149.233.80/28",
23
+ "134.33.102.192/28",
24
+ "135.116.136.160/28",
25
+ "135.13.64.240/28",
26
+ "135.220.73.208/28",
27
+ "135.220.73.240/28",
28
+ "135.237.131.208/28",
29
+ "135.237.133.48/28",
30
+ "137.135.191.176/28",
31
+ "138.91.46.96/28",
32
+ "145.132.136.96/28",
33
+ "158.158.5.32/28",
34
+ "168.63.252.240/28",
35
+ "172.162.248.64/28",
36
+ "172.170.1.80/28",
37
+ "172.170.225.0/28",
38
+ "172.170.241.80/28",
39
+ "172.172.206.48/28",
40
+ "172.175.152.224/28",
41
+ "172.178.140.144/28",
42
+ "172.178.141.112/28",
43
+ "172.178.141.128/28",
44
+ "172.183.143.224/28",
45
+ "172.183.222.128/28",
46
+ "172.192.112.208/28",
47
+ "172.197.160.192/28",
48
+ "172.197.203.16/28",
49
+ "172.198.161.128/28",
50
+ "172.198.58.176/28",
51
+ "172.198.78.192/28",
52
+ "172.198.79.112/28",
53
+ "172.199.137.80/28",
54
+ "172.204.28.224/28",
55
+ "172.204.96.80/28",
56
+ "172.205.189.192/28",
57
+ "172.206.38.240/28",
58
+ "172.207.1.32/28",
59
+ "172.212.172.160/28",
60
+ "172.215.215.32/28",
61
+ "191.232.238.96/28",
62
+ "191.233.197.0/28",
63
+ "191.233.199.160/28",
64
+ "191.234.167.144/28",
65
+ "191.235.99.160/28",
66
+ "191.237.249.64/28",
67
+ "20.102.212.144/28",
68
+ "20.113.211.112/28",
69
+ "20.113.225.112/28",
70
+ "20.125.112.224/28",
71
+ "20.125.144.144/28",
72
+ "20.161.75.208/28",
73
+ "20.168.7.192/28",
74
+ "20.169.73.32/28",
75
+ "20.169.73.64/28",
76
+ "20.169.78.128/28",
77
+ "20.169.78.160/28",
78
+ "20.169.78.192/28",
79
+ "20.169.78.48/28",
80
+ "20.169.78.64/28",
81
+ "20.169.86.224/28",
82
+ "20.169.86.240/28",
83
+ "20.170.184.16/28",
84
+ "20.170.184.32/28",
85
+ "20.170.184.48/28",
86
+ "20.170.184.64/28",
87
+ "20.170.184.80/28",
88
+ "20.172.29.32/28",
89
+ "20.199.211.160/28",
90
+ "20.199.242.0/28",
91
+ "20.200.212.240/28",
92
+ "20.206.101.192/28",
93
+ "20.210.211.192/28",
94
+ "20.215.187.208/28",
95
+ "20.215.219.128/28",
96
+ "20.215.219.160/28",
97
+ "20.215.219.208/28",
98
+ "20.218.30.240/28",
99
+ "20.219.184.96/28",
100
+ "20.219.71.192/28",
101
+ "20.222.36.192/28",
102
+ "20.227.140.32/28",
103
+ "20.228.106.176/28",
104
+ "20.235.87.224/28",
105
+ "20.249.63.208/28",
106
+ "20.250.136.64/28",
107
+ "20.250.6.128/28",
108
+ "20.45.178.144/28",
109
+ "20.55.229.144/28",
110
+ "20.57.199.192/28",
111
+ "20.63.180.96/28",
112
+ "20.63.221.64/28",
113
+ "20.78.130.48/28",
114
+ "20.83.243.176/28",
115
+ "20.98.18.80/28",
116
+ "23.101.217.176/28",
117
+ "23.102.140.144/28",
118
+ "23.102.141.32/28",
119
+ "23.98.142.176/28",
120
+ "23.98.186.176/28",
121
+ "23.98.186.192/28",
122
+ "23.98.186.64/28",
123
+ "23.98.186.96/28",
124
+ "4.151.119.48/28",
125
+ "4.151.71.176/28",
126
+ "4.189.118.208/28",
127
+ "4.189.119.48/28",
128
+ "4.197.115.112/28",
129
+ "4.197.22.112/28",
130
+ "4.197.64.0/28",
131
+ "4.197.64.16/28",
132
+ "4.197.64.48/28",
133
+ "4.197.64.64/28",
134
+ "4.201.232.64/28",
135
+ "4.205.128.176/28",
136
+ "4.218.24.64/28",
137
+ "4.226.200.16/28",
138
+ "4.226.226.32/28",
139
+ "40.116.73.208/28",
140
+ "40.124.161.0/28",
141
+ "40.74.200.208/28",
142
+ "40.81.234.144/28",
143
+ "40.81.67.96/28",
144
+ "40.84.221.208/28",
145
+ "40.84.221.224/28",
146
+ "48.221.184.80/28",
147
+ "48.221.184.96/28",
148
+ "48.221.40.176/28",
149
+ "51.116.2.80/28",
150
+ "51.116.221.96/28",
151
+ "51.57.0.96/28",
152
+ "51.59.24.64/28",
153
+ "51.59.24.80/28",
154
+ "51.59.48.80/28",
155
+ "51.8.155.112/28",
156
+ "51.8.155.48/28",
157
+ "52.148.129.32/28",
158
+ "52.156.77.144/28",
159
+ "52.159.227.32/28",
160
+ "52.159.249.96/28",
161
+ "52.161.49.96/28",
162
+ "52.165.212.48/28",
163
+ "52.172.129.160/28",
164
+ "52.173.219.112/28",
165
+ "52.173.219.96/28",
166
+ "52.173.221.16/28",
167
+ "52.173.221.176/28",
168
+ "52.173.221.208/28",
169
+ "52.173.234.16/28",
170
+ "52.173.234.80/28",
171
+ "52.183.217.240/28",
172
+ "52.190.137.144/28",
173
+ "52.190.137.16/28",
174
+ "52.190.139.48/28",
175
+ "52.190.142.64/28",
176
+ "52.190.190.16/28",
177
+ "52.225.75.208/28",
178
+ "52.231.30.48/28",
179
+ "52.231.34.176/28",
180
+ "52.231.39.144/28",
181
+ "52.231.50.64/28",
182
+ "52.236.94.144/28",
183
+ "52.241.146.208/28",
184
+ "52.242.132.224/28",
185
+ "52.242.132.240/28",
186
+ "52.255.109.144/28",
187
+ "52.255.109.80/28",
188
+ "52.255.109.96/28",
189
+ "52.255.111.0/28",
190
+ "52.255.111.80/28",
191
+ "57.154.174.112/28",
192
+ "57.154.175.0/28",
193
+ "57.154.187.32/28",
194
+ "68.154.28.96/28",
195
+ "68.220.57.64/28",
196
+ "70.153.189.192/28",
197
+ "70.153.32.16/28",
198
+ "70.153.32.32/28",
199
+ "70.153.87.224/28",
200
+ "70.156.152.96/28",
201
+ "74.161.200.96/28",
202
+ "74.224.217.64/28",
203
+ "74.226.253.160/28",
204
+ "74.248.37.160/28",
205
+ "74.7.35.112/28",
206
+ "74.7.35.48/28",
207
+ "74.7.36.64/28",
208
+ "74.7.36.80/28",
209
+ "74.7.36.96/28",
210
+ "85.211.128.16/28",
211
+ "85.211.128.32/28",
212
+ "9.129.0.0/17",
213
+ "9.160.128.16/28",
214
+ "9.160.128.64/28",
215
+ "9.160.163.128/28",
216
+ "9.160.34.144/28",
217
+ "9.160.36.16/28",
218
+ "9.160.96.16/28",
219
+ "9.163.101.48/28",
220
+ "9.205.128.32/28",
221
+ "9.205.128.48/28",
222
+ "9.205.25.128/28",
223
+ "9.205.30.128/28",
224
+ "9.205.30.144/28",
225
+ "9.205.30.176/28",
226
+ "9.205.8.48/28",
227
+ "9.205.8.64/28",
228
+ "9.223.181.208/28",
229
+ "9.234.96.192/28",
230
+ "9.234.97.96/28"
231
+ ]
@@ -0,0 +1,28 @@
1
+ [
2
+ "216.73.216.0/22",
3
+ "34.162.230.222/32",
4
+ "34.162.244.71/32",
5
+ "34.162.191.81/32",
6
+ "34.150.241.79/32",
7
+ "34.85.172.162/32",
8
+ "35.245.175.129/32",
9
+ "34.182.222.37/32",
10
+ "34.186.108.163/32",
11
+ "35.245.89.239/32",
12
+ "34.182.161.143/32",
13
+ "34.182.218.27/32",
14
+ "34.182.220.85/32",
15
+ "34.11.34.31/32",
16
+ "34.182.140.95/32",
17
+ "136.107.176.208/32",
18
+ "34.182.226.151/32",
19
+ "34.182.226.221/32",
20
+ "35.221.29.174/32",
21
+ "34.182.225.167/32",
22
+ "40.124.101.48/28",
23
+ "20.102.46.224/28",
24
+ "20.64.57.208/28",
25
+ "16.58.26.69/32",
26
+ "18.225.238.228/32",
27
+ "18.227.226.255/32"
28
+ ]
@@ -0,0 +1,24 @@
1
+ [
2
+ "173.245.48.0/20",
3
+ "103.21.244.0/22",
4
+ "103.22.200.0/22",
5
+ "103.31.4.0/22",
6
+ "141.101.64.0/18",
7
+ "108.162.192.0/18",
8
+ "190.93.240.0/20",
9
+ "188.114.96.0/20",
10
+ "197.234.240.0/22",
11
+ "198.41.128.0/17",
12
+ "162.158.0.0/15",
13
+ "104.16.0.0/13",
14
+ "104.24.0.0/14",
15
+ "172.64.0.0/13",
16
+ "131.0.72.0/22",
17
+ "2400:cb00::/32",
18
+ "2606:4700::/32",
19
+ "2803:f800::/32",
20
+ "2405:b500::/32",
21
+ "2405:8100::/32",
22
+ "2a06:98c0::/29",
23
+ "2c0f:f248::/32"
24
+ ]
@@ -0,0 +1,245 @@
1
+ [
2
+ "23.228.249.0/24",
3
+ "120.52.22.96/27",
4
+ "23.228.222.0/24",
5
+ "205.251.249.0/24",
6
+ "180.163.57.128/26",
7
+ "23.228.220.0/24",
8
+ "204.246.168.0/22",
9
+ "111.13.171.128/26",
10
+ "18.160.0.0/15",
11
+ "205.251.252.0/23",
12
+ "54.192.0.0/16",
13
+ "204.246.173.0/24",
14
+ "23.228.244.0/24",
15
+ "54.230.200.0/21",
16
+ "120.253.240.192/26",
17
+ "23.234.192.0/18",
18
+ "116.129.226.128/26",
19
+ "130.176.0.0/17",
20
+ "3.173.192.0/18",
21
+ "108.156.0.0/14",
22
+ "99.86.0.0/16",
23
+ "23.228.214.0/24",
24
+ "23.228.213.0/24",
25
+ "13.32.0.0/15",
26
+ "120.253.245.128/26",
27
+ "13.224.0.0/14",
28
+ "70.132.0.0/18",
29
+ "15.158.0.0/16",
30
+ "111.13.171.192/26",
31
+ "13.249.0.0/16",
32
+ "18.238.0.0/15",
33
+ "18.244.0.0/15",
34
+ "205.251.208.0/20",
35
+ "3.165.0.0/16",
36
+ "3.168.0.0/14",
37
+ "23.228.251.0/24",
38
+ "65.9.128.0/18",
39
+ "130.176.128.0/18",
40
+ "23.228.221.0/24",
41
+ "23.228.248.0/24",
42
+ "58.254.138.0/25",
43
+ "205.251.206.0/23",
44
+ "54.230.208.0/20",
45
+ "3.160.0.0/14",
46
+ "116.129.226.0/25",
47
+ "23.91.0.0/19",
48
+ "52.222.128.0/17",
49
+ "18.164.0.0/15",
50
+ "23.228.246.0/24",
51
+ "111.13.185.32/27",
52
+ "64.252.128.0/18",
53
+ "205.251.254.0/24",
54
+ "3.166.0.0/15",
55
+ "54.230.224.0/19",
56
+ "71.152.0.0/17",
57
+ "216.137.32.0/19",
58
+ "204.246.172.0/24",
59
+ "205.251.202.0/23",
60
+ "18.172.0.0/15",
61
+ "120.52.39.128/27",
62
+ "118.193.97.64/26",
63
+ "3.164.64.0/18",
64
+ "18.154.0.0/15",
65
+ "3.173.0.0/17",
66
+ "54.240.128.0/18",
67
+ "205.251.250.0/23",
68
+ "180.163.57.0/25",
69
+ "52.46.0.0/18",
70
+ "3.174.0.0/15",
71
+ "52.82.128.0/19",
72
+ "54.230.0.0/17",
73
+ "54.230.128.0/18",
74
+ "23.228.247.0/24",
75
+ "54.239.128.0/18",
76
+ "130.176.224.0/20",
77
+ "36.103.232.128/26",
78
+ "52.84.0.0/15",
79
+ "143.204.0.0/16",
80
+ "144.220.0.0/16",
81
+ "120.52.153.192/26",
82
+ "23.228.250.0/24",
83
+ "119.147.182.0/25",
84
+ "120.232.236.0/25",
85
+ "111.13.185.64/27",
86
+ "3.164.0.0/18",
87
+ "3.172.64.0/18",
88
+ "54.182.0.0/16",
89
+ "58.254.138.128/26",
90
+ "120.253.245.192/27",
91
+ "54.239.192.0/19",
92
+ "18.68.0.0/16",
93
+ "18.64.0.0/14",
94
+ "120.52.12.64/26",
95
+ "24.110.32.0/19",
96
+ "99.84.0.0/16",
97
+ "205.251.204.0/23",
98
+ "130.176.192.0/19",
99
+ "23.228.223.0/24",
100
+ "23.228.212.0/24",
101
+ "52.124.128.0/17",
102
+ "204.246.164.0/22",
103
+ "13.35.0.0/16",
104
+ "204.246.174.0/23",
105
+ "3.164.128.0/17",
106
+ "24.110.128.0/17",
107
+ "3.172.0.0/18",
108
+ "36.103.232.0/25",
109
+ "119.147.182.128/26",
110
+ "118.193.97.128/25",
111
+ "120.232.236.128/26",
112
+ "204.246.176.0/20",
113
+ "65.8.0.0/16",
114
+ "65.9.0.0/17",
115
+ "108.138.0.0/15",
116
+ "120.253.241.160/27",
117
+ "3.173.128.0/18",
118
+ "51.74.192.0/18",
119
+ "64.252.64.0/18",
120
+ "13.113.196.64/26",
121
+ "13.113.203.0/24",
122
+ "52.199.127.192/26",
123
+ "57.182.253.0/24",
124
+ "57.183.42.0/25",
125
+ "13.124.199.0/24",
126
+ "3.35.130.128/25",
127
+ "52.78.247.128/26",
128
+ "13.203.133.0/26",
129
+ "13.233.177.192/26",
130
+ "15.207.13.128/25",
131
+ "15.207.213.128/25",
132
+ "52.66.194.128/26",
133
+ "13.228.69.0/24",
134
+ "47.129.82.0/24",
135
+ "47.129.83.0/24",
136
+ "47.129.84.0/24",
137
+ "52.220.191.0/26",
138
+ "13.210.67.128/26",
139
+ "13.54.63.128/26",
140
+ "3.107.43.128/25",
141
+ "3.107.44.0/25",
142
+ "3.107.44.128/25",
143
+ "43.218.56.128/26",
144
+ "43.218.56.192/26",
145
+ "43.218.56.64/26",
146
+ "43.218.71.0/26",
147
+ "99.79.169.0/24",
148
+ "18.192.142.0/23",
149
+ "18.199.68.0/22",
150
+ "18.199.72.0/22",
151
+ "18.199.76.0/22",
152
+ "35.158.136.0/24",
153
+ "52.57.254.0/24",
154
+ "18.200.212.0/23",
155
+ "52.212.248.0/26",
156
+ "13.134.24.0/23",
157
+ "13.134.94.0/23",
158
+ "18.175.65.0/24",
159
+ "18.175.66.0/24",
160
+ "18.175.67.0/24",
161
+ "3.10.17.128/25",
162
+ "3.11.53.0/24",
163
+ "52.56.127.0/25",
164
+ "15.188.184.0/24",
165
+ "51.44.234.0/23",
166
+ "51.44.236.0/23",
167
+ "51.44.238.0/23",
168
+ "52.47.139.0/24",
169
+ "3.29.40.128/26",
170
+ "3.29.40.192/26",
171
+ "3.29.40.64/26",
172
+ "3.29.57.0/26",
173
+ "18.229.220.192/26",
174
+ "18.230.229.0/24",
175
+ "18.230.230.0/25",
176
+ "54.233.255.128/26",
177
+ "56.125.46.0/24",
178
+ "56.125.47.0/32",
179
+ "56.125.48.0/24",
180
+ "3.231.2.0/25",
181
+ "3.234.232.224/27",
182
+ "3.236.169.192/26",
183
+ "3.236.48.0/23",
184
+ "34.195.252.0/24",
185
+ "34.226.14.0/24",
186
+ "44.220.194.0/23",
187
+ "44.220.196.0/23",
188
+ "44.220.198.0/23",
189
+ "44.220.200.0/23",
190
+ "44.220.202.0/23",
191
+ "44.222.66.0/24",
192
+ "13.59.250.0/26",
193
+ "18.216.170.128/25",
194
+ "3.128.93.0/24",
195
+ "3.134.215.0/24",
196
+ "3.146.232.0/22",
197
+ "3.147.164.0/22",
198
+ "3.147.244.0/22",
199
+ "52.15.127.128/26",
200
+ "3.101.158.0/23",
201
+ "52.52.191.128/26",
202
+ "34.216.51.0/25",
203
+ "34.223.12.224/27",
204
+ "34.223.80.192/26",
205
+ "35.162.63.192/26",
206
+ "35.167.191.128/26",
207
+ "35.93.168.0/23",
208
+ "35.93.170.0/23",
209
+ "35.93.172.0/23",
210
+ "44.227.178.0/24",
211
+ "44.234.108.128/25",
212
+ "44.234.90.252/30",
213
+ "2600:9000:3000::/36",
214
+ "2600:9000:f600::/39",
215
+ "2600:9000:f540::/42",
216
+ "2409:8c00:2421:300::/56",
217
+ "2600:9000:f000::/38",
218
+ "2600:9000:f500::/43",
219
+ "2600:9000:ddd::/48",
220
+ "2600:9000:f800::/37",
221
+ "2600:9000:f400::/40",
222
+ "2600:9000:f538::/45",
223
+ "2600:9000:5380::/41",
224
+ "2600:f0f0:5504::/46",
225
+ "2600:9000:1000::/36",
226
+ "2600:9000:2000::/36",
227
+ "2400:7fc0:500::/40",
228
+ "2001:3fc6:20::/43",
229
+ "2600:9000:4000::/36",
230
+ "2600:9000:fff::/48",
231
+ "2409:8c00:2421:400::/56",
232
+ "2404:c2c0:500::/40",
233
+ "2600:9000:5308::/45",
234
+ "2600:9000:f534::/46",
235
+ "2600:f0f0:601::/48",
236
+ "2600:9000:6000::/36",
237
+ "2600:9000:f520::/44",
238
+ "2600:9000:5320::/43",
239
+ "2600:9000:5310::/44",
240
+ "2600:9000:f580::/41",
241
+ "2600:f0f0:602::/47",
242
+ "2600:9000:5340::/42",
243
+ "2600:9000:eee::/48",
244
+ "2600:9000:5200::/40"
245
+ ]
@@ -0,0 +1,20 @@
1
+ [
2
+ "132.196.86.0/24",
3
+ "172.182.202.0/25",
4
+ "172.182.207.0/25",
5
+ "20.125.66.80/28",
6
+ "20.171.206.0/24",
7
+ "20.171.207.0/24",
8
+ "4.227.36.0/25",
9
+ "52.230.152.0/24",
10
+ "74.7.175.128/25",
11
+ "74.7.227.0/25",
12
+ "74.7.227.128/25",
13
+ "74.7.228.0/25",
14
+ "74.7.230.0/25",
15
+ "74.7.241.0/25",
16
+ "74.7.241.128/25",
17
+ "74.7.242.0/25",
18
+ "74.7.243.128/25",
19
+ "74.7.244.0/25"
20
+ ]
@@ -0,0 +1,41 @@
1
+ [
2
+ "104.210.140.128/28",
3
+ "13.66.216.176/28",
4
+ "135.234.64.0/24",
5
+ "172.182.193.224/28",
6
+ "172.182.193.80/28",
7
+ "172.182.194.144/28",
8
+ "172.182.194.32/28",
9
+ "172.182.195.48/28",
10
+ "172.182.209.208/28",
11
+ "172.182.211.192/28",
12
+ "172.182.213.192/28",
13
+ "172.182.224.0/28",
14
+ "172.203.190.112/28",
15
+ "172.203.190.128/28",
16
+ "172.203.190.80/28",
17
+ "20.14.99.96/28",
18
+ "20.168.18.32/28",
19
+ "20.169.6.224/28",
20
+ "20.169.7.48/28",
21
+ "20.169.77.0/25",
22
+ "20.171.123.64/28",
23
+ "20.171.53.224/28",
24
+ "20.25.151.224/28",
25
+ "20.42.10.176/28",
26
+ "23.102.145.48/28",
27
+ "4.227.36.0/25",
28
+ "40.67.175.0/25",
29
+ "40.90.214.16/28",
30
+ "51.8.102.0/24",
31
+ "74.7.175.128/25",
32
+ "74.7.228.0/25",
33
+ "74.7.228.128/25",
34
+ "74.7.229.0/25",
35
+ "74.7.229.128/25",
36
+ "74.7.230.0/25",
37
+ "74.7.241.128/25",
38
+ "74.7.242.128/25",
39
+ "74.7.243.0/25",
40
+ "74.7.244.0/25"
41
+ ]
package/src/index.js CHANGED
@@ -1,3 +1,5 @@
1
+ const path = require('path');
2
+
1
3
  const { merge } = require('lodash');
2
4
 
3
5
  const app = require('./app');
@@ -8,10 +10,18 @@ const lib = require('./lib');
8
10
  const modules = require('./modules');
9
11
  const plugins = require('./plugins');
10
12
 
11
- const { cache, logger, pipeline, util } = lib;
13
+ const { cache, logger, persistence, pipeline, util } = lib;
12
14
 
13
15
  let initialized = false;
14
16
 
17
+ function getPersistenceDir() {
18
+ const base =
19
+ constants.persistence.path || path.join(process.cwd(), '.hyperwatch-data');
20
+ return constants.persistence.namespace
21
+ ? path.join(base, constants.persistence.namespace)
22
+ : base;
23
+ }
24
+
15
25
  function init(config = {}) {
16
26
  if (initialized) {
17
27
  console.warn(`Can't init, Hyperwatch was already initialized.`);
@@ -28,11 +38,22 @@ function start() {
28
38
  return;
29
39
  }
30
40
  modules.start();
41
+ if (constants.persistence.enabled) {
42
+ persistence.load(getPersistenceDir());
43
+ }
31
44
  return Promise.all([app.start(), pipeline.start()]);
32
45
  }
33
46
 
34
- function stop() {
35
- return Promise.all([app.stop(), pipeline.stop()]);
47
+ async function stop() {
48
+ await pipeline.stop();
49
+ try {
50
+ if (constants.persistence.enabled) {
51
+ persistence.dump(getPersistenceDir());
52
+ }
53
+ } catch (err) {
54
+ console.error('Error dumping aggregators:', err.message);
55
+ }
56
+ return app.stop();
36
57
  }
37
58
 
38
59
  module.exports = {
package/src/input/http.js CHANGED
@@ -10,6 +10,10 @@ function create({ name = 'HTTP server', path, parse = fromJS }) {
10
10
  // No validation before sending the response to the client
11
11
  res.send('Ok');
12
12
  // Processing the message(s)
13
+ // Express 5 leaves req.body undefined when no body parser matched
14
+ if (req.body === undefined) {
15
+ return;
16
+ }
13
17
  const messages = Array.isArray(req.body) ? req.body : [req.body];
14
18
  messages.forEach((message) => {
15
19
  try {
@@ -1,5 +1,6 @@
1
1
  const { fromJS } = require('immutable');
2
- const syslogParse = require('syslog-parse');
2
+ // syslog-parse is ESM-only with a default export
3
+ const syslogParse = require('syslog-parse').default;
3
4
 
4
5
  const socket = require('./socket');
5
6
 
@@ -21,6 +22,9 @@ function create({
21
22
  }
22
23
  try {
23
24
  const result = syslogParse(message);
25
+ if (!result) {
26
+ throw new Error('Unparseable syslog message');
27
+ }
24
28
  success(parse(result.message));
25
29
  } catch (err) {
26
30
  reject(err);