diff --git a/lib/static/views.js b/lib/static/views.js index 957bfb09c92d0b3d1e6ec25d0392c9222d6f2530..65fe37fa4b2007b9fa2ff2d3fbcebac9a2f129eb 100644 --- a/lib/static/views.js +++ b/lib/static/views.js @@ -13,7 +13,8 @@ und = require('underscore'), util = require('util'), httputils = require('../httputils.js'), etagify = require('etagify'), -secrets = require('../secrets'); +secrets = require('../secrets'), +version = require('../version'); require("jwcrypto/lib/algs/rs"); @@ -43,6 +44,12 @@ function renderCachableView(req, res, template, options) { options.enable_development_menu = config.get('enable_development_menu'); + // The real version number is not ready until sometime after initial load, + // until it is ready a fake randomly generated string is used. Go get + // the real SHA whenever it is actually needed so that the randomly + // generated SHA is not returned to the user. + options.commit = version(); + res.local('util', util); res.render(template, options); } diff --git a/resources/views/authenticate_with_primary.ejs b/resources/views/authenticate_with_primary.ejs index 45f8dab1d09c80d294440ce144536cd12cac2259..57ef4cc40d5e7743e8eeea1de8153a4480d49aae 100644 --- a/resources/views/authenticate_with_primary.ejs +++ b/resources/views/authenticate_with_primary.ejs @@ -1,7 +1,5 @@ <!DOCTYPE html> -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<%- partial('partial/license_with_code_ver') %> <html> <head> <meta charset="utf-8"> diff --git a/resources/views/communication_iframe.ejs b/resources/views/communication_iframe.ejs index 147b0228a8e6a400f841f2cbadbf60459ef7823b..66c8e0f400d009656402a2c4b5531984c1e2c6d3 100644 --- a/resources/views/communication_iframe.ejs +++ b/resources/views/communication_iframe.ejs @@ -1,7 +1,5 @@ <!DOCTYPE html> -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<%- partial('partial/license_with_code_ver') %> <html> <head><title>non-interactive iframe</title> <meta charset="utf-8"> diff --git a/resources/views/dialog_layout.ejs b/resources/views/dialog_layout.ejs index 6e567ccba473db1379e4d8c96d75c99a5292d420..5700e6d410d166daf2f68ef74521930085db8bc3 100644 --- a/resources/views/dialog_layout.ejs +++ b/resources/views/dialog_layout.ejs @@ -1,8 +1,5 @@ <!DOCTYPE html> -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> - +<%- partial('partial/license_with_code_ver') %> <html LANG="<%= lang %>" dir="<%= lang_dir %>"> <head> <meta charset="utf-8"> diff --git a/resources/views/layout.ejs b/resources/views/layout.ejs index cbc7cc078e9ea6f1f6e0dbb0f6b13347196e1094..bea90bcae84c2dad6a30d0d250760a08b687b485 100644 --- a/resources/views/layout.ejs +++ b/resources/views/layout.ejs @@ -1,7 +1,5 @@ <!DOCTYPE html> -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<%- partial('partial/license_with_code_ver') %> <html> <head> <meta charset="utf-8"> diff --git a/resources/views/partial/license_with_code_ver.ejs b/resources/views/partial/license_with_code_ver.ejs new file mode 100644 index 0000000000000000000000000000000000000000..7cc908f73db6e0030d843f5af80425a27e81a5cd --- /dev/null +++ b/resources/views/partial/license_with_code_ver.ejs @@ -0,0 +1,7 @@ +<!-- This Source Code Form is subject to the terms of the Mozilla Public + - License, v. 2.0. If a copy of the MPL was not distributed with this + - file, You can obtain one at http://mozilla.org/MPL/2.0/. + - Source: https://github.com/mozilla/browserid/ + - Current Commit: https://github.com/mozilla/browserid/commit/<%- commit %> +--> + diff --git a/resources/views/relay.ejs b/resources/views/relay.ejs index 4ee25e8a7607c8c11afac7ebb0859c46da746d2f..a530006e70b4b6633a0b3e3ce4f2efe4daebe059 100644 --- a/resources/views/relay.ejs +++ b/resources/views/relay.ejs @@ -1,7 +1,5 @@ <!DOCTYPE html> -<!-- This Source Code Form is subject to the terms of the Mozilla Public - - License, v. 2.0. If a copy of the MPL was not distributed with this - - file, You can obtain one at http://mozilla.org/MPL/2.0/. --> +<%- partial('partial/license_with_code_ver') %> <html> <head> <meta charset="utf-8">