Commit Graph

726 Commits

Author SHA1 Message Date
binwiederhier de65d07518 Simplify(?) templating cases 2024-03-20 21:33:54 -04:00
wunter8 83356f565e
remove debug print statement 2024-03-20 10:54:41 -06:00
Hunter Kehoe 7fd5f0b29d allow large HTTP body so long as resulting message is small 2024-03-19 21:56:55 -06:00
Hunter Kehoe 867cf28080 refactor gjson parsing code 2024-03-19 20:30:24 -06:00
Hunter Kehoe b2eb5b94bd use existing message and title fields for templates 2024-03-18 20:04:40 -06:00
Hunter Kehoe df7d6baec5 add templating for title and message fields 2024-03-17 21:55:50 -06:00
binwiederhier 243123fd7e Convert duration flags, add docs 2024-03-07 12:22:35 -05:00
binwiederhier 36b33030f3 Add message-{size|delay}-limit 2024-03-07 11:53:12 -05:00
binwiederhier 17709f2fb7 Merge branch 'main' into zhzy0077-patch-1 2024-03-07 10:38:19 -05:00
binwiederhier aecf0a5f25 Remove Rate-Topics 2024-03-07 10:07:42 -05:00
binwiederhier b65044712b Fix linter 2023-11-16 21:04:49 -05:00
binwiederhier 22f48c5ad3 Change mod path 2023-11-16 20:54:58 -05:00
binwiederhier 859a4e4f79 Added another test 2023-11-16 09:58:32 -05:00
binwiederhier 7f1855ad4d It's better than nothing 2023-11-16 09:49:35 -05:00
binwiederhier b42958de9f Merge branch 'main' of github.com:binwiederhier/ntfy into html-emails 2023-11-16 06:11:00 -05:00
binwiederhier c332c132fa Fix CI 2023-10-29 20:04:37 -04:00
binwiederhier d9387dac99 Refine logic 2023-09-24 17:59:23 -04:00
zhzy0077 6a10bac017 Update template server.yml 2023-09-08 13:21:55 +08:00
Gustavo de León 85740d810b
Fix cloudflarePriorityIgnore
- Now, only if the header being processed is the "priority" header, the cloudflarePriorityIgnore function is called, solving problems with that header injected by CF
- we make the check with regex now.
2023-09-03 18:55:57 -06:00
Gustavo de León 30a913c05c
Ignore Cloudflare Priority header
With these changes, If the web request contains the new Priority header (RFC 9218), The server will ignore it and continue searching for other headers or query parameters.
2023-08-28 23:20:04 -06:00
nisbet-hubbard 4e9eeb1fa1
Add missing note on log file permissions 2023-07-12 20:24:57 +08:00
binwiederhier 68f82b9182 Fix wording in tests 2023-07-09 07:36:36 -04:00
binwiederhier 499b2fb0d6 Docs, tests 2023-07-08 15:48:08 -04:00
binwiederhier b7679c7826 Remove setting, add persistence 2023-07-08 15:14:35 -04:00
binwiederhier 43981bb675 Merge branch 'main' into markdown 2023-07-04 21:15:08 -04:00
nimbleghost dd02267f9b Disable PWA (manifest) when web push is disabled 2023-06-24 20:11:10 +02:00
binwiederhier 9aeea4d9fa Fix text 2023-06-24 13:45:29 -04:00
binwiederhier 271056a4aa The last commit 2023-06-20 21:46:09 -04:00
nimbleghost 5f6d753cb7 Remove navigation fallback for all except app root 2023-06-19 21:45:55 +02:00
nimbleghost 8211b4cc24 Fix: add v1 to navigation fallback denylist
This is required for the Stripe redirection flow
2023-06-19 21:28:40 +02:00
nimbleghost d7aacb8b24 Fix PWA for non-root web roots 2023-06-19 10:58:15 +02:00
binwiederhier dc7dd836c6 web-push-startup-queries 2023-06-18 14:20:22 -04:00
binwiederhier 88c6b4adae Rename web-push-subscriptions-file to web-push-file 2023-06-17 21:57:47 -04:00
binwiederhier 020996ea04 Minor changes 2023-06-17 21:51:04 -04:00
nimbleghost 3cd61d8278 Add web push delete test 2023-06-17 21:44:21 +02:00
nimbleghost 2d45e397a7 Add disabled web push test 2023-06-17 21:40:08 +02:00
binwiederhier ff7e894e4c Add more tests, change endpoint 2023-06-17 14:44:55 -04:00
binwiederhier 341e84f643 Limit number of webpush subscriptions per subscriber IP 2023-06-16 21:59:07 -04:00
binwiederhier c43a1166e2 Docs, mostly 2023-06-16 16:55:42 -04:00
binwiederhier 6e95d62726 Cosmetic changess 2023-06-15 22:25:05 -04:00
binwiederhier 2d0c043dfd Derp 2023-06-12 21:03:49 -04:00
binwiederhier a8def0aed2 Make allowed endpoints a list of patterns 2023-06-12 21:01:43 -04:00
binwiederhier 58992fc795 Make DELETE endpoint, add different UI description 2023-06-10 21:09:01 -04:00
binwiederhier 1abcc88fce Add subscription_topic table, change updated_at type to INT, split expire function 2023-06-09 23:17:48 -04:00
nimbleghost 4704b2a0e4 Set default TTL for web push to the cache duration 2023-06-09 11:32:44 +02:00
binwiederhier 966ffe1669 More refactor 2023-06-08 23:09:38 -04:00
binwiederhier 9d38aeb863 Docs in server.yml, schemaVersion table, refactoring 2023-06-08 21:45:52 -04:00
binwiederhier d3ac976d05 Remove web-push-(enabled|duration*), change endpoint, other cosmetic changes 2023-06-08 14:30:19 -04:00
binwiederhier 75a4b5bd88 Small refactor 2023-06-08 12:20:12 -04:00
nimbleghost 46f34ca1e3 Add push service allowlist and topic limit 2023-06-07 21:09:13 +02:00
nimbleghost 0f0074cbab Implement push subscription expiry 2023-06-07 21:09:13 +02:00
nimbleghost 47ad024ec7 Simplify web push UX and updates
- Use a single endpoint
- Use a declarative web push sync hook. This thus handles all edge cases
  that had to be manually handled before: logout, login, account sync,
  etc.
