mirror of
https://github.com/bunkerity/bunkerweb
synced 2026-05-24 09:28:37 +00:00
tests - road to linux tests 🚀
This commit is contained in:
parent
c277a33e9c
commit
e4321629f1
23 changed files with 265 additions and 31 deletions
|
|
@ -5,11 +5,19 @@ if [ $(id -u) -ne 0 ] ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
curl https://ftp.drupal.org/files/projects/drupal-9.4.2.tar.gz -Lo /tmp/drupal.tar.gz
|
||||
tar -xvzf /tmp/drupal.tar.gz -C /tmp
|
||||
cp -r /tmp/drupal-9.4.2/* /opt/bunkerweb/www
|
||||
chown -R www-data:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type d -exec chmod 750 /opt/bunkerweb/www {} \;
|
||||
find /opt/bunkerweb/www -type f -exec chmod 640 /opt/bunkerweb/www {} \;
|
||||
systemctl start php-fpm
|
||||
cp variables.env /opt/bunkerweb/variables.env
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
curl https://releases.mattermost.com/7.2.0/mattermost-7.2.0-linux-amd64.tar.gz -Lo /tmp/mattermost.tar.gz
|
||||
tar -xvzf /tmp/mattermost.tar.gz -C /tmp
|
||||
cd /tmp/drupal-*
|
||||
cp -r * /opt/bunkerweb/www
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
cp -r bw-data/configs/* /opt/bunkerweb/configs
|
||||
|
|
@ -4,9 +4,10 @@
|
|||
"docker",
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes"
|
||||
"kubernetes",
|
||||
"linux"
|
||||
],
|
||||
"no_copy_container": true,
|
||||
"no_copy_container": true,
|
||||
"timeout": 60,
|
||||
"delay": 60,
|
||||
"tests": [
|
||||
|
|
|
|||
|
|
@ -5,10 +5,16 @@ if [ $(id -u) -ne 0 ] ; then
|
|||
exit 1
|
||||
fi
|
||||
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
curl https://downloads.joomla.org/fr/cms/joomla4/4-1-5/Joomla_4-1-5-Stable-Full_Package.zip?format=zip -Lo /tmp/joomla.zip
|
||||
unzip /tmp/joomla.zip -d /opt/bunkerweb/www
|
||||
chown -R www-data:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type d -exec chmod 750 /opt/bunkerweb/www {} \;
|
||||
find /opt/bunkerweb/www -type f -exec chmod 640 /opt/bunkerweb/www {} \;
|
||||
systemctl start php-fpm
|
||||
cp variables.env /opt/bunkerweb/variables.env
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
21
examples/moodle/setup-linux.sh
Executable file
21
examples/moodle/setup-linux.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
curl https://download.moodle.org/download.php/direct/stable400/moodle-4.0.2.tgz -Lo /tmp/moodle.tgz
|
||||
tar -xvzf /tmp/moodle.tgz -C /tmp
|
||||
cp -r /tmp/moodle/* /opt/bunkerweb/www
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
|
|
@ -4,7 +4,8 @@
|
|||
"docker",
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes"
|
||||
"kubernetes",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 300,
|
||||
"delay": 180,
|
||||
|
|
|
|||
22
examples/nextcloud/setup-linux.sh
Executable file
22
examples/nextcloud/setup-linux.sh
Executable file
|
|
@ -0,0 +1,22 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
curl https://download.nextcloud.com/server/releases/latest.zip -Lo /tmp/nextcloud.zip
|
||||
unzip /tmp/nextcloud.zip -d /tmp
|
||||
cp -r /tmp/nextcloud/* /opt/bunkerweb/www
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
cp -r bw-data/configs/* /opt/bunkerweb/configs
|
||||
|
|
@ -4,7 +4,8 @@
|
|||
"docker",
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes"
|
||||
"kubernetes",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 120,
|
||||
"delay": 60,
|
||||
|
|
|
|||
19
examples/nextcloud/variables.env
Normal file
19
examples/nextcloud/variables.env
Normal file
|
|
@ -0,0 +1,19 @@
|
|||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
# Replace with your domain
|
||||
SERVER_NAME=www.example.com
|
||||
DISABLE_DEFAULT_SERVER=yes
|
||||
AUTO_LETS_ENCRYPT=yes
|
||||
USE_CLIENT_CACHE=yes
|
||||
USE_GZIP=yes
|
||||
X_FRAME_OPTIONS=SAMEORIGIN
|
||||
ALLOWED_METHODS=GET|POST|HEAD|COPY|DELETE|LOCK|MKCOL|MOVE|PROPFIND|PROPPATCH|PUT|UNLOCK|OPTIONS
|
||||
BAD_BEHAVIOR_STATUS_CODES=400 401 403 405 444
|
||||
MAX_CLIENT_SIZE=10G
|
||||
LIMIT_REQ_URL_1=/apps
|
||||
LIMIT_REQ_RATE_1=5r/s
|
||||
LIMIT_REQ_URL_2=/apps/text/session/sync
|
||||
LIMIT_REQ_RATE_2=8r/s
|
||||
LIMIT_REQ_URL_3=/core/preview
|
||||
LIMIT_REQ_RATE_3=5r/s
|
||||
19
examples/php-multisite/setup-linux.sh
Executable file
19
examples/php-multisite/setup-linux.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
cp -r ./bw-data/www/* /opt/bunkerweb/www
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
|
|
@ -2,7 +2,8 @@
|
|||
"name": "php-multisite",
|
||||
"kinds": [
|
||||
"docker",
|
||||
"autoconf"
|
||||
"autoconf",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 60,
|
||||
"tests": [
|
||||
|
|
|
|||
19
examples/php-singlesite/setup-linux.sh
Executable file
19
examples/php-singlesite/setup-linux.sh
Executable file
|
|
@ -0,0 +1,19 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
cp -r ./bw-data/www/* /opt/bunkerweb/www
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
25
examples/proxy-protocol/setup-linux.sh
Executable file
25
examples/proxy-protocol/setup-linux.sh
Executable file
|
|
@ -0,0 +1,25 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
DNF=$(which dnf)
|
||||
APT=$(which apt)
|
||||
|
||||
if [ ! -z $DNF ] ; then
|
||||
dnf install -y haproxy
|
||||
elif [ ! -z $APT ] ; then
|
||||
apt install -y haproxy
|
||||
fi
|
||||
|
||||
cp haproxy.cfg /etc/haproxy
|
||||
sed -i "s/*:8080/*:80/g" /etc/haproxy/haproxy.cfg
|
||||
sed -i "s/*:8443/*:443/g" /etc/haproxy/haproxy.cfg
|
||||
sed -i "s/mybunker/127.0.0.1/g" /etc/haproxy/haproxy.cfg
|
||||
systemctl stop bunkerweb
|
||||
systemctl stop haproxy
|
||||
systemctl start haproxy
|
||||
|
||||
echo "hello" > /opt/bunkerweb/www/index.html
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
{
|
||||
"name": "proxy-protocol",
|
||||
"kinds": [
|
||||
"docker"
|
||||
"docker",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 60,
|
||||
"tests": [
|
||||
|
|
@ -11,4 +12,4 @@
|
|||
"string": "hello"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
8
examples/proxy-protocol/variables.env
Normal file
8
examples/proxy-protocol/variables.env
Normal file
|
|
@ -0,0 +1,8 @@
|
|||
*DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
# replace with your domains
|
||||
SERVER_NAME=www.example.com
|
||||
# real IP settings
|
||||
USE_PROXY_PROTOCOL=yes
|
||||
USE_REAL_IP=yes
|
||||
REAL_IP_FROM=127.0.0.0/8
|
||||
REAL_IP_HEADER=proxy_protocol
|
||||
10
examples/reverse-proxy-multisite/setup-linux.sh
Executable file
10
examples/reverse-proxy-multisite/setup-linux.sh
Executable file
|
|
@ -0,0 +1,10 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir /opt/bunkerweb/www/{app1.example.com,app2.example.com}
|
||||
echo "hello" > /opt/bunkerweb/www/app1.example.com/index.html
|
||||
echo "hello" > /opt/bunkerweb/www/app2.example.com/index.html
|
||||
|
|
@ -2,9 +2,10 @@
|
|||
"name": "reverse-proxy-multisite",
|
||||
"kinds": [
|
||||
"docker",
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes"
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 60,
|
||||
"delay": 60,
|
||||
|
|
@ -20,4 +21,4 @@
|
|||
"string": "hello"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
14
examples/reverse-proxy-multisite/variables.env
Normal file
14
examples/reverse-proxy-multisite/variables.env
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
# Replace with your domain
|
||||
SERVER_NAME=app1.example.com app2.example.com
|
||||
MULTISITE=yes
|
||||
DISABLE_DEFAULT_SERVER=yes
|
||||
AUTO_LETS_ENCRYPT=yes
|
||||
USE_CLIENT_CACHE=yes
|
||||
USE_GZIP=yes
|
||||
app1.example.com_LOCAL_PHP=/run/php/php-fpm.sock
|
||||
app1.example.com_LOCAL_PHP_PATH=/opt/bunkerweb/www/app1.example.com
|
||||
app2.example.com_LOCAL_PHP=/run/php/php-fpm.sock
|
||||
app2.example.com_LOCAL_PHP_PATH=/opt/bunkerweb/www/app2.example.com
|
||||
11
examples/reverse-proxy-singlesite/setup-linux.sh
Executable file
11
examples/reverse-proxy-singlesite/setup-linux.sh
Executable file
|
|
@ -0,0 +1,11 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
mkdir /opt/bunkerweb/www/{app1,app2}
|
||||
echo "hello" > /opt/bunkerweb/www/app1/index.html
|
||||
echo "hello" > /opt/bunkerweb/www/app2/index.html
|
||||
cp -r bw-data/configs/* /opt/bunkerweb/configs
|
||||
|
|
@ -2,8 +2,9 @@
|
|||
"name": "reverse-proxy-singlesite",
|
||||
"kinds": [
|
||||
"docker",
|
||||
"autoconf",
|
||||
"swarm"
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 60,
|
||||
"no_copy_container": true,
|
||||
|
|
@ -19,4 +20,4 @@
|
|||
"string": "hello"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
11
examples/reverse-proxy-singlesite/variables.env
Normal file
11
examples/reverse-proxy-singlesite/variables.env
Normal file
|
|
@ -0,0 +1,11 @@
|
|||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
# Replace with your domain
|
||||
SERVER_NAME=www.example.com
|
||||
DISABLE_DEFAULT_SERVER=yes
|
||||
AUTO_LETS_ENCRYPT=yes
|
||||
USE_CLIENT_CACHE=yes
|
||||
USE_GZIP=yes
|
||||
LOCAL_PHP=/run/php/php-fpm.sock
|
||||
LOCAL_PHP_PATH=/opt/bunkerweb/www
|
||||
21
examples/wordpress/setup-linux.sh
Executable file
21
examples/wordpress/setup-linux.sh
Executable file
|
|
@ -0,0 +1,21 @@
|
|||
#!/bin/bash
|
||||
|
||||
if [ $(id -u) -ne 0 ] ; then
|
||||
echo "❌ Run me as root"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
if id www-data > /dev/null 2>&1 ; then
|
||||
user="www-data"
|
||||
elif id apache > /dev/null 2>&1 ; then
|
||||
user="apache"
|
||||
else
|
||||
echo "❌ No PHP user found"
|
||||
exit 1
|
||||
fi
|
||||
curl https://wordpress.org/latest.zip -Lo /tmp/wordpress.zip
|
||||
unzip /tmp/wordpress.zip -d /tmp
|
||||
cp -r /tmp/wordpress/* /opt/bunkerweb/www
|
||||
chown -R $user:nginx /opt/bunkerweb/www
|
||||
find /opt/bunkerweb/www -type f -exec chmod 0640 {} \;
|
||||
find /opt/bunkerweb/www -type d -exec chmod 0750 {} \;
|
||||
|
|
@ -2,9 +2,10 @@
|
|||
"name": "wordpress",
|
||||
"kinds": [
|
||||
"docker",
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes"
|
||||
"autoconf",
|
||||
"swarm",
|
||||
"kubernetes",
|
||||
"linux"
|
||||
],
|
||||
"timeout": 60,
|
||||
"delay": 120,
|
||||
|
|
@ -16,4 +17,4 @@
|
|||
"string": "wordpress"
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
|
|
|||
12
examples/wordpress/variables.env
Normal file
12
examples/wordpress/variables.env
Normal file
|
|
@ -0,0 +1,12 @@
|
|||
HTTP_PORT=80
|
||||
HTTPS_PORT=443
|
||||
DNS_RESOLVERS=8.8.8.8 8.8.4.4
|
||||
# Replace with your domain
|
||||
SERVER_NAME=www.example.com
|
||||
DISABLE_DEFAULT_SERVER=yes
|
||||
AUTO_LETS_ENCRYPT=yes
|
||||
USE_CLIENT_CACHE=yes
|
||||
USE_GZIP=yes
|
||||
LOCAL_PHP=/run/php/php-fpm.sock
|
||||
LOCAL_PHP_PATH=/opt/bunkerweb/www
|
||||
MAX_CLIENT_SIZE=50m
|
||||
Loading…
Reference in a new issue