Commit graph

597 commits

Author SHA1 Message Date
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
Pēteris Caune
fce1ffbd4a
Update CHANGELOG 2024-04-22 13:03:45 +03:00
Pēteris Caune
7f03a9e738
Improve Opsgenie notifications (include description, schedule, link...) 2024-04-19 11:58:35 +03:00
Pēteris Caune
577602ae21
Fix Opsgenie integration to not disclose check's code in incident data 2024-04-19 11:24:12 +03:00
Pēteris Caune
bd64fab619
Fix hc.front.views.docs_search to handle AND/OR/NOT as query strings 2024-04-18 15:36:48 +03:00
Pēteris Caune
f77eac08b0
Update CHANGELOG 2024-04-15 10:44:33 +03:00
Pēteris Caune
9bb5656d40
Implement dynamic favicon in the projects overview page
cc: #971
2024-04-10 14:36:42 +03:00
Pēteris Caune
d7948d9939
Show status changes (flips) in check's log page
Fixes: #447
2024-04-09 12:39:42 +03:00
Pēteris Caune
6e2df6a71c
Update CHANGELOG for v3.3 release 2024-04-03 18:15:10 +03:00
Pēteris Caune
ab639e6cfd
Fix templates to output correct favicon tag 2024-03-26 17:27:32 +02:00
Pēteris Caune
855fac0973
Implement filtering by event type in the Log page
Fixes: #873
2024-03-21 11:04:45 +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
33e58fa014
Change the signup flow to accept registered users
(and sign them in instead)
2024-03-15 17:30:06 +02:00
Pēteris Caune
a0545b875e
Add "Last ping subject" field in email notifications 2024-03-13 15:45:27 +02:00
Pēteris Caune
4c97068776
Update notification templates to handle Check.last_ping == None 2024-02-29 14:38:35 +02:00
Pēteris Caune
1322bb1123
Add support for per-check status badges
Fixes: #853
2024-02-27 12:55:51 +02:00
Pēteris Caune
4959856e58
Redesign the "Status Badges" page 2024-02-26 12:34:26 +02:00
Pēteris Caune
6686147cb1
Update CHANGELOG 2024-02-23 11:43:02 +02:00
Pēteris Caune
f6378fc26b
Fix Gotify integration to handle Gotify server URLs with paths
Fixes: #964
2024-02-20 10:12:54 +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
c99b644a22
Update CHANGELOG for v3.2 release 2024-02-09 14:09:45 +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
Pēteris Caune
56f8bd93e3
Update CHANGELOG 2024-02-08 15:44:27 +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
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