Commit graph

1661 commits

Author SHA1 Message Date
Kailash Nadh
e2f24a140e Turn notifs into a special stateful global singleton package, removing clunky deps. 2025-04-05 22:45:19 +05:30
Kailash Nadh
e327ebbbdf Move all HTTP handlers directly to App and remove the redundant in-between layer. 2025-04-05 19:24:25 +05:30
Kailash Nadh
b3d46a8c85 Refactor system notification callbacks into a new notifs package. 2025-04-05 19:07:06 +05:30
Kailash Nadh
00c858fc49 Refactor all HTTP handlers and attach them to a single struct.
- Attach all HTTP handlers to a new `Handlers{}` struct.
- Remove all `handle*` function prefixes.
- Remove awkward, repetitive `app = c.Get("app").(*App)` from all handlers
  and instead, simply access it from `h.app` from `Handlers{}`

Originally proposed in #2292.
2025-04-05 15:42:35 +05:30
Kailash Nadh
007f4de850 Fix a number of cosmetic inconsistenies across handlers and functions.
- Make the beginning of handlers consistent with uniform variable declaration
  and grouping.
- Add missing comments.
- Fix staticcheck/vet warnings and idiom issues.
2025-04-05 13:41:31 +05:30
Kailash Nadh
fcf2449a70 Replace awkward auth user object access in handlers with an explicit func. 2025-04-05 00:26:05 +05:30
Kailash Nadh
17998fbff5 Refactor user auth models and permission checks.
- Move user models from `/models` to `internal/auth`.
- Move and refactor various permission check functions into `User.()`
- Refactor awkward `get, manage bool` function args into `Get|Manage` bitflags.
2025-04-05 00:19:27 +05:30
Kailash Nadh
5c785064c1 Refactor superfluous list perm check middleware into standalone function. 2025-04-04 23:29:41 +05:30
Kailash Nadh
a271bf54d5 Introduce per-campaign filter permissions. Closes #2325.
This patch introduces new `campaigns:get_all` and `campaigns:manage_all`
permissions which alter the behaviour of the the old `campaigns:get` and
`campaigns:manage` permissions. This is a subtle breaking behavioural change.

Old:

- `campaigns:get` -> View all campaigns irrespective of a user's list
  permissions.
- `campaigns:manage` -> Manage all campaigns irrespective of a user's list
  permissions.

New:

- `campaigns:get_all` -> View all campaigns irrespective of a user's list
  permissions.
- `campaigns:manage_all` -> Manage all campaigns irrespective of a user's list
  permissions.
- `campaigns:get` -> View only the campaigns that have at least one list to
  which which a user has get or manage access.
- `campaigns:manage` -> Manage only the campaigns that have at list one list
  to which a user has get or manage access.

In addition, this patch refactors and cleans up certain permission related
logic and functions.
2025-03-31 16:39:42 +05:30
Kailash Nadh
a5f8b28cb1 Fix inconsistent behaviour in campaign scheduling on the UI.
- Fix status/button state management issues when `Send at` was toggled
  under various scenarios.
