Commit graph

2004 commits

Author SHA1 Message Date
Pēteris Caune
64bb43f74f
Limit allowed protocols, add INTEGRATIONS_ALLOW_PRIVATE_IPS setting 2022-08-16 11:13:14 +03:00
Pēteris Caune
41428d1dee
Switch transports from requests to pycurl
With requests, there is no clean way to set a time limit
on a single HTTP request:  https://stackoverflow.com/a/71453648/5821
2022-08-16 09:17:57 +03:00
Pēteris Caune
3799bd3c20
Fix the handling of TooManyRedirects exceptions 2022-08-15 10:52:50 +03:00
Pēteris Caune
dd1c05a706
Update links to Django docs, render docs 2022-08-09 08:31:54 +03:00
Facorazza
6f1900cfa3
Add support for SMTP with implicit TLS 2022-08-09 08:25:07 +03:00
Pēteris Caune
1bab426fc2
Simplify Profile.checks_from_all_projects()
Curiously, Django ORM translates the old and the new
version to the exact same SQL
2022-08-08 17:02:55 +03:00
Pēteris Caune
f371561fe5
Update the logout action to use HTTP POST 2022-08-08 15:16:24 +03:00
Pēteris Caune
5a0bf4062f
Add API support for resuming paused checks
Fixes: #687
2022-08-04 14:00:46 +03:00
Pēteris Caune
47e624900f
Fix the pause views to create Flip objects
I found a bug in the downtime statistics calculation. The
scenario:

* at T=0 a check goes down
* at T=5 some time later the user pauses it
* at T=10 the check receives a ping and goes up

If we don't record a status change (a flip) at T=5, then
the calculated total downtime will come out wrong (10)

This change fixes the pause views (hc.api.views.pause,
hc.front.views.pause) to create Flip objects.
2022-08-04 12:20:06 +03:00
Pēteris Caune
8ca0e2d636
Remove deprecated django.utils.timezone.utc usage 2022-08-04 11:24:06 +03:00
Pēteris Caune
b9de55043a
Fix duration calculation again, kind can also be "" (empty string) 2022-08-04 10:29:53 +03:00
Pēteris Caune
c44148e715
Fix duration calculation to skip "log" and "ign" events 2022-08-04 09:26:40 +03:00
Pēteris Caune
c840f72e3a
Clean up tests 2022-08-03 17:06:38 +03:00
Pēteris Caune
51fd339602
Add auto-refresh and running indicator in My Projects
Fixes: #681
2022-08-02 16:37:25 +03:00
Pēteris Caune
2f562bb502
Fix the checks list to preserve filters when adding/updating checks
Fixes: #684
2022-08-02 13:27:04 +03:00
Pēteris Caune
6644b43577
Fix the update_timeout view to record more information
Checks can flip from "up" to "down" state as a result of changing
check's schedule.  We don't want to send notifications when changing
schedule interactively in the web UI. So we update the `alert_after`
and `status` fields the same way as `sendalerts` would do. This is not
new, this was already being done.

With this change, we now additionally create Flip objects, recording
the fact that a check went down at such-and-such date. We fill the
"processed" field, to make sure sendalerts skips over these objects.

We need the Flip objects because otherwise the calculation
in Check.downtimes() could come out wrong (when a check later comes up,
we would have no record of when it went down).
2022-08-02 09:43:35 +03:00
Pēteris Caune
dd6be22ab4
Upgrade to fido2 1.0.0 2022-08-01 16:16:15 +03:00
Pēteris Caune
453b426090
Add testcase and update CHANGELOG 2022-07-29 12:58:58 +03:00
Leandro Britez
37ff7b1b05 Add support for multiple RCPT TO in incoming email 2022-07-29 12:56:30 +03:00
Pēteris Caune
a4b6fc61ad
Replace HipChat, Pagerteam classes with transports.RemovedTransport 2022-07-29 11:35:03 +03:00
Pēteris Caune
580304110e
Make tests not sensitive to the SITE_NAME setting 2022-07-27 15:26:32 +03:00
Pēteris Caune
65cef0b271
Fix grouping and sorting in the text version of the report/nag emails
Fixes: #679
2022-07-27 15:22:41 +03:00
Pēteris Caune
b2b361e2b9
Improve Notification admin: link to project from the list view 2022-07-26 11:04:03 +03:00
Pēteris Caune
5a94e6809e
Update links to Django docs (3.1 -> 4.0) 2022-07-26 10:40:50 +03:00
Pēteris Caune
438c94efb7
Fix a race condition in the "Change Email" flow
The race scenario was as follows:

