Skip to content

Commit 41cc0c3

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 41cc0c3

File tree

10 files changed

+20
-20
lines changed

10 files changed

+20
-20
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

documentation/release_notes_older.markdown

+4-4
Original file line numberDiff line numberDiff line change
@@ -1541,7 +1541,7 @@ For PostgreSQL consumers this means the extra `data` key needs to be traversed t
15411541

15421542
* Retire `facts.strip_internal` (terminus). ([PDB-971](https://tickets.puppetlabs.com/browse/PDB-971))
15431543

1544-
This patch adds a `maybe_strip_internal` method to Puppet::Node::Facts::Puppetdb
1544+
This patch adds a `maybe_strip_internal` method to Puppet0.0.0.0Node::Facts::Puppetdb
15451545
that will call `Facts#strip_internal` if the method exists, but Facts#values if
15461546
not. This will allow our terminus to remain backward compatible when Puppet
15471547
retires the `strip_internal` method and the `timestamp` fact.
@@ -3075,7 +3075,7 @@ Notable improvements and fixes:
30753075
The PuppetDB API specifies that it is JSON, so we should parse it as
30763076
that and not as PSON.
30773077

3078-
Some Puppet classes (Puppet::Node and Puppet::Node::Facts) don't
3078+
Some Puppet classes (Puppet0.0.0.0Node and Puppet::Node::Facts) don't
30793079
support JSON serialization, so continue to use PSON serialization
30803080
for them. In Puppet 3.4.0+ they have methods to do seralization in
30813081
other formats than PSON though, so when support for older versions
@@ -3085,7 +3085,7 @@ Notable improvements and fixes:
30853085

30863086
This patch adds some select profiling blocks to the PuppetDB terminus code.
30873087

3088-
The profiler is provided by puppet core from Puppet::Util::Puppetdb#profile,
3088+
The profiler is provided by puppet core from Puppet0.0.0.0Util::Puppetdb#profile,
30893089
which has recently become public for our use. We provide here in our own utils
30903090
library our own wrapper implementation that can be mixed in.
30913091

@@ -3688,7 +3688,7 @@ Notable features and improvements:
36883688
cache terminus, intercepting the first save request and storing the values
36893689
in PuppetDB.
36903690

3691-
* Avoid Array#find in Puppet::Resource::Catalog::Puppetdb#find_resource (Aman Gupta)
3691+
* Avoid Array#find in Puppet0.0.0.0Resource::Catalog::Puppetdb#find_resource (Aman Gupta)
36923692

36933693
This patch provides performance improvements in the terminus, during the
36943694
synthesize_edges stage. For example, in cases with 10,000 resource (with

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)