Commit graph

597 commits

Author SHA1 Message Date
Pēteris Caune
e2a8e712c4
Update CHANGELOG for v2.0 release 2022-03-18 09:05:55 +02:00
Pēteris Caune
6958a9e898
Add a "Download Original" link in the "Ping Details" dialog 2022-03-16 17:31:01 +02:00
Pēteris Caune
fcaf894d46
Fix Mattermost integration to treat 404 as a transient error
Fixes: #613
2022-03-09 10:10:38 +02:00
Pēteris Caune
16a2cd204e
Fix unwanted localization of period and grace values
cc: #617
2022-03-09 09:13:09 +02:00
Pēteris Caune
05bb80130b
Add support for storing ping bodies in S3-compatible object storage
This is an initial, minimal implementation. It is currently
missing: error handling, timeouts for S3 operations, documentation.

cc: #609
2022-02-28 11:51:04 +02:00
Pēteris Caune
5ecd625c0b
Add Ping.body_raw field for storing body as bytes 2022-02-25 16:50:54 +02:00
Pēteris Caune
3b56fd4175
Fix Signal integration to handle UNREGISTERED_FAILURE errors 2022-02-23 11:32:17 +02:00
Pēteris Caune
8dcc1bfdc1
Fix Telegram bot to handle TransportError exceptions
The Telegram onboarding flow in a nutshell:

1. user invites our bot in a channel and types "/start"
2. Telegram calls our webhook (/integration/telegram/bot/)
3. Our webhook generates and posts an invite link to the chat
4. User clicks the invite link, we show "Add Telegram" form
...

In step 3, when we post the invitation link, if Telegram returns
an error (for example, CHAT_WRITE_FORBIDDEN), our webhook was
throwing HTTP 500. In response, Telegram would retry the webhook
several times, but that's probably futile.

After this commit, the webhook will return HTTP 200, regardless
of whether we could post the invite to the Telegram chat or not.
2022-02-16 16:12:54 +02:00
Pēteris Caune
3f521b16f7
Make email non-editable in "Invite Member" when team limit reached
There is a specific limit of how many other users a given user
can invite in their projects (depends on the plan they are on).
When the limit is reached, the user cannot invite *new* users
in their projects, but they can still invite team members
from one project into another project. In other words, we count
the number of unique invited users, not the number of memberships.

There was an UI bug in the "Invite a Team Member" dialog. The
dialog has an editable "Email" text field. When an user has reached
the team limit, and they open the "Invite" dialog, they could
enter a new user's email address in the Email field and try to invite
them. The server would refuse to exceed the team limit and would
return a plain HTTP 403 page. This is of course confusing to the 
end user.

The fix is to show "Email" as a text field only if the user has
not yet exceeded their team size. If they have, then show "Email"
as non-editable text.
2022-02-04 20:43:17 +02:00
Pēteris Caune
5ae85f850c
Fix JS error after copying a code snippet 2022-02-04 17:05:45 +02:00
Pēteris Caune
6539173a0f
Fix special character escaping in LINE Notify notifications 2022-02-04 15:16:56 +02:00
Pēteris Caune
d5103a8231
Disable special character escaping in Pushbullet notifications 2022-02-04 15:02:15 +02:00
Pēteris Caune
d38ebee06c
Disable HTML escaping in Spike.sh notifications 2022-02-04 14:27:02 +02:00
Pēteris Caune
b56f27e4e2
Improve PagerDuty notifications
- Include additional data in the "details" key
- Don't escape HTML characters in the "description" field

cc: #600
2022-02-04 10:36:33 +02:00
Pēteris Caune
14e77f0acc
Disable HTML escaping in Pushover notification titles
Fixes: #606
2022-02-04 10:04:07 +02:00
Pēteris Caune
e5ac8d7dbc
Update the "Add TOTP" form to display plaintext TOTP secret
Fixes: #602
2022-01-24 15:17:48 +02:00
Pēteris Caune
82663a2a52
Update Signal integration to use JSON RPC over UNIX socket 2022-01-13 18:12:33 +02:00
Pēteris Caune
24a36beb77
Update email bounce handler to mark email channels as disabled
User can re-enable a disabled email channel by editing it
(in the Integrations page, click the "Fix..." button).

Fixes: #446
2022-01-13 12:10:08 +02:00
Pēteris Caune
39db47387f
Update Telegram to treat "group chat was deleted" as permanent error 2022-01-07 16:16:24 +02:00
Pēteris Caune
731c54529c
Update CHANGELOG for v1.25.0 release 2022-01-07 12:17:22 +02:00
Pēteris Caune
d615cde23e
Update Dockerfile to avoid running "pip wheel" more than once
The problem:
- the first "pip wheel" collects a specific version of requests
- the second "pip wheel" collects the latest version of requests
- later "pip install" tries to install both and fails

The fix is to run "pip wheel" once, and it will then pick a single
version of requests that satisfies all constraints.

Fixes: #594
2022-01-05 21:35:09 +02:00
Pēteris Caune
6805d75a29
Bump the min. Python version to 3.8 (as required by Django 4) 2022-01-05 16:13:49 +02:00
Pēteris Caune
a155f40861
Upgrade to Django 4
Replace usages of pytz with zoneinfo, upgrade to cronsim==2.0,
which is compatible with zoneinfo.
2022-01-05 16:01:48 +02:00
Pēteris Caune
d15ea01077
Bump the minimal Python version from 3.6 (EOL) to 3.7 2022-01-05 14:25:07 +02:00
Pēteris Caune
7317adc7f7
Refactor transport classes, add Channel.disabled field
- Refactor transport classes to raise exceptions
  on delivery problems, instead of returning error
  message as string. Exceptions can carry extra meta
  information (see TransportError.permanent field, see
  MigrationRequiredError subclass). I considered attaching
  the extra information to strings by subclassing str, but
  using exceptions felt cleaner and less hacky.