- Simplify UX: browser notifications are always enabled (unless denied),
  web push toggle only shows up if permissions are already granted.
2023-06-07 20:38:21 +02:00
nimbleghost 0c25425346 Use readJSONWithLimit for web push sub/unsub 2023-06-07 20:38:21 +02:00
nimbleghost 4648f83669 Format emojis in the service worker directly 2023-06-07 20:38:21 +02:00
nimbleghost 44913c1668 Replace if err-nil-Fatal check with require.Nil 2023-06-07 20:38:21 +02:00
binwiederhier 20c7650e51 server.yml update 2023-06-07 20:38:21 +02:00
binwiederhier e8139ad655 Move web-push-config endpoint to config.js 2023-06-07 20:38:21 +02:00
binwiederhier 9e0687e142 Random tiny changes 2023-06-07 20:38:21 +02:00
binwiederhier 7f3e4b5f47 Move stuff to server_web_push.go 2023-06-07 20:38:21 +02:00
binwiederhier 7b23158e0a Cosmetic changes 2023-06-07 20:38:21 +02:00
nimbleghost a9fef387fa Add web push tests 2023-06-07 20:38:21 +02:00
nimbleghost ff5c854192 Add PWA, service worker and Web Push
- Use new notification request/opt-in flow for push
- Implement unsubscribing
- Implement muting
- Implement emojis in title
- Add iOS specific PWA warning
- Don’t use websockets when web push is enabled
- Fix duplicate notifications
- Implement default web push setting
- Implement changing subscription type
- Implement web push subscription refresh
- Implement web push notification click
2023-06-07 20:38:20 +02:00
binwiederhier d084a415f3 Do not forward UP messages to upstream 2023-05-31 15:36:02 -04:00
binwiederhier 7d46f1eed9 Merge branch 'main' into markdown 2023-05-26 21:15:38 -04:00
binwiederhier 7812eb9d19 WIP: Markdown 2023-05-24 20:37:27 -04:00
nimbleghost e21327cec5 Add vite
Changes according to Vite defaults:

