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..304e7ef07 100644 --- a/modules/ocf_www/manifests/site/www.pp +++ b/modules/ocf_www/manifests/site/www.pp @@ -26,6 +26,13 @@ include ocf_www::mod::php 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'; + } + # TODO: dev-death should add a robots.txt disallowing everything apache::vhost { 'www': servername => 'www.ocf.berkeley.edu', @@ -42,6 +49,13 @@ 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 +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', ], rewrite_rule => '^/(.*)$ http://lb.ocf.berkeley.edu:4080/$1 [P]', }