Commit graph

59 commits

Author SHA1 Message Date
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
a6d55d63b1 Upgrade smtp-pool lib fixing bad conn state issues. 2024-01-04 23:44:45 +05:30
dependabot[bot]
80b2537c1d
Bump golang.org/x/crypto from 0.15.0 to 0.17.0 (#1632)
Bumps [golang.org/x/crypto](https://github.com/golang/crypto) from 0.15.0 to 0.17.0.
- [Commits](https://github.com/golang/crypto/compare/v0.15.0...v0.17.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-12-19 20:58:53 +05:30
Kailash Nadh
53eb71a83b Add 404 HTTP handlers to prevent those requests going to BasicAuth endpoints. 2023-11-25 11:53:56 +05:30
dependabot[bot]
82c74cd544
Bump golang.org/x/image from 0.6.0 to 0.10.0 (#1580)
Bumps [golang.org/x/image](https://github.com/golang/image) from 0.6.0 to 0.10.0.
- [Commits](https://github.com/golang/image/compare/v0.6.0...v0.10.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-11-11 20:33:06 +05:30
dependabot[bot]
764a052ecc
Bump golang.org/x/net from 0.8.0 to 0.17.0 (#1555)
Bumps [golang.org/x/net](https://github.com/golang/net) from 0.8.0 to 0.17.0.
- [Commits](https://github.com/golang/net/compare/v0.8.0...v0.17.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>
2023-10-15 20:42:38 +05:30
Ryan Lahfa
25513b8104
go: bump to 1.20 (#1479) 2023-08-27 13:24:47 +05:30
Kailash Nadh
e0cda4b35c Fix all pagination. Closes #1356. Closes #1357. 2023-06-03 16:19:10 +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
39a627d839 Upgrade koanf lib to fix mapstructure []byte unmarshal bug. 2023-04-12 22:00:09 +05:30
Kailash Nadh
13ad9adb8b Upgrade koanf to v2. 2023-04-10 12:45:25 +05:30
Kailash Nadh
3646e6d20a Upgrade Go package deps. 2023-03-19 22:58:38 +05:30
dependabot[bot]
7be73d59d6
Bump golang.org/x/sys from 0.0.0-20211205182925-97ca703d548d to 0.1.0 (#1212)
Bumps [golang.org/x/sys](https://github.com/golang/sys) from 0.0.0-20211205182925-97ca703d548d to 0.1.0.
- [Release notes](https://github.com/golang/sys/releases)
- [Commits](https://github.com/golang/sys/commits/v0.1.0)

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

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-02-26 11:28:04 +05:30
Kailash Nadh
274d86422c Upgrade smtp-pool lib fixing incorrect nested mail commands. 2023-01-30 23:07:53 +05:30
Kailash Nadh
4dee2e9a1b Fix per_page=all in API calls in the paginator lib.
Closes #1098.
2022-12-25 00:43:58 +05:30
Kailash Nadh
a8193d80c8 Tidy go.mod 2022-11-10 23:31:15 +05:30
Kailash Nadh
f958f3d24b Add RSS feed to the public mailing list archive. 2022-11-10 23:30:53 +05:30
Kailash Nadh
56a9836e86 Integrate paginator library in place of custom pagination function. 2022-11-10 23:30:50 +05:30
Kailash Nadh
74322cda36 Fix e-mail From/Return-Path envelope sender. Closes #908, closes #1008. 2022-11-10 00:01:24 +05:30
dependabot[bot]
db2fd9ad70
Bump github.com/labstack/echo/v4 from 4.6.1 to 4.9.0 (#962)
Bumps [github.com/labstack/echo/v4](https://github.com/labstack/echo) from 4.6.1 to 4.9.0.
- [Release notes](https://github.com/labstack/echo/releases)
- [Changelog](https://github.com/labstack/echo/blob/master/CHANGELOG.md)
- [Commits](https://github.com/labstack/echo/compare/v4.6.1...v4.9.0)

---
updated-dependencies:
- dependency-name: github.com/labstack/echo/v4
  dependency-type: direct:production
...

Signed-off-by: dependabot[bot] <support@github.com>

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2022-10-01 14:12:31 +05:30
Kailash Nadh
ee448170ef Add support for testing SMTP connections in the settings UI. 2022-07-11 19:44:44 +05:30
Joe Paul
a1df02b41c feat(postback): Add attachment, from email to postback body 2022-06-27 15:47:38 +05:30
Rohan
5dd5cb1cc3 feat: bump simples3 for digitalocean support 2022-02-22 11:30:56 +05:30
Kailash Nadh
0f6a0376da Add accurate realtime message rate counter.
The `rate` field `/api/campaigns/running/stats` returned was computed
based on the total time spent from the start of the campaign to the
current time. This meant that for large campaigns, if there were
pauses or slowdowns in between, the rate would be skewed heavily
making it useless to figure out the current send rate.

This commit introduces a realtime running rate counter in the campaign
manager that returns accurate (running) send rates for the last minute.

The `rate` field in the API now shows the live running rate and a
new `net_rate` field shows the rate from the beginning of the campaign.
2022-02-06 11:38:02 +05:30
Kailash Nadh
7955a4fa27 Fix media upload S3 IAM init blocking outside non-AWS environments.
- Update `simples3` to a version that supports IAM timeout.
- On IAM error, fall back to key/secret mode (although with empty creds)
  so that the app still starts.
2022-01-15 20:45:17 +05:30
Kailash Nadh
e1d3dd4a65 Merge branch 'master' of github.com:knadh/listmonk 2022-01-04 22:33:58 +05:30
Kailash Nadh
dd061f56d4 Add support for direct SSL/TLS (non-STARTTLS) SMTP connections.
- Add support for TLS in `smtppool` (v0.4.0) and upgrade the lib.
- Change `tls_enabled: bool` in the settings table to string
  `tls_type: STARTTLS|TLS|none` and on the settings UI.
- Add DB migrations and schema changes to apply the field change.

Closes #504.
2022-01-03 19:28:36 +05:30
Rohan
c003aec9c9 feat: switch from s3 POST to s3 put
This commit switches simples3 from issuing a POST to a PUT.

Ref #617
2021-12-29 15:13:23 +05:30
Kailash Nadh
e9709e54ee Upgrade labstack/echo webserver to major version v4.
- echo is now on v4 with major changes including a few breaking changes
- bind() behaviour is now strict. JSON / form etc. unmarshalling of
  request data need appropriate `json`, `form` tags. Missing tags for
  the public subscription page is added in this commit.
- This also closes #602.
2021-12-09 20:51:07 +05:30
Kailash Nadh
a7fa97a214 Add scanning of full bounce email body for bounce headers. Closes #492. 2021-11-10 20:47:55 +05:30
Kailash Nadh
d0f1a2700b Update Go deps. 2021-09-29 00:07:26 +05:30
Kailash Nadh
d6d1883587 Add custom S3 backend support (eg: Minio) to media uploads
- Introduce a new S3 backend URL on the settings UI
- Add DB migration to populate S3 URL for existing S3 settings
- Refactor and fix URL formatting

Closes #139
2021-08-15 16:09:00 +05:30
Kailash Nadh
1ae98699e7 Add support for bounce processing.
- Blocklist or unsubscribe subscribers based on a bounce threshold
- Add /bounces UI for viewing bounces and in the subscriber view
- Add settings UI for managing bounce settings
- Add support for scanning POP3 bounce mailboxes
- Add a generic webhook for posting custom bounces at /webhooks/bounce
- Add SES bounce webhook support at /webhooks/services/ses
- Add Sendgrid bounce webhook support at /webhooks/services/sendgrid
2021-08-14 15:35:29 +05:30
Kailash Nadh
931e467b25 Fixes campaign test messages not including unsub headers.
Campaign messages are handled by `manager` whereas test messages
were being pushed directly into a messenger skipping some campaign
related routines such as the addition of list unsub headers.

This commit exposes a new function `manager.PushCampaignMessage()`
that accepts arbitrary campaign messages that then pass through
the standard campaign message workers, thus getting the missing unsub
headers. This closes #360.

In addition, this removes the superfluous `CampaignMessage.Render()`
function which had to be mandatorily called always and makes it
implicit in `manager.NewCampaignMessage()`.
2021-05-21 23:35:08 +05:30
Kailash Nadh
1e59d53135 Add markdown support to campaign content. 2021-04-14 12:26:09 +05:30
Tamal Saha
40aaa2694d Use github.com/Masterminds/sprig/v3
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-04-11 03:00:48 -07:00
Tamal Saha
b060c751ce Bundle sprig template functions
Signed-off-by: Tamal Saha <tamal@appscode.com>
2021-04-11 15:07:10 +05:30
Kailash Nadh
b1696c0fb9 Tidy go.mod 2021-02-13 12:42:38 +05:30
Kailash Nadh
13aac1af28 Update smtppool lib adding support for Unicode in e-mail IDs 2020-10-17 23:35:03 +05:30
Kailash Nadh
6cf43ea674 Add generic HTTP postback Messenger support.
This is a major feature that builds upon the `Messenger` interface
that has been in listmonk since its inception (with SMTP as the only
messenger). This commit introduces a new Messenger implementation, an
HTTP "postback", that can post campaign messages as a standard JSON
payload to arbitrary HTTP servers. These servers can in turn push them
to FCM, SMS, or any or any such upstream, enabling listmonk to be a
generic campaign messenger for any type of communication, not just
e-mails.

Postback HTTP endpoints can be defined in settings and they can be
selected on campaigns.
2020-10-10 18:52:08 +05:30
Kailash Nadh
b822955ac9 Add BasicAuth to admin endpoints.
This removes the Nginx dependency for protecting admin pages.
BasicAuth is configured in config.toml. This is a "temporary"
setup until a full fledged auth mechanism is added.
2020-08-08 13:11:49 +05:30
Kailash Nadh
5fb7c6cfb0 Add support for automatic, idempotent DB migrations
- On boot, the app now checks if the DB version matches its
  expected version and refuses to start if there are pending
  migrations to be run.
- The new `--upgrade` flag runs data migrations from the last
  recorded migration (in the settings table) to the latest one
  in the binary.
- Migrations are DB/arbitrary logic functions in .go files in
  internal/migrations.
- All migration functions are idempotent.
2020-08-03 19:02:23 +05:30
Kailash Nadh
942eb7c3d8 Add settings UI and "hot reload" support to the app.
This is a major breaking change that moves away from having the
entire app configuration in external TOML files to settings being
in the database with a UI to update them dynamically.

The app loads all config into memory (app settings, SMTP conf)
on boot. "Hot" replacing them is complex and it's a fair tradeoff
to instead just restart the application as it is practically
instant.

A new `settings` table stores arbitrary string keys with a JSONB
value field which happens to support arbitrary types. After every
settings update, the app gracefully releases all resources
(HTTP server, DB pool, SMTP pool etc.) and restarts itself,
occupying the same PID. If there are any running campaigns, the
auto-restart doesn't happen and the user is prompted to invoke
it manually with a one-click button once all running campaigns
have been paused.
2020-07-21 00:23:57 +05:30
Kailash Nadh
18329ff052 Add TLS to SMTP config 2020-05-17 21:07:48 +05:30
Kailash Nadh
9d3ca357f6 Integrate new SMTP pool lib 2020-05-16 23:25:37 +05:30
jaredfolkins
11c7c60455 enhc: add plain text email body along with HTML, add option in
config.toml
2020-04-14 11:19:34 -07:00
Kailash Nadh
71803ab1af Add support for loading custom static files with --static-dir
- Removed duplicate copies of static files in `static/public/`
2020-03-14 21:07:14 +05:30
Kailash Nadh
83d888a30b Update and cleanup deps 2020-03-08 16:03:57 +05:30
Kailash Nadh
892d5d2a20 Remove 'govalidator' package dependecy 2020-03-08 13:03:38 +05:30
Kailash Nadh
8853809713 Refactor and cleanup initialization.
- Clean up main.go (by moving init to init.go) and improve
  composition comprehension.
- Refactor app context and init struct and field names.
- Update package dependencies in initialisation.
2020-03-08 00:06:48 +05:30