Commit graph

1981 commits

Author SHA1 Message Date
Pēteris Caune
52a8df4dbf
Fix naturaltime usage in the WhatsApp integration
When preparing WhatsApp payload we call naturaltime() and
serialize its output as JSON. naturaltime can return a lazy object
which causes an exception during JSON serialization. The fix
is to wrap naturaltime in str() to force its output to be a string.
2024-02-17 10:05:59 +02:00
Pēteris Caune
12b5c36897
Add a system check that warns about WhatsApp misconfiguration 2024-02-16 12:58:48 +02:00
Pēteris Caune
4ef470730f
Fix tests 2024-02-16 12:45:10 +02:00
Pēteris Caune
ec0791b4ee
Update the WhatsApp integration to use Twilio Content Templates 2024-02-16 12:37:11 +02:00
Pēteris Caune
1250195e3e
Add support for $NAME_JSON and $BODY_JSON placeholders 2024-02-14 11:52:35 +02:00
Pēteris Caune
b1cd529532
Fix type annotation 2024-02-12 11:34:27 +02:00
Pēteris Caune
33284bd93f
Fix MariaDB version check
Naively comparing with string "10.7" does not quite work for
versions 10.10 and 10.11 :-)
2024-02-09 14:01:48 +02:00
Pēteris Caune
d881afa3f0
Add a system check to warn about a required MariaDB UUID migration
cc: #929
2024-02-09 11:32:30 +02:00
Michael Boateng
6bfd9c901c
Make grace time editable when job is created (#953)
Fixes: #945
2024-02-08 15:34:52 +02:00
Pēteris Caune
4d0cf7fb80
Remove @nolog decorator
The purpose of @nolog was to disable logging in certain
test cases to avoid console spam during tests. But with the
current logging configuration console is clean even without it.
2024-02-06 17:30:24 +02:00
Pēteris Caune
2923a39a46
Add logging for "signal-cli call failed (<error_code>)" errors 2024-02-06 17:20:29 +02:00
Pēteris Caune
79382ca82e
Fix systemd expression in a testcase to work after 2024-02-01 2024-02-02 13:00:29 +02:00
Pēteris Caune
7cb47188b9
Remove redundant cast 2024-01-22 16:09:20 +02:00
Pēteris Caune
16450a66c7
Add tooltips to tag buttons in the checks list screen
Fixes: #911
2024-01-22 15:20:09 +02:00
Pēteris Caune
42f88f4fb0
Add S3_SECURE setting
It controls whether to use secure (TLS) connection to S3 or not.
2024-01-10 12:19:45 +02:00
Pēteris Caune
ae94648efd
Fix minio-related mypy warnings
A few warnings remain, I think these should be fixed in minio-py:

https://github.com/minio/minio-py/pull/1389
2024-01-04 16:01:34 +02:00
Pēteris Caune
1284ee27a6
Fix the case where PING_BODY_LIMIT is None
cc: #931
2023-12-22 12:29:32 +02:00
Pēteris Caune
54ffe39143
Fix the handling of ping bodies > 2.5MB
Django has a DATA_UPLOAD_MAX_MEMORY_SIZE which controls the maximum
allowed request body size, and is 2.5MB by default.

We now bump up DATA_UPLOAD_MAX_MEMORY_SIZE to be no lower
than PING_BODY_LIMIT.

Fixes: #931
2023-12-22 12:05:16 +02:00
Pēteris Caune
7c5e3130fb
Hardcode a higher S3 operation timeout, add sorting by Check.code 2023-12-21 16:12:22 +02:00
Pēteris Caune
767c3ae702
Add a management command for pruning all checks 2023-12-21 14:55:05 +02:00
Pēteris Caune
b0f8c730f5
Change query in Check.prune() to work around pg index selection issue
In prune(), we need to look up the earliest ping in the database
for a given check. The old version did:

    ping = self.ping_set.earliest("id")

The new version does:

    ping = self.ping_set.earliest("created")

Both yield the same result, but in the first case Postgres may
decide to use the index for the api_ping.id column and scan
almost the entire table.

In the second case it uses the index for the api_ping.owner_id column,
and scans just the rows associated with the check.
2023-12-21 12:00:05 +02:00
Pēteris Caune
f0f2a9aed8
Add a system check which warns about missing SMTP credentials 2023-12-19 14:47:12 +02:00
Pēteris Caune
2a0b8f4e6f
Simplify datetime object initializations in tests 2023-12-19 14:20:04 +02:00
Pēteris Caune
c8897b7026
Improve the handling of StopIteration exceptions
Instead of returning a datetime in far future,
get_grace_start() now returns None which (meaning "never").
2023-12-19 14:05:10 +02:00
Pēteris Caune
1d6e7297be
Fix get_grace_start to handle StopIteration exceptions
These can happen with "one-shot" OnCalendar schedules,
for example: "2023-12-19 11:30"
2023-12-19 13:29:52 +02:00
Pēteris Caune
ce1d7bd4cb
Add a test for #930 2023-12-18 15:58:04 +02:00
Marlene Koh
2b318cab84
Fix crash when email host not configured (#930)
* Log exception when email host not configured instead of raising assertion error

* Fix tests

* Reset to master

* Check email host before sending email for project invites
2023-12-18 15:53:35 +02:00
Pēteris Caune
39a21861ba
Improve type hints 2023-12-15 14:31:30 +02:00
Pēteris Caune
65b9dd371f
Add system check to validate settings.SITE_ROOT
Fixes: #895
2023-12-15 11:04:21 +02:00
Pēteris Caune
9b27600cbe
Fix oncalendar_preview to require a logged in user 2023-12-13 12:55:12 +02:00
Pēteris Caune
7bef951484
Fix oncalendar schedule display in admin 2023-12-12 12:51:13 +02:00
Pēteris Caune
0abfe58cef
Implement OnCalendar schedules in the "Add Check" dialog 2023-12-08 12:02:01 +02:00
Pēteris Caune
52ec0bf4f1
Add a testcase for oncalendar syntax in hc.api.tests.check_test_model 2023-12-07 15:52:32 +02:00
Pēteris Caune
54b8092be9
Fix mypy warnings 2023-12-07 14:44:31 +02:00
Pēteris Caune
fc56cf2635
Add API support for OnCalendar schedules 2023-12-07 14:03:35 +02:00
Pēteris Caune
980520e3b2
Fix the validation of multi-line OnCalendar expressions 2023-12-06 16:50:59 +02:00
Pēteris Caune
fa7e37360f
Tweak the number of iterations in oncalendar preview 2023-12-06 16:34:48 +02:00
Pēteris Caune
e9882879ed
Reduce repetition in test_cron_preview 2023-12-06 16:07:20 +02:00
Pēteris Caune
c1a3ae6f48
Rename CronExpressionValidator -> CronValidator 2023-12-06 16:05:50 +02:00
Pēteris Caune
d65f41d192
Add support for systemd's OnCalendar schedules
(work-in-progress)

cc: #919
2023-12-06 15:42:57 +02:00
Pēteris Caune
0f62a8cd14
Update the Signal integration to disable channel on UNREGISTERED_FAILURE 2023-11-28 13:57:27 +02:00
Pēteris Caune
18e1a3d9e4
Update Pushover onboarding code to generate lowercase state values
Since recently, Pushover seems to return them converted
to lowercase, this is a workaround for that.
2023-11-27 14:52:19 +02:00
Pēteris Caune
b9df18728a
Improve error logging in hc.lib.s3._remove_objects 2023-11-24 10:11:31 +02:00
Pēteris Caune
9c8bb54f7f
Update Twilio integrations to not retry error 21211 2023-11-23 16:18:05 +02:00
Pēteris Caune
ccc7e103ba
Fix capitalization 2023-11-23 15:43:31 +02:00
Pēteris Caune
1b1899052c
Make payments_subscription.user_id not nullable 2023-11-22 10:17:01 +02:00
Pēteris Caune
fa25453734
Add migration for the Group integration 2023-11-22 10:16:27 +02:00
Pēteris Caune
96823a7f90
Add logging for failed webauthn key registrations 2023-11-17 16:06:39 +02:00
Pēteris Caune
2a2c7d66ec
Fix mypy warning 2023-11-15 10:22:22 +02:00
Pēteris Caune
cff4138774
Fix webauthn registration failure on Firefox with Bitwarden extension 2023-11-15 10:13:40 +02:00