1
0

Add config options for task attachments (#125)

Add config options for task attachments

Co-authored-by: kolaente <k@knt.li>
Reviewed-on: https://kolaente.dev/vikunja/api/pulls/125
This commit is contained in:
konrad
2020-01-26 19:10:31 +00:00
parent b2b1546a8f
commit fc65052ba0
5 changed files with 41 additions and 31 deletions

View File

@ -24,13 +24,14 @@ 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"`
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"`
}
// Info is the handler to get infos about this vikunja instance
@ -42,12 +43,13 @@ type vikunjaInfos struct {
// @Router /info [get]
func Info(c echo.Context) error {
infos := vikunjaInfos{
Version: version.Version,
FrontendURL: config.ServiceFrontendurl.GetString(),
Motd: config.ServiceMotd.GetString(),
LinkSharingEnabled: config.ServiceEnableLinkSharing.GetBool(),
MaxFileSize: config.FilesMaxSize.GetString(),
RegistrationEnabled: config.ServiceEnableRegistration.GetBool(),
Version: version.Version,
FrontendURL: config.ServiceFrontendurl.GetString(),
Motd: config.ServiceMotd.GetString(),
LinkSharingEnabled: config.ServiceEnableLinkSharing.GetBool(),
MaxFileSize: config.FilesMaxSize.GetString(),
RegistrationEnabled: config.ServiceEnableRegistration.GetBool(),
TaskAttachmentsEnabled: config.ServiceEnableTaskAttachments.GetBool(),
}
if config.MigrationWunderlistEnable.GetBool() {
infos.AvailableMigrators = append(infos.AvailableMigrators, "wunderlist")