Commit 37f881ef authored by Łukasz Nowak's avatar Łukasz Nowak

caddy-frontend: Fix monitor cors-domains

parent 7e2fa75d
...@@ -18,7 +18,7 @@ md5sum = 906e5bd66b1265b8109a86b6ab46e91f ...@@ -18,7 +18,7 @@ md5sum = 906e5bd66b1265b8109a86b6ab46e91f
[template-apache-frontend] [template-apache-frontend]
filename = instance-apache-frontend.cfg filename = instance-apache-frontend.cfg
md5sum = a0e1e10f154342e8cc9936066e855b8f md5sum = b170d0987563b481eb71cf705c3658ab
[template-apache-replicate] [template-apache-replicate]
filename = instance-apache-replicate.cfg.in filename = instance-apache-replicate.cfg.in
......
...@@ -127,7 +127,6 @@ configuration.trafficserver-mgmt-port = 8084 ...@@ -127,7 +127,6 @@ configuration.trafficserver-mgmt-port = 8084
configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html configuration.re6st-verification-url = http://[2001:67c:1254:4::1]/index.html
configuration.enable-http2-by-default = true configuration.enable-http2-by-default = true
configuration.mpm-graceful-shutdown-timeout = 5 configuration.mpm-graceful-shutdown-timeout = 5
configuration.monitor-cors-domains =
configuration.monitor-httpd-port = 8072 configuration.monitor-httpd-port = 8072
[frontend-configuration] [frontend-configuration]
...@@ -622,6 +621,7 @@ apache-certificate = ...@@ -622,6 +621,7 @@ apache-certificate =
open-port = 80 443 open-port = 80 443
extra_slave_instance_list = extra_slave_instance_list =
frontend-name = frontend-name =
monitor-cors-domains =
monitor-username = $${monitor-instance-parameter:username} monitor-username = $${monitor-instance-parameter:username}
monitor-password = $${monitor-htpasswd:passwd} monitor-password = $${monitor-htpasswd:passwd}
...@@ -631,7 +631,7 @@ monitor-password = $${monitor-htpasswd:passwd} ...@@ -631,7 +631,7 @@ monitor-password = $${monitor-htpasswd:passwd}
[monitor-instance-parameter] [monitor-instance-parameter]
monitor-httpd-port = $${instance-parameter:configuration.monitor-httpd-port} monitor-httpd-port = $${instance-parameter:configuration.monitor-httpd-port}
cors-domains = $${instance-parameter:configuration.monitor-cors-domains} cors-domains = $${slap-parameter:monitor-cors-domains}
username = $${slap-parameter:monitor-username} username = $${slap-parameter:monitor-username}
password = $${slap-parameter:monitor-password} password = $${slap-parameter:monitor-password}
......
...@@ -735,6 +735,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin): ...@@ -735,6 +735,14 @@ class TestSlave(SlaveHttpFrontendTestCase, TestDataMixin):
set(), set(),
set(os.listdir(os.path.join(partition_path, 'etc', 'monitor-promise')))) set(os.listdir(os.path.join(partition_path, 'etc', 'monitor-promise'))))
# check that monitor cors domains are correctly setup by file presence, as
# we trust monitor stack being tested in proper place and it is too hard
# to have working monitor with local proxy
self.assertTestData(
open(
os.path.join(
partition_path, 'etc', 'httpd-cors.cfg'), 'r').read().strip())
def test_empty(self): def test_empty(self):
parameter_dict = self.slave_connection_parameter_dict_dict[ parameter_dict = self.slave_connection_parameter_dict_dict[
'empty'] 'empty']
......
SetEnvIf Origin "^http(s)?://(.+\.)?(monitor\.app\.officejs\.com)$" ORIGIN_DOMAIN=$0
Header always set Access-Control-Allow-Origin "%{ORIGIN_DOMAIN}e" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Credentials "true" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization" env=ORIGIN_DOMAIN
\ No newline at end of file
SetEnvIf Origin "^http(s)?://(.+\.)?(monitor\.app\.officejs\.com)$" ORIGIN_DOMAIN=$0
Header always set Access-Control-Allow-Origin "%{ORIGIN_DOMAIN}e" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Credentials "true" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Methods "PROPFIND, PROPPATCH, COPY, MOVE, DELETE, MKCOL, LOCK, UNLOCK, PUT, GETLIB, VERSION-CONTROL, CHECKIN, CHECKOUT, UNCHECKOUT, REPORT, UPDATE, CANCELUPLOAD, HEAD, OPTIONS, GET, POST" env=ORIGIN_DOMAIN
Header always set Access-Control-Allow-Headers "Overwrite, Destination, Content-Type, Depth, User-Agent, X-File-Size, X-Requested-With, If-Modified-Since, X-File-Name, Cache-Control, Authorization" env=ORIGIN_DOMAIN
\ No newline at end of file
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment