2
0
Эх сурвалжийг харах

Use consistent naming for host-related env vars

FreddleSpl0it 3 сар өмнө
parent
commit
4c4a440cdf

+ 3 - 3
data/Dockerfiles/bootstrap/modules/BootstrapNginx.py

@@ -8,9 +8,9 @@ class BootstrapNginx(BootstrapBase):
     self.connect_mysql()
 
     # wait for Hosts
-    php_service = os.getenv("PHPFPMHOST") or "php-fpm-mailcow"
-    rspamd_service = os.getenv("RSPAMDHOST") or "rspamd-mailcow"
-    sogo_service = os.getenv("SOGOHOST")
+    php_service = os.getenv("PHPFPM_HOST") or "php-fpm-mailcow"
+    rspamd_service = os.getenv("RSPAMD_HOST") or "rspamd-mailcow"
+    sogo_service = os.getenv("SOGO_HOST")
     self.wait_for_host(php_service)
     if not self.isYes(os.getenv("SKIP_RSPAMD", False)):
       self.wait_for_host(rspamd_service)

+ 9 - 9
data/conf/nginx/config_templates/sites-default.conf.j2

@@ -104,7 +104,7 @@ location ~ ^/cache/(.*)$ {
 location ~ \.php$ {
     try_files $uri =404;
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
-    fastcgi_pass {{ PHPFPMHOST }}:9002;
+    fastcgi_pass {{ PHPFPM_HOST }}:9002;
     fastcgi_index index.php;
     include /etc/nginx/fastcgi_params;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
@@ -115,7 +115,7 @@ location ~ \.php$ {
 
 location ~* ^/Autodiscover/Autodiscover.xml {
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
-    fastcgi_pass {{ PHPFPMHOST }}:9002;
+    fastcgi_pass {{ PHPFPM_HOST }}:9002;
     include /etc/nginx/fastcgi_params;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     try_files /autodiscover.php =404;
@@ -123,7 +123,7 @@ location ~* ^/Autodiscover/Autodiscover.xml {
 
 location ~* ^/Autodiscover/Autodiscover.json {
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
-    fastcgi_pass {{ PHPFPMHOST }}:9002;
+    fastcgi_pass {{ PHPFPM_HOST }}:9002;
     include /etc/nginx/fastcgi_params;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     try_files /autodiscover-json.php =404;
@@ -131,7 +131,7 @@ location ~* ^/Autodiscover/Autodiscover.json {
 
 location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
     fastcgi_split_path_info ^(.+\.php)(/.+)$;
-    fastcgi_pass {{ PHPFPMHOST }}:9002;
+    fastcgi_pass {{ PHPFPM_HOST }}:9002;
     include /etc/nginx/fastcgi_params;
     fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
     try_files /autoconfig.php =404;
@@ -141,7 +141,7 @@ location ~ /(?:m|M)ail/(?:c|C)onfig-v1.1.xml {
 location /rspamd/ {
     location /rspamd/auth {
       # proxy_pass is not inherited
-      proxy_pass       http://{{ RSPAMDHOST }}:11334/auth;
+      proxy_pass       http://{{ RSPAMD_HOST }}:11334/auth;
       proxy_intercept_errors on;
       proxy_set_header Host      $http_host;
       proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
@@ -150,7 +150,7 @@ location /rspamd/ {
       error_page 401 /_rspamderror.php;
     }
 
-    proxy_pass       http://{{ RSPAMDHOST }}:11334/;
+    proxy_pass       http://{{ RSPAMD_HOST }}:11334/;
     proxy_set_header Host      $http_host;
     proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
     proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
@@ -182,7 +182,7 @@ location ^~ /Microsoft-Server-ActiveSync {
     proxy_set_header Authorization "$auth";
     proxy_set_header x-webobjects-auth-type "$auth_type";
 
-    proxy_pass http://{{ SOGOHOST }}:20000/SOGo/Microsoft-Server-ActiveSync;
+    proxy_pass http://{{ SOGO_HOST }}:20000/SOGo/Microsoft-Server-ActiveSync;
 
     proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
     proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
@@ -207,7 +207,7 @@ location ^~ /SOGo {
         proxy_set_header Authorization "$auth";
         proxy_set_header x-webobjects-auth-type "$auth_type";
 
-        proxy_pass http://{{ SOGOHOST }}:20000;
+        proxy_pass http://{{ SOGO_HOST }}:20000;
 
         proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
         proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};
@@ -229,7 +229,7 @@ location ^~ /SOGo {
     proxy_set_header Authorization "$auth";
     proxy_set_header x-webobjects-auth-type "$auth_type";
 
-    proxy_pass http://{{ SOGOHOST }}:20000;
+    proxy_pass http://{{ SOGO_HOST }}:20000;
 
     proxy_set_header X-Forwarded-For {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$proxy_add_x_forwarded_for{% else %}$proxy_protocol_addr{%endif%};
     proxy_set_header X-Real-IP {% if not NGINX_USE_PROXY_PROTOCOL|lower in ["y", "yes"] %}$remote_addr{% else %}$proxy_protocol_addr{%endif%};

+ 4 - 4
docker-compose.yml

@@ -439,10 +439,10 @@ services:
         - SKIP_RSPAMD=${SKIP_RSPAMD:-n}
         - DISABLE_IPv6=${DISABLE_IPv6:-n}
         - HTTP_REDIRECT=${HTTP_REDIRECT:-n}
-        - PHPFPMHOST=${PHPFPMHOST:-php-fpm-mailcow}
-        - RSPAMDHOST=${RSPAMDHOST:-rspamd-mailcow}
-        - SOGOHOST=${SOGOHOST:-${IPV4_NETWORK:-172.22.1}.248}
-        - REDISHOST=${REDISHOST:-redis-mailcow}
+        - PHPFPM_HOST=${PHPFPM_HOST:-php-fpm-mailcow}
+        - RSPAM_DHOST=${RSPAMD_HOST:-rspamd-mailcow}
+        - SOGO_HOST=${SOGO_HOST:-${IPV4_NETWORK:-172.22.1}.248}
+        - REDIS_HOST=${REDIS_HOST:-redis-mailcow}
         - IPV4_NETWORK=${IPV4_NETWORK:-172.22.1}
         - NGINX_USE_PROXY_PROTOCOL=${NGINX_USE_PROXY_PROTOCOL:-n}
         - TRUSTED_PROXIES=${TRUSTED_PROXIES:-}