Commit graph

37 commits

Author SHA1 Message Date
Kailash Nadh
7c3ee469bd Update login credentials doc in sample config. 2024-09-16 23:00:58 +05:30
Kailash Nadh
31c5358d0e Refactor handler groups and add mising auth features like logout. 2024-09-16 23:00:58 +05:30
Kailash Nadh
5d4f1ea0ad Add optional params in DB config to accept arbitrary Postgres params. Closes #1016. 2022-12-25 16:28:19 +05:30
Kailash Nadh
0cd41ed9c4 Add comment explicitly stating that DB has to be created externally. Closes #830. 2022-07-14 10:52:41 +05:30
Caleb Maclennan
09c56da8c6
Document tidbits about listening addresses for non-sysadmin types 2021-05-07 14:44:17 +03:00
Caleb Maclennan
26a023813e
Bind to ‘localhost’ instead of ‘0.0.0.0’ by default
This is a small safety precaution to make sure the out of the box
configuration is not world routeable. Bringing this up on a public
interface with a connected database could be a security concern. Any
sysadmin worth their salt is going to test offline or by binding to
localhost only first anyway, but this gets them started on the right
foot and makes sure people don't make mistakes.

Also with the high likelihood that a proxy is going to be used for HTTPS
termination anyway, the decision to move to a public IP should be more
deliberate.
2021-05-07 12:35:22 +03:00
Caleb Maclennan
6c40e05d2d
Use ‘localhost’ as default name for database server
Using localhost instead of some random string is much more likely to
actually work out of the box. Also it's a lot easier for a sysamdmin to
'scan' for things that need changing.
2021-05-07 12:33:22 +03:00
Caleb Maclennan
708ec66d9b
Don't indent TOML keys deeper than their sections 2021-05-06 18:28:04 +03:00
Karan Sharma
ad8f290dad feat: Set default values for DB connection parameters
- Configures `max_open` and `max_idle` in default configs to `25`.
  This changes the previous behaviour of connection pooling where both the
  values were unset (from default config) and causes unbounded connection
  limit and no connection reuse.
- Configures `db.SetConnMaxLifetime` which sets the maximum time the
  connection can be reused in a pool.
- Sets `max_conn_lifetime` in default config as `5 minutes`.

Closes https://github.com/knadh/listmonk/issues/225
2020-11-17 14:34:35 +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
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
Karan Sharma
06bb719a7b feat: Add separate config for demo setup, tweak docs
This PR adds `config-demo.toml` to `Dockerfile` which uses the db host
`demo-db`. This is more suited for demo setups. For normal docker installations
the db host is changed back to `db` which is a better sane default.
Reworded `INSTALL.md` and `README.md` for more clarity on docker
installation and configuration.
2020-07-08 22:38:31 +05:30
Kailash Nadh
79dd916d09 Make DB pull batch size in campaign manager configurable 2020-07-05 19:48:39 +05:30
Kailash Nadh
24192a327f Refactor and fix media uploads.
- Fix path related issues in filesystem and S3.
- Add checks for S3 "/" path prefix.
- Add support for custom S3 domain names.
- Remove obsolete `width` and `height` columns from media table (breaking)
- Add `provider` field to media table (breaking)
2020-07-05 17:35:05 +05:30
Kailash Nadh
7a467a5a3b Add support for custom e-mail headers per SMTP server 2020-05-31 21:16:56 +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
894ede561a Add support for message throughput rate limiting 2020-04-02 18:22:27 +05:30
Kailash Nadh
21ffe5fb02 Clean up [upload] config doc 2020-04-01 19:59:41 +05:30
Kailash Nadh
9dcd716f91 Add support for SMTP 'LOGIN' auth 2020-04-01 19:56:40 +05:30
Kailash Nadh
f8a204408f Add default values to sample config URLs 2020-02-09 11:36:15 +05:30
Kailash Nadh
9a88c2ed7b Add support for custom SMTP HELO hostname (for FQDNS) 2020-02-06 15:39:43 +05:30
Kailash Nadh
047de69770 Add support for no-auth SMTPs 2020-02-05 18:09:13 +05:30
Kailash Nadh
6b6dc59067 Add max idle/open params to DB connect 2019-12-05 17:28:22 +05:30
Karan Sharma
e5c3196b31 feat: Add blobstore package
This commit introduces a `blobstore` package and refactors the existing
upload mechanism. Upload is now handled by `providers` and the two
bundled providers are `S3` and `Filesystem`. `app.Blobstore` initialises
the correct provider based on the configuration and handles `Put`,
`Delete` and `Get` operations.
2019-10-31 11:25:31 +05:30
Kailash Nadh
3fddd78ebf Refactor "unsubscribe from all" (self-blacklist) behaviour.
- Add an option to toggle allowing subscribers to blacklist themselves.
- Move the "unsubscribe from all" to the subscription management page
2019-07-21 20:45:35 +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
karan
728d1c26e7 feat: Add docker demo setup 2019-07-12 14:03:54 +05:30
Vivek R
09117426ee feat: add config to enable/disable postgres ssl mode 2019-05-27 17:16:46 +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
c24c19b120 Add admin e-mail notifications.
- Add notifications for campaign state change
- Add notifications for import state change

Related changes.
- Add a new 'templates' directory with HTML templates
- Move the static campaign template as a .tpl file into it
- Change Messenger.Push() to accept multiple recipients
- Change exhaustCampaign()'s behaviour to pass metadata to admin emails
2018-11-28 13:29:57 +05:30
Kailash Nadh
a7614ebfe8 Change sample error value to a sane number 2018-11-26 17:16:18 +05:30
Kailash Nadh
a7954df70b Add missing error key to sample config 2018-11-26 17:15:40 +05:30
Kailash Nadh
1a39ed15ec Add support for campaign error tracking and auto-pause.
When a campaign exceeds N number of message send errors, for instance
SMTP errors, it is now auto-paused until there is manual intervention.

For this, the master goroutine in runner.Run() that was synchronising
between the tick based DB scanner and subscriber fetching has been
split into two. A new queue aggregates send errors from workers
again a threshold after which the campaign is paused.
2018-11-26 16:40:51 +05:30
Kailash Nadh
ad8787cab3 Load global configuration into the frontend as a JS dict using a <script> inclusion 2018-11-02 23:33:00 +05:30
Kailash Nadh
3ab21383b1 Fresh start 2018-10-25 19:21:47 +05:30