Skip to content

Commit

Permalink
Merge pull request #99 from kobotoolbox/96-reverse-proxy-not-retained
Browse files Browse the repository at this point in the history
Fix for reverse proxy value not retained
  • Loading branch information
jnm authored Jun 11, 2020
2 parents 3041ffb + da377c5 commit 553d3a6
Showing 1 changed file with 10 additions and 4 deletions.
14 changes: 10 additions & 4 deletions helpers/config.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,9 @@ class Config:
DEFAULT_PROXY_PORT = "8080"
DEFAULT_NGINX_PORT = "80"
DEFAULT_NGINX_HTTPS_PORT = "443"
KOBO_DOCKER_BRANCH = 'dynamic-uwsgi-pass-timeout'
KOBO_INSTALL_BRANCH = 'dynamic-uwsgi-pass-timeout'
KOBO_INSTALL_VERSION = '2.4.1'
KOBO_DOCKER_BRANCH = '2.020.24a'
KOBO_INSTALL_BRANCH = 'master'
KOBO_INSTALL_VERSION = '2.4.2'

# Maybe overkill. Use this class as a singleton to get the same configuration
# for each instantiation.
Expand Down Expand Up @@ -1364,7 +1364,6 @@ def __questions_reverse_proxy(self):
self.__config["use_letsencrypt"] = CLI.get_response([Config.TRUE, Config.FALSE],
self.__config.get("use_letsencrypt", Config.TRUE))
self.__config["proxy"] = Config.TRUE
self.__config["block_common_http_ports"] = Config.TRUE
self.__config["exposed_nginx_docker_port"] = Config.DEFAULT_NGINX_PORT

if self.use_letsencrypt:
Expand Down Expand Up @@ -1414,6 +1413,12 @@ def __questions_reverse_proxy(self):
self.__config["block_common_http_ports"] = CLI.get_response(
[Config.TRUE, Config.FALSE],
self.__config.get("block_common_http_ports", Config.FALSE))
else:
self.__config["block_common_http_ports"] = Config.TRUE

if not self.__is_port_allowed(self.__config["nginx_proxy_port"]):
# Force nginx proxy port if port is not allowed
self.__config["nginx_proxy_port"] = Config.DEFAULT_PROXY_PORT

CLI.colored_print("Internal port used by reverse proxy?", CLI.COLOR_SUCCESS)
while True:
Expand All @@ -1424,6 +1429,7 @@ def __questions_reverse_proxy(self):
else:
CLI.colored_print("Ports 80 and 443 are reserved!", CLI.COLOR_ERROR)
else:
self.__config["block_common_http_ports"] = Config.TRUE
if not self.use_letsencrypt:
CLI.colored_print("Internal port used by reverse proxy is {}.".format(
Config.DEFAULT_PROXY_PORT
Expand Down

0 comments on commit 553d3a6

Please sign in to comment.