Commit graph

1919 commits

Author SHA1 Message Date
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
Pēteris Caune
6a68fd2c23
Add subject and subject_fail type and length validation 2022-06-03 09:18:22 +03:00
Tyler
d61909ffd2 Expose subject and subject_fail via API 2022-06-03 09:12:46 +03:00
Pēteris Caune
b19ddab1bd
Add Gotify integration
Fixes: #270
2022-06-01 16:13:41 +03:00
Pēteris Caune
03dea07ae2
Remove obsolete field: Check.last_ping_was_fail 2022-05-31 15:13:00 +03:00
Pēteris Caune
8216377da6
Improve tests 2022-05-30 17:33:10 +03:00
Pēteris Caune
f7b4a6d71c
Remove support for unsigned login tokens 2022-05-30 16:59:13 +03:00
Pēteris Caune
c1ff8875e3
Implement login link expiration
Login links will now expire in 1 hour.
2022-05-30 15:48:51 +03:00
Pēteris Caune
66b7f4dd32
Fix upload test to specify its own PING_BODY_LIMIT 2022-05-30 14:42:23 +03:00
Pēteris Caune
a5e5b45983
Reduce logging, add Ctrl+C handler in sendalerts and sendreports
cc: #656
2022-05-27 14:49:44 +03:00
Pēteris Caune
901f944055
Test pyflakes warnings 2022-05-26 21:39:53 +03:00
Pēteris Caune
09a99d3e9c
Add tests 2022-05-20 18:14:43 +03:00
Pēteris Caune
6790d867a6
Add address verification step in the "Change Email" flow
A similar issue has come up multiple times: the user
changes account's email address, enters a bad address
by mistake, and gets locked out of their account.

This commit adds an extra step in the "Change Email" flow:

* In "Account Settings", user clicks on [Change Email]
* User gets a prompt for a 6-digit confirmation code, which
  has been sent to their old address. This is to prevent
  account takeover when Eve sits down at a computer where Alice
  is logged in.
* The user enters the confirmation code, and a "Change Email"
  form loads.
* The user enters their new email address.
* (The new step!) Instead of changing the email right away,
  we send a special login link to user's specified new address.
* (The new step, continued) The user clicks on the login link,
  their account's email address gets updated, and they get
  logged in.

The additional step makes sure the user can receive email
at their new address. If they cannot receive email there,
they cannot complete the "Change Email" procedure.
2022-05-20 17:54:45 +03:00
Pēteris Caune
8da87cdea5
Update code to not use related managers of unsaved objects
When testing with django==4.1a1, some tests were failing with
a message:

> ValueError: 'Check' instance needs to have a primary key
> value before this relationship can be used.

This commit fixes these failures, but there might be more
places to fix, that are not covered by tests yet.
2022-05-18 13:07:50 +03:00
Pēteris Caune
59e112852b
Switch from auto_now_add=True to default=now
I've run in the following problem a few times in tests:

* I create a model instance
* set its "created" field to a specific value
* I save the model instance
* I write testcase logic which relies on that specific "created" value

The testcase fails, because, with auto_now_add=True, Django
overwrites the created field. I can work around this by:

* Create and save a model instance
* Save it
* Set the created field to my desired value
* Save it again

But this is annoying to do, and annoying to troubleshoot
– it's easy to forget about the auto_now_add behaviour.

So I'm replacing auto_now_add=True with
default=django.utils.timezone.now.
2022-05-18 11:42:56 +03:00
Pēteris Caune
7247983fdd
Add logic to handle ContentDecodingError exceptions 2022-05-17 16:16:24 +03:00
Pēteris Caune
fb0e3bc10d
Update hc.front.views.channels to handle empty strings in settings
Fixes: #635
2022-05-16 15:10:26 +03:00
Pēteris Caune
e7076155e7
Add "Ping-Body-Limit" response header in ping API responses
The header format is:

    Ping-Body-Limit: n

Where "n" is an integer number, the value of the  PING_BODY_LIMIT
configuration setting.

Clients can use this header to decide how much POST data to send
in HTTP requests. If a client sends more than "n" bytes in the
request body, Healthchecks will store the first "n" bytes, and
ignore the rest.

The default value for PING_BODY_LIMIT is 10000 (10KB).
2022-05-10 15:44:27 +03:00
Pēteris Caune
eac023caa1
Enable searching channels by code in admin UI 2022-05-10 15:36:49 +03:00
Pēteris Caune
7a5b6b6b31
Fix tests 2022-05-07 20:56:39 +03:00
Pēteris Caune
62c631a1e8
Increase the default profile limits
Accounts on self-hosted instances should have "unlimited" limits.
I had originally assumed 500 checks should be *enough for everybody*,
but in practice people do have accounts with 1000+ checks,
and may want to do scale testing with even more checks
(see #649). This commit raises the "unlimited" limits higher
to make it less likely users bump into them.
2022-05-07 20:51:07 +03:00
Pēteris Caune
f8382fd84e
Increase max displayed duration from 24h to 72h
Fixes: #644
2022-05-02 12:07:14 +03:00
Pēteris Caune
d1d9dd5021
Fix "Test" button for integrations that only send "up" notifications 2022-05-02 11:55:00 +03:00
Pēteris Caune
b776762ba9
Fix prunenotifications to handle checks with missing pings
Fixes: #636
2022-04-20 16:25:19 +03:00
Pēteris Caune
4c58c55741
Fix tests to skip time.sleep() 2022-04-19 11:39:28 +03:00
Pēteris Caune
aa2571b7fc
Add small delay in transports.Email.notify to allow ping body to upload 2022-04-19 11:37:48 +03:00
Pēteris Caune
32f021b9c5
Update email template to handle not yet uploaded ping bodies 2022-04-13 10:43:12 +03:00
Pēteris Caune
bb38ad3187
Remove the Signal CAPTCHA form (use "submitchallenge" command instead) 2022-04-11 14:24:28 +03:00
Pēteris Caune
6124ad59cd
Improve CAPTCHA alert email 2022-04-11 09:38:30 +03:00
Pēteris Caune
d1033ba6b5
Fix CAPTCHA email alert 2022-04-11 09:34:58 +03:00
Pēteris Caune
90d30c8b62
Add management command to submit Signal CAPTCHAs 2022-04-11 09:29:33 +03:00
Pēteris Caune
842f0c3e16
Improve CSS in Channel and Notification admin 2022-04-09 17:16:10 +03:00
Pēteris Caune
cb36e17440
Improve Notification admin 2022-04-09 16:43:39 +03:00
Pēteris Caune
7bd916558b
Add @login_required and update CHANGELOG 2022-04-09 16:35:57 +03:00
Pēteris Caune
131ffe14fb
Add experimental UI for submitting Signal rate limit challenges 2022-04-09 16:29:26 +03:00
Pēteris Caune
1826f6f654
Improve Channel and Notification admin 2022-04-09 15:03:59 +03:00