diff --git a/assets/templates/app.tmpl b/assets/templates/app.tmpl index 1fa1e34d3..ecdac47d2 100644 --- a/assets/templates/app.tmpl +++ b/assets/templates/app.tmpl @@ -18,7 +18,10 @@ {{end}} - {{if not .config.Sponsor}}
{{ .signUp.message }}
{{end}} + {{if .config.Imprint}}
+ {{if .config.ImprintUrl}}{{ .config.Imprint }}{{else}} + {{ .config.Imprint }}{{end}} +
{{end}}
diff --git a/frontend/src/component/navigation.vue b/frontend/src/component/navigation.vue index 105112366..e1382faca 100644 --- a/frontend/src/component/navigation.vue +++ b/frontend/src/component/navigation.vue @@ -500,7 +500,10 @@ -
Browse Your Life in Pictures
+
+ {{ config.imprint }} + {{ config.imprint }} +
@@ -557,7 +560,7 @@ export default { accountInfo() { const user = this.$session.getUser(); return user.PrimaryEmail ? user.PrimaryEmail : this.$gettext("Account"); - } + }, }, created() { this.reload.subscription = Event.subscribe("dialog.reload", () => this.reload.dialog = true); diff --git a/frontend/src/css/navigation.css b/frontend/src/css/navigation.css index 9f4e32212..4437f7676 100644 --- a/frontend/src/css/navigation.css +++ b/frontend/src/css/navigation.css @@ -53,7 +53,7 @@ color: white; } -#photoprism-info { +#imprint { position: fixed; bottom: 0; left: 50%; @@ -64,7 +64,8 @@ border-radius: 5px 5px 0 0; } -#photoprism-info a { +#imprint a, +#imprint span { text-decoration: none; font-size: 12px; color: #000; diff --git a/frontend/src/css/splash.css b/frontend/src/css/splash.css index c573a0396..80fe6c4a8 100644 --- a/frontend/src/css/splash.css +++ b/frontend/src/css/splash.css @@ -148,7 +148,8 @@ text-align: center; } -#loading-info a { +#loading-info a, +#loading-info span { text-align: center; text-decoration: none; font-size: 13px; diff --git a/frontend/src/share/navigation.vue b/frontend/src/share/navigation.vue index 887f5589a..a49a41d8a 100644 --- a/frontend/src/share/navigation.vue +++ b/frontend/src/share/navigation.vue @@ -18,7 +18,7 @@ -
Shared with PhotoPrism
+
Shared with PhotoPrism
diff --git a/internal/commands/config.go b/internal/commands/config.go index e28abd2ad..140ea4a2f 100644 --- a/internal/commands/config.go +++ b/internal/commands/config.go @@ -100,6 +100,10 @@ func configAction(ctx *cli.Context) error { fmt.Printf("%-25s %s\n", "site-description", conf.SiteDescription()) fmt.Printf("%-25s %s\n", "site-preview", conf.SitePreview()) + // Legal info. + fmt.Printf("%-25s %s\n", "imprint", conf.Imprint()) + fmt.Printf("%-25s %s\n", "imprint-url", conf.ImprintUrl()) + // URIs. fmt.Printf("%-25s %s\n", "content-uri", conf.ContentUri()) fmt.Printf("%-25s %s\n", "static-uri", conf.StaticUri()) diff --git a/internal/config/client.go b/internal/config/client.go index 420b4fe15..12e8a3564 100644 --- a/internal/config/client.go +++ b/internal/config/client.go @@ -31,6 +31,8 @@ type ClientConfig struct { SiteCaption string `json:"siteCaption"` SiteDescription string `json:"siteDescription"` SitePreview string `json:"sitePreview"` + Imprint string `json:"imprint"` + ImprintUrl string `json:"imprintUrl"` AppName string `json:"appName"` AppMode string `json:"appMode"` AppIcon string `json:"appIcon"` @@ -206,6 +208,8 @@ func (c *Config) PublicConfig() ClientConfig { SiteCaption: c.SiteCaption(), SiteDescription: c.SiteDescription(), SitePreview: c.SitePreview(), + Imprint: c.Imprint(), + ImprintUrl: c.ImprintUrl(), AppName: c.AppName(), AppMode: c.AppMode(), AppIcon: c.AppIcon(), @@ -274,6 +278,8 @@ func (c *Config) GuestConfig() ClientConfig { SiteCaption: c.SiteCaption(), SiteDescription: c.SiteDescription(), SitePreview: c.SitePreview(), + Imprint: c.Imprint(), + ImprintUrl: c.ImprintUrl(), AppName: c.AppName(), AppMode: c.AppMode(), AppIcon: c.AppIcon(), @@ -337,6 +343,8 @@ func (c *Config) UserConfig() ClientConfig { SiteCaption: c.SiteCaption(), SiteDescription: c.SiteDescription(), SitePreview: c.SitePreview(), + Imprint: c.Imprint(), + ImprintUrl: c.ImprintUrl(), AppName: c.AppName(), AppMode: c.AppMode(), AppIcon: c.AppIcon(), diff --git a/internal/config/config.go b/internal/config/config.go index dc06e5b7d..26436c2c9 100644 --- a/internal/config/config.go +++ b/internal/config/config.go @@ -384,6 +384,24 @@ func (c *Config) SitePreview() string { return c.options.SitePreview } +// Imprint returns the legal info text for the page footer. +func (c *Config) Imprint() string { + if !c.Sponsor() || c.Test() { + return MsgSponsor + } + + return c.options.Imprint +} + +// ImprintUrl returns the legal info url. +func (c *Config) ImprintUrl() string { + if !c.Sponsor() || c.Test() { + return SignUpURL + } + + return c.options.ImprintUrl +} + // Debug tests if debug mode is enabled. func (c *Config) Debug() bool { return c.options.Debug diff --git a/internal/config/flags.go b/internal/config/flags.go index e58e1f43c..6bd68878e 100644 --- a/internal/config/flags.go +++ b/internal/config/flags.go @@ -98,27 +98,27 @@ var GlobalFlags = []cli.Flag{ }, cli.StringFlag{ Name: "import-path", - Usage: "optional base `PATH` from which files can be imported to originals", + Usage: "base `PATH` from which files can be imported to originals (optional)", EnvVar: "PHOTOPRISM_IMPORT_PATH", }, cli.StringFlag{ Name: "cache-path", - Usage: "optional custom cache `PATH` for sessions and thumbnail files", + Usage: "custom cache `PATH` for sessions and thumbnail files (optional)", EnvVar: "PHOTOPRISM_CACHE_PATH", }, cli.StringFlag{ Name: "sidecar-path", - Usage: "optional custom relative or absolute sidecar `PATH`", + Usage: "custom relative or absolute sidecar `PATH` (optional)", EnvVar: "PHOTOPRISM_SIDECAR_PATH", }, cli.StringFlag{ Name: "temp-path", - Usage: "optional custom temporary file `PATH`", + Usage: "custom temporary file `PATH` (optional)", EnvVar: "PHOTOPRISM_TEMP_PATH", }, cli.StringFlag{ Name: "backup-path", - Usage: "optional custom backup `PATH` for index backup files", + Usage: "custom backup `PATH` for index backup files (optional)", EnvVar: "PHOTOPRISM_BACKUP_PATH", }, cli.StringFlag{ @@ -239,24 +239,24 @@ var GlobalFlags = []cli.Flag{ }, cli.StringFlag{ Name: "app-icon", - Usage: "application `ICON` (logo, app, crisp, mint, bold)", + Usage: "web app `ICON` (logo, app, crisp, mint, bold)", EnvVar: "PHOTOPRISM_APP_ICON", }, cli.StringFlag{ Name: "app-name", - Usage: "application `NAME` when installed on a device", + Usage: "web app `NAME` when installed on a device", Value: "PhotoPrism", EnvVar: "PHOTOPRISM_APP_NAME", }, cli.StringFlag{ Name: "app-mode", - Usage: "application `MODE` (fullscreen, standalone, minimal-ui, browser)", + Usage: "web app `MODE` (fullscreen, standalone, minimal-ui, browser)", Value: "standalone", EnvVar: "PHOTOPRISM_APP_MODE", }, cli.StringFlag{ Name: "cdn-url", - Usage: "optional content delivery network `URL`", + Usage: "content delivery network `URL` (optional)", EnvVar: "PHOTOPRISM_CDN_URL", }, cli.StringFlag{ @@ -267,7 +267,7 @@ var GlobalFlags = []cli.Flag{ }, cli.StringFlag{ Name: "site-author", - Usage: "`COPYRIGHT`, artist, or owner name", + Usage: "site `OWNER`, copyright, or artist", EnvVar: "PHOTOPRISM_SITE_AUTHOR", }, cli.StringFlag{ @@ -284,14 +284,26 @@ var GlobalFlags = []cli.Flag{ }, cli.StringFlag{ Name: "site-description", - Usage: "optional site `DESCRIPTION`", + Usage: "site `DESCRIPTION` (optional)", EnvVar: "PHOTOPRISM_SITE_DESCRIPTION", }, cli.StringFlag{ Name: "site-preview", - Usage: "optional preview image `URL`", + Usage: "site preview image `URL` (optional)", EnvVar: "PHOTOPRISM_SITE_PREVIEW", }, + cli.StringFlag{ + Name: "imprint", + Usage: "legal `INFO`, displayed in the page footer", + Value: "", + EnvVar: "PHOTOPRISM_IMPRINT", + }, + cli.StringFlag{ + Name: "imprint-url", + Usage: "legal info `URL` (optional)", + Value: "", + EnvVar: "PHOTOPRISM_IMPRINT_URL", + }, cli.IntFlag{ Name: "http-port", Value: 2342, @@ -429,12 +441,12 @@ var GlobalFlags = []cli.Flag{ }, cli.StringFlag{ Name: "download-token", - Usage: "custom download URL `TOKEN` (default: random)", + Usage: "`SECRET` download URL token for originals (default: random)", EnvVar: "PHOTOPRISM_DOWNLOAD_TOKEN", }, cli.StringFlag{ Name: "preview-token", - Usage: "custom thumbnail and streaming URL `TOKEN` (default: random)", + Usage: "`SECRET` thumbnail and video streaming URL token (default: random)", EnvVar: "PHOTOPRISM_PREVIEW_TOKEN", }, cli.StringFlag{ diff --git a/internal/config/options.go b/internal/config/options.go index ccb099fe9..64f971295 100644 --- a/internal/config/options.go +++ b/internal/config/options.go @@ -88,6 +88,8 @@ type Options struct { SiteCaption string `yaml:"SiteCaption" json:"SiteCaption" flag:"site-caption"` SiteDescription string `yaml:"SiteDescription" json:"SiteDescription" flag:"site-description"` SitePreview string `yaml:"SitePreview" json:"SitePreview" flag:"site-preview"` + Imprint string `yaml:"Imprint" json:"Imprint" flag:"imprint"` + ImprintUrl string `yaml:"ImprintUrl" json:"ImprintUrl" flag:"imprint-url"` DatabaseDriver string `yaml:"DatabaseDriver" json:"-" flag:"database-driver"` DatabaseDsn string `yaml:"DatabaseDsn" json:"-" flag:"database-dsn"` DatabaseServer string `yaml:"DatabaseServer" json:"-" flag:"database-server"`