feat: add ability to set the ipv4/ipv6 bind address for an app

This allows users to handle mulitple interfaces separately or even ensure applications remain accessible only on a local network.

Closes #3805
This commit is contained in:
Jose Diaz-Gonzalez
2019-12-19 02:23:50 -05:00
parent 38a58a17e4
commit 6b431378a1
9 changed files with 192 additions and 10 deletions

View File

@@ -107,6 +107,55 @@ assert_error_log() {
assert_failure
}
@test "(nginx-vhosts) nginx:set bind-address" {
run deploy_app
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4 127.0.0.1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv6 ::1"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-conf $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "[::1]:80;"
assert_output_contains "127.0.0.1:80;"
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv4"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:set $TEST_APP bind-address-ipv6"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:build-config $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_success
run /bin/bash -c "dokku nginx:show-conf $TEST_APP"
echo "output: $output"
echo "status: $status"
assert_output_contains "[::1]:80;" 0
assert_output_contains "127.0.0.1:80;" 0
}
@test "(nginx-vhosts) nginx:validate" {
deploy_app
run /bin/bash -c "dokku nginx:validate"