Skip to content

Commit

Permalink
Implement IPv6 capability (#826)
Browse files Browse the repository at this point in the history
* 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 <sascha.issbruecker@googlemail.com>
  • Loading branch information
itz-Jana and sissbruecker authored Sep 16, 2024
1 parent ffaaf05 commit c22e30c
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 1 deletion.
3 changes: 2 additions & 1 deletion bootstrap.sh
Original file line number Diff line number Diff line change
@@ -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
Expand Down Expand Up @@ -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
6 changes: 6 additions & 0 deletions docs/Options.md
Original file line number Diff line number Diff line change
Expand Up @@ -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`
Expand Down

0 comments on commit c22e30c

Please sign in to comment.