Commit graph

23 commits

Author SHA1 Message Date
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
7f9a811897 Merge branch 'vue' 2020-07-05 15:16:28 +05:30
Kailash Nadh
feb5ba09be Add new dashboard (with new metrics) 2020-07-04 22:25:02 +05:30
Kailash Nadh
97583fe4b4 Rewrite frontend with Vue+Buevy and ditch React+Ant Design.
- antd+react was resulting in extremely clunky and unreadable
  spaghetti frontend code (primarily due to how antd is).
- Buefy is lighter by an order of magnitude, has excellent
  responsive views (especially tables) and usability.
- Vue's templating produces far more readable template code.
2020-07-04 00:12:14 +05:30
Kailash Nadh
75547b609d Refactor subscriber handlers to send opt-in mails on updation. 2020-06-24 20:30:44 +05:30
Kailash Nadh
c9fc83fb60 Fix comments 2020-05-19 23:29:58 +05:30
Kailash Nadh
f498cddc7a Add support for hosted messages and {{ MessageURL }} tpl tag. 2020-04-26 15:51:43 +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
Kailash Nadh
4faffe0d46 Refactor template name in public pages 2020-03-07 20:24:42 +05:30
Kailash Nadh
c08ca14a5b Add subscription forms 2020-03-07 20:22:01 +05:30
Kailash Nadh
afdf053288 Add 'send opt-in mail' link to subscriber modal UI 2020-02-09 17:17:58 +05:30
Kailash Nadh
871893a9d2 Add double opt-in support.
- Lists can now be marked as single | double optin.
- Insert subscribers to double opt-in lists send out a
  confirmation e-mail to the subscriber with a confirmation link.
- Add `{{ OptinURL }}` to template functions.

This is a breaking change. Adds a new field 'optin' to the lists
table and changes how campaigns behave. Campaigns on double opt-in
lists exclude subscribers who haven't explicitly confirmed subscriptions.

Changes the structure and behaviour of how notification e-mail routines,
including notif email template compilation,  notification callbacks for
campaign and bulk import completions.
2020-02-09 11:36:15 +05:30
j
f6878130a5 Fix: perPage logic in getPagination 2020-01-17 22:17:14 +05:30
Rohan Verma
712ad2d517 chore: minor refactors based on static checks
- unchecked returns fixed (most)
- remove unused constants
- remove unsed structs
- function parameters unused or incorrectly used
- removed if else chains for error checks
- use regex MustCompile instead of compile
- spell checks
- preallocate slice cap when size known
- scope issues inside range
2019-10-29 11:03:51 +05:30
Kailash Nadh
3cd8b86213 Check subscriber existence by UUID on public pages 2019-07-21 21:58:25 +05:30
Kailash Nadh
31b9690d74 Remove orphan func 2019-07-21 21:22:26 +05:30
Kailash Nadh
a060d94cb5 Move UUID validation from multiple places into a middleware func 2019-07-21 20:45:37 +05:30
Kailash Nadh
3b7902802e Add data privacy export / wipe features (aimed at GDPR compliance).
- Toggle options to enable self-service data export and wipe
  options on the public unsubscription page. Subscribers can get
  a copy of all data on them e-mailed to them as JSON, or
  instantly wipe all their data.
- Refactor "unsubscribe" pages and URIs to "subscription".
- Add export icon to subscriber admin view.
2019-07-21 19:21:23 +05:30
Kailash Nadh
fe9102120c Remove stub user features and handlers. 2019-06-26 16:22:47 +05:30
Kailash Nadh
8701cb445a Fix import and campaign page and integrate new paginated lists API 2019-05-14 22:06:14 +05:30
Kailash Nadh
5b42e8659f Fix incorrect passing of error in HTTP response 2019-03-09 13:14:53 +05:30
Kailash Nadh
7eeb813f19 Add embedding of static assets for standalone dist binary
This is a big commit that involves drastic changes to how static assets
(.sql and template files, the whole frontend bundle) are handled.
listmonk distribution should be a self-contained single binary
distribution, hence all static assets should be bundled. After
evaluating several solutions, srtkkou/zgok seemed like the best bet but
it lacked several fundamental features, namely the ability to fall back
to the local filesystem in the absence of embedded assets (for instance,
in the dev mode). Moreover, there was a lot of room for cleanup.

After a PR went unanswered, github.com/knadh/stuffbin was created. Just
like zgok, this enables arbitrary files and assets to be embedded into a
compiled Go binary that can be read during runtime. These changes
followed:

- Compress and embed all static files into the binary during
  the build (Makefile) to make it standalone and distributable
- Refactor static paths (/public/* for public facing assets,
  /frontend/* for the frontend app's assets)
- Add 'logo_url' to config
- Remove 'assets_path' from config
- Tweak yarn build to not produce symbol maps and override
  the default /static (%PUBLIC_URL%) path to /frontend
2019-01-03 16:48:47 +05:30
Kailash Nadh
3ab21383b1 Fresh start 2018-10-25 19:21:47 +05:30