Skip to content

High performance, self-hosted, newsletter and mailing list manager with a modern dashboard. Single binary app.

Add missing `root_url` to settings UI

Kailash Nadhe4f233e2e577
diff --git a/frontend/src/views/Settings.vue b/frontend/src/views/Settings.vue
index bbea5675..0416212d 100644
--- a/frontend/src/views/Settings.vue
+++ b/frontend/src/views/Settings.vue
@@ -18,6 +18,12 @@
<b-tabs type="is-boxed" :animated="false">
<b-tab-item label="General" label-position="on-border">
<div class="items">
+ <b-field label="Root URL" label-position="on-border"
+ message="Public URL of the installation (no trailing slash).">
+ <b-input v-model="form['app.root_url']" name="app.root_url"
+ placeholder='https://listmonk.yoursite.com' :maxlength="300" />
+ </b-field>
+
<b-field label="Logo URL" label-position="on-border"
message="(Optional) full URL to the static logo to be displayed on
user facing view such as the unsubscription page.">
diff --git a/init.go b/init.go
index 68233b42..a69bc3ab 100644
--- a/init.go
+++ b/init.go
@@ -37,7 +37,7 @@ const (
// constants contains static, constant config values required by the app.
type constants struct {
- RootURL string `koanf:"root"`
+ RootURL string `koanf:"root_url"`
LogoURL string `koanf:"logo_url"`
FaviconURL string `koanf:"favicon_url"`
FromEmail string `koanf:"from_email"`
@@ -347,7 +347,7 @@ func initMediaStore() media.Store {
var o filesystem.Opts
ko.Unmarshal("upload.filesystem", &o)
- o.RootURL = ko.String("app.root")
+ o.RootURL = ko.String("app.root_url")
o.UploadPath = filepath.Clean(o.UploadPath)
o.UploadURI = filepath.Clean(o.UploadURI)
up, err := filesystem.NewDiskStore(o)
diff --git a/schema.sql b/schema.sql
index 01934bf3..a6f47798 100644
--- a/schema.sql
+++ b/schema.sql
@@ -165,6 +165,7 @@ CREATE TABLE settings (
);
DROP INDEX IF EXISTS idx_settings_key; CREATE INDEX idx_settings_key ON settings(key);
INSERT INTO settings (key, value) VALUES
+ ('app.root_url', '"https://localhost:9000"'),
('app.favicon_url', '""'),
('app.from_email', '"listmonk <[email protected]>"'),
('app.logo_url', '"http://localhost:9000/public/static/logo.png"'),