Skip to content

feat: option to configure Flask listening address#439

Open
L2jLiga wants to merge 1 commit intoNeptuneHub:mainfrom
L2jLiga:patch-1
Open

feat: option to configure Flask listening address#439
L2jLiga wants to merge 1 commit intoNeptuneHub:mainfrom
L2jLiga:patch-1

Conversation

@L2jLiga
Copy link
Copy Markdown

@L2jLiga L2jLiga commented Apr 18, 2026

Added environment variable to configure gunicorn bind address, so it can be changed to [::] for IPv6-only / dual-stack environments

Copy link
Copy Markdown
Contributor

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Code Review

This pull request updates the Gunicorn bind address in supervisord.conf to support IPv6 and adds a trailing newline. Feedback suggests removing the single quotes from the bind address to prevent potential parsing errors and considering an environment variable for the bind address to ensure compatibility with systems where IPv6 is disabled.

Comment thread deployment/supervisord.conf Outdated

[program:flask]
command=/usr/local/bin/gunicorn --bind 0.0.0.0:8000 --workers 1 --threads 4 --worker-class gthread --keep-alive 5 --timeout 300 app:app
command=/usr/local/bin/gunicorn --bind '[::]:8000' --workers 1 --threads 4 --worker-class gthread --keep-alive 5 --timeout 300 app:app
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

medium

While binding to [::] is the standard way to support both IPv4 and IPv6 on modern Linux systems, there are two points to consider:

  1. Compatibility: Gunicorn will fail to start if the host system has IPv6 completely disabled at the kernel level (e.g., via ipv6.disable=1). For a more robust implementation, consider making the bind address configurable via an environment variable to allow users to revert to 0.0.0.0 if needed.
  2. Quotes: The single quotes around [::]:8000 are unnecessary in a supervisord.conf command string and might be passed literally to Gunicorn depending on the Supervisor version's parsing logic, which could lead to binding errors. It is safer to remove them.
command=/usr/local/bin/gunicorn --bind [::]:8000 --workers 1 --threads 4 --worker-class gthread --keep-alive 5 --timeout 300 app:app

Changes gunicorn bind address from IPV4-only 0.0.0.0 to  IPv4/IPv6 [::].

This chance allows to run flask properly on IPv6-only or dual-stack networks
@L2jLiga L2jLiga changed the title feat: listen on IPv4/IPv6 both feat: option to configure Flask listening address Apr 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant