From e5bafc913678a3729173bf603bad480cb18e1823 Mon Sep 17 00:00:00 2001 From: Daniel Ho Date: Wed, 29 Apr 2020 16:12:36 -0700 Subject: [PATCH 1/4] Added matrix JSON file, modified apache config --- modules/ocf_www/files/matrix-server | 3 +++ modules/ocf_www/manifests/site/www.pp | 13 +++++++++++++ 2 files changed, 16 insertions(+) create mode 100644 modules/ocf_www/files/matrix-server diff --git a/modules/ocf_www/files/matrix-server b/modules/ocf_www/files/matrix-server new file mode 100644 index 000000000..2e85fd057 --- /dev/null +++ b/modules/ocf_www/files/matrix-server @@ -0,0 +1,3 @@ +{ + "m.server": "matrix.ocf.berkeley.edu:443" +} diff --git a/modules/ocf_www/manifests/site/www.pp b/modules/ocf_www/manifests/site/www.pp index 27498fec8..c89ed005e 100644 --- a/modules/ocf_www/manifests/site/www.pp +++ b/modules/ocf_www/manifests/site/www.pp @@ -26,6 +26,11 @@ include ocf_www::mod::php include ocf_www::mod::suexec + file { + '/var/www/html/.well-known/matrix/server': + source => 'puppet:///modules/ocf_www/matrix-server'; + } + # TODO: dev-death should add a robots.txt disallowing everything apache::vhost { 'www': servername => 'www.ocf.berkeley.edu', @@ -42,6 +47,12 @@ request_headers => ['set X-Forwarded-Proto https'], proxy_preserve_host => true, + aliases => [ + { alias => '/.well-known/matrix/server', + path => '/var/www/html/.well-known/matrix/server', + }, + ], + rewrites => [ { comment => 'redirect .well-known/host-meta to mastodon', @@ -56,6 +67,8 @@ '%{REQUEST_URI} !^/icons/', # ...hide ocfweb metrics '%{REQUEST_URI} !^/metrics', + # ...and not if it's the matrix well-known file + '%{REQUEST_URI} !^/\.well-known/matrix', ], rewrite_rule => '^/(.*)$ http://lb.ocf.berkeley.edu:4080/$1 [P]', } From 4e8b7967b26e37e5d85f525fe38b89868479e505 Mon Sep 17 00:00:00 2001 From: Daniel Ho Date: Wed, 29 Apr 2020 16:39:23 -0700 Subject: [PATCH 2/4] Changes to www.pp file --- modules/ocf_www/manifests/site/www.pp | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/modules/ocf_www/manifests/site/www.pp b/modules/ocf_www/manifests/site/www.pp index c89ed005e..9abcf9626 100644 --- a/modules/ocf_www/manifests/site/www.pp +++ b/modules/ocf_www/manifests/site/www.pp @@ -27,6 +27,8 @@ include ocf_www::mod::suexec file { + ['/var/www/html/.well-known', '/var/www/html/.well-known/matrix']: + ensure => 'directory'; '/var/www/html/.well-known/matrix/server': source => 'puppet:///modules/ocf_www/matrix-server'; } @@ -47,9 +49,9 @@ request_headers => ['set X-Forwarded-Proto https'], proxy_preserve_host => true, - aliases => [ + aliases => [ { alias => '/.well-known/matrix/server', - path => '/var/www/html/.well-known/matrix/server', + path => '/var/www/html/.well-known/matrix/server', }, ], @@ -67,8 +69,8 @@ '%{REQUEST_URI} !^/icons/', # ...hide ocfweb metrics '%{REQUEST_URI} !^/metrics', - # ...and not if it's the matrix well-known file - '%{REQUEST_URI} !^/\.well-known/matrix', + # ...and not if it's the matrix well-known file + '%{REQUEST_URI} !^/\.well-known/matrix', ], rewrite_rule => '^/(.*)$ http://lb.ocf.berkeley.edu:4080/$1 [P]', } From 3da0719fb77100452fbbb91948ef2f17dc5e696c Mon Sep 17 00:00:00 2001 From: Christopher Cooper Date: Thu, 30 Apr 2020 16:20:06 -0700 Subject: [PATCH 3/4] update formatting for www.pp --- modules/ocf_www/manifests/site/www.pp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/modules/ocf_www/manifests/site/www.pp b/modules/ocf_www/manifests/site/www.pp index 9abcf9626..42042cf77 100644 --- a/modules/ocf_www/manifests/site/www.pp +++ b/modules/ocf_www/manifests/site/www.pp @@ -50,7 +50,8 @@ proxy_preserve_host => true, aliases => [ - { alias => '/.well-known/matrix/server', + { + alias => '/.well-known/matrix/server', path => '/var/www/html/.well-known/matrix/server', }, ], @@ -69,8 +70,8 @@ '%{REQUEST_URI} !^/icons/', # ...hide ocfweb metrics '%{REQUEST_URI} !^/metrics', - # ...and not if it's the matrix well-known file - '%{REQUEST_URI} !^/\.well-known/matrix', + # ...and not if it's the matrix well-known file + '%{REQUEST_URI} !^/\.well-known/matrix', ], rewrite_rule => '^/(.*)$ http://lb.ocf.berkeley.edu:4080/$1 [P]', } From b7dfe42167579228a7a36cb3d82efb84bf5dc366 Mon Sep 17 00:00:00 2001 From: Christopher Cooper Date: Thu, 30 Apr 2020 16:22:49 -0700 Subject: [PATCH 4/4] for real this time --- modules/ocf_www/manifests/site/www.pp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ocf_www/manifests/site/www.pp b/modules/ocf_www/manifests/site/www.pp index 42042cf77..304e7ef07 100644 --- a/modules/ocf_www/manifests/site/www.pp +++ b/modules/ocf_www/manifests/site/www.pp @@ -50,7 +50,7 @@ proxy_preserve_host => true, aliases => [ - { + { alias => '/.well-known/matrix/server', path => '/var/www/html/.well-known/matrix/server', },