1
0
Fork 0
mirror of https://github.com/miniflux/v2.git synced 2025-07-22 17:18:37 +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

@ -94,7 +94,7 @@ func (p *Parser) parseLines(lines []string) (err error) {
case "PORT":
port = value
case "LISTEN_ADDR":
p.opts.listenAddr = parseString(value, defaultListenAddr)
p.opts.listenAddr = parseStringList(value, []string{defaultListenAddr})
case "DATABASE_URL":
p.opts.databaseURL = parseString(value, defaultDatabaseURL)
case "DATABASE_URL_FILE":
@ -258,7 +258,7 @@ func (p *Parser) parseLines(lines []string) (err error) {
}
if port != "" {
p.opts.listenAddr = ":" + port
p.opts.listenAddr = []string{":" + port}
}
youtubeEmbedURL, err := url.Parse(p.opts.youTubeEmbedUrlOverride)
@ -339,6 +339,10 @@ func parseStringList(value string, fallback []string) []string {
for _, item := range items {
itemValue := strings.TrimSpace(item)
if itemValue == "" {
continue
}
if _, found := strMap[itemValue]; !found {
strMap[itemValue] = true
strList = append(strList, itemValue)