Add missing `root_url` to settings UI

This commit is contained in:
Kailash Nadh 2020-08-01 16:53:29 +05:30
parent 8c0804ba9f
commit e4f233e2e5
3 changed files with 9 additions and 2 deletions

View File

@ -18,6 +18,12 @@
<b-tabs type="is-boxed" :animated="false"> <b-tabs type="is-boxed" :animated="false">
<b-tab-item label="General" label-position="on-border"> <b-tab-item label="General" label-position="on-border">
<div class="items"> <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" <b-field label="Logo URL" label-position="on-border"
message="(Optional) full URL to the static logo to be displayed on message="(Optional) full URL to the static logo to be displayed on
user facing view such as the unsubscription page."> user facing view such as the unsubscription page.">

View File

@ -37,7 +37,7 @@ const (
// constants contains static, constant config values required by the app. // constants contains static, constant config values required by the app.
type constants struct { type constants struct {
RootURL string `koanf:"root"` RootURL string `koanf:"root_url"`
LogoURL string `koanf:"logo_url"` LogoURL string `koanf:"logo_url"`
FaviconURL string `koanf:"favicon_url"` FaviconURL string `koanf:"favicon_url"`
FromEmail string `koanf:"from_email"` FromEmail string `koanf:"from_email"`
@ -347,7 +347,7 @@ func initMediaStore() media.Store {
var o filesystem.Opts var o filesystem.Opts
ko.Unmarshal("upload.filesystem", &o) 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.UploadPath = filepath.Clean(o.UploadPath)
o.UploadURI = filepath.Clean(o.UploadURI) o.UploadURI = filepath.Clean(o.UploadURI)
up, err := filesystem.NewDiskStore(o) up, err := filesystem.NewDiskStore(o)

View File

@ -165,6 +165,7 @@ CREATE TABLE settings (
); );
DROP INDEX IF EXISTS idx_settings_key; CREATE INDEX idx_settings_key ON settings(key); DROP INDEX IF EXISTS idx_settings_key; CREATE INDEX idx_settings_key ON settings(key);
INSERT INTO settings (key, value) VALUES INSERT INTO settings (key, value) VALUES
('app.root_url', '"https://localhost:9000"'),
('app.favicon_url', '""'), ('app.favicon_url', '""'),
('app.from_email', '"listmonk <noreply@listmonk.yoursite.com>"'), ('app.from_email', '"listmonk <noreply@listmonk.yoursite.com>"'),
('app.logo_url', '"http://localhost:9000/public/static/logo.png"'), ('app.logo_url', '"http://localhost:9000/public/static/logo.png"'),