add basic config lock between autoconf and scheduler + remove reverse-proxy tests for linux

This commit is contained in:
bunkerity 2023-08-31 15:14:12 +02:00
parent cf55ade15d
commit c206daf9dd
7 changed files with 16 additions and 49 deletions

View file

@ -1,10 +0,0 @@
#!/bin/bash
if [ $(id -u) -ne 0 ] ; then
echo "❌ Run me as root"
exit 1
fi
mkdir /var/www/html/{app1.example.com,app2.example.com}
echo "hello" > /var/www/html/app1.example.com/index.html
echo "hello" > /var/www/html/app2.example.com/index.html

View file

@ -1,6 +1,6 @@
{
"name": "reverse-proxy-multisite",
"kinds": ["docker", "autoconf", "swarm", "kubernetes", "linux"],
"kinds": ["docker", "autoconf", "swarm", "kubernetes"],
"timeout": 60,
"delay": 90,
"tests": [

View file

@ -1,14 +0,0 @@
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=/var/www/html/app1.example.com
app2.example.com_LOCAL_PHP=/run/php/php-fpm.sock
app2.example.com_LOCAL_PHP_PATH=/var/www/html/app2.example.com

View file

@ -1,12 +0,0 @@
#!/bin/bash
if [ $(id -u) -ne 0 ] ; then
echo "❌ Run me as root"
exit 1
fi
mkdir /var/www/html/{app1,app2}
echo "hello" > /var/www/html/app1/index.html
echo "hello" > /var/www/html/app2/index.html
cp -r bw-data/configs/* /etc/bunkerweb/configs
chown -R nginx:nginx /etc/bunkerweb/configs

View file

@ -1,6 +1,6 @@
{
"name": "reverse-proxy-singlesite",
"kinds": ["docker", "autoconf", "swarm", "linux"],
"kinds": ["docker", "autoconf", "swarm"],
"delay": 120,
"timeout": 60,
"no_copy_container": true,

View file

@ -1,11 +0,0 @@
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=/var/www/html

View file

@ -113,6 +113,20 @@ class Config(ConfigCaller):
)
sleep(5)
# wait until changes are applied
while True:
changes = self._db.check_changes()
if isinstance(changes, str):
self.__logger.error(
f"An error occurred when checking for changes in the database : {changes}"
)
elif not any(changes.values()):
break
else:
self.__logger.warning(
"Scheduler is already applying a configuration, retrying in 5 seconds ...",
)
sleep(5)
# update instances in database
if updates["instances"]:
err = self._db.update_instances(self.__instances, changed=False)