From ab6ccbdfbee46fbb5c0be56b158a49b3bd21dfa8 Mon Sep 17 00:00:00 2001 From: Daste Date: Sun, 22 May 2022 02:00:28 +0200 Subject: [PATCH 1/2] README: Mention the WAKAPI_AVATAR_URL_TEMPLATE configuration variable --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index c326ae0..236c225 100644 --- a/README.md +++ b/README.md @@ -145,7 +145,7 @@ You can specify configuration options either via a config file (default: `config | `app.inactive_days` /
`WAKAPI_INACTIVE_DAYS` | `7` | Number of days after which to consider a user inactive (only for metrics) | | `app.heartbeat_max_age /`
`WAKAPI_HEARTBEAT_MAX_AGE` | `4320h` | Maximum acceptable age of a heartbeat (see [`ParseDuration`](https://pkg.go.dev/time#ParseDuration)) | | `app.custom_languages` | - | Map from file endings to language names | -| `app.avatar_url_template` | (see [`config.default.yml`](config.default.yml)) | URL template for external user avatar images (e.g. from [Dicebear](https://dicebear.com) or [Gravatar](https://gravatar.com)) | +| `app.avatar_url_template` /
`WAKAPI_AVATAR_URL_TEMPLATE` | (see [`config.default.yml`](config.default.yml)) | URL template for external user avatar images (e.g. from [Dicebear](https://dicebear.com) or [Gravatar](https://gravatar.com)) | | `server.port` /
`WAKAPI_PORT` | `3000` | Port to listen on | | `server.listen_ipv4` /
`WAKAPI_LISTEN_IPV4` | `127.0.0.1` | IPv4 network address to listen on (leave blank to disable IPv4) | | `server.listen_ipv6` /
`WAKAPI_LISTEN_IPV6` | `::1` | IPv6 network address to listen on (leave blank to disable IPv6) | From 33509beaf7cc8ed228a48a3d1bd980e0121640ad Mon Sep 17 00:00:00 2001 From: Daste Date: Sun, 22 May 2022 01:57:00 +0200 Subject: [PATCH 2/2] Enable env configuration for `AvatarURLTemplate` Added an `env:"WAKAPI_AVATAR_URL_TEMPLATE"` option for the Avatar URL Template configuration setting. I wanted to configure this on my instance, but the only way now is through the yaml config file. --- config/config.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/config/config.go b/config/config.go index 72b6b7d..572e455 100644 --- a/config/config.go +++ b/config/config.go @@ -70,7 +70,7 @@ type appConfig struct { InactiveDays int `yaml:"inactive_days" default:"7" env:"WAKAPI_INACTIVE_DAYS"` HeartbeatMaxAge string `yaml:"heartbeat_max_age" default:"4320h" env:"WAKAPI_HEARTBEAT_MAX_AGE"` CountCacheTTLMin int `yaml:"count_cache_ttl_min" default:"30" env:"WAKAPI_COUNT_CACHE_TTL_MIN"` - AvatarURLTemplate string `yaml:"avatar_url_template" default:"api/avatar/{username_hash}.svg"` + AvatarURLTemplate string `yaml:"avatar_url_template" default:"api/avatar/{username_hash}.svg" env:"WAKAPI_AVATAR_URL_TEMPLATE"` CustomLanguages map[string]string `yaml:"custom_languages"` Colors map[string]map[string]string `yaml:"-"` }