Pēteris Caune
5f94889d01
Fix mypy warning
2024-12-19 12:34:38 +02:00
Pēteris Caune
f7334f7a0e
Add a system check for testing SITE_ROOT against ALLOWED_HOSTS
...
It checks if the hostname in SITE_ROOT would validate
against ALLOWED_HOSTS.
2024-12-19 11:45:07 +02:00
Pēteris Caune
45b8bd64df
Simplify hosting under subpath
...
Instead of using SCRIPT_NAME / FORCE_SCRIPT_NAME, PATH_INFO
and their associated issues, update urls.py to add the subpath
to all routes. This allows us to get rid of several hacks:
* the uwsgi.ini magic which parses SITE_ROOT, sets SCRIPT_NAME
and fixes PATH_INFO
* set_script_prefix() in sendalerts
* chopping the subpath off an URL in hc.accounts.views._allow_redirect
The idea comes from @apollo13
in https://code.djangoproject.com/ticket/35985#comment:5
cc: #1091
2024-12-19 09:04:45 +02:00
Pēteris Caune
281ce65504
isort
2024-12-18 13:42:18 +02:00
Pēteris Caune
0fb011464f
Update SMS notification template to include failure reason
...
cc: #1069
2024-12-18 12:31:22 +02:00
Pēteris Caune
aba1161597
Update RocketChat notification template to include failure reason
...
cc: #1069
2024-12-18 11:51:16 +02:00
Pēteris Caune
22695bfdde
Update Spike notification template to include failure reason
...
cc: #1069
2024-12-18 09:39:56 +02:00
Pēteris Caune
3fa80a8800
Update PagerTree notification template to include failure reason
...
cc: #1069
2024-12-18 09:13:05 +02:00
Pēteris Caune
fd0d58e96d
Update Zulip notification template to include failure reason
...
cc: #1069
2024-12-18 09:00:56 +02:00
Pēteris Caune
46c51787bb
Update PushBullet notification template to include failure reason
...
cc: #1069
2024-12-18 08:50:58 +02:00
Pēteris Caune
c28ae32261
Update VictorOps notification template to include failure reason
...
cc: #1069
2024-12-17 16:01:51 +02:00
Pēteris Caune
dcc5d7a7c4
Update Gotify notification template to include failure reason
...
cc: #1069
2024-12-17 15:22:19 +02:00
Pēteris Caune
d8d8d280ca
Update OpsGenie notification template to include failure reason
...
cc: #1069
2024-12-17 10:09:55 +02:00
Pēteris Caune
f390d6eece
Update MS Teams Workflows notification to include failure reason
...
cc: #1069
2024-12-17 09:50:29 +02:00
Pēteris Caune
aff41f6688
Update ntfy notification template to include failure reason
...
cc: #1069
2024-12-17 08:58:31 +02:00
Pēteris Caune
4628deb395
Update PagerDuty notification template to include failure reason
...
cc: #1069
2024-12-17 08:46:35 +02:00
Pēteris Caune
cd70e88c52
Update Pushover notification template to include failure reason
...
cc: #1069
2024-12-17 08:23:01 +02:00
Pēteris Caune
4808f35a4c
Update Signal notification template to include failure reason
...
cc: #1069
2024-12-16 17:20:28 +02:00
Pēteris Caune
3769bf3ede
Fix mypy warning
2024-12-16 15:55:36 +02:00
Pēteris Caune
ca0d639c6b
Update Slack notification template to include failure reason
...
cc: #1069
2024-12-16 15:43:25 +02:00
Pēteris Caune
f41e1e52ea
Clean up transports.Matrix.get_url()
2024-12-16 15:24:16 +02:00
Pēteris Caune
645efa5ce4
Update Telegram notification template to include failure reason
...
cc: #1069
2024-12-16 15:20:45 +02:00
Pēteris Caune
ff5b060e86
Move repeating flip reason descriptions to Flip.reason_long()
2024-12-16 14:35:36 +02:00
Pēteris Caune
e09fd28836
Improve Matrix notifications (include tags, period, last ping type etc.)
...
cc: #1069
2024-12-13 13:34:41 +02:00
Pēteris Caune
b685e66b71
Add a workaround for reverse() omitting script prefix when on thread
...
https://code.djangoproject.com/ticket/35985
cc: #1091
2024-12-09 11:53:53 +02:00
Pēteris Caune
22268c1484
Move absolute URL construction to hc.lib.urls.absolute_reverse()
...
absolute_reverse() works the same as django.urls.reverse()
except it generates absolute URLs (starting with http[s]://)
2024-12-03 17:24:27 +02:00
Pēteris Caune
5e848f4976
Add index on api_flip (owner_id, created)
...
This helps queries in hc.front.views._get_events,
especially for checks that are flipping between up and down
states a lot.
2024-12-03 10:37:01 +02:00
Pēteris Caune
b328c8739f
Reduce the number of Check.get_status() calls
2024-11-14 13:33:21 +02:00
Pēteris Caune
5c67c94654
Add a missing article
2024-11-08 11:31:09 +02:00
Pēteris Caune
5912758a8a
Update email alerts to mention failure reason
...
cc: #1069
2024-11-08 11:20:44 +02:00
Pēteris Caune
9edae634c7
Add Flip.reason field
...
cc: #1069
2024-11-08 10:24:50 +02:00
Pēteris Caune
79da9e9f4f
Fix auto-fixable ruff warnings
...
(`ruff check --fix`)
2024-11-07 15:15:58 +02:00
Pēteris Caune
4907073c55
Remove unneeded quotes
2024-11-06 19:32:44 +02:00
Pēteris Caune
e048ec4c48
Fix "class Foo(object):" -> "class Foo:"
...
In Python 3 these are equivalent, and shorter is better.
2024-10-29 17:57:50 +02:00
Pēteris Caune
a6ca589b34
Fix pyright warning
2024-10-29 11:54:48 +02:00
Pēteris Caune
c372e3232f
Update MS Teams legacy webhook retirement date to Jan 2025
...
Microsoft pushed it forward again:
https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/
2024-10-25 09:51:58 +03:00
Pēteris Caune
9e69b5b5f5
Fix smtp listener to reject email addresses with unexpected domain
...
cc: #1077
2024-10-21 17:48:57 +03:00
Pēteris Caune
84f22c8978
Fix type warnings
2024-10-21 17:34:02 +03:00
Pēteris Caune
a5d4dc2db5
Fix smtp listener to reject email addresses with non-UUID local parts
...
cc: #1077 )
2024-10-21 15:56:24 +03:00
Pēteris Caune
c91213179f
Fix API to gracefully handle too long slugs
2024-10-16 12:35:30 +03:00
Pēteris Caune
8c210e151f
Update the Signal integration to retry on network errors
2024-10-14 11:19:37 +03:00
Pēteris Caune
4f9b0b11b9
Update Signal transport to log unexpected signal-cli replies
...
When signal-cli returns an error that we are not handling yet,
log the precise JSON message that signal-cli returns. This
is for debug & development: We can look at the logged messages
and see what additional special error handling may be needed.
2024-10-10 10:21:08 +03:00
Pēteris Caune
fd96cc794b
Remove unused bits
2024-10-04 17:34:30 +03:00
Pēteris Caune
a51420744c
Add RiskCheck: disable in SMS transport
...
This is to reduce the chance of hitting Twilio error 30453,
"Message couldn't be delivered".
https://www.twilio.com/docs/api/errors/30453
2024-10-02 17:01:23 +03:00
Pēteris Caune
de4c4897e3
Remove prunenotifications
management command
...
Notifications are now cleaned up automatically during pinging.
2024-10-02 09:24:01 +03:00
Pēteris Caune
13f92b90ef
Update settings.py to read SECURE_PROXY_SSL_HEADER from env vars
...
And add it to docs.
And add a system check to make sure it, if set, is a tuple
with 2 elements.
cc: #851
2024-10-01 19:13:26 +03:00
Pēteris Caune
e73d7a1ece
Remove pruneflips
management command
...
Flips are now cleaned up automatically during pinging.
2024-10-01 15:33:56 +03:00
Pēteris Caune
2cb47d3742
Make the sorting of null values in Flip.select_channels() explicit
2024-09-12 10:52:06 +03:00
Pēteris Caune
f241d070e1
Update Flip.select_channels() to sort channels by last_notify_duration
...
If a check has multiple associated channels, some are slow and
some are quick, handle the quick ones first.
2024-09-12 10:44:56 +03:00
Pēteris Caune
f60af9a156
Update ntfy integration to give up db connection before network IO
2024-09-12 10:30:58 +03:00