- Add Channel.disabled field, for disabling integrations
  on permanent errors. For example, if Slack returns
  HTTP 404, we will now mark the integration as disabled
  and will not make requests to that Slack endpoint again.
2022-01-05 09:46:39 +02:00
Pēteris Caune
2cf1ed417e
Update the Slack integration to not retry when Slack returns 404 2021-12-30 18:17:53 +02:00
Pēteris Caune
d8f1659e45
Implement Telegram group to supergroup migration
Fixes: #132
2021-12-30 11:54:02 +02:00
Pēteris Caune
abb7bc7150
Add support for Telegram channels
To make this work, existing installations must re-run
the "settelegramwebhook" management command.

Fixes: #592
2021-12-28 18:50:06 +02:00
Pēteris Caune
543deb5a30
Upgrade to django-compressor 3.0 2021-12-13 09:49:41 +02:00
Pēteris Caune
1da1a02be4
Add "The following checks are also down: ..." in Signal notifications 2021-12-10 11:30:48 +02:00
Pēteris Caune
307dfbb99e
Add "The following checks are also down: ..." in Telegram notifications 2021-12-08 16:06:08 +02:00
Pēteris Caune
c7c48477df
Fix report templates to not show the "started" status 2021-12-08 09:41:49 +02:00
Pēteris Caune
7fb64c8249
Implement Pushover emergency alert cancellation when check goes up 2021-11-21 13:15:35 +02:00
Pēteris Caune
8d9a6866a4
Update CHANGELOG for the v1.24.1 release 2021-11-10 13:51:29 +02:00
Pēteris Caune
a0d3d40033
Update CHANGELOG for the v1.24.0 release 2021-11-10 12:29:47 +02:00
Pēteris Caune
9e36eb5fcc
Remove the "welcome" landing page
Redirect unauthenticated users to the sign in page
instead. Rationale:

- The content on the welcome page is what often belongs
  to a separate "marketing site". The marketing content
  is of no use on self-hosted instances, which typically
  have new signups disabled and are for internal use only
- (the real reason, let's be honest) a number of
  self-hosted instances are accessible over the public
  internet. Search engines index the nearly identical
  landing pages and see them as duplicated content.
2021-11-10 11:59:55 +02:00
Pēteris Caune
1299738f50
Add SIGTERM handling in sendreports 2021-11-07 11:05:10 +02:00
Pēteris Caune
bc2d127c27
Add SIGTERM handling in sendalerts 2021-11-06 19:54:41 +02:00
Pēteris Caune
e0d2f36928
Improve period and grace controls, allow up to 365 day periods
Fixes: #281
2021-11-04 15:44:51 +02:00
Pēteris Caune
b77c54f665
Update Dockerfile to install apprise
Fixes: #581
2021-10-25 21:55:11 +03:00
Pēteris Caune
e1f51093f1
Implement automatic api_ping and api_notification pruning
cc: #556
2021-10-21 14:35:02 +03:00
Pēteris Caune
ba3f222f37
Fix a crash in hc.api.views.pause with an int in request body
The jsonify decorator parses request payload as JSON
and puts it in request.json. The payload would normally
be a complex object, but if a client sends, let's say,
a single integer, then request.json is a python int.

The authorize decorator looks for API key first in request
headers, then in request body. It expects the request
body to be a complex object.

This commit changes adds the following validation rule in
the jsonify decorator: if request body is not empty, it
*must* parse as JSON, and the root element of the parsed
document *must* be a dict.
2021-10-20 23:06:21 +03:00
Pēteris Caune
829a39f4cf
Fix hc.api.views.ping to handle non-utf8 data in request body
Fixes: #574
2021-10-19 19:19:46 +03:00
Pēteris Caune
6158f9c539
Change outgoing webhook timeout to 10s, and change the retry logic
Previous retry logic was:
- max 3 tries
- every try times out after 5 seconds

The new retry logic is:
- max 3 tries
- every try times out after 10 seconds
- if the first two tries have used > 10 seconds, don't
  do the third try

cc: #569
2021-10-14 16:22:14 +03:00
Pēteris Caune
141d71d9fe
Switch from croniter to cronsim (vendored in hc.lib.cronsim) 2021-10-14 12:42:31 +03:00
Pēteris Caune
0056cbf058
Fix release dates in CHANGELOG 2021-10-13 12:27:23 +03:00
Pēteris Caune
30a3482d0e
Fix missing uwsgi dependencies in arm/v7 Docker image 2021-10-13 10:43:04 +03:00
Pēteris Caune
3e0ff1cf81
Update CHANGELOG for v1.23.0 release 2021-10-13 09:35:00 +03:00
Pēteris Caune
5656515830
Add 'schemaVersion' field in the shields.io endpoint
Fixes: #566
2021-10-02 13:38:45 +03:00
Pēteris Caune
5fe4a60b30
Upgrade to jQuery 3.6.0 2021-10-01 13:12:20 +03:00