[FIX] runbot: fix nginx static

This commit is contained in:
Xavier-Do 2022-06-09 15:53:41 +02:00
parent a6fa7b8023
commit f654738b04
2 changed files with 14 additions and 0 deletions

View File

@ -144,6 +144,8 @@ class Runbot(models.AbstractModel):
env = self.env
settings = {}
settings['port'] = config.get('http_port')
settings['runbot_static'] = os.path.join(get_module_resource('runbot', 'static'), '')
settings['base_url'] = self.get_base_url()
nginx_dir = os.path.join(self._root(), 'nginx')
settings['nginx_dir'] = nginx_dir
settings['re_escape'] = re.escape

View File

@ -37,6 +37,18 @@ proxy_set_header X-Forwarded-Host $host;
proxy_set_header X-Forwarded-Proto $real_scheme;
proxy_set_header Host $host;
server {
listen 8080 default;
location /runbot/static/ {
alias <t t-esc="runbot_static"/>;
autoindex off;
location ~ /runbot/static/build/[^/]+/(logs|tests)/ {
autoindex on;
add_header 'Access-Control-Allow-Origin' '<t t-esc="base_url"/>';
}
}
}
<t t-foreach="builds" t-as="build">
server {
listen 8080;