Commit graph

102 commits

Author SHA1 Message Date
Kailash Nadh
ae2a386193 Add support for "list roles".
This commit splits roles into two, user roles and list roles, both of which
are attached separately to a user.

List roles are collection of lists each with read|write permissions, while
user roles now have all permissions except for per-list ones.

This allows for easier management of roles, eliminating the need to clone and
create new roles just to adjust specific list permissions.
2024-10-13 17:03:58 +05:30
Kailash Nadh
12a6451ed0 Add list permission check to subscriber calls. 2024-10-13 17:03:55 +05:30
Kailash Nadh
1649b3b135 Fix logic for preventing sole super admin from being wrongly updated/deleted. 2024-10-13 16:59:52 +05:30
Kailash Nadh
1e875afa67 Add OIDC auth hooks (init, callback, session) and finish OIDC support. 2024-10-13 16:59:52 +05:30
Kailash Nadh
612c1d6eac Add per-list permission management to roles. 2024-10-13 16:59:52 +05:30
Kailash Nadh
474f93559f Add permission checks to admin UI to toggle visibility/functionality of components. 2024-10-13 16:59:52 +05:30
Kailash Nadh
32d5823dfe Refactor 'super' user type to a pre-defined super admin role. 2024-10-13 16:59:52 +05:30
Kailash Nadh
d4e4c5fa99 Add granular permissions and role management to backend and admin UI. 2024-10-13 16:59:51 +05:30
Kailash Nadh
2000e9fa12 Style and add OIDC logo to the login page. 2024-10-13 16:59:51 +05:30
Kailash Nadh
4997c10b97 Add user profile APIs and update UI. 2024-10-13 16:59:51 +05:30
Kailash Nadh
906e0f57b6 Refactor handler groups and add mising auth features like logout. 2024-10-13 16:59:51 +05:30
Kailash Nadh
57ac9dca4b Add public login page and auth middleware and handlers. 2024-10-13 16:59:51 +05:30
Kailash Nadh
1516bf216f Add api type user. 2024-10-13 16:59:51 +05:30
Kailash Nadh
0968e58766 Add user/password login handler. 2024-10-13 16:59:51 +05:30
Kailash Nadh
435d6d5169 Add create/add/delete user management UI and database schema. 2024-10-13 16:59:51 +05:30
Kailash Nadh
e406b2516a Add a settings UI for OIDC. 2024-10-13 16:59:50 +05:30
Bowrna
b0f3891629
Make import overwrite off by default and add warning (#2078)
* Move CSV example rendering to code to get around breaking auto-formatter.
* Improve overwrite confirmation logic.

---------

Co-authored-by: Kailash Nadh <kailash@nadh.in>
2024-10-13 16:40:36 +05:30
Bowrna
1e6e97e750
Add validation for filename with non-ASCII chars in media upload (#1973) 2024-08-05 20:08:33 +05:30
Kailash Nadh
74ef6f5033 Add a 'view' link on the lists page. Closes #1674. 2024-01-27 22:25:21 +05:30
Kailash Nadh
5a3664aee2 Add support for caching slow queries on large databases.
- Add materialized views for list -> subscriber counts, dashboard chart,
  and dashboard aggregate stats that slow down significantly on large
  databases (with millions or tens of millions of subscribers). These
  slow queries involve full table scan COUNTS().

- Add a toggle to enable caching slow results in Settings -> Performance.

- Add support for setting a cron string that crons and periodically
  refreshes aggregated stats in materialized views.

Closes #1019.
2024-01-27 15:51:12 +05:30
Kailash Nadh
d8ca26e747 Add a 'template reference' docs link next to campaign editor. Closes #1405. 2024-01-10 22:07:40 +05:30
Kailash Nadh
0d319ad9fd Add 'slug' (permalink) support for campaign archives. Closes #1394. 2024-01-09 23:34:08 +05:30
Kailash Nadh
a2629c2c31 Make all ID/UUID labels on the UI onclick -> clipboard copy. 2023-12-31 21:39:19 +05:30
Kailash Nadh
491fab38cb Update i18n language files. 2023-10-15 20:55:46 +05:30
Kailash Nadh
11f90b2f62 Fix typo in i18n S3 expiry description. 2023-09-19 13:51:26 +05:30
Kailash Nadh
2b95c88188
Add Postmark bounce webhook support (refactor #1385) (#1485)
Co-authored-by: Thomas Siebers <tom@tsiebers.de>
2023-08-31 21:27:34 +05:30
Kailash Nadh
79ff7293ea Fix broken dummy password warning on SMTP test UI. Closes #1450. 2023-08-15 20:57:58 +05:30
Kailash Nadh
ad80c716f9 Add new privacy option 'Record opt-in IP' to record IP address of optin confirmation.
- Add new 'Subscriptions' table on the subscriber list form that shows subs,
  IP, and other data.
- Add new `meta` JSONB field to `subscriber_lsts` table.

Closes #1329.
2023-07-26 23:00:32 +05:30
Kailash Nadh
a62851915c Mask passwords on the UI accurately with the actual passwords length.
This PR masks all the password fields in the UI with a pseudo dot character
retaining the rune length of the original password so that the password
fields on the UI appear to be containing the entered value as-is.

The earlier implementation would revert to a fixed length dummy password
confusing certain users and making it look like the password they entered
wasn't being saved.
2023-07-21 23:46:46 +05:30
Kailash Nadh
3b9a0f782e
Add support for file attachments on campaigns (#1341)
- Adds support for arbitrary file uploads with an admin setting to select allowed file extensions.
- Adds support for attaching media (files) to campaigns.
2023-05-18 16:55:59 +05:30
Kailash Nadh
5fc28a733c Add support for variable bounce processing actions.
- Add support for `complaint` to the SES bounce processor.
- Add support for `hard/soft` to Sendgrid bounce processor.
- Add new bounce actions `None` and `Unsubscribe`.
- Add per type (`soft/hard/complaint`) bounce rule configuration to
  admin settings UI.
- Refactor Cypress bounce tests.
2023-04-11 11:33:40 +05:30
Justin Beaty
476d5bebf2
Add support for publishing full content in public archive RSS feed body (#1262)
- Introduces a new option on the settings UI to optionally publish the full campaign body in
  public archive RSS feeds.

Closes #1033 

Co-authored-by: Kailash Nadh <kailash@nadh.in>
2023-04-08 09:39:10 +05:30
peix187
146e8e7a63
Add missing translation message in maintenance page (#1279) 2023-04-08 08:48:40 +05:30
Kailash Nadh
d6fd4ab586 Fix 'delete' -> 'clear' language on bounces UI. Closes #1072. 2023-02-26 13:19:00 +05:30
kosssi
3513988a07
[i18n] Add translation of the term Powered by (#1168) 2023-02-07 14:43:25 +05:30
Kailash Nadh
8985e5c24a
Add hCaptcha.com support to public subscription form. (#1152)
Bots easily bypass the simple `nonce` hack. This commit adds support
for the hcaptcha.com widget.

- New `Security` tab in the admin settings UI.
- Enable/disable CAPTCHA.
- Render CAPTCHA on the public subscription form.

Closes #1116.
2023-01-23 21:50:10 +05:30
Kailash Nadh
3cfbc646e3 Add support for multiple subscribers in a single transactional message call.
This patch adds new array fields on `POST /tx`: `subscriber_emails[]`, `subscriber_ids[]`.
Either of these array fields can be sent with multiple subscribers.

The individual non-array fields `subscriber_id` and `subscriber_email` are deprecated.

Closes #994.
2022-12-25 17:32:01 +05:30
Kailash Nadh
818f2c9d8e Add public archive on/off toggle to settings. 2022-11-10 23:30:53 +05:30
Kailash Nadh
438568eeb0 Add global site name setting to render name on public pages. 2022-11-10 23:30:53 +05:30
Kailash Nadh
9add728b08 WIP: Add support for publishing campaigns to publish archives. 2022-11-10 23:30:11 +05:30
Kailash Nadh
ef1f84ee7c Add new description field to lists. Closes #925. 2022-11-01 21:04:35 +05:30
Kailash Nadh
3b0083190e Add ability for subscribers to manage preferences on the unsub form.
- Ability to change name.
- Ability to unsubscribe from individual lists.
- Toggle option to enable this in Admin Settings -> Privacy.

Closes #455.
2022-10-29 15:23:28 +05:30
Kailash Nadh
6d820f4f6e Add maintenance options.
- Add new maintenance UI with options to garbage collect (delete)
  orphan subscriber and analytics records.
2022-09-03 14:58:25 +05:30
Kailash Nadh
57dbb9e5db Add explicit warning on empty password to SMTP test UI. 2022-07-30 20:42:17 +05:30
Kailash Nadh
b44d0a653a Refresh newly added i18n langauge strings. 2022-07-13 22:24:54 +05:30
Kailash Nadh
df31426566 Add button to insert HTML snippets into WYSIWYG editor. 2022-07-13 22:24:27 +05:30
Kailash Nadh
278d5bf74e Merge branch 'test-smtp' 2022-07-11 19:46:03 +05:30
Kailash Nadh
ee448170ef Add support for testing SMTP connections in the settings UI. 2022-07-11 19:44:44 +05:30
Kailash Nadh
2dcac57cba Fix tx template delete query. 2022-07-09 10:36:12 +05:30
Kailash Nadh
463e92d1e1 Add transactional (tx) messaging capability.
This commit adds a new API `POST /api/tx` that sends an ad-hoc message
to a subscriber based on a pre-defined transactional template. This is
a large commit that adds the following:

- New campaign / tx template types on the UI. tx templates have an
  additional subject field.
- New fields `type` and `subject` to the templates table.
- Refactor template CRUD operations and models.
- Refactor template func assignment in manager.
- Add pre-compiled template caching to manager runtime.
- Pre-compile all tx templates into memory on program boot to avoid
  expensive template compilation on ad-hoc tx messages.
2022-07-09 10:36:12 +05:30