- Allow paused campaigns to be edited and turned into scheduled campaigns.
- Add Cypress UI tests for unscheduling.
2025-03-31 13:00:51 +05:30
Kailash Nadh
fbc27ae4b2 Refactor UI time diff display function to prefix '-' on past dates. 2025-03-31 12:56:43 +05:30
Kailash Nadh
92e5d630ca Fix various static-check/idiom warnings. 2025-03-30 11:21:50 +05:30
Kailash Nadh
b18c7ad0fb Fix incorrect loading spinner on the Lists UI. Closes #1822. 2025-03-30 10:53:54 +05:30
dependabot[bot]
d1c964da4f
Bump vite from 5.4.12 to 5.4.15 in /frontend (#2379)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.12 to 5.4.15.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.15/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.15/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-30 00:18:23 +05:30
Kailash Nadh
b8f50eafa3 Add support for domain allowlists in addition to blocklists. Closes #2230.
This patch introduces a new `Domain allowlist` input in Settings -> Privacy UI
as a new tab alongside domain `Domain blocklist`. If any domains are entered
here, then only subscriptions/imports/additions of e-mails from those particular
domains are accepted. blocklist is mutually exclusive with allowlist when there
are values in the allowlist.
2025-03-29 23:31:34 +05:30
Kailash Nadh
6efb6e7600 Upgrade smtppool to v2 and add support for concrete SSL options. 2025-03-29 17:05:03 +05:30
Kailash Nadh
e4a18dabc3 Remove forcing unique filename on all media uploads.
This patch removes the forced suffixing of all media upload filenames with
random strings. The upload handler now checks the `media` table to ensure that
the filename being uploaded doesn't exist before forcing a suffix.

Outright rejecting duplicate filenames cannot be done to maintain backwards
compatibility with the old behaviour.

Closes #2277.
2025-03-29 15:21:32 +05:30
Kailash Nadh
ef8f31919d Remove obsolete language key and refresh i18n files. 2025-03-29 14:08:25 +05:30
Kailash Nadh
9224e344be Update i18n refresh script to remove deleted base keys from all other files. 2025-03-29 14:07:26 +05:30
Kailash Nadh
5f1b676401 Remove ASCII-only restriction on media filenames. Closes #2277. 2025-03-29 14:06:57 +05:30
Kailash Nadh
0be7a79dac Fix broken log rendering on importer UI. 2025-03-29 13:10:46 +05:30
Tamás Halasi
1b43e1a013
Add minor i18n Hungarian language pack fixes (#2375) 2025-03-28 15:45:12 +05:30
Thomerson Roncally
06c2f3b963
Add Nuxt.js module to Supported Libraries Lists (#2371) 2025-03-27 00:18:40 +05:30
Tamás Halasi
473f94272f
Add i18n Hungarian language pack fixes (#2370) 2025-03-26 23:01:03 +05:30
Fabian Schneebauer
7d3e6e615a
Fix too greedy TrackLink regex replacement. (#2355)
Co-authored-by: Fabian Schneebauer <fabian@fs-it.org>
2025-03-25 15:39:35 +05:30
Brian Smith
79f8b60e28
Updating documentation to reflect AWS Console changes (#2365) 2025-03-25 15:38:22 +05:30
Kailash Nadh
625f616705 Change the docker-compose example to bind Postgres locally. Closes #2357. 2025-03-20 11:07:06 +05:30
listumps
de9a8ea4b1
Add Bulgarian i18n translation (#2349) 2025-03-19 00:27:06 +05:30
Kailash Nadh
f310131669 Update Go version to v1.24.1 2025-03-18 20:22:44 +05:30
Kailash Nadh
d43ac10790 Tidy go.mod 2025-03-18 20:01:25 +05:30
dependabot[bot]
f34551d2c2
Bump golang.org/x/net from 0.33.0 to 0.36.0 (#2348)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.33.0 to 0.36.0.
- [Commits](https://github.com/golang/net/compare/v0.33.0...v0.36.0)

---
updated-dependencies:
- dependency-name: golang.org/x/net
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-13 10:07:47 +05:30
dependabot[bot]
2005e7a425
Bump github.com/go-jose/go-jose/v3 from 3.0.3 to 3.0.4 (#2346)
Bumps [github.com/go-jose/go-jose/v3](https://github.com/go-jose/go-jose) from 3.0.3 to 3.0.4.
- [Release notes](https://github.com/go-jose/go-jose/releases)
- [Changelog](https://github.com/go-jose/go-jose/blob/main/CHANGELOG.md)
- [Commits](https://github.com/go-jose/go-jose/compare/v3.0.3...v3.0.4)

---
updated-dependencies:
- dependency-name: github.com/go-jose/go-jose/v3
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 22:24:47 +05:30
dependabot[bot]
bc5b817554
Bump axios from 1.7.9 to 1.8.2 in /frontend (#2347)
Bumps [axios](https://github.com/axios/axios) from 1.7.9 to 1.8.2.
- [Release notes](https://github.com/axios/axios/releases)
- [Changelog](https://github.com/axios/axios/blob/v1.x/CHANGELOG.md)
- [Commits](https://github.com/axios/axios/compare/v1.7.9...v1.8.2)

---
updated-dependencies:
- dependency-name: axios
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 22:24:32 +05:30
Kailash Nadh
a9869612dc Disallow private list UUIDs on public sub endpoints. Closes #2296. 2025-03-12 22:00:35 +05:30
dependabot[bot]
8dc5bc295c
Bump prismjs from 1.29.0 to 1.30.0 in /frontend (#2345)
Bumps [prismjs](https://github.com/PrismJS/prism) from 1.29.0 to 1.30.0.
- [Release notes](https://github.com/PrismJS/prism/releases)
- [Changelog](https://github.com/PrismJS/prism/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PrismJS/prism/compare/v1.29.0...v1.30.0)

---
updated-dependencies:
- dependency-name: prismjs
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-03-12 10:53:59 +05:30
Marc Weistroff
f8d07ad9b5
Fix DELETE list documentation. (#2335) 2025-03-07 06:22:21 +05:30
Impeck
06768ba87e
Fix ru i18n lang (#2330) 2025-03-04 18:14:44 +05:30
Bo-Yi Wu
e649cf6f6c
docs: improve clarity and consistency of user-related translations (#2324)
- Update translation for "powered by" text
- Refine user-related translations for role and status labels
- Improve clarity of translations for user type and role descriptions
- Modify "username help" text for better guidance

Signed-off-by: appleboy <appleboy.tw@gmail.com>
2025-02-26 11:23:55 +05:30
Kailash Nadh
d3a417d172 Fix typo in function name. 2025-02-20 11:54:09 +05:30
Kailash Nadh
2defef3857 Refactor SMTP name to always have email- prefix for consistency. 2025-02-14 18:38:47 +05:30
Fran Quinto
24af0bc20d
Update ca.json (#2303) 2025-02-12 10:57:13 +05:30
lcd1232
d055cc5311
Add support for selecting SMTP per campaign (#2290)
This patch adds a new optional `name` field to SMTP server config on the UI.
When a name is given to an SMTP server, it's initialized as a standalone messenger
which shows up as a sub-group item under the main "email" messenger
on the campaign page.

Co-authored-by: Kailash Nadh <kailash@nadh.in>
2025-02-11 22:41:45 +05:30
candide ꘎ media
756e3915c3
Fix typos in subscribers.md (#2302)
subsriber -> subscriber
2025-02-11 09:16:49 +05:30
Matěj D.
61d7a9d2e4
Update cs-cz.json (#2293)
Fix unclear wording, where it might seem like user has unsubscribed when they confirmed the subscription.
2025-02-06 18:17:14 +05:30
Sávio Ribeiro
2f5ab4c619
Display filename and milliseconds in timestamp on the logs admin UI (#2280) 2025-02-06 11:14:24 +05:30
dependabot[bot]
ad162c259a
Bump vite from 5.4.11 to 5.4.12 in /frontend (#2268)
Bumps [vite](https://github.com/vitejs/vite/tree/HEAD/packages/vite) from 5.4.11 to 5.4.12.
- [Release notes](https://github.com/vitejs/vite/releases)
- [Changelog](https://github.com/vitejs/vite/blob/v5.4.12/packages/vite/CHANGELOG.md)
- [Commits](https://github.com/vitejs/vite/commits/v5.4.12/packages/vite)

---
updated-dependencies:
- dependency-name: vite
  dependency-type: direct:development
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-02-05 22:05:56 +05:30
vegardgithub
86f9ad051a
Add Norwegian Bokmål (no.json) i18n language pack (#2289)
Co-authored-by: Kailash Nadh <kailash@nadh.in>
2025-02-05 22:03:04 +05:30
Kunall Banerjee
d0321baf4f
fix: typo in callout under the settings page (#2283) 2025-02-04 09:21:08 +05:30
mlaht
c3069e55a9
Update Finnish translation (#2270) 2025-01-27 14:04:18 +05:30
Kailash Nadh
672d8ffb2c
Merge pull request #2269 from s-en-o/patch-1
fix(static): no matching closing anchor tag
2025-01-24 10:16:07 +05:30