Commit graph

622 commits

Author SHA1 Message Date
Pēteris Caune
0f6099b311
Fix fetchstatus.py to handle SITE_ROOT with a path
Fixes: #1107
2024-12-19 09:35:31 +02:00
Pēteris Caune
03710eec88
Update CHANGELOG 2024-12-18 13:43:30 +02:00
Pēteris Caune
4a2775c3fe
Update changelog for v3.8.1 release 2024-12-13 13:44:25 +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
04ebbeb0bd
Update CHANGELOG for v3.8 release 2024-12-09 15:15:29 +02:00
Pēteris Caune
ae074a7b2a
Update SITE_ROOT docs and CHANGELOG
cc: #1091
2024-12-09 15:13:25 +02:00
Pēteris Caune
cb7e53677d
Increase ntfy.sh topic max length to 64 2024-11-25 11:16:15 +02:00
Pēteris Caune
2ef550e16e
Update Changelog 2024-11-14 14:57:09 +02:00
Pēteris Caune
5f3bbfd940
De-emphasize the unsubscribe link in email notifications
I received a report about multiple cases of users clicking
on the unsubscribe link by accident. The unsubscribe action
does not have a confirmation step so the users get instantly
unsubscribed. I do not want to add a confirmation step, so
instead I'm making a few small changes to hopefully reduce
the chances of accidental clicks:

- The footer text now has a "You are receiving this email because..."
  blurb to separate the footer a little more from the primary
  content
- The unsubscribe link is now a shorter single word: "Unsubscribe",
  making it a smaller click target
- the footer now uses a slightly smaller font than the rest of
  the email message

The people looking for the unsubscribe link should still be able
to easily find it, but hopefully it should now draw less
"accidental attention".
2024-11-12 14:51:05 +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
e3cbe79f57
Update CustomHeaderMiddleware to normalize email addresses to lower case
Also add a data migration to normalize any already existing user
accounts with non-lower-case email addresses too.

Fixes: #1074
2024-10-24 13:22:37 +03:00
Pēteris Caune
dd0a4c1582
Update Dockerfile to use Python 3.13 2024-10-23 13:22:41 +03:00
Pēteris Caune
0bf73bf743
Rewrite the fetchstatus.py script to reduce Docker container CPU use
fetchstatus.py was a Django management command, and is now
a standalone script. This way we avoid doing Django housekeeping
every time it runs (every 10 seconds). It still needs to access
the ALLOWED_HOSTS setting, to make the HTTP request with
a correct Host header.

Fixes: #1071
2024-10-22 10:53:47 +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
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
bbd45f2737
Update changelog for v3.7 release 2024-10-21 12:59:47 +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
b886c93cb7
Make slider labels clickable in the "Update Period & Grace" dialog
Fixes: #1039
2024-10-11 13:37:29 +03:00
Pēteris Caune
e49b5f8fbd
Remove LINE Notify onboarding form
LINE Notify is shutting down on Apr 1, 2025:
https://notify-bot.line.me/closing-announce

I'm removing the onboarding form so people don't set up new
integrations that will stop working in 5 months.

The code for sending LINE Notify notifications still exists,
and the existing integrations will continue to work (until LINE
Notify stops working).
2024-10-08 09:13:03 +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
28af3720f4
Increase outgoing webhook timeout from 10 to 30 seconds
Also simplify the retry logic: each retry attempt is now
allowed to use the full 30 seconds. This means, a single
webhook delivery can take up to 3*30=90 seconds.
2024-09-11 12:37:40 +03:00
Pēteris Caune
fd0c428e29
Update sqlite settings to avoid "Database is locked" errors
Fixes: #1057

"PRAGMA busy_timeout" configures the database to wait when a
database is locked instead of giving up immediately.

"transaction_mode IMMEDIATE" starts transactions in read/write
mode, required to make busy_timeout work.

Reference: https://gcollazo.com/optimal-sqlite-settings-for-django/
2024-09-09 10:11:22 +03:00
Pēteris Caune
5a19f9658a
Update changelog for v3.6 release 2024-09-04 10:18:56 +03:00
Pēteris Caune
029881f3b9
Refactor sendalerts
* Remove the --no-loop and --no-threads arguments
* Use a threadpool to do multiple sends concurrently
* Add a new `--num-workers` argument. It limits how many flips we grab
  from the database and process concurrently.
* Do not prioritize flips with historically low send times any more
  (not as important now with concurrent sending, and simpler this way)
* Workers close db connections when they finish
  (to keep the number of idle connections low)

Note: concurrent.futures.ThreadPoolExecutor internally has an unbounded
queue, it will accept any amount of jobs and keep them queued. We don't
want that. We only want to grab a flip, and commit to processing it,
if we know there's a free worker for it. Therefore we're tracking the
number of jobs in flight using a semaphore (`self.seats`).
2024-08-29 16:20:36 +03:00
Pēteris Caune
320a7c7733
Fix the Docker healthcheck script to supply correct Host header
Commit 8fed685f12 added a HEALTHCHECK
instruction in the Dockerfile. The healthcheck script calls http://localhost:8000/api/v3/status/, which fails if localhost is not in ALLOWED_HOSTS.

