Merge pull request #1256 from bunkerity/dev

chore: Tweak environment variables in example tests
This commit is contained in:
Théophile Diot 2024-06-07 13:21:56 +01:00 committed by GitHub
commit be7a85203f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 12 additions and 2 deletions

View file

@ -56,6 +56,10 @@ class AutoconfTest(Test):
if "AUTO_LETS_ENCRYPT=yes" not in data["services"]["bunkerweb"]["environment"]:
data["services"]["bunkerweb"]["environment"].append("AUTO_LETS_ENCRYPT=yes")
data["services"]["bunkerweb"]["environment"].append("USE_LETS_ENCRYPT_STAGING=yes")
data["services"]["bunkerweb"]["environment"].append("LOG_LEVEL=info")
data["services"]["bunkerweb"]["environment"].append("USE_BUNKERNET=no")
data["services"]["bunkerweb"]["environment"].append("SEND_ANONYMOUS_REPORT=no")
data["services"]["bunkerweb"]["environment"].append("USE_DNSBL=no")
with open(compose, "w") as f:
f.write(dump(data))
proc = run(

View file

@ -54,7 +54,7 @@ class DockerTest(Test):
Test.replace_in_file(
compose,
r"AUTO_LETS_ENCRYPT=yes",
"AUTO_LETS_ENCRYPT=yes\n - USE_LETS_ENCRYPT_STAGING=yes\n - LOG_LEVEL=info",
"AUTO_LETS_ENCRYPT=yes\n - USE_LETS_ENCRYPT_STAGING=yes\n - LOG_LEVEL=info\n - USE_BUNKERNET=no\n - SEND_ANONYMOUS_REPORT=no\n - USE_DNSBL=no",
)
Test.replace_in_file(compose, r"DISABLE_DEFAULT_SERVER=yes", "DISABLE_DEFAULT_SERVER=no")
for ex_domain, test_domain in self._domains.items():

View file

@ -33,6 +33,9 @@ class KubernetesTest(Test):
"REAL_IP_FROM": "100.64.0.0/10 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8",
"REAL_IP_HEADER": "proxy_protocol",
"LOG_LEVEL": "info",
"USE_BUNKERNET": "no",
"SEND_ANONYMOUS_REPORT": "no",
"USE_DNSBL": "no",
}
replace_env = {"API_WHITELIST_IP": "127.0.0.1/8 100.64.0.0/10 192.168.0.0/16 172.16.0.0/12 10.0.0.0/8"}
for yaml in data:

View file

@ -115,7 +115,7 @@ class LinuxTest(Test):
raise Exception("docker exec cp variables.env failed (test)")
proc = self.docker_exec(
self.__distro,
"echo '' >> /etc/bunkerweb/variables.env ; echo 'USE_LETS_ENCRYPT_STAGING=yes' >> /etc/bunkerweb/variables.env ; echo 'LOG_LEVEL=info' >> /etc/bunkerweb/variables.env",
"echo '' >> /etc/bunkerweb/variables.env ; echo 'USE_LETS_ENCRYPT_STAGING=yes' >> /etc/bunkerweb/variables.env ; echo 'LOG_LEVEL=info' >> /etc/bunkerweb/variables.env ; echo 'USE_BUNKERNET=no' >> /etc/bunkerweb/variables.env ; echo 'SEND_ANONYMOUS_REPORT=no' >> /etc/bunkerweb/variables.env ; echo 'USE_DNSBL=no' >> /etc/bunkerweb/variables.env",
)
if proc.returncode != 0:
raise (Exception("docker exec append variables.env failed (test)"))

View file

@ -33,6 +33,9 @@ class SwarmTest(Test):
data["services"]["bunkerweb"]["environment"].append("AUTO_LETS_ENCRYPT=yes")
data["services"]["bunkerweb"]["environment"].append("USE_LETS_ENCRYPT_STAGING=yes")
data["services"]["bunkerweb"]["environment"].append("LOG_LEVEL=info")
data["services"]["bunkerweb"]["environment"].append("USE_BUNKERNET=no")
data["services"]["bunkerweb"]["environment"].append("SEND_ANONYMOUS_REPORT=no")
data["services"]["bunkerweb"]["environment"].append("USE_DNSBL=no")
del data["services"]["bunkerweb"]["deploy"]["placement"]
with open(compose, "w") as f:
f.write(dump(data))