From c22e30cbdad995a4050b0b3646a75589a15d4263 Mon Sep 17 00:00:00 2001 From: itz-Jana Date: Mon, 16 Sep 2024 13:18:18 +0200 Subject: [PATCH] Implement IPv6 capability (#826) MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit * Implement IPv6 capability Enables uWSGI to listen for IPv6 requests also. This is done by defaulting to [::] as the listen address, which creates a dual stack socket, which can respond to IPv4 and IPv6 requests simultaneously. Furthermore a config option is adden to overwrite this default, if a user so desires. * Add LD_SERVER_HOST to .env.sample Additionally fix the default name of the LD_SERVER_PORT variable, which was falsely LD_HOST_PORT here. * revert .env.sample --------- Co-authored-by: Sascha Ißbrücker --- bootstrap.sh | 3 ++- docs/Options.md | 6 ++++++ 2 files changed, 8 insertions(+), 1 deletion(-) diff --git a/bootstrap.sh b/bootstrap.sh index a3d728f..24e0063 100755 --- a/bootstrap.sh +++ b/bootstrap.sh @@ -1,6 +1,7 @@ #!/usr/bin/env bash # Bootstrap script that gets executed in new Docker containers +LD_SERVER_HOST="${LD_SERVER_HOST:-[::]}" LD_SERVER_PORT="${LD_SERVER_PORT:-9090}" # Create data folder if it does not exist @@ -32,4 +33,4 @@ if [ "$LD_DISABLE_BACKGROUND_TASKS" != "True" ]; then fi # Start uwsgi server -exec uwsgi --http :$LD_SERVER_PORT uwsgi.ini +exec uwsgi --http $LD_SERVER_HOST:$LD_SERVER_PORT uwsgi.ini diff --git a/docs/Options.md b/docs/Options.md index 688e42f..817081a 100644 --- a/docs/Options.md +++ b/docs/Options.md @@ -62,6 +62,12 @@ Values: `Integer` as seconds | Default = `60` Configures the request timeout in the uwsgi application server. This can be useful if you want to import a bookmark file with a high number of bookmarks and run into request timeouts. +### `LD_SERVER_HOST` + +Values: Valid address for socket to bind to | Default = `[::]` + +Allows to set a custom host for the UWSGI server running in the container. The default creates a dual stack socket, which will respond to IPv4 and IPv6 requests. IPv4 requests are logged as IPv4-mapped IPv6 addresses, such as "::ffff:127.0.0.1". If reverting to an IPv4-only socket is desired, this can be set to "0.0.0.0". + ### `LD_SERVER_PORT` Values: Valid port number | Default = `9090`