diff --git a/config.yml.sample b/config.yml.sample index e47aa248b..3897f7dba 100644 --- a/config.yml.sample +++ b/config.yml.sample @@ -203,3 +203,9 @@ backgrounds: # It will only show in the UI if your application has been approved for Enterprise usage, therefore if # you’re in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id applicationid: + +# Legal urls +# Will be shown in the frontend if configured here +legal: + imprinturl: + privacyurl: diff --git a/docs/content/doc/setup/config.md b/docs/content/doc/setup/config.md index 285c47b24..0888d93cd 100644 --- a/docs/content/doc/setup/config.md +++ b/docs/content/doc/setup/config.md @@ -246,4 +246,10 @@ backgrounds: # It will only show in the UI if your application has been approved for Enterprise usage, therefore if # you’re in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id applicationid: + +# Legal urls +# Will be shown in the frontend if configured here +legal: + imprinturl: + privacyurl: {{< /highlight >}} diff --git a/pkg/config/config.go b/pkg/config/config.go index b7d84eade..229e01e6a 100644 --- a/pkg/config/config.go +++ b/pkg/config/config.go @@ -52,6 +52,9 @@ const ( ServiceEnableTotp Key = `service.enabletotp` ServiceSentryDsn Key = `service.sentrydsn` + LegalImprintURL Key = `legal.imprinturl` + LegalPrivacyURL Key = `legal.privacyurl` + DatabaseType Key = `database.type` DatabaseHost Key = `database.host` DatabaseUser Key = `database.user` diff --git a/pkg/routes/api/v1/info.go b/pkg/routes/api/v1/info.go index 503f28002..74b3716fc 100644 --- a/pkg/routes/api/v1/info.go +++ b/pkg/routes/api/v1/info.go @@ -26,16 +26,22 @@ import ( ) type vikunjaInfos struct { - Version string `json:"version"` - FrontendURL string `json:"frontend_url"` - Motd string `json:"motd"` - LinkSharingEnabled bool `json:"link_sharing_enabled"` - MaxFileSize string `json:"max_file_size"` - RegistrationEnabled bool `json:"registration_enabled"` - AvailableMigrators []string `json:"available_migrators"` - TaskAttachmentsEnabled bool `json:"task_attachments_enabled"` - EnabledBackgroundProviders []string `json:"enabled_background_providers"` - TotpEnabled bool `json:"totp_enabled"` + Version string `json:"version"` + FrontendURL string `json:"frontend_url"` + Motd string `json:"motd"` + LinkSharingEnabled bool `json:"link_sharing_enabled"` + MaxFileSize string `json:"max_file_size"` + RegistrationEnabled bool `json:"registration_enabled"` + AvailableMigrators []string `json:"available_migrators"` + TaskAttachmentsEnabled bool `json:"task_attachments_enabled"` + EnabledBackgroundProviders []string `json:"enabled_background_providers"` + TotpEnabled bool `json:"totp_enabled"` + Legal legalInfo `json:"legal"` +} + +type legalInfo struct { + ImprintURL string `json:"imprint_url"` + PrivacyPolicyURL string `json:"privacy_policy_url"` } // Info is the handler to get infos about this vikunja instance @@ -55,6 +61,10 @@ func Info(c echo.Context) error { RegistrationEnabled: config.ServiceEnableRegistration.GetBool(), TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(), TotpEnabled: config.ServiceEnableTotp.GetBool(), + Legal: legalInfo{ + ImprintURL: config.LegalImprintURL.GetString(), + PrivacyPolicyURL: config.LegalPrivacyURL.GetString(), + }, } // Migrators