mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
tests - init cors and fix example_data path for autoconf
This commit is contained in:
parent
d8c8ceab36
commit
2033974442
6 changed files with 70 additions and 1 deletions
12
examples/cors/setup-docker.sh
Executable file
12
examples/cors/setup-docker.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chown -R root:101 bw-data
|
||||
chmod -R 770 bw-data
|
||||
chown -R 33:101 ./bw-data/www
|
||||
find ./bw-data/www -type f -exec chmod 0640 {} \;
|
||||
find ./bw-data/www -type d -exec chmod 0750 {} \;
|
||||
12
examples/cors/setup-linux.sh
Executable file
12
examples/cors/setup-linux.sh
Executable file
|
|
@ -0,0 +1,12 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
chown -R www-data:nginx ./bw-data/www
|
||||
find ./bw-data/www -type f -exec chmod 0640 {} \;
|
||||
find ./bw-data/www -type d -exec chmod 0750 {} \;
|
||||
cp -rp ./bw-data/www/* /opt/bunkerweb/www
|
||||
cp variables.env /opt/bunkerweb/variables.env
|
||||
26
examples/cors/tests.json
Normal file
26
examples/cors/tests.json
Normal file
|
|
@ -0,0 +1,26 @@
|
|||
{
|
||||
"name": "cors",
|
||||
"kinds": [
|
||||
"docker",
|
||||
"autoconf",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 60,
|
||||
"tests": [
|
||||
{
|
||||
"type": "string",
|
||||
"url": "https://app1.example.com",
|
||||
"string": "app1"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"url": "https://app2.example.com",
|
||||
"string": "app2"
|
||||
},
|
||||
{
|
||||
"type": "string",
|
||||
"url": "https://app3.example.com",
|
||||
"string": "app3"
|
||||
}
|
||||
]
|
||||
}
|
||||
19
examples/cors/variables.env
Normal file
19
examples/cors/variables.env
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
MULTISITE=yes
|
||||
# Replace with your domains
|
||||
SERVER_NAME=app1.example.com app2.example.com app3.example.com
|
||||
AUTO_LETS_ENCRYPT=yes
|
||||
DISABLE_DEFAULT_SERVER=yes
|
||||
USE_CLIENT_CACHE=yes
|
||||
USE_GZIP=yes
|
||||
app1.example.com_USE_CORS=yes
|
||||
app1.example.com_CORS_ALLOW_ORIGIN=https://app2.example.com
|
||||
app1.example.com_ALLOWED_METHODS=GET|POST|HEAD|OPTIONS
|
||||
app1.example.com_REMOTE_PHP=myapp1
|
||||
app1.example.com_REMOTE_PHP_PATH=/app
|
||||
app2.example.com_REMOTE_PHP=myapp2
|
||||
app2.example.com_REMOTE_PHP_PATH=/app
|
||||
app3.example.com_REMOTE_PHP=myapp3
|
||||
app3.example.com_REMOTE_PHP_PATH=/app
|
||||
|
|
@ -76,7 +76,7 @@ class AutoconfTest(Test) :
|
|||
super()._setup_test()
|
||||
test = "/tmp/tests/" + self._name
|
||||
compose = "/tmp/tests/" + self._name + "/autoconf.yml"
|
||||
example_data = "./examples/" + self._name + "/bw-data"
|
||||
example_data = "/tmp/tests/" + self._name + "/bw-data"
|
||||
Test.replace_in_file(compose, r"bunkerity/bunkerweb:.*$", "10.20.1.1:5000/bw-tests:latest")
|
||||
Test.replace_in_file(compose, r"\./bw\-data:/", "/tmp/bw-data:/")
|
||||
Test.replace_in_file(compose, r"\- bw_data:/", "- /tmp/bw-data:/")
|
||||
|
|
|
|||
Loading…
Reference in a new issue