Skip to content

Commit 42021d3

Browse files
committed
Support IPv6 by default in Jetty
The equivalent "all" interface to `0.0.0.0` for IPv6 is `::`; this _includes_ IPv4's `0.0.0.0`. In other words, this should be fully backward compatible. Signed-off-by: Jo Vandeginste <[email protected]>
1 parent e478a5d commit 42021d3

File tree

9 files changed

+16
-16
lines changed

9 files changed

+16
-16
lines changed

docker/puppetdb/conf.d/jetty.ini

+3-3
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# IP address or hostname to listen for clear-text HTTP. To avoid resolution
33
# issues, IP addresses are recommended over hostnames.
44
# Default is `localhost`.
5-
host = 0.0.0.0
5+
host = ::
66

77
# Port to listen on for clear-text HTTP.
88
port = 8080
@@ -13,8 +13,8 @@ port = 8080
1313

1414
# IP address to listen on for HTTPS connections. Hostnames can also be used
1515
# but are not recommended to avoid DNS resolution issues. To listen on all
16-
# interfaces, use `0.0.0.0`.
17-
# ssl-host = 0.0.0.0
16+
# interfaces, use `::`.
17+
# ssl-host = ::
1818

1919
# The port to listen on for HTTPS connections
2020
# ssl-port = 8081

documentation/configure.markdown

+3-3
Original file line numberDiff line numberDiff line change
@@ -623,7 +623,7 @@ The `[jetty]` section configures HTTP for PuppetDB.
623623
Sets the IP interface to listen on for **unencrypted** HTTP
624624
traffic. If not supplied, we bind to `localhost`, which will reject
625625
connections from anywhere but the PuppetDB server itself. To listen on
626-
all available interfaces, use `0.0.0.0`.
626+
all available interfaces, use `::`.
627627

628628
To avoid DNS resolution confusion, if you wish to set this to something other than `localhost`, we reccomend using an IP address instead of a hostname.
629629

@@ -654,7 +654,7 @@ can be made at one time. Defaults to 50.
654654

655655
Sets which IP interface to listen on for **encrypted** HTTPS traffic. If
656656
not supplied, we bind to `localhost`. To listen on all available
657-
interfaces, use `0.0.0.0`.
657+
interfaces, use `::`.
658658

659659
To avoid DNS resolution confusion, if you wish to set this to something other than `localhost`, we reccomend using an IP address instead of a hostname
660660

@@ -821,7 +821,7 @@ Specifies the host or IP address for the REPL service to listen on. By
821821
default this is `127.0.0.1` only. As this is an insecure channel this
822822
is the only recommended setting for production environments.
823823

824-
If you wish to listen on all interfaces, you can specify `0.0.0.0`, for example, although this is generally not recommended for production.
824+
If you wish to listen on all interfaces, you can specify `::`, for example, although this is generally not recommended for production.
825825

826826
## `[developer]` settings
827827

documentation/load_testing_tool.markdown

+1-1
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ below.
6767

6868
* On the primary server, modify `/etc/puppetlabs/puppetdb/conf.d/jetty.ini`.
6969
In the `[jetty]` section, set either:
70-
* `host=0.0.0.0 # http access from all agents`
70+
* `host=:: # http access from all agents`
7171
* `host=<agent ip address> # access from specific agent`
7272

7373
* Install java on the agent

resources/ext/cli/ssl-setup.erb

+2-2
Original file line numberDiff line numberDiff line change
@@ -349,7 +349,7 @@ chown -R "$user:$group" "$ssl_dir"
349349
if [ -f "$jettyfile" ] ; then
350350
# Check settings are correct and fix or warn
351351
settings=(
352-
"ssl-host:0.0.0.0"
352+
"ssl-host:::"
353353
"ssl-port:8081"
354354
"ssl-key:${private_file}"
355355
"ssl-cert:${public_file}"
@@ -423,7 +423,7 @@ then
423423
echo " [jetty]"
424424
echo " #host = localhost"
425425
echo " port = 8080"
426-
echo " ssl-host = 0.0.0.0"
426+
echo " ssl-host = ::"
427427
echo " ssl-port = 8081"
428428
echo " ssl-key = ${private_file}"
429429
echo " ssl-cert = ${public_file}"

resources/ext/config/conf.d/jetty.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ port = 8080
1313

1414
# IP address to listen on for HTTPS connections. Hostnames can also be used
1515
# but are not recommended to avoid DNS resolution issues. To listen on all
16-
# interfaces, use `0.0.0.0`.
16+
# interfaces, use `::`.
1717
# ssl-host = <host>
1818

1919
# The port to listen on for HTTPS connections

resources/puppetlabs/puppetdb/benchmark/config.ini

+1-1
Original file line numberDiff line numberDiff line change
@@ -2,5 +2,5 @@
22
logging-config = resources/logback.xml
33

44
[jetty]
5-
host = 0.0.0.0
5+
host = ::
66
port = 8080

test-resources/integration-puppetdb.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,10 @@ nrepl: {
1919
}
2020

2121
jetty: {
22-
host: 0.0.0.0
22+
host: ::
2323
port: 0
2424

25-
ssl-host: 0.0.0.0
25+
ssl-host: ::
2626
ssl-port: 0 # filled out by the test harness
2727

2828
# Original settings

test-resources/puppetserver/puppetserver.conf

+2-2
Original file line numberDiff line numberDiff line change
@@ -12,9 +12,9 @@ webserver: {
1212
access-log-config: ./dev/request-logging-dev.xml
1313
client-auth: want
1414
# ssl-host controls what networks the server will accept connections from.
15-
# The default value below is '0.0.0.0', so will accept connections from
15+
# The default value below is '::', so will accept connections from
1616
# any client. For better security, you might wish to set this to 'localhost'.
17-
ssl-host: 0.0.0.0
17+
ssl-host: ::
1818
#ssl-host: localhost
1919
ssl-port: 8140
2020
}

test/puppetlabs/puppetdb/cli/services_test.clj

+1-1
Original file line numberDiff line numberDiff line change
@@ -214,7 +214,7 @@
214214
(assoc :database *db*)
215215
(assoc :jetty (merge cert-config
216216
{:ssl-port 0
217-
:ssl-host "0.0.0.0"
217+
:ssl-host "::"
218218
:ssl-protocols "TLSv1,TLSv1.1,TLSv1.2"}))
219219
(assoc-in [:puppetdb :certificate-allowlist] (str allowlist-file)))
220220
(fn []

0 commit comments

Comments
 (0)