High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.
JavaScript campaigncampaign-managementemail-marketingemail-subscriptionlistmonkmailing-listnewsletternewsletter-managementnewsletter-softwareself-hostedsms-gatewaysmtptransactional-emails
Refactor config error message
Kailash Nadh275554e57e31
diff --git a/INSTALL.md b/INSTALL.mdindex 525b252a..b80b8f4a 100644--- a/INSTALL.md+++ b/INSTALL.md@@ -2,7 +2,7 @@- Run `./listmonk --new-config` to generate a sample `config.toml` and add your configuration (SMTP and Postgres DB credentials primarily).- `./listmonk --install` to setup the DB.-- Visit `http://localhost:9000`.+- Run `./listmonk` and visit `http://localhost:9000`.## Running on Dockerdiff --git a/README.md b/README.mdindex eee7321a..711819ce 100644--- a/README.md+++ b/README.md@@ -11,7 +11,7 @@ listmonk is a standalone, self-hosted, newsletter and mailing list manager. It i- Download the [latest release](https://github.com/knadh/listmonk/releases) and extract the listmonk binary somewhere.- Run `./listmonk --new-config` to generate a sample `config.toml` and add your configuration (SMTP and Postgres DB credentials primarily).- `./listmonk --install` to setup the DB.-- Visit `http://localhost:9000`.+- Run `./listmonk` and visit `http://localhost:9000`.- Since there is no user auth yet, it's best to put listmonk behind a proxy like Nginx and setup basicauth on all endpoints except for the few endpoints that need to be public. Here is a [sample nginx config](https://github.com/knadh/listmonk/wiki/Production-Nginx-config) for production use.### Running on Dockerdiff --git a/main.go b/main.goindex 80a62df3..d53bdcdc 100644--- a/main.go+++ b/main.go@@ -85,19 +85,22 @@ func init() {// Generate new config.if ok, _ := f.GetBool("new-config"); ok {if err := newConfigFile(); err != nil {- fmt.Println(err)+ logger.Println(err)os.Exit(1)}- fmt.Println("generated config.toml. Edit and run --install")+ logger.Println("generated config.toml. Edit and run --install")os.Exit(0)}// Load config files.cFiles, _ := f.GetStringSlice("config")for _, f := range cFiles {- log.Printf("reading config: %s", f)+ logger.Printf("reading config: %s", f)if err := ko.Load(file.Provider(f), toml.Parser()); err != nil {- log.Fatalf("error loadng config: %v", err)+ if os.IsNotExist(err) {+ logger.Fatal("config file not found. If there isn't one yet, run --new-config to generate one.")+ }+ logger.Fatalf("error loadng config: %v.", err)}}ko.Load(posflag.Provider(f, ".", ko), nil)