From 95e32917c754a8bfe9684d1d8b8beb43b4ff537d Mon Sep 17 00:00:00 2001 From: Marcin Kuzminski Date: Sun, 31 Jul 2016 12:57:39 +0200 Subject: [PATCH] static: change static path to serve rhodecode static assets from dedicated rhodecode path. This helps to serve statics via http server and then still allow plugin statics to work under a common prefix --- docs/admin/apache-reverse-proxy.rst | 4 ++-- docs/admin/nginx-config-example.rst | 2 +- rhodecode/config/middleware.py | 2 +- rhodecode/public/js/src/rhodecode/utils/pyroutes.js | 2 +- rhodecode/templates/debug_style/tables.html | 2 +- 5 files changed, 6 insertions(+), 6 deletions(-) diff --git a/docs/admin/apache-reverse-proxy.rst b/docs/admin/apache-reverse-proxy.rst index a42aa4df..e1c056ba 100644 --- a/docs/admin/apache-reverse-proxy.rst +++ b/docs/admin/apache-reverse-proxy.rst @@ -10,8 +10,8 @@ Here is a sample configuration file for using Apache as a reverse proxy. ServerAlias hg.myserver.com ## uncomment to serve static files by Apache - ## ProxyPass /_static ! - ## Alias /_static /path/to/.rccontrol/enterprise-1/static + ## ProxyPass /_static/rhodecode ! + ## Alias /_static/rhodecode /path/to/.rccontrol/enterprise-1/static Order allow,deny diff --git a/docs/admin/nginx-config-example.rst b/docs/admin/nginx-config-example.rst index b5d78c72..c2864ed9 100644 --- a/docs/admin/nginx-config-example.rst +++ b/docs/admin/nginx-config-example.rst @@ -59,7 +59,7 @@ Use the following example to configure Nginx as a your web server. include /etc/nginx/proxy.conf; ## uncomment to serve static files by nginx - # location /_static { + # location /_static/rhodecode { # alias /path/to/.rccontrol/enterprise-1/static; # } diff --git a/rhodecode/config/middleware.py b/rhodecode/config/middleware.py index d76c1c41..5e4e9d7a 100644 --- a/rhodecode/config/middleware.py +++ b/rhodecode/config/middleware.py @@ -318,7 +318,7 @@ def includeme_first(config): config.add_static_view( '_static/deform', 'deform:static') config.add_static_view( - '_static', path='rhodecode:public', cache_max_age=3600 * 24) + '_static/rhodecode', path='rhodecode:public', cache_max_age=3600 * 24) def wrap_app_in_wsgi_middlewares(pyramid_app, config): """ diff --git a/rhodecode/public/js/src/rhodecode/utils/pyroutes.js b/rhodecode/public/js/src/rhodecode/utils/pyroutes.js index b9b73e85..fbfd4b82 100644 --- a/rhodecode/public/js/src/rhodecode/utils/pyroutes.js +++ b/rhodecode/public/js/src/rhodecode/utils/pyroutes.js @@ -168,7 +168,7 @@ var pyroutes = (function() { }; return { 'asset': function(path, ver) { - var asset_url = ASSET_URL || '/_static/'; + var asset_url = ASSET_URL || '/_static/rhodecode/'; var ret = asset_url + path; if (ver !== undefined) { ret += '?ver=' + ver; diff --git a/rhodecode/templates/debug_style/tables.html b/rhodecode/templates/debug_style/tables.html index b6cb410b..6a256648 100644 --- a/rhodecode/templates/debug_style/tables.html +++ b/rhodecode/templates/debug_style/tables.html @@ -507,7 +507,7 @@ - + default