diff --git a/server/bindata.go b/server/bindata.go index d383806854ce92d3b10db3f023d61131e477f0d2..ec1216ad3998d5b79363328103dd0eccc56fc679 100644 --- a/server/bindata.go +++ b/server/bindata.go @@ -1239,7 +1239,7 @@ var _templatesPageHtml = []byte(`{{define "header"}}<!DOCTYPE html> <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> {{if .U2FSignRequest}}<meta name="u2f_request" value="{{json .U2FSignRequest}}">{{end}} <link rel="stylesheet" href="/static/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"> - <link rel="stylesheet" href="/static/css/signin.css" integrity="sha384-zxlIX2SfN6SpDKbrkQNcrn07kaD/iSlYdEKRCab8ZAcTEvpWshVV4xqTpoQaeyPq"> + <link rel="stylesheet" href="/static/css/signin.css" integrity="sha384-cd2kbbMX+cYhUlp/Xc7Mu9yBphBGNEvZpeIltWsgUMlkt1kNO3hytQQeTglDcMF/"> <title>Sign In</title> </head> @@ -1255,7 +1255,7 @@ var _templatesPageHtml = []byte(`{{define "header"}}<!DOCTYPE html> <script src="/static/js/bootstrap-4.0.0-beta.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"></script> {{if .U2FSignRequest}} <script type="text/javascript" src="/static/js/u2f-api.js" integrity="sha384-9ChevE6pp8ArGK03HgolnFjZbF3webZQtYkwcabzbcI28Lx1/2x2j2fbaAWD4cgR"></script> - <script type="text/javascript" src="/static/js/u2f.js" integrity="sha384-Aw1M0kx84dOGmcbSKwVf6MWXFfyF8YK7LFfpAPqBMG+843kqUeyHNUpEom8kSIiz"></script> + <script type="text/javascript" src="/static/js/u2f.js" integrity="sha384-vd6lytRvVm189G5gr34wlOvN672vVBceTZqV+lTSeec0DBLc0GlWLyKDHc6mrIZS"></script> {{end}} </body> </html> @@ -1272,7 +1272,7 @@ func templatesPageHtml() (*asset, error) { return nil, err } - info := bindataFileInfo{name: "templates/page.html", size: 1493, mode: os.FileMode(436), modTime: time.Unix(1510996183, 0)} + info := bindataFileInfo{name: "templates/page.html", size: 1493, mode: os.FileMode(436), modTime: time.Unix(1511203590, 0)} a := &asset{bytes: bytes, info: info} return a, nil } diff --git a/server/http.go b/server/http.go index 464cda6f7cef03d8cedbca9f8ef35fdaa1ec1fb8..1c97ff434939ce4938d1fabb2d32c15185d1d42f 100644 --- a/server/http.go +++ b/server/http.go @@ -1,5 +1,6 @@ package server +//go:generate python sri.py templates/*.html //go:generate go-bindata --nocompress --pkg server static/... templates/... import ( diff --git a/server/sri.py b/server/sri.py index aea5ac21c2e2d5a7fef67d75606dbfbe1c451e97..ba1a60cf5569bd6d07806531c4298a906edb855d 100755 --- a/server/sri.py +++ b/server/sri.py @@ -3,9 +3,10 @@ # Automatically fix Subresource Integrity links in the HTML templates. # # Pass templates as command-line arguments. Expects to be run from the -# resources/ directory. +# base resource directory. # +import glob import re import sys from hashlib import sha384 @@ -44,9 +45,10 @@ def fix_sri(path): if __name__ == '__main__': - for path in sys.argv[1:]: - try: - fix_sri(path) - except Exception as e: - print >>sys.stderr, "Error fixing %s: %s" % (path, e) + for arg in sys.argv[1:]: + for path in glob.glob(arg): + try: + fix_sri(path) + except Exception as e: + print >>sys.stderr, "Error fixing %s: %s" % (path, e) diff --git a/server/templates/page.html b/server/templates/page.html index 65ebc46608d36daf2a4116bc5ec1fe5f36d70232..e16b0f6f0991fadcfd9a2bfca71b678a2681c287 100644 --- a/server/templates/page.html +++ b/server/templates/page.html @@ -5,7 +5,7 @@ <meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no"> {{if .U2FSignRequest}}<meta name="u2f_request" value="{{json .U2FSignRequest}}">{{end}} <link rel="stylesheet" href="/static/css/bootstrap.min.css" integrity="sha384-/Y6pD6FV/Vv2HJnA6t+vslU6fwYXjCFtcEpHbNJ0lyAFsXTsjBbfaDjzALeQsN6M"> - <link rel="stylesheet" href="/static/css/signin.css" integrity="sha384-zxlIX2SfN6SpDKbrkQNcrn07kaD/iSlYdEKRCab8ZAcTEvpWshVV4xqTpoQaeyPq"> + <link rel="stylesheet" href="/static/css/signin.css" integrity="sha384-cd2kbbMX+cYhUlp/Xc7Mu9yBphBGNEvZpeIltWsgUMlkt1kNO3hytQQeTglDcMF/"> <title>Sign In</title> </head> @@ -21,7 +21,7 @@ <script src="/static/js/bootstrap-4.0.0-beta.min.js" integrity="sha384-h0AbiXch4ZDo7tp9hKZ4TsHbi047NrKGLO3SEJAg45jXxnGIfYzk4Si90RDIqNm1"></script> {{if .U2FSignRequest}} <script type="text/javascript" src="/static/js/u2f-api.js" integrity="sha384-9ChevE6pp8ArGK03HgolnFjZbF3webZQtYkwcabzbcI28Lx1/2x2j2fbaAWD4cgR"></script> - <script type="text/javascript" src="/static/js/u2f.js" integrity="sha384-Aw1M0kx84dOGmcbSKwVf6MWXFfyF8YK7LFfpAPqBMG+843kqUeyHNUpEom8kSIiz"></script> + <script type="text/javascript" src="/static/js/u2f.js" integrity="sha384-vd6lytRvVm189G5gr34wlOvN672vVBceTZqV+lTSeec0DBLc0GlWLyKDHc6mrIZS"></script> {{end}} </body> </html>