Commit graph

3074 commits

Author SHA1 Message Date
Pēteris Caune
db1088eb9c
Add type hints in hc.front.templatetags.linemode 2023-10-26 08:41:05 +03:00
Pēteris Caune
5afc2ea20c
Improve type hints 2023-10-26 08:35:06 +03:00
Pēteris Caune
343e55bd4f
Improve type hints 2023-10-25 18:12:12 +03:00
Pēteris Caune
37ee900798
Improve Discord tests 2023-10-25 14:51:54 +03:00
Pēteris Caune
232f534bc0
Improve type hints in hc.lib.curl 2023-10-25 14:47:52 +03:00
Pēteris Caune
65eddaacd6
Improve API error handling in hc.front.views.add_linenotify_complete 2023-10-25 14:46:57 +03:00
Pēteris Caune
bff59c92ed
Improve API error handling in hc.front.views.trello_settings 2023-10-25 14:20:51 +03:00
Pēteris Caune
da22899cd6
Improve OAuth error handling in hc.front.views.add_discord_complete 2023-10-25 13:49:14 +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
511863594c
Improve OAuth error handling in hc.front.views.add_slack_complete 2023-10-25 13:40:56 +03:00
Pēteris Caune
4d0ec64da8
Update Signal integration to use Ping.get_kind_display() 2023-10-23 11:47:17 +03:00
Pēteris Caune
6110b10c3c
Update Telegram integration to use Ping.get_kind_display() 2023-10-23 11:43:07 +03:00
Pēteris Caune
c9540f8ddd
Update email integration to use Ping.get_kind_display() 2023-10-23 11:39:37 +03:00
Pēteris Caune
6c7f5881a7
Update ntfy integration to use Ping.get_kind_display() 2023-10-23 11:37:18 +03:00
Pēteris Caune
60630c1dee
Fix special character escaping in ntfy notifications 2023-10-23 11:22:14 +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
1004ca776a
Switch to using Pydantic for validating Matrix join responses 2023-10-23 08:53:15 +03:00
Pēteris Caune
cf552c86cb
Switch to using Pydantic for validating Pushbullet OAuth responses 2023-10-23 08:52:31 +03:00
Pēteris Caune
06328dbecf
Fix mypy warning 2023-10-22 16:57:02 +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
7e7cbe9f75
Fix the Login form to not perform form validation in GET requests 2023-10-22 10:45:06 +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
0971051418
Refactor Webhook transport 2023-10-21 18:04:27 +03:00
Pēteris Caune
2d447d5bc8
Enable mock autospeccing in more places 2023-10-21 11:55:30 +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
4226ec4059
Remove unnecessary type conversion 2023-10-20 19:14:44 +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
33a0f65144
Improve type hints in hc.api.decorators 2023-10-20 18:41:11 +03:00
Pēteris Caune
5ebc7696d7
Remove braintree dependency, should no longer be needed to run tests 2023-10-19 15:04:54 +03:00
Pēteris Caune
7900eb55b8
Remove a few more files that I missed 2023-10-19 14:58:39 +03:00
Pēteris Caune
a9c7dbc397
Remove billing.html which I meant to remove before but missed 2023-10-19 14:44:17 +03:00
Pēteris Caune
61e03fa88d
Fix base_docs.html -> docs_single.html in CONTRIBUTING.md 2023-10-19 14:41:01 +03:00
Pēteris Caune
a308997b3a
Remove most of the hc.payments stuff
Why remove:

* For self-hosters, payment-related features are unused and dead weight
* For SaaS (any would-be Healthchecks.io competitors), the existing
  payment handling logic is not very useful either, as it would need to
  be heavily modified to match their business model, pricing, chosen
  payment gateway
* For the hosted service (Healthchecks.io), the up-to-date billing code
  lives in a private fork of this repo. Maintenance is easier if this
  repo does not have an older, diverging version of the same
  functionality

A few payment-related bits are staying at least for time being:

* the "USE_PAYMENTS" setting
* the hc.payments.models.Subscription model
* tiny stubs for the "Pricing" and "Billing" pages

They are used in various places in the code and templates,
and I think ripping them out in one go would be too disruptive.
2023-10-19 14:17:44 +03:00
Pēteris Caune
fa2e456353
Fix mypy warning 2023-10-19 10:56:59 +03:00
Pēteris Caune
0aa21d5ac8
Update mypy.ini, remove a few "ignore_missing_imports"
fido2, apprise, braintree, urllib3 now have type hints,
so don't need "ignore_missing_imports" in mypy.ini any more, nice!
2023-10-18 16:56:58 +03:00
Pēteris Caune
fdfe03158d
Fix mypy warnings 2023-10-18 16:33:15 +03:00
Pēteris Caune
1aec03dfc6
Improve type hints in management commands 2023-10-18 16:15:01 +03:00
Pēteris Caune
e8be347d1a
Improve type hints in management commands 2023-10-18 13:47:02 +03:00
Pēteris Caune
ce622da6bd
Improve type hints and remove threading support which was unused
sendalerts had support for sending notifications
synchronously (with the --no-threads flag) and asynchronously using
threads (the default).

It turns out there was a bug in argument handling and sendalerts
was always using the synchronous mode regardless of the
presence/absence of the "--no-threads" flag. Since noone seems to
have noticed, I removed the unused async code.
2023-10-18 13:45:23 +03:00
Pēteris Caune
286b8a5a3b
Improve type hints in hc.front.templatetags.hc_extras 2023-10-18 10:08:29 +03:00
Pēteris Caune
c22c8a0a76
Improve markdown markup 2023-10-18 09:17:31 +03:00
Pēteris Caune
e4f233ba30
Sync templates/docs/self_hosted_docker.md and docker/README.md 2023-10-18 09:00:38 +03:00
Pēteris Caune
c123e4d3a9
Add note about SMTPD_PORT in docs
cc: #791
2023-10-18 08:39:22 +03:00
Pēteris Caune
3d5850d2da
Improve type hints, use pydantic for parsing Zulip configurations 2023-10-17 16:58:57 +03:00
Pēteris Caune
bb7632f467
Fix mypy warning 2023-10-17 16:15:37 +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
86eb2e43e5
Make the "notification" parameter non-optional in Transport.notify()
Its signature was "notification: Notification | None = None".

But callers always specify it, the default value is never used.

So I changed the signature to "notification: Notification".
2023-10-17 14:56:54 +03:00
Pēteris Caune
02888e6db9
Fix sending test notification to a group integration 2023-10-17 11:37:12 +03:00
Pēteris Caune
89aa0a832b
Update uwsgi.ini to allow UWSGI_PROCESSES env var to override it 2023-10-17 10:24:20 +03:00