Commit graph

3129 commits

Author SHA1 Message Date
Pēteris Caune
36e8843481
Drop clipboard.js dependency, use navigator.clipboard directly 2022-12-15 15:05:40 +02:00
Pēteris Caune
43a900c802
Improve layout in "My Checks" for checks with long ping URLs
Fixes: #745
2022-12-15 11:40:57 +02:00
Pēteris Caune
30e88beda3
Update CHANGELOG for release 2022-12-14 15:53:40 +02:00
Pēteris Caune
2f59995601
Tweak wording in the "Register a backup key!" message 2022-12-14 14:42:15 +02:00
Pēteris Caune
ee5015a141
Update package versions 2022-12-06 12:03:49 +02:00
Pēteris Caune
5e826ec15a
Fix pruneflips 2022-12-02 12:19:52 +02:00
Pēteris Caune
c3369b22d6
Add more tests 2022-12-02 09:54:07 +02:00
Pēteris Caune
ef5df02238
Add max width limit for the timezone select 2022-12-01 16:18:33 +02:00
Pēteris Caune
15cbb39bd3
Change "Settings - Email Reports" page to allow manual tz selection 2022-12-01 16:12:32 +02:00
Pēteris Caune
86262ef620
Make datetime.datetime imports consistent everywhere 2022-12-01 15:36:35 +02:00
Pēteris Caune
260f6e36a7
Fix templates to use user's timezone when displaying dates 2022-12-01 15:21:40 +02:00
Pēteris Caune
818ccad56f
Fix week, month boundary calculation to use user's timezone 2022-12-01 13:46:21 +02:00
Pēteris Caune
8cc6498b1b
Improve REMOTE_USER_HEADER docs
cc: #743
2022-12-01 09:51:15 +02:00
Pēteris Caune
ff7b963d15
Move "send report", "deactivate" admin actions to the Profile admin 2022-12-01 09:35:13 +02:00
Pēteris Caune
a65aa171f4
Replace var=[...];if var: [...] usages with the walrus operator 2022-12-01 09:16:19 +02:00
Pēteris Caune
b5006f2741
Fix downtime calculation for recently created checks 2022-11-30 16:19:02 +02:00
Pēteris Caune
91c7321f38
Update CHANGELOG 2022-11-30 14:05:17 +02:00
Pēteris Caune
12f6f59e0a
Refactor and improve type hints 2022-11-30 14:02:03 +02:00
Pēteris Caune
ac2f2fefc2
Improve sendreports tests 2022-11-30 12:17:16 +02:00
Pēteris Caune
34bd608acd
Update Profile.send_report to prepare weekly totals for weekly reports
Fixes: #736
2022-11-30 11:51:00 +02:00
Pēteris Caune
796c6b9272
Add Check.downtimes_by_boundary, add hc.lib.date.week_boundaries
cc: #736
2022-11-30 10:49:42 +02:00
Pēteris Caune
f4dc008c55
Refactor Check.downtimes to handle any boundaries, not just monthly
cc: #736
2022-11-30 10:29:42 +02:00
Pēteris Caune
dbb360e524
Improve TOC and section titles in Management API docs 2022-11-28 14:58:57 +02:00
Pēteris Caune
144d50417c
Update CHANGELOG 2022-11-28 14:50:51 +02:00
Pēteris Caune
c3e6fca6a7
Fix "get body" views to preserve body bytes, avoid string conversions 2022-11-28 14:48:55 +02:00
Pēteris Caune
ea2f2d9ec0
Add more tests 2022-11-28 14:04:57 +02:00
Pēteris Caune
de7097e1eb
Improve docs 2022-11-28 13:40:40 +02:00
Pēteris Caune
9e9490d815
Move test to separate file, remove trailing slash from URL 2022-11-28 13:28:08 +02:00
Martin Lablans
a55a2692dc
Allow to retrieve a ping's body (#737)
Add /api/v1/checks/<uuid>/pings/<n>/body endpoint for retrieving ping body (#737)
2022-11-28 13:21:26 +02:00
Pēteris Caune
8930bedd4a
Refactor the other "edit channel" views, add type hints 2022-11-25 12:48:04 +02:00
Pēteris Caune
346ebc184c
Refactor hc.front.views.ntfy_form, add type hints 2022-11-25 11:23:58 +02:00
Pēteris Caune
c275bf09f1
Improve type hints 2022-11-25 10:07:57 +02:00
Pēteris Caune
f1fe0b9643
Fix alignment in the "add ntfy" form 2022-11-24 18:32:30 +02:00
Pēteris Caune
646aa1cb48
Add ".txt" suffix to the filename when downloading ping body
Fixes: #738
2022-11-24 18:22:34 +02:00
Pēteris Caune
c0a0c97388
Tweak wording 2022-11-24 14:59:12 +02:00
Pēteris Caune
413b97c48f
Fix ntfy edit form initialization 2022-11-24 14:48:19 +02:00
Pēteris Caune
d2810d62d8
Simplify AddPushoverForm 2022-11-24 13:43:26 +02:00
Pēteris Caune
390bb781ca
Refactor duplicated code 2022-11-24 13:26:09 +02:00
Pēteris Caune
3dcc7d60a2
Add ntfy integration
Fixes: #728
2022-11-24 12:09:53 +02:00
Pēteris Caune
9977789cac
Add a special case for the last ping body containing backticks 2022-11-22 20:22:37 +02:00
Pēteris Caune
e962429e79
Update CHANGELOG 2022-11-22 17:52:22 +02:00
Sebastian Schneider
6481ed0d19
Add last ping body body to Slack notifications (#735)
Co-authored-by: Sebastian Schneider <sebastian.schneider@boxine.de>
Co-authored-by: Pēteris Caune <cuu508@gmail.com>
2022-11-22 17:50:11 +02:00
Pēteris Caune
75188e218e
Fix duration calculation in the "Get Pings" API call 2022-11-11 13:04:08 +02:00
Pēteris Caune
14017392fa
Optimize PNG 2022-11-11 10:45:23 +02:00
Pēteris Caune
5a464f186f
Add "Specifying Run IDs" section in docs 2022-11-10 18:34:35 +02:00
Pēteris Caune
a26ca60046
Fix run ID display in dark mode 2022-11-10 12:28:03 +02:00
Pēteris Caune
85f7a1c348
Update Ping API and Management API docs for run IDs 2022-11-10 11:49:38 +02:00
Pēteris Caune
7458770b41
Improve alerting logic when run IDs are used
* Add Check.last_start_rid field
* Fill Check.last_start_rid on every start event
* Clear Check.last_start on every "fail" event
* Clear Check.last_start on success event if either case is true:
 - the event's rid matches Check.last_start_rid
 - the event does not specify rid

In human terms, the alerting logic will be: we track the
execution time of the most recent "start" event only. It would
take a major redesign to track the execution time of all
concurrent "start" events and send alerts when *any* of them
overshoots the time budget. So, whenever we see a "start" event,
the timer resets.

Example:

* 00:00 client sends start signal with rid=A, timer starts
* 00:10 client sends start signal with rid=B, timer resets
* 00:20 client sends success signal with rid=A, timer
  does not reset because rid A does not match the rid seen in
  the most recent start signal (it was B)
* 00:30 the grace time runs out, the check's status shows
  as started + failed

At this point the check can be reset to a healthy state in 3
different ways:

* send a success signal with rid=B
* send a failure signal with any rid value or without it
* send a success signal without a rid value
2022-11-09 19:01:22 +02:00
Pēteris Caune
e58a9ee71e
Add protection for n queries problem in _get_events
If every fetched ping is a success event, and has an unique
run ID, then we cannot determine the duration just from the
fetched data, and must fall back to Ping.duration(). This
would generate a SQL query per displayed ping.

The solution is to count how many times we would need to use
the fallback, and if it goes above some threshold (currently,
10 times), then disable duration display altogether.
2022-11-08 12:41:46 +02:00
Pēteris Caune
8f249b8c59
Refactor test case some more 2022-11-08 12:12:01 +02:00