* Alice initiates email address change to bob@example.org
* a verification link is sent to bob@example.org
* separately, somebody creates a new account for bob@example.org
* Alice clicks on the verification link

At this point,
- if the database has an uniqueness constraint on auth_user.email,
  Alice will receive a HTTP 500 error
- if there's no uniqueness constraint, the email change
  will succeed and the system will have two accounts with the
  same email address

The simple fix is to re-check the address availability just
before finalizing the email address change. Currently this is
not done in a transaction block, so the race condition still
exists in theory, but is much less likely to happen in practice.
2022-07-21 15:14:51 +03:00
Pēteris Caune
01720ca9ae
Update notification templates to handle "log" events 2022-07-21 14:22:41 +03:00
Pēteris Caune
dc107ff7f5
Add ping endpoints for "log" events 2022-07-21 10:30:52 +03:00
Pēteris Caune
efa5acc1b4
Add support for the $JSON placeholder in webhook payloads 2022-07-20 12:06:39 +03:00
Pēteris Caune
cd087d2fbf
Add API support for enabling/disabling filtering in message body
Specifically, add read/write support for the new fields:

* success_kw
* failure_kw
* filter_subject
* filter_body

The API still supports reading/writing the "subject" and
"subject_fail" fields, but these are now marked as deprecated
in API documentation.

Fixes: #653
2022-07-15 13:04:41 +03:00
Pēteris Caune
4766aade95
Fix migrations
When adding "NOT NULL" on multiple columns at once, Django
throws errors:

    django.db.utils.OperationalError:
    cannot ALTER TABLE "api_check" because it has
    pending trigger events

A workaround is to modify columns one by one in
separate migrations.
2022-07-13 12:24:47 +03:00
Pēteris Caune
ae4ee37053
Add "NOT NULL" constraints on the new api_check fields
cc: #653
2022-07-13 12:02:58 +03:00
Pēteris Caune
cc32af6127
Remove api_check.subject and api_check.subject_fail fields
cc: #653
2022-07-13 11:40:35 +03:00
Pēteris Caune
426d6d07b3
Update API to use success_kw and failure_kw fields
cc: #653
2022-07-13 11:05:13 +03:00
Pēteris Caune
003d35d431
Add "Filter by keywords in the message body" feature
cc: #653
2022-07-12 15:46:15 +03:00
Pēteris Caune
3effd77e70
Add retry limit in hc.lib.s3.put_object 2022-07-01 23:47:47 +03:00
Pēteris Caune
227a8407bb
Update the Signal integration to handle RATE_LIMIT_FAILURE errors 2022-07-01 15:12:13 +03:00
Pēteris Caune
0553f0a38a
Fix the display of ignored pings with non-zero exit status 2022-06-30 16:49:09 +03:00
Pēteris Caune
ec0be60ca8
Include last ping type in MS Teams notifications 2022-06-30 13:15:40 +03:00
Pēteris Caune
56a0d9f78b
Include last ping type in Slack, Mattermost, Discord notifications 2022-06-30 12:56:09 +03:00
Pēteris Caune
b3f2bc64a5
Improve "Show Usage Examples" dialog, "Email" tab 2022-06-30 10:22:46 +03:00
Pēteris Caune
0c6223ffa5
Implement the "Add Check" dialog 2022-06-29 10:35:12 +03:00
Pēteris Caune
1b6269b29f
Improve Credential admin 2022-06-22 10:21:14 +03:00
Pēteris Caune
fa3b2dc6e3
Add code comments and type hints, remove now-unused cbor.js 2022-06-19 12:51:01 +03:00
Pēteris Caune
2b623453c1
Update tests 2022-06-19 12:31:27 +03:00
Pēteris Caune
a4c4df976c
Split the helper class in GetHelper and CreateHelper 2022-06-19 11:30:37 +03:00
Pēteris Caune
57021e962c
Refactor webauthn implementation, use webauthn-json 2022-06-19 10:10:57 +03:00
Pēteris Caune
64a6245736
Improve tests 2022-06-17 15:44:47 +03:00
Pēteris Caune
93c13b8221
Include check.desc in email text template, update tests 2022-06-17 14:55:34 +03:00
Pēteris Caune
9e578f6dfc
Add "Disabled" priority for Pushover notifications
Fixes: #663
2022-06-10 18:19:12 +03:00
Pēteris Caune
51f7fe7332
Expose subject and subject_fail in API GET calls, improve docs 2022-06-03 09:59:20 +03:00