Skip to content

Commit bd25e52

Browse files
committed
feat: enable ipv6 support
Enables IPv6 support for the base OS, and several services running on it (kong, pg, pgbouncer)
1 parent 4cbf385 commit bd25e52

File tree

9 files changed

+14
-24
lines changed

9 files changed

+14
-24
lines changed

amazon-arm64.pkr.hcl

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -243,7 +243,8 @@ build {
243243
"DOCKER_USER=${var.docker_user}",
244244
"DOCKER_PASSWD=${var.docker_passwd}",
245245
"DOCKER_IMAGE=${var.docker_image}",
246-
"DOCKER_IMAGE_TAG=${var.docker_image_tag}"
246+
"DOCKER_IMAGE_TAG=${var.docker_image_tag}",
247+
"POSTGRES_SUPABASE_VERSION=${var.postgres-version}"
247248
]
248249
use_env_var_file = true
249250
script = "ebssurrogate/scripts/surrogate-bootstrap.sh"

ansible/files/kong_config/kong.conf.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,4 @@ declarative_config = /etc/kong/kong.yml
44
# plugins defined in the dockerfile
55
plugins = request-transformer,cors,key-auth,http-log
66

7-
proxy_listen = 0.0.0.0:80 reuseport backlog=16384, 0.0.0.0:443 http2 ssl reuseport backlog=16834
7+
proxy_listen = 0.0.0.0:80 reuseport backlog=16384, 0.0.0.0:443 http2 ssl reuseport backlog=16834, [::]:80 reuseport backlog=16384, [::]:443 http2 ssl reuseport backlog=16384

ansible/files/pgbouncer_config/pgbouncer.ini.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -51,7 +51,7 @@ pidfile = /var/run/pgbouncer/pgbouncer.pid
5151
;;;
5252

5353
;; IP address or * which means all IPs
54-
listen_addr = 0.0.0.0
54+
listen_addr = *
5555
listen_port = 6543
5656

5757
;; Unix socket is also used for -R.

ansible/files/postgresql_config/pg_hba.conf.j2

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ host all all 10.0.0.0/8 scram-sha-256
8989
host all all 172.16.0.0/12 scram-sha-256
9090
host all all 192.168.0.0/16 scram-sha-256
9191
host all all 0.0.0.0/0 scram-sha-256
92+
93+
# IPv6 external connections
94+
host all all ::0/0 scram-sha-256

ansible/tasks/setup-system.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,7 @@
128128
copy:
129129
content: |
130130
127.0.0.1 localhost
131+
::1 localhost
131132
dest: /etc/hosts
132133
mode: 0644
133134
owner: root

docker/all-in-one/etc/kong/kong.conf

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ declarative_config = /etc/kong/kong.yml
55
plugins = request-transformer,cors,key-auth,basic-auth,http-log,ip-restriction,rate-limiting
66

77
admin_listen = off
8-
proxy_listen = 0.0.0.0:80 reuseport backlog=16384, 0.0.0.0:443 http2 ssl reuseport backlog=16834
8+
proxy_listen = 0.0.0.0:80 reuseport backlog=16384, 0.0.0.0:443 http2 ssl reuseport backlog=16834, [::]:80 reuseport backlog=16384, [::]:443 http2 ssl reuseport backlog=16348
99

1010
nginx_http_log_format = custom_log '$remote_addr - $remote_user [$time_local] "$request" $status $body_bytes_sent "$http_referer" "$http_user_agent" $request_time $request_length'
1111
nginx_http_client_body_buffer_size = 512k

docker/all-in-one/etc/pgbouncer/pgbouncer.ini

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ pidfile = /var/run/pgbouncer/pgbouncer.pid
5050
;;;
5151

5252
;; IP address or * which means all IPs
53-
listen_addr = 0.0.0.0
53+
listen_addr = *
5454
listen_port = 6543
5555

5656
;; Unix socket is also used for -R.

docker/all-in-one/etc/postgresql/pg_hba.conf

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,3 +89,6 @@ host all all 10.0.0.0/8 scram-sha-256
8989
host all all 172.16.0.0/12 scram-sha-256
9090
host all all 192.168.0.0/16 scram-sha-256
9191
host all all 0.0.0.0/0 scram-sha-256
92+
93+
# IPv6 external connections
94+
host all all ::0/0 scram-sha-256

ebssurrogate/scripts/chroot-bootstrap.sh

Lines changed: 1 addition & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -100,11 +100,6 @@ EOF
100100
localedef -i en_US -f UTF-8 en_US.UTF-8
101101
}
102102

103-
# Disable IPV6 for ufw
104-
function disable_ufw_ipv6 {
105-
sed -i 's/IPV6=yes/IPV6=no/g' /etc/default/ufw
106-
}
107-
108103
function install_packages_for_build {
109104
apt-get install -y --no-install-recommends linux-libc-dev \
110105
acl \
@@ -141,19 +136,7 @@ GRUB_DEFAULT=0
141136
GRUB_TIMEOUT=0
142137
GRUB_TIMEOUT_STYLE="hidden"
143138
GRUB_DISTRIBUTOR="Supabase postgresql"
144-
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset console=tty1 console=ttyS0 ipv6.disable=1"
145-
EOF
146-
}
147-
148-
function setup_grub_conf_amd64 {
149-
mkdir -p /etc/default/grub.d
150-
151-
cat << EOF > /etc/default/grub.d/50-aws-settings.cfg
152-
GRUB_RECORDFAIL_TIMEOUT=0
153-
GRUB_TIMEOUT=0
154-
GRUB_CMDLINE_LINUX_DEFAULT=" root=/dev/nvme0n1p2 rootfstype=ext4 rw noatime,nodiratime,discard console=tty1 console=ttyS0 ip=dhcp tsc=reliable net.ifnames=0 quiet module_blacklist=psmouse,input_leds,autofs4 ipv6.disable=1 nvme_core.io_timeout=4294967295 systemd.hostname=ubuntu ipv6.disable=1"
155-
GRUB_TERMINAL=console
156-
GRUB_DISABLE_LINUX_UUID=true
139+
GRUB_CMDLINE_LINUX_DEFAULT="nomodeset console=tty1 console=ttyS0 ipv6.disable=0"
157140
EOF
158141
}
159142

@@ -230,7 +213,6 @@ setup_hostname
230213
create_admin_account
231214
set_default_target
232215
setup_eth0_interface
233-
disable_ufw_ipv6
234216
disable_sshd_passwd_auth
235217
disable_fsck
236218
#setup_ccache

0 commit comments

Comments
 (0)