mirror of
https://github.com/odoo/runbot.git
synced 2025-03-27 13:25:47 +07:00
[IMP] runbot: let nginx serve static files
This commit is contained in:
parent
d66047230b
commit
f889f2095c
@ -31,6 +31,7 @@ import werkzeug
|
|||||||
import openerp
|
import openerp
|
||||||
from openerp import http, SUPERUSER_ID
|
from openerp import http, SUPERUSER_ID
|
||||||
from openerp.http import request
|
from openerp.http import request
|
||||||
|
from openerp.modules import get_module_resource
|
||||||
from openerp.osv import fields, osv
|
from openerp.osv import fields, osv
|
||||||
from openerp.tools import config, appdirs
|
from openerp.tools import config, appdirs
|
||||||
from openerp.addons.website.models.website import slug
|
from openerp.addons.website.models.website import slug
|
||||||
@ -411,6 +412,7 @@ class runbot_repo(osv.osv):
|
|||||||
def _reload_nginx(self, cr, uid, context=None):
|
def _reload_nginx(self, cr, uid, context=None):
|
||||||
settings = {}
|
settings = {}
|
||||||
settings['port'] = config['xmlrpc_port']
|
settings['port'] = config['xmlrpc_port']
|
||||||
|
settings['runbot_static'] = os.path.join(get_module_resource('runbot', 'static'), '')
|
||||||
nginx_dir = os.path.join(self._root(cr, uid), 'nginx')
|
nginx_dir = os.path.join(self._root(cr, uid), 'nginx')
|
||||||
settings['nginx_dir'] = nginx_dir
|
settings['nginx_dir'] = nginx_dir
|
||||||
ids = self.search(cr, uid, [('nginx','=',True)], order='id')
|
ids = self.search(cr, uid, [('nginx','=',True)], order='id')
|
||||||
|
@ -692,6 +692,13 @@ http {
|
|||||||
location / { proxy_pass http://127.0.0.1:<t t-esc="port"/>; }
|
location / { proxy_pass http://127.0.0.1:<t t-esc="port"/>; }
|
||||||
location /longpolling/im/poll { return 404; }
|
location /longpolling/im/poll { return 404; }
|
||||||
location /longpolling/poll { return 404; }
|
location /longpolling/poll { return 404; }
|
||||||
|
location /runbot/static/ {
|
||||||
|
alias <t t-esc="runbot_static"/>;
|
||||||
|
autoindex off;
|
||||||
|
location ~ /runbot/static/build/[^/]+/logs/ {
|
||||||
|
autoindex on;
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
<t t-foreach="builds" t-as="build">
|
<t t-foreach="builds" t-as="build">
|
||||||
server {
|
server {
|
||||||
|
Loading…
Reference in New Issue
Block a user