Commit graph

1919 commits

Author SHA1 Message Date
Pēteris Caune
db8749e38f
Fix tests to use Mock.assert_called_once() and Mock.assert_not_called() 2023-05-04 10:27:56 +03:00
Pēteris Caune
1c80b32adf
Use simpler base classes in hc.lib.tests 2023-05-04 10:20:36 +03:00
Pēteris Caune
5113b96879
Fix mock.call_args usage in tests 2023-05-03 15:07:49 +03:00
Pēteris Caune
db1b75e966
Add support for specifying MessagingServiceSid in Twilio API requests 2023-05-03 13:06:08 +03:00
Pēteris Caune
4e3034978f
Fix another instance of pinging/deleting race condition 2023-05-02 14:11:56 +03:00
Pēteris Caune
2eeb0b5471
Improve code comments 2023-05-02 13:25:16 +03:00
Pēteris Caune
6375b0aac4
Fix a race condition when pinging and deleting checks at the same time 2023-05-02 13:22:16 +03:00
Pēteris Caune
5de8d6fce7
Move body truncation code into get_ping_body() 2023-04-28 18:05:02 +03:00
Nikolai T. Jensen
ca18da5d62
Add last ping body in MS Teams notifications (#817)
* Include body in msteams template if exists.

Support it like it does in https://github.com/healthchecks/healthchecks/blob/master/templates/integrations/slack_message.json
The markdown codeblock works well in teams also.

* Move body to a separate section, fix transport class, add tests

---------

Co-authored-by: Pēteris Caune <cuu508@gmail.com>
2023-04-28 17:51:39 +03:00
Pēteris Caune
c3b80b06cf
Add Profile.deletion_scheduled_deleted field and UI banner when it's set 2023-04-28 15:03:04 +03:00
Pēteris Caune
5f2b795a88
Add "Activate" and "Deactivate" actions in User admin 2023-04-28 14:26:19 +03:00
Pēteris Caune
cb6bdf0dd3
Update Signal notification template to include more data 2023-04-28 13:11:33 +03:00
Pēteris Caune
9ddae08437
Upgrade to cronsim 2.4 2023-04-26 18:18:31 +03:00
Pēteris Caune
9ead449d90
Add error logging in hc.lib.s3.get_object 2023-04-14 15:14:23 +03:00
Pēteris Caune
b1e9bdde76
Fix test_ping_details to avoid real S3 calls during tests 2023-04-14 15:12:12 +03:00
Pēteris Caune
dcd174f761
Add statsd metric collection in hc.lib.s3.get_object() 2023-04-14 13:23:16 +03:00
Pēteris Caune
dc58910bb5
Switch from CssAbsoluteFilter to CssRelativeFilter
cc: #822

This should fix icon font loading when serving Healthchecks
from a subdirectory.
2023-04-12 11:37:14 +03:00
Pēteris Caune
b9996e63c8
Fix django-compressor warning with github_actions.html
HTML files in /templates/docs/ are not Django templates,
they contain HTML content to be used verbatim in
hc.front.views.serve_doc view.

Some of these files contain "{{ ... }}" syntax. When
we run "./manage.py compress", django-compressor trips
up on this syntax because it treats them as Django templates.

The fix is to change file extension for these files
from .html to something else (I picked .html-fragment)
so django-compressor would ignore them.
2023-04-11 20:34:31 +03:00
Pēteris Caune
7a06f01fca
Update links to Django docs 2023-04-07 12:50:09 +03:00
Pēteris Caune
80b6aa89ea
Add cron expression tester and samples in the cron cheatsheet page 2023-04-04 13:54:24 +03:00
Pēteris Caune
e722404842
Fix tests 2023-04-04 11:57:47 +03:00
Pēteris Caune
a5324ac13c
Make warnings about no backup second factor more assertive 2023-04-04 11:53:34 +03:00
Pēteris Caune
eab52ed73c
Add email fallback for Signal notifications that hit rate limit 2023-04-04 10:21:35 +03:00
Pēteris Caune
e21ada67f1
Remove L10N markup from base.html, and associated translations 2023-03-29 19:19:03 +03:00
Pēteris Caune
64f13d1219
Update Trello onboarding form to allow tokens up to 256 chars long
cc: #806
2023-03-29 15:19:45 +03:00
Pēteris Caune
bea84b744a
Update Trello onboarding form to allow longer Trello auth tokens
Trello token length change announcement:
https://community.developer.atlassian.com/t/trello-tokens-are-getting-longer/62964

Fixes: #806
2023-03-29 14:21:06 +03:00
Pēteris Caune
f6aeda978d
Fix hc.lib.s3.get_object to handle more urllib3 exceptions 2023-03-29 14:00:10 +03:00
Pēteris Caune
50d15d53e5
Add a "Remove TOTP" action in Profile admin 2023-03-28 17:36:57 +03:00
Pēteris Caune
f8026a73b6
Add a test for fdfab66a81 2023-03-10 16:33:57 +02:00
Pēteris Caune
fdfab66a81
Fix notification query in the Log page
The bug: the Log page would sometimes show a number of "zombie"
notifications at the very end: notifications that should not be
shown to the user, but have not yet been garbage-collected.

The fix: when preparing the created__gte filter value for the
notification query, make sure the filter value is not lower than the
timestamp of the oldest visible ping.
2023-03-10 16:25:06 +02:00
Pēteris Caune
4d552efd67
Improve styling of the project switcher 2023-03-10 11:50:41 +02:00
Pēteris Caune
bad4b9adbf
Add a "Switch Project" menu in top navigation 2023-03-10 10:36:09 +02:00
Pēteris Caune
9656c51034
Update tests to check the active tab in the Ping Details dialog 2023-03-09 13:33:38 +02:00
seidnerj
87841b6038
Update the ping details dialog to show the "HTML" tab by default (if available) (#801)
* typo correction in README.md

* when opening the "ping details" dialog, by default set the active tab to "HTML" (if html content exists), otherwise set the active tab to "Text".
2023-03-09 13:17:16 +02:00
Pēteris Caune
d269b54ca1
Fix tests 2023-02-21 11:11:43 +02:00
Pēteris Caune
04c9398da3
Fix the "Test" button in the Integrations screen for read-only users
(I broke it by accident in 963f1758de)
2023-02-20 10:21:41 +02:00
Pēteris Caune
d84a97acef
Add @sensitive_post_parameters() to views that handle passwords 2023-02-20 10:09:16 +02:00
Pēteris Caune
c2f828df83
Add custom ExceptionReporterFilter which filters out TWILIO_AUTH 2023-02-20 09:43:03 +02:00
Pēteris Caune
423dac4b19
Add a protection for non-bool settings.SESSION_COOKIE_SECURE value 2023-02-15 09:20:00 +02:00
Pēteris Caune
3d728325fe
Fix the SameSite and Secure attributes on the "auto-login" cookie
The "auto-login" cookie is a part of a work-around for
some email clients automatically clicking links in emails:

- when sending an one-time sign-in link, server also sends the
  "auto-login" cookie to the client
- when end user clicks on the sign-in link, the server checks
  if client's request contains the "auto-login" cookie
- if the "auto-login" cookie is present, log the user in
- if the "auto-login" cookie is absent, serve a HTTP POST form
  with a submit button. The user must click the button to log in.

This commit fixes attributes on the "auto-login" cookie:

- it sets SameSite=Lax
- it sets Secure=true if SESSION_COOKIE_SECURE=True
2023-02-15 09:17:09 +02:00
Pēteris Caune
c8750ad05b
Fix the signup form to work with httpOnly CSRF cookies 2023-02-14 14:20:27 +02:00
Pēteris Caune
e46cf3725b
Add CSRF protection in the signup view 2023-02-14 09:15:46 +02:00
Pēteris Caune
f27e7c82a2
Optimize SQL query in hc.front.views.status
Filter checks by project.id instead of project.code,
this avoids a JOIN in the query.
2023-02-10 12:06:56 +02:00
Pēteris Caune
0d0087d898
Update Telegram notification template to include more data 2023-02-08 15:28:39 +02:00
Pēteris Caune
b1d47abd97
Fix tests when TELEGRAM_BOT_NAME has a custom value 2023-02-08 14:22:55 +02:00
Pēteris Caune
311f7064dc
Fix a race condition in Check.ping method
The code in Check.ping() updates a Check object, then
creates a Ping object. There's a possible race condition
where the "sendalerts" command sees# the updated Check object
before the Ping object is created. This is especially likely
when offloading ping bodies to S3, because Ping gets created
*after* the upload completes, which can take some time.

To avoid this, put both operations inside a transaction,
but keep the S3 upload *outside* the transaction--uploads
can hang, and we want to avoid long transactions.
2023-02-08 13:12:05 +02:00
Fabrizio Ferrai
9939e45c5a
Add body to Telegram notifications (#783)
Add body to Telegram notifications

---------

Co-authored-by: Pēteris Caune <cuu508@gmail.com>
2023-02-08 12:52:36 +02:00
Pēteris Caune
19383d0414
Improve the error message about rejected private IPs 2023-02-03 10:08:06 +02:00
boopzz
55361d5ae2
Amended Mattermost class to include the BODY in the message (#785)
Add last ping body in Mattermost notifications

---------

Co-authored-by: Pēteris Caune <cuu508@gmail.com>
2023-02-01 13:22:54 +02:00
Pēteris Caune
e995d299b8
Improve hc.lib.s3 tests 2023-02-01 10:25:17 +02:00