Revert deletion of the no-linux-reload argument of the main.py in the generator

This commit is contained in:
Théophile Diot 2024-05-27 10:54:12 +01:00
parent 56376318d9
commit 441909a2ae
No known key found for this signature in database
GPG key ID: 248FEA4BAE400D06
3 changed files with 5 additions and 3 deletions

View file

@ -39,6 +39,7 @@ if __name__ == "__main__":
parser.add_argument("--output", default=join(sep, "etc", "nginx"), type=str, help="where to write the rendered files")
parser.add_argument("--target", default=join(sep, "etc", "nginx"), type=str, help="where nginx will search for configurations files")
parser.add_argument("--variables", type=str, help="path to the file containing environment variables")
parser.add_argument("--no-linux-reload", action="store_true", help="disable linux reload")
args = parser.parse_args()
settings_path = Path(args.settings)

View file

@ -169,7 +169,7 @@ function start() {
MODSECURITY_CRS_VERSION="3"
fi
sudo -E -u nginx -g nginx /bin/bash -c "echo -ne 'IS_LOADING=yes\nUSE_BUNKERNET=no\nSEND_ANONYMOUS_REPORT=no\nSERVER_NAME=\nMODSECURITY_CRS_VERSION=${MODSECURITY_CRS_VERSION}\nDNS_RESOLVERS=${DNS_RESOLVERS}\nAPI_HTTP_PORT=${API_HTTP_PORT}\nAPI_LISTEN_IP=${API_LISTEN_IP}\nAPI_SERVER_NAME=${API_SERVER_NAME}\nAPI_WHITELIST_IP=${API_WHITELIST_IP}\nUSE_REAL_IP=${USE_REAL_IP}\nUSE_PROXY_PROTOCOL=${USE_PROXY_PROTOCOL}\nREAL_IP_FROM=${REAL_IP_FROM}\nREAL_IP_HEADER=${REAL_IP_HEADER}\nHTTP_PORT=${HTTP_PORT}\nHTTPS_PORT=${HTTPS_PORT}\n' > /var/tmp/bunkerweb/tmp.env"
sudo -E -u nginx -g nginx /bin/bash -c "PYTHONPATH=/usr/share/bunkerweb/deps/python/ /usr/share/bunkerweb/gen/main.py --variables /var/tmp/bunkerweb/tmp.env"
sudo -E -u nginx -g nginx /bin/bash -c "PYTHONPATH=/usr/share/bunkerweb/deps/python/ /usr/share/bunkerweb/gen/main.py --variables /var/tmp/bunkerweb/tmp.env --no-linux-reload"
# shellcheck disable=SC2181
if [ $? -ne 0 ] ; then
log "SYSTEMCTL" "❌" "Error while generating config from /var/tmp/bunkerweb/tmp.env"

View file

@ -688,7 +688,8 @@ if __name__ == "__main__":
join(sep, "etc", "nginx"),
"--variables",
str(SCHEDULER_TMP_ENV_PATH),
],
]
+ (["--no-linux-reload"] if MASTER_MODE else []),
stdin=DEVNULL,
stderr=STDOUT,
check=False,
@ -721,7 +722,7 @@ if __name__ == "__main__":
logger.info("Successfully reloaded nginx")
else:
logger.error("Error while reloading nginx")
elif INTEGRATION == "Linux" and not MASTER_MODE:
elif INTEGRATION == "Linux":
# Reload nginx
logger.info("Reloading nginx ...")
proc = subprocess_run(