With this change, the healthcheck script is now a Django management
command. It reads Django's ALLOWED_HOSTS setting, grabs the first
element, and uses it in the "Host:" HTTP header when making a HTTP
request.

cc: #1051
2024-08-21 15:52:19 +03:00
Pēteris Caune
6d15c45b21
Update CHANGELOG for v3.5.1 release 2024-08-20 13:46:09 +03:00
Pēteris Caune
ca75c7e984
Update CHANGELOG for v3.5 release 2024-08-20 11:20:34 +03:00
Pēteris Caune
5e051bfc30
Fix AJAX views to better handle user logging out
Rather than redirecting to login page, return HTTP 403 Forbidden
2024-08-20 10:57:36 +03:00
Pēteris Caune
8fed685f12
Update Dockerfile to report container health in docker ps
This commit adds a HEALTHCHECK instruction in Dockerfile.
The HEALTHCHECK instruction calls /docker/fetchstatus.sh
which in turn makes a HTTP request to
http://localhost:8000/api/v3/status/
This endpoint makes a test database query and returns non-200
response if the query fails. So, in short, if the Healthchecks
container for any reason is unable to query database, `docker ps`
will now show the container as "unhealthy".

cc: #1045
2024-08-19 10:17:05 +03:00
Pēteris Caune
d3ae4e7fac
Add support for $SLUG placeholder in webhook payloads
Fixes: #1049
2024-08-16 13:24:12 +03:00
Pēteris Caune
cda744d0c1
Implement search by slug in the checks list
cc: #1048
2024-08-15 14:17:28 +03:00
Pēteris Caune
56bac98816
Update the "Set Password" page to reject very weak passwords 2024-08-15 12:04:28 +03:00
Pēteris Caune
3fbba0c2f0
Update timezone dropdowns to show frequently used timezones at the top 2024-08-13 13:57:52 +03:00
Pēteris Caune
bdb6f18a3d
Add "uuid" field in API responses when read/write key is used
The API responses already contain ping_url, update_url, resume_url,
pause_url fields where the UUID can be extracted from, so we are
not exposing new information. The extraction can be finicky in,
say, shell-scripting scenarios. So for API user convenience we will
now also provide the check's code (UUID) as a separate field.

Fixes: #1007
2024-07-18 18:15:52 +03:00
Pēteris Caune
e83f60cc0b
Implement Implement MS Teams Workflows integration
We already have a MS Teams integration but MS Teams is discontinuing
the incoming webhook feature used by this integration:

https://devblogs.microsoft.com/microsoft365dev/retirement-of-office-365-connectors-within-microsoft-teams/

MS Teams now recommends to use Workflows to post messages
via webhook. MS Teams does not provide backwards compatibility or
an upgrade path for existing integrations.

This commit adds a new "msteamsw" integration which uses MS Teams
Workflows to post notifications. It also updates the instructions
and illustrations in the "Add MS Teams Integration" page.

cc: #1024
2024-07-17 13:35:17 +03:00
Pēteris Caune
1b695c6970
Improve performance of loading ping body previews
Defer loading body_raw, instead load its first 150 bytes
as "body_raw_preview". This reduces both network I/O to database,
and disk I/O on the database host if the database contains large
request bodies.

cc: #1023
2024-07-11 17:38:25 +03:00
Pēteris Caune
bc8fb90fed
Update Check.ping() to use select_for_update()
Without it, on MariaDB, concurrent pings can lead to a deadlock.
This results in OperationalError and HTTP 500 response to the client.

cc: #1023
2024-07-10 19:50:39 +03:00
Pēteris Caune
17d01ee6e2
Update changelog for release 2024-06-20 15:15:29 +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
24e5e83bbc
Update Ping Details dialog to also show formatted datetimes
Fixes: #975
2024-05-29 15:43:06 +03:00
Pēteris Caune
d56105e670
Update Slack integration to use channel name as the integration name
Fixes: #1003
2024-05-27 15:54:30 +03:00
Pēteris Caune
1bdfbac775
Fix Sign In page to hide "Email Link" option if SMTP is not configured
Fixes: #922
2024-05-10 11:04:21 +03:00
Pēteris Caune
da90d33d38
Fix a bug in the log page that caused log events to sometimes load twice 2024-05-10 10:27:40 +03:00
Pēteris Caune
1ef7ef96b7
Update email notifications to include the timestamps of status flips 2024-04-26 10:24:45 +03:00
Pēteris Caune
4ec7a48082
Update the Discord integration to disable channel on HTTP 404 responses 2024-04-26 09:25:42 +03:00
Pēteris Caune
6fb46aee32
Fix integrations to include oncalendar schedules in notifications 2024-04-24 16:08:55 +03:00