Commit Graph

819 Commits

Author SHA1 Message Date
binwiederhier
b1eb90addc Move NewPollRequestMessage 2026-02-21 18:01:36 -05:00
binwiederhier
4b6979aa89 Move model constants 2026-02-21 10:42:34 -05:00
binwiederhier
c76e39bb0e Manual updates 2026-02-21 10:36:09 -05:00
binwiederhier
07e60ba041 Merge branch 'main' into postgres-support 2026-02-21 09:59:55 -05:00
Ivan Uzkikh
2e499389fc fix(smtp): preserve <br> line breaks in HTML emails
HTML-only emails (e.g. from Synology DSM 7.3 Task Scheduler) use <br>
tags for line breaks. The existing implementation passed the raw HTML
body to bluemonday with AddSpaceWhenStrippingTag(true), which replaced
every tag including <br> with a space, causing all content to appear
on a single unreadable line.

Fix: convert <br> tags to newlines before stripping HTML, so line break
semantics are preserved in the notification body.

Resolves the gap noted in #690 ("very sub-par" HTML support).
2026-02-21 14:44:06 +01:00
binwiederhier
7c69a76345 Docs 2026-02-20 16:56:47 -05:00
binwiederhier
a28d8e7924 Update docs, manual changes 2026-02-20 16:36:41 -05:00
binwiederhier
eb6e1ac44a Docs 2026-02-20 15:57:47 -05:00
binwiederhier
a4c836b531 Refine 2026-02-20 15:36:12 -05:00
binwiederhier
e818b063f7 Fmt 2026-02-20 08:25:32 -05:00
binwiederhier
039d555689 Fix tests 2026-02-20 08:19:25 -05:00
binwiederhier
bf265449ac Docs 2026-02-19 22:38:27 -05:00
binwiederhier
4cbd80c68e Use one PG connection, add support for connection params 2026-02-19 22:34:53 -05:00
binwiederhier
305e3fc9af DB conn to 25 2026-02-19 21:36:09 -05:00
binwiederhier
9e4a48b058 Make server tests also run against postgres 2026-02-19 20:48:01 -05:00
binwiederhier
939b3d1117 Fix lint, make pipeline use psotgres 2026-02-18 21:07:31 -05:00
binwiederhier
0d1f3444f2 fmt 2026-02-18 20:48:41 -05:00
binwiederhier
2716ede6e1 Extract message cache into message/ package with model/ types
Move message cache from server/message_cache.go into a dedicated
message/ package with Store interface, SQLite and PostgreSQL
implementations. Extract shared types into model/ package.
2026-02-18 20:22:44 -05:00
binwiederhier
07c3e280bf Refactor user package to Store interface with PostgreSQL support
Extract database operations from Manager into a Store interface with
SQLite and PostgreSQL implementations using a shared commonStore.
Split SQLite migrations into store_sqlite_migrations.go, use shared
schema_version table for PostgreSQL, rename user_user/user_tier tables
to "user"/tier, and wire up database-url in CLI commands.
2026-02-16 22:39:54 -05:00
binwiederhier
4e5f95ba0c Refactor webpush store to eliminate code duplication
Consolidate SQLite and Postgres store implementations into a single
commonStore with database-specific SQL queries passed via configuration.
This eliminates ~100 lines of duplicate code while maintaining full
functionality for both backends.

Key changes:
- Move all store methods to commonStore in store.go
- Remove sqliteStore and postgresStore wrapper structs
- Refactor SQLite to use QueryRow() pattern like Postgres
- Pass database-specific queries via storeQueries struct
- Make store types unexported, only expose Store interface

