Pēteris Caune
1a5ca45d09
Fix InvalidResponseError() initialization parameters
2024-06-20 15:15:14 +03:00
Pēteris Caune
9dbd961beb
Add test case for InvalidResponseError handling
2024-06-20 15:11:42 +03:00
Pēteris Caune
475bdff87d
Add handling for minio.InvalidResponseError exceptions
2024-06-18 23:50:11 +03:00
Pēteris Caune
b2c5e91c70
Implement legacy -> canonical timezone conversion
...
There are three related changes:
* Removed legacy timezones from hc.lib.tz.all_timezones
* Added data migration to update existing Check.tz values
* For backwards compatibility, added code to automatically
replace a legacy timezone with a canonical timezone when a
legacy timezone is passed to an API call
I used the timezone mapping on
https://en.wikipedia.org/wiki/List_of_tz_database_time_zones
2024-06-14 12:55:57 +03:00
Pēteris Caune
c5bd666faf
Add data migration to update timezone "Europe/Kiev" to "Europe/Kyiv"
2024-06-13 15:03:51 +03:00
Pēteris Caune
66d482c4af
Disable a type warning related to statsd having no type hints yet
...
python-statsd does have a PR for adding type hints, so
hopefully this is temporary.
2024-05-01 11:39:20 +03:00
Pēteris Caune
5b905c1cbc
Bump django-stubs-ext to 5.0.0
2024-05-01 11:11:54 +03:00
Pēteris Caune
22325565b5
Remove unused import
2024-03-18 13:02:46 +02:00
Pēteris Caune
3615d26aea
Remove debug statement
2024-03-18 12:56:18 +02:00
Pēteris Caune
274a59956a
Make statsd metrics collection optional
...
To enable, set STATSD_HOST env var (or set STATSD_HOST in
local_settings.py):
STATSD_HOST=localhost:1234
cc: #974
2024-03-18 12:55:36 +02:00
Pēteris Caune
4959856e58
Redesign the "Status Badges" page
2024-02-26 12:34:26 +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
7cb47188b9
Remove redundant cast
2024-01-22 16:09:20 +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
767c3ae702
Add a management command for pruning all checks
2023-12-21 14:55:05 +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
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
Pēteris Caune
ec9649a6a6
Fix logging calls to avoid string formatting in client code
2023-10-27 10:33:55 +03:00
Pēteris Caune
ab7449a279
Improve type hints in hc.lib.s3
2023-10-26 10:19:28 +03:00
Pēteris Caune
d059431b08
Improve type hints in hc.lib.webauthn
2023-10-26 10:14:30 +03:00
Pēteris Caune
343e55bd4f
Improve type hints
2023-10-25 18:12:12 +03:00
Pēteris Caune
232f534bc0
Improve type hints in hc.lib.curl
2023-10-25 14:47:52 +03:00
Pēteris Caune
8b006e0d58
Move nolog decorator to hc.test so it can be reused
2023-10-25 13:48:55 +03:00
Pēteris Caune
7e503d9c33
Move the "join Matrix room" code to hc.lib.matrix
2023-10-23 09:32:03 +03:00
Pēteris Caune
5911075282
Fix HTTP verb in hc.lib.curl.post
2023-10-22 12:38:44 +03:00
Pēteris Caune
30a3a784c3
Move AuthenticatedHttpRequest to hc.accounts.http module
...
If AuthenticatedHttpRequest lives in the hc.lib.typealias
module then hc.lib.typealias imports User and Profile,
and so needs configured Django settings. Most of the stuff
in hc.lib is intended to work standalone, and not rely on Django.
2023-10-21 18:16:48 +03:00
Pēteris Caune
470f70b164
Update curl.get and curl.post to closer match requests fn signatures
...
In requests, "params" is a positional argument for the get function:
requests.get(url, params=None, **kwargs)
So I made params positional here too.
In requests, "data" is a positional argument for the post function:
requests.post(url, data=None, json=None, **kwargs)
So I data positional here too.
2023-10-21 11:45:45 +03:00
Pēteris Caune
7c7774d18c
Replace **kwargs with explicit keyword arguments in hc.lib.curl
...
This makes the code more verbose, but at the same time
makes type hinting cleaner, and allows mock autospeccing
to catch more problems.
2023-10-21 11:21:42 +03:00
Pēteris Caune
52ab8c4703
Improve type hints in hc.lib.curl and hc.api.transports
...
This results in changes in other places too:
* curl.post() does not accept `data` as positional arg,
it must now be a keyword argument
* we need asserts and if clauses in a few places to make sure
we are not passing `None` in the arguments to hc.lib.curl.request
2023-10-20 19:11:08 +03:00
Pēteris Caune
42a137e128
Switch to pydantic for validating Telegram incoming webhooks
2023-10-17 16:10:35 +03:00
Pēteris Caune
5d99c544ee
Increase the precision in hc.lib.date.format_approx_duration
...
Format durations in one of the following forms:
* "{x} days {y} h"
* "{y} h {z} min"
* "{z} min {w} sec"
2023-10-02 12:50:59 +03:00
Pēteris Caune
58d7c8cc55
Simplify DowntimeSummary
2023-09-27 17:16:16 +03:00
Pēteris Caune
f7af738c76
Add monthly uptime percentage display in Check Details page
...
Fixes : #773
2023-09-27 13:44:35 +03:00
Pēteris Caune
e48d361331
Fix time interval formatting in check details - downtime summary
...
In hc.lib.date.format_approx_duration, we were calling
timedeltaobj.total_seconds() and basing all calculations off that.
This method returns float, so the final result was "2.0 hours" or
"3.0 days" and similar. We now convert it to int, to get "2 hours",
"3 days" etc.
2023-09-26 10:30:34 +03:00
Pēteris Caune
ee40cd8dab
Fix type warnings
2023-09-08 16:47:27 +03:00
Pēteris Caune
5746bbb015
Improve type hints in hc.api.models
2023-09-08 15:58:39 +03:00
Pēteris Caune
92bf9773dc
Improve type hints in hc.lib
2023-09-08 13:05:19 +03:00
Pēteris Caune
9173475194
Improve type hints in hc.api.views
2023-09-07 14:38:55 +03:00
Pēteris Caune
05d2d0065e
Remove usage of backports.zoneinfo
2023-09-06 12:54:27 +03:00
Pēteris Caune
c9bf3132fe
Replace usage of typing.List, typing.Optional etc. with modern syntax
2023-09-06 11:27:43 +03:00
Pēteris Caune
d79069f669
Fix type warnings, improve type hints in hc.front.views
2023-09-06 11:18:47 +03:00
Pēteris Caune
e9ac841d01
Move reusable type aliases to hc.lib.typealias
2023-09-06 10:52:47 +03:00
Pēteris Caune
65b3acf964
Improve type hints in hc.accounts.views
2023-09-06 10:02:50 +03:00
Pēteris Caune
9153c1a552
Improve type hints
2023-09-05 13:31:59 +03:00
Pēteris Caune
2901f03146
Fix type warnings
2023-09-03 09:04:38 +03:00
Pēteris Caune
477f690057
Improve type hints
2023-08-31 14:17:08 +03:00
Pēteris Caune
4affd70822
Fix JSON type aliases for Py 3.8 again
2023-08-31 12:25:18 +03:00