- Move index.html to root
- Replace `%PUBLIC_URL%` with plain `/`
2023-05-24 22:16:10 +02:00
binwiederhier f8a00dd411 Fix test 2023-05-23 14:24:11 -04:00
binwiederhier da06ae4485 Clarify error message for poll requests 2023-05-23 13:20:43 -04:00
binwiederhier 168ad8bf1b Support encoding any header as RFC 2047 2023-05-21 20:56:56 -04:00
binwiederhier 3b3e6ac2cd Rename twilio-from-number to twilio-phone-number 2023-05-18 13:32:27 -04:00
binwiederhier 25d3a66f91 Upstream access token 2023-05-18 13:08:10 -04:00
binwiederhier fc1087a42b The last one 2023-05-17 11:19:48 -04:00
binwiederhier 92c384374a More self-review 2023-05-17 10:58:28 -04:00
binwiederhier ac029c389e Self-review 2023-05-17 10:39:15 -04:00
binwiederhier 2c81773d01 Add call verification 2023-05-16 22:27:48 -04:00
binwiederhier 496d6e74b0 Staticcheck 2023-05-16 15:12:18 -04:00
binwiederhier 7c574d73de Cont'd Twilio stuff 2023-05-16 14:15:58 -04:00
binwiederhier deb4f24856 Cont'd, getting there 2023-05-15 22:06:43 -04:00
binwiederhier 4b9e0c5c38 Phone number verification in publishing 2023-05-15 20:42:43 -04:00
binwiederhier 69b01bc468 Merge branch 'main' into twilio 2023-05-15 20:02:51 -04:00
binwiederhier f14f0aaa26 Add tests for users, slightly change API a bit 2023-05-15 10:42:24 -04:00
binwiederhier 4f4165f46f Merge branch 'main' into access-api 2023-05-14 20:43:07 -04:00
Philipp C. Heckel 8f87e9008b
Merge pull request #728 from wunter8/attachment-filename
set attachment filename when download through browser
2023-05-14 14:15:31 -04:00
Hunter Kehoe 4fa0655438 set attachment filename when download through browser 2023-05-14 11:19:49 -06:00
binwiederhier 97fc287b78 User endpoint 2023-05-13 22:07:54 -04:00
binwiederhier 625b13280f WIP: Access API 2023-05-13 14:39:31 -04:00
binwiederhier 539ba43cd1 WIP twilio 2023-05-13 12:26:14 -04:00
Michael Manganiello 49bd6129ff Convert mailer_emoji JSON file to map
This fixes a pending TODO comment regarding inefficient tags to emojis
mapping, by requiring a full scan over emoji aliases to determine
matches.

Instead, now the JSON file is a map, with aliases as keys, and emojis as
values. The script to convert the file with Python was:

```python
import json

with open("./mailer_emoji.json", "r", encoding="utf-8") as f:
    content = json.load(f)

emoji_map = {}
for emoji in content:
    for alias in emoji["aliases"]:
        if alias in emoji_map:
            print("WARNING: Duplicate alias:", alias)
            continue
        emoji_map[alias] = str(emoji["emoji"])

sorted_emoji_map = {k: emoji_map[k] for k in sorted(emoji_map)}

with open("./mailer_emoji_map.json", "w", encoding="utf-8") as f:
    json.dump(sorted_emoji_map, f, indent=4, ensure_ascii=False)
```
2023-05-13 11:43:47 -03:00
binwiederhier cea434a57c WIP Twilio 2023-05-12 21:47:41 -04:00
binwiederhier f99159ee5b WIP calls, remove SMS 2023-05-12 20:01:12 -04:00
binwiederhier d4767caf30 Verify 2023-05-11 13:50:10 -04:00
binwiederhier a26a6be62b Merge branch 'main' into twilio 2023-05-10 14:18:55 -04:00
binwiederhier f4e6874ff0 Formatting 2023-05-09 20:57:09 -04:00
Guillaume Taquet Gasperini 5b8520b4e0 Add quoted-printable decoding to smtp server
Some e-mails are sent using quoted-printable encoding [0], resulting in
notifications with weird characters.

This commit adds support for this encoding, resulting in the following:

**Before**
```
A
=3D=3D=3D=3D=3D
B
=3D=3D=3D=3D=3D
C
```

**After**
```
A
=====
B
=====
C
```

[0] https://www.rfc-editor.org/rfc/rfc2045.html
2023-05-08 10:54:34 +02:00
binwiederhier eb0805a470 Update web app with SMS and calls stuff 2023-05-07 22:28:07 -04:00
binwiederhier f9e2d6ddcb Add limiters and database changes 2023-05-07 11:59:15 -04:00
binwiederhier 113b7c8a08 Metrics, tests 2023-05-06 14:23:48 -04:00
binwiederhier 3863357207 WIP 2023-05-05 20:14:46 -04:00
binwiederhier 1c0162c434 WIP: Twilio 2023-05-05 16:22:54 -04:00
binwiederhier c997e4911a Fix test and retry 2023-05-02 14:16:59 -04:00