diff --git a/docker/4_run/Dockerfile b/docker/4_run/Dockerfile index eee2634..865f2de 100755 --- a/docker/4_run/Dockerfile +++ b/docker/4_run/Dockerfile @@ -56,3 +56,7 @@ ENTRYPOINT /docker-entrypoint.sh # Add the most-changing files as last step for faster rebuilds. ADD config_local.py /data/git/blender-cloud/ ADD deploy /data/git +RUN python3 -c "import re, secrets; \ +f = open('/data/git/blender-cloud/config_local.py', 'a'); \ +h = re.sub(r'[_.~-]', '', secrets.token_urlsafe())[:8]; \ +print(f'STATIC_FILE_HASH = {h!r}', file=f)" diff --git a/docker/4_run/config_local.py b/docker/4_run/config_local.py index f4a5cf7..22ffa5e 100644 --- a/docker/4_run/config_local.py +++ b/docker/4_run/config_local.py @@ -125,3 +125,7 @@ SMTP_TIMEOUT = 30 # timeout in seconds, https://docs.python.org/3/library/smtpl MAIL_RETRY = 180 # in seconds, delay until trying to send an email again. MAIL_DEFAULT_FROM_NAME = 'Blender Cloud' MAIL_DEFAULT_FROM_ADDR = 'cloudsupport@blender.org' + +# MUST be 8 characters long, see pillar.flask_extra.HashedPathConverter +# STATIC_FILE_HASH = '12345678' +# The value used in production is appended from Dockerfile. diff --git a/src/templates/layout.pug b/src/templates/layout.pug index 35c09aa..08942cc 100644 --- a/src/templates/layout.pug +++ b/src/templates/layout.pug @@ -29,34 +29,34 @@ html(lang="en") meta(name="twitter:image", content="{{ url_for('static', filename='assets/img/backgrounds/background_gleb_locomotive.jpg')}}") | {% endblock og %} - script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery-3.1.0.min.js', v=9112017)}}") - script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.typeahead-0.11.1.min.js', v=9112017)}}") - script(src="{{ url_for('static_pillar', filename='assets/js/vendor/js.cookie-2.0.3.min.js', v=9112017)}}") + script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery-3.1.0.min.js')}}") + script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.typeahead-0.11.1.min.js')}}") + script(src="{{ url_for('static_pillar', filename='assets/js/vendor/js.cookie-2.0.3.min.js')}}") script. | {% if current_user.has_cap('subscriber') %} | {# Only load if we can comment (for converting markdown as-we-type) #} - script(src="{{ url_for('static_pillar', filename='assets/js/markdown.min.js', v=9112017) }}") + script(src="{{ url_for('static_pillar', filename='assets/js/markdown.min.js') }}") | {% endif %} - script(src="{{ url_for('static_pillar', filename='assets/js/tutti.min.js', v=9112017) }}") + script(src="{{ url_for('static_pillar', filename='assets/js/tutti.min.js') }}") link(href="{{ url_for('static', filename='assets/img/favicon.png') }}", rel="shortcut icon") link(href="{{ url_for('static', filename='assets/img/apple-touch-icon-precomposed.png') }}", rel="icon apple-touch-icon-precomposed", sizes="192x192") - link(href="{{ url_for('static_pillar', filename='assets/css/vendor/bootstrap.min.css', v=9112017) }}", rel="stylesheet") - link(href="{{ url_for('static', filename='assets/google-font-roboto/roboto.css', v=9112017) }}", rel="stylesheet") + link(href="{{ url_for('static_pillar', filename='assets/css/vendor/bootstrap.min.css') }}", rel="stylesheet") + link(href="{{ url_for('static', filename='assets/google-font-roboto/roboto.css') }}", rel="stylesheet") | {% block head %}{% endblock %} | {% block css %} - link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css', v=9112017) }}", rel="stylesheet") - link(href="{{ url_for('static_pillar', filename='assets/css/base.css', v=9112017) }}", rel="stylesheet") + link(href="{{ url_for('static_pillar', filename='assets/css/font-pillar.css') }}", rel="stylesheet") + link(href="{{ url_for('static_pillar', filename='assets/css/base.css') }}", rel="stylesheet") | {% if title == 'blog' %} - link(href="{{ url_for('static_pillar', filename='assets/css/blog.css', v=9112017) }}", rel="stylesheet") + link(href="{{ url_for('static_pillar', filename='assets/css/blog.css') }}", rel="stylesheet") | {% else %} - link(href="{{ url_for('static', filename='cloud/assets/css/main.css', v=9112017) }}", rel="stylesheet") + link(href="{{ url_for('static_cloud', filename='assets/css/main.css') }}", rel="stylesheet") | {% endif %} | {% endblock css %} @@ -320,7 +320,7 @@ html(lang="en") noscript link(href='//fonts.googleapis.com/css?family=Roboto:300,400', rel='stylesheet', type='text/css') - script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.bootstrap-3.3.7.min.js', v=9112017) }}") + script(src="{{ url_for('static_pillar', filename='assets/js/vendor/jquery.bootstrap-3.3.7.min.js') }}") script. $(document).ready(function() {