Add option to configure legal urls
continuous-integration/drone/push Build is passing Details

This commit is contained in:
kolaente 2020-07-18 18:53:56 +02:00
parent f8d84139fa
commit 41cf73a473
Signed by: konrad
GPG Key ID: F40E70337AB24C9B
4 changed files with 35 additions and 10 deletions

View File

@ -203,3 +203,9 @@ backgrounds:
# It will only show in the UI if your application has been approved for Enterprise usage, therefore if # It will only show in the UI if your application has been approved for Enterprise usage, therefore if
# youre in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id # youre in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id
applicationid: applicationid:
# Legal urls
# Will be shown in the frontend if configured here
legal:
imprinturl:
privacyurl:

View File

@ -246,4 +246,10 @@ backgrounds:
# It will only show in the UI if your application has been approved for Enterprise usage, therefore if # It will only show in the UI if your application has been approved for Enterprise usage, therefore if
# youre in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id # youre in Demo mode, you can also find the ID in the URL at the end: https://unsplash.com/oauth/applications/:application_id
applicationid: applicationid:
# Legal urls
# Will be shown in the frontend if configured here
legal:
imprinturl:
privacyurl:
{{< /highlight >}} {{< /highlight >}}

View File

@ -52,6 +52,9 @@ const (
ServiceEnableTotp Key = `service.enabletotp` ServiceEnableTotp Key = `service.enabletotp`
ServiceSentryDsn Key = `service.sentrydsn` ServiceSentryDsn Key = `service.sentrydsn`
LegalImprintURL Key = `legal.imprinturl`
LegalPrivacyURL Key = `legal.privacyurl`
DatabaseType Key = `database.type` DatabaseType Key = `database.type`
DatabaseHost Key = `database.host` DatabaseHost Key = `database.host`
DatabaseUser Key = `database.user` DatabaseUser Key = `database.user`

View File

@ -26,16 +26,22 @@ import (
) )
type vikunjaInfos struct { type vikunjaInfos struct {
Version string `json:"version"` Version string `json:"version"`
FrontendURL string `json:"frontend_url"` FrontendURL string `json:"frontend_url"`
Motd string `json:"motd"` Motd string `json:"motd"`
LinkSharingEnabled bool `json:"link_sharing_enabled"` LinkSharingEnabled bool `json:"link_sharing_enabled"`
MaxFileSize string `json:"max_file_size"` MaxFileSize string `json:"max_file_size"`
RegistrationEnabled bool `json:"registration_enabled"` RegistrationEnabled bool `json:"registration_enabled"`
AvailableMigrators []string `json:"available_migrators"` AvailableMigrators []string `json:"available_migrators"`
TaskAttachmentsEnabled bool `json:"task_attachments_enabled"` TaskAttachmentsEnabled bool `json:"task_attachments_enabled"`
EnabledBackgroundProviders []string `json:"enabled_background_providers"` EnabledBackgroundProviders []string `json:"enabled_background_providers"`
TotpEnabled bool `json:"totp_enabled"` 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 // 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(), RegistrationEnabled: config.ServiceEnableRegistration.GetBool(),
TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(), TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(),
TotpEnabled: config.ServiceEnableTotp.GetBool(), TotpEnabled: config.ServiceEnableTotp.GetBool(),
Legal: legalInfo{
ImprintURL: config.LegalImprintURL.GetString(),
PrivacyPolicyURL: config.LegalPrivacyURL.GetString(),
},
} }
// Migrators // Migrators