1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-08-26 18:21:01 +00:00

feat: Allow multiple listen addresses

This change implements the ability to specify multiple listen addresses.
This allows the application to listen on different interfaces or ports simultaneously,
or a combination of IP addresses and Unix sockets.

Closes #3343
This commit is contained in:
Ingmar Stein 2025-06-12 23:25:15 +02:00 committed by Frédéric Guillot
parent dc05965895
commit 8fa5041c37
7 changed files with 235 additions and 79 deletions

View file

@ -119,7 +119,7 @@ type Options struct {
databaseMinConns int
databaseConnectionLifetime int
runMigrations bool
listenAddr string
listenAddr []string
certFile string
certDomain string
certKeyFile string
@ -202,7 +202,7 @@ func NewOptions() *Options {
databaseMinConns: defaultDatabaseMinConns,
databaseConnectionLifetime: defaultDatabaseConnectionLifetime,
runMigrations: defaultRunMigrations,
listenAddr: defaultListenAddr,
listenAddr: []string{defaultListenAddr},
certFile: defaultCertFile,
certDomain: defaultCertDomain,
certKeyFile: defaultKeyFile,
@ -339,7 +339,7 @@ func (o *Options) DatabaseConnectionLifetime() time.Duration {
}
// ListenAddr returns the listen address for the HTTP server.
func (o *Options) ListenAddr() string {
func (o *Options) ListenAddr() []string {
return o.listenAddr
}
@ -740,7 +740,7 @@ func (o *Options) SortedOptions(redactSecret bool) []*Option {
"HTTP_SERVICE": o.httpService,
"INVIDIOUS_INSTANCE": o.invidiousInstance,
"KEY_FILE": o.certKeyFile,
"LISTEN_ADDR": o.listenAddr,
"LISTEN_ADDR": strings.Join(o.listenAddr, ","),
"LOG_FILE": o.logFile,
"LOG_DATE_TIME": o.logDateTime,
"LOG_FORMAT": o.logFormat,