Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ develop-pythontests:
# OPENWISP_TEST_OPENVPN_IMAGE is used in tests to run OpenVPN tests with the
# latest locally built image rather than the image published in the registries.
OPENWISP_TEST_OPENVPN_IMAGE=$(IMAGE_PREFIX)/openwisp-openvpn:$(OPENWISP_VERSION) \
OPENWISP_TEST_FREERADIUS_IMAGE=$(IMAGE_PREFIX)/openwisp-freeradius:$(OPENWISP_VERSION) \
python3 tests/runtests.py

# Development
Expand Down
5 changes: 5 additions & 0 deletions deploy/auto-install.sh
Original file line number Diff line number Diff line change
Expand Up @@ -223,6 +223,11 @@ setup_docker_openwisp() {
}

upgrade_docker_openwisp() {
local compose_version
if ! compose_version=$(docker compose version --short 2>>"$LOG_FILE") ||
! dpkg --compare-versions "${compose_version#v}" ge 2.33.1; then
error_msg "Docker Compose 2.33.1 or later is required. Upgrade the Docker Compose plugin and retry."
fi
echo -e ${GRN}"\nOpenWISP Configuration:"${NON}
get_version_from_user
echo ""
Expand Down
16 changes: 16 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -134,6 +134,8 @@ services:
dockerfile: openwisp_nginx/Dockerfile
env_file:
- .env
environment:
INGRESS_IPV6_ENABLED: ${INGRESS_IPV6_ENABLED:-false}
volumes:
- openwisp_static:/opt/openwisp/public/static:ro
- openwisp_media:/opt/openwisp/public/media:ro
Expand All @@ -145,6 +147,8 @@ services:
aliases:
- dashboard.internal
- api.internal
ingress:
gw_priority: 1
Comment thread
coderabbitai[bot] marked this conversation as resolved.
Resolved
ports:
- "${NGINX_PORT:-80}:80"
- "${NGINX_SSL_PORT:-443}:443"
Expand All @@ -161,6 +165,12 @@ services:
dockerfile: openwisp_freeradius/Dockerfile
env_file:
- .env
environment:
INGRESS_IPV6_ENABLED: ${INGRESS_IPV6_ENABLED:-false}
networks:
default: {}
ingress:
gw_priority: 1
ports:
- "1812:1812/udp"
- "1813:1813/udp"
Expand Down Expand Up @@ -190,6 +200,10 @@ services:
- "1194:1194/udp"
env_file:
- .env
networks:
default: {}
ingress:
gw_priority: 1
depends_on:
- postgres
cap_add:
Expand Down Expand Up @@ -241,6 +255,8 @@ volumes:
openwisp_private_storage: {}

networks:
ingress:
enable_ipv6: ${INGRESS_IPV6_ENABLED:-false}
default:
ipam:
config:
Expand Down
5 changes: 5 additions & 0 deletions docs/user/architecture.rst
Original file line number Diff line number Diff line change
Expand Up @@ -42,3 +42,8 @@ repository.
server, but openwisp-api & openwisp-dashboard use it as a base.
- **Redis**: data caching service (required for actions like login).
- **PostgreSQL**: SQL database container for OpenWISP.

The Compose deployment connects Nginx, OpenVPN and FreeRADIUS to a shared
ingress network as well as the IPv4 backend network. The ingress network
supports IPv6 when enabled. Published ports use the ingress network, while
the other services remain on the backend network.
10 changes: 10 additions & 0 deletions docs/user/quickstart.rst
Original file line number Diff line number Diff line change
Expand Up @@ -105,6 +105,10 @@ To upgrade an installation in a custom directory, pass its path to the

sudo bash auto-install.sh --upgrade /srv/openwisp

The upgrade requires Docker Compose 2.33.1 or later. If Compose is missing
or older, the script stops before replacing the existing installation.
Upgrade the Docker Compose plugin, then run the upgrade command again.

.. note::

- If you're having any installation issues with the ``latest``
Expand All @@ -119,6 +123,12 @@ Using Docker Compose
This setup is suitable for single-server setup requirements. It is quicker
and requires less prior knowledge about OpenWISP & networking.

The Compose deployment requires Docker Engine 28 or later and Docker
Compose 2.33.1 or later. To enable IPv6 on the ingress network, set
``INGRESS_IPV6_ENABLED=true`` in ``.env`` before starting the deployment.
Public IPv6 access also requires a host IPv6 address and firewall rules
for the published ports. Hostname-based access requires DNS AAAA records.

1. Install requirements:

.. code-block:: bash
Expand Down
28 changes: 26 additions & 2 deletions docs/user/settings.rst
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,24 @@ Essential
You will need to adapt these values to get the docker images working
properly on your system.

``INGRESS_IPV6_ENABLED``
~~~~~~~~~~~~~~~~~~~~~~~~

- **Explanation:** Enables IPv6 on the shared ingress network and the
default Nginx and FreeRADIUS IPv6 listeners.
- **Valid Values:** ``true``, ``false``.
- **Default:** ``false``.

Docker allocates the IPv6 subnet automatically from its configured address
pool, or from a generated Unique Local Address (ULA) pool. Clients connect
to the host's public IPv6 address, not the container's ULA address. The
host must have IPv6 connectivity and allow the relevant published ports.

When ``NGINX_CUSTOM_FILE=True``, configure IPv6 listeners in your custom
Nginx configuration instead. Explicit values for ``NGINX_IP6_STRING`` and
``NGINX_IP6_80_STRING`` take precedence over the generated defaults,
including empty values that disable the corresponding listeners.

.. _openwisp_version:

``OPENWISP_VERSION``
Expand Down Expand Up @@ -874,15 +892,21 @@ Nginx
- **Explanation:** Nginx listen on IPv6 for SSL connection. You can either
enter a valid nginx statement or leave this value empty.
- **Valid Values:** ``listen [::]:443 ssl http2;`` or empty string.
- **Default:** ``""`` (empty string).
- **Default:** ``listen [::]:443 ssl http2;`` when ingress IPv6 is
enabled, otherwise ``""``. The HTTP/2 option follows ``NGINX_HTTP2``.

``NGINX_IP6_80_STRING``
~~~~~~~~~~~~~~~~~~~~~~~

- **Explanation:** Nginx listen on IPv6 connection. You can either enter a
valid nginx statement or leave this value empty.
- **Valid Values:** ``listen [::]:80;`` or empty string.
- **Default:** ``""`` (empty string).
- **Default:** ``listen [::]:80;`` when ingress IPv6 is enabled, otherwise
``""``.

For both Nginx IPv6 listener settings, explicitly setting an empty value
disables that listener even when ``INGRESS_IPV6_ENABLED=true``. Nonempty
values are preserved regardless of ``INGRESS_IPV6_ENABLED``.

``NGINX_ADMIN_ALLOW_NETWORK``
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Expand Down
2 changes: 2 additions & 0 deletions images/common/init_command.sh
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ elif [ "$MODULE_NAME" = 'postfix' ]; then
rsyslogd -n
elif [ "$MODULE_NAME" = 'freeradius' ]; then
wait_nginx_services
configure_freeradius_ipv6
if [ "$FREERADIUS_DEBUG_MODE" = 'True' ]; then
source docker-entrypoint.sh -X
else
Expand Down Expand Up @@ -54,6 +55,7 @@ elif [ "$MODULE_NAME" = 'nginx' ]; then
if [ "$NGINX_CUSTOM_FILE" = 'True' ]; then
exec nginx -g 'daemon off;'
fi
configure_nginx_ipv6
# Expand escape sequences in the optional events block so it can be injected
# correctly into the nginx configuration template.
NGINX_EVENTS_BLOCK=$(printf "%b" "${NGINX_EVENTS_BLOCK:-}")
Expand Down
20 changes: 20 additions & 0 deletions images/common/utils.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,26 @@ init_conf() {
default_psql_vars
}

configure_nginx_ipv6() {
if [ "${INGRESS_IPV6_ENABLED:-false}" = true ]; then
NGINX_IP6_80_STRING=${NGINX_IP6_80_STRING-'listen [::]:80;'}
NGINX_IP6_STRING=${NGINX_IP6_STRING-"listen [::]:443 ssl ${NGINX_HTTP2-http2};"}
else
NGINX_IP6_80_STRING=${NGINX_IP6_80_STRING-}
NGINX_IP6_STRING=${NGINX_IP6_STRING-}
fi
export NGINX_IP6_80_STRING NGINX_IP6_STRING
}

configure_freeradius_ipv6() {
if [ "${INGRESS_IPV6_ENABLED:-false}" = true ]; then
cp /etc/raddb/ipv6-listeners.template /etc/raddb/ipv6-listeners.conf
else
# Keep the included file present but remove any IPv6 listeners.
: >/etc/raddb/ipv6-listeners.conf
fi
}

is_dev_mode() {
# DEV_MODE treats case-insensitive "true" and "yes" values as enabled.
case "${DEV_MODE:-False}" in
Expand Down
11 changes: 11 additions & 0 deletions images/openwisp_freeradius/raddb/ipv6-listeners.template
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
listen {
type = auth
ipv6addr = ::
port = 1812
}

listen {
type = acct
ipv6addr = ::
port = 1813
}
1 change: 1 addition & 0 deletions images/openwisp_freeradius/raddb/sites-enabled/default
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
server default {
$INCLUDE ${confdir}/ipv6-listeners.conf
listen {
type = auth
ipaddr = *
Expand Down
2 changes: 0 additions & 2 deletions images/openwisp_nginx/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -122,8 +122,6 @@ ENV MODULE_NAME=nginx \
NGINX_HTTPS_ALLOWED_IPS=all \
NGINX_SERVER_NAME_HASH_BUCKET=32 \
NGINX_SSL_CONFIG='' \
NGINX_IP6_STRING='' \
NGINX_IP6_80_STRING='' \
NGINX_80_CONFIG='' \
NGINX_GZIP_SWITCH=on \
NGINX_GZIP_LEVEL=6 \
Expand Down
Loading
Loading