Prepare coreDNS for proxy tests

This commit is contained in:
Matej Bačo
2025-09-12 20:37:36 +02:00
parent cfbb6d9453
commit e508f049bf
6 changed files with 77 additions and 2 deletions
+2 -2
View File
@@ -26,8 +26,8 @@ _APP_DOMAIN=traefik
_APP_CONSOLE_DOMAIN=localhost
_APP_DOMAIN_FUNCTIONS=functions.localhost
_APP_DOMAIN_SITES=sites.localhost
_APP_DOMAIN_TARGET_CNAME=test.l
_APP_DOMAIN_TARGET_A=127.0.0.1
_APP_DOMAIN_TARGET_CNAME=cname.tests.appwrite.io
_APP_DOMAIN_TARGET_A=203.0.0.1
_APP_DOMAIN_TARGET_AAAA=::1
_APP_DOMAIN_TARGET_CAA=digicert.com
_APP_RULES_FORMAT=md5
+22
View File
@@ -89,9 +89,12 @@ services:
- ./public:/usr/src/code/public
- ./src:/usr/src/code/src
- ./dev:/usr/src/code/dev
dns:
- 172.16.238.100
depends_on:
- mariadb
- redis
- coredns
# - clamav
entrypoint:
- php
@@ -524,9 +527,12 @@ services:
image: appwrite-dev
networks:
- appwrite
dns:
- 172.16.238.100
depends_on:
- redis
- mariadb
- coredns
volumes:
- appwrite-config:/storage/config:rw
- appwrite-certificates:/storage/certificates:rw
@@ -1068,6 +1074,19 @@ services:
- appwrite
volumes:
- appwrite-redis:/data:rw
coredns: # DNS server for testing purposes (Proxy APIs)
image: coredns/coredns:1.12.4
container_name: appwrite-coredns
<<: *x-logging
command: ["-conf", "/mnt/resources/Corefile"]
ports:
- "1053:1053"
networks:
appwrite:
ipv4_address: 172.16.238.100
volumes:
- ./tests/resources/coredns:/mnt/resources:ro
# Dev Tools Start ------------------------------------------------------------------------------------------
#
@@ -1146,6 +1165,9 @@ networks:
name: gateway
appwrite:
name: appwrite
ipam:
config:
- subnet: 172.16.238.0/24
runtimes:
name: runtimes
@@ -540,4 +540,15 @@ class ProxyCustomServerTest extends Scope
$this->assertEquals(0, $rules['body']['total']);
$this->assertCount(0, $rules['body']['rules']);
}
public function testRuleVerification(): void
{
// TODO: Implement
// wrong-a-webapp.com
// webapp.com
// stage.webapp.com
// stage-wrong-cname.webapp.com
// stage-wrong-caa.webapp.com
// stage-correct-caa.webapp.com
}
}
+15
View File
@@ -0,0 +1,15 @@
# Re-use public resolver to answer unknown queries
. {
forward . 1.1.1.1
}
# Zones configuration
webapp.com {
file /mnt/resources/webapp.com.zone
}
# Zones configuration
wrong-a-webapp.com {
file /mnt/resources/wrong-a-webapp.com.zone
}
+19
View File
@@ -0,0 +1,19 @@
; Nessessary setup
$ORIGIN webapp.com.
@ IN SOA ns1.webapp.com. hostmaster.webapp.com. (2025091201 7200 3600 1209600 3600)
@ IN NS ns1.webapp.com.
ns1 IN A 127.0.0.1
; Custom DNS records
@ IN A 203.0.0.1
stage IN CNAME cname.tests.appwrite.io
; No CAA record intentionally
stage-wrong-cname IN CNAME cname-wrong.tests.appwrite.io
stage-wrong-caa IN CNAME cname.tests.appwrite.io
stage-wrong-caa IN CAA 0 issue "unknown-issuer.org"
stage-correct-caa IN CNAME cname.tests.appwrite.io
stage-correct-caa IN CAA 0 issue "digicert.com"
@@ -0,0 +1,8 @@
; Nessessary setup
$ORIGIN wrong-a-webapp.com.zone.
@ IN SOA ns1.wrong-a-webapp.com.zone. hostmaster.wrong-a-webapp.com.zone. (2025091201 7200 3600 1209600 3600)
@ IN NS ns1.wrong-a-webapp.com.zone.
ns1 IN A 127.0.0.1
; Custom DNS records
@ IN A 203.0.0.5