All tests pass for both SQLite and PostgreSQL backends.
2026-02-16 19:53:34 -05:00
binwiederhier
a8dcecdb6d Refactor webpush store tests and add coverage
- Add SetSubscriptionUpdatedAt to Store interface, remove DB() accessor
- Rename store files to store_sqlite.go and store_postgres.go
- Use camelCase for test function names
- Add tests for upsert field updates and multi-user removal
- Use transaction in setupNewPostgresDB
- Use lowercase "excluded." in PostgreSQL upsert query
2026-02-16 18:53:12 -05:00
binwiederhier
5331437664 Unify webpush store tests across SQLite and PostgreSQL backends
Share test logic in store_test.go with thin per-backend wrappers.
Add SetSubscriptionUpdatedAt to both stores, removing the need for
raw SQL and the DB() accessor in tests.
2026-02-16 12:38:00 -05:00
binwiederhier
e432bf2886 Rename PostgreSQL table prefix from wp_ to webpush_ 2026-02-16 12:13:10 -05:00
binwiederhier
c6ab380ea4 Merge branch '1364-copy-action' 2026-02-08 20:46:54 -05:00
binwiederhier
cfdc364e3f Version API endpoint 2026-02-08 14:28:27 -05:00
binwiederhier
3f0a7b65ee Server/Web: Support "copy" action button to copy a value to the clipboard 2026-02-08 14:20:03 -05:00
binwiederhier
65050ef4dc Fix server crash (nil pointer panic) when subscriber disconnects during publish 2026-02-08 11:23:31 -05:00
binwiederhier
3647d3975c Fix panic in handleSubscribeHTTP when client disconnects during publish
Replace wlock.TryLock() with a proper Lock() + closed flag to prevent
writing to a response writer that has been cleaned up after the handler
returns. The previous TryLock approach could not guarantee the response
writer was still valid when a concurrent Publish goroutine called Flush.
2026-02-08 10:49:31 -05:00
binwiederhier
570b188a88 Support for templating the priority header 2026-02-04 09:46:09 -08:00
binwiederhier
08eaafa77b Fix log spam from http: response.WriteHeader on hijacked connection for WebSocket errors 2026-02-04 06:05:54 -08:00
Alexander Ivanov
b26546b709 chore: fix typos in server.yml config file
Signed-off-by: Alexander Ivanov <oshli.a.er@gmail.com>
2026-01-25 19:19:31 +03:00
binwiederhier
d8232e539a PWA description 2026-01-19 20:38:42 -05:00
binwiederhier
602f201bae Derp 2026-01-18 19:15:10 -05:00
binwiederhier
ac9cfbfaf4 Delete attachments 2026-01-18 16:04:42 -05:00
binwiederhier
c23d201186 Updated/cancel scheduled messages 2026-01-18 15:50:40 -05:00
binwiederhier
eddf654b96 Last fixes 2026-01-18 10:56:11 -05:00
binwiederhier
856f150958 Better 2026-01-18 10:46:15 -05:00
binwiederhier
5a1aa68ead Refine 2026-01-18 09:44:21 -05:00
binwiederhier
cc9f9c0d24 Update checker 2026-01-17 20:36:15 -05:00
binwiederhier
353fedb93f Docs, lint 2026-01-17 14:59:43 -05:00
binwiederhier
6d5cc6aeac Windows server support 2026-01-17 14:43:43 -05:00
binwiederhier
b23f6632b1 Use Go templates, update docs 2026-01-17 04:59:46 -05:00
binwiederhier
6bacf7dafc Works 2026-01-17 04:34:32 -05:00
binwiederhier
0e200b96e0 Merge branch 'main' of github.com:binwiederhier/ntfy into feature/twilio-call-format-file 2026-01-17 03:49:52 -05:00
binwiederhier
c1ee163cab Remove cache thing 2026-01-16 10:07:09 -05:00
binwiederhier
fcf57a04e1 Move event up 2026-01-16 09:36:27 -05:00
binwiederhier
2cc4bf7d28 Fix webpush stuff 2026-01-15 21:55:20 -05:00
binwiederhier
96638b516c Fix service worker handling for updating/deleting 2026-01-14 20:46:18 -05:00
binwiederhier
44f20f6b4c Add tests, fix firebase 2026-01-13 20:50:31 -05:00
binwiederhier
a3c16d81f8 Rename to clear 2026-01-13 16:31:13 -05:00