Fixed icons and updated web-vault

This commit is contained in:
Daniel García 2018-02-17 18:48:42 +01:00
parent d5486670d8
commit 0e644d2711
7 changed files with 17 additions and 15 deletions

View File

@ -47,7 +47,7 @@ Clone the web-vault outside the project:
git clone https://github.com/bitwarden/web.git web-vault git clone https://github.com/bitwarden/web.git web-vault
``` ```
Modify `web-vault/settings.json` to look like this: Modify `web-vault/settings.Production.json` to look like this:
```json ```json
{ {
"appSettings": { "appSettings": {

View File

@ -16,9 +16,11 @@ pub fn routes() -> Vec<Route> {
#[get("/<domain>/icon.png")] #[get("/<domain>/icon.png")]
fn icon(domain: String) -> Content<Vec<u8>> { fn icon(domain: String) -> Content<Vec<u8>> {
let icon_type = ContentType::new("image", "x-icon");
// Validate the domain to avoid directory traversal attacks // Validate the domain to avoid directory traversal attacks
if domain.contains("/") || domain.contains("..") { if domain.contains("/") || domain.contains("..") {
return Content(ContentType::PNG, get_fallback_icon()); return Content(icon_type, get_fallback_icon());
} }
let url = format!("https://icons.bitwarden.com/{}/icon.png", domain); let url = format!("https://icons.bitwarden.com/{}/icon.png", domain);
@ -26,10 +28,10 @@ fn icon(domain: String) -> Content<Vec<u8>> {
// Get the icon, or fallback in case of error // Get the icon, or fallback in case of error
let icon = match get_icon_cached(&domain, &url) { let icon = match get_icon_cached(&domain, &url) {
Ok(icon) => icon, Ok(icon) => icon,
Err(_) => return Content(ContentType::PNG, get_fallback_icon()) Err(_) => return Content(icon_type, get_fallback_icon())
}; };
Content(ContentType::PNG, icon) Content(icon_type, icon)
} }
fn get_icon(url: &str) -> Result<Vec<u8>, reqwest::Error> { fn get_icon(url: &str) -> Result<Vec<u8>, reqwest::Error> {

View File

@ -32,9 +32,9 @@
<title page-title>bitwarden Web Vault</title> <title page-title>bitwarden Web Vault</title>
<meta name="x-stylesheet-test" content="" class="fa invisible" /> <meta name="x-stylesheet-test" content="" class="fa invisible" />
<script src="js/fallback-styles.min.js?v=vmy29c"></script> <script src="js/fallback-styles.min.js?v=twgcvb"></script>
<link rel="stylesheet" href="css/vault.min.css?v=vmy29c" /> <link rel="stylesheet" href="css/vault.min.css?v=twgcvb" />
<link rel="apple-touch-icon" sizes="180x180" href="images/icons/apple-touch-icon.png"> <link rel="apple-touch-icon" sizes="180x180" href="images/icons/apple-touch-icon.png">
<link rel="icon" type="image/png" sizes="32x32" href="images/icons/favicon-32x32.png"> <link rel="icon" type="image/png" sizes="32x32" href="images/icons/favicon-32x32.png">
<link rel="icon" type="image/png" sizes="16x16" href="images/icons/favicon-16x16.png"> <link rel="icon" type="image/png" sizes="16x16" href="images/icons/favicon-16x16.png">
@ -46,11 +46,11 @@
'control-sidebar-open': main.usingControlSidebar && main.openControlSidebar}"> 'control-sidebar-open': main.usingControlSidebar && main.openControlSidebar}">
<div ui-view></div> <div ui-view></div>
<script src="js/fallback-scripts.min.js?v=vmy29c"></script> <script src="js/fallback-scripts.min.js?v=twgcvb"></script>
<script src="js/settings.js?v=vmy29c"></script> <script src="js/settings.js?v=twgcvb"></script>
<script src="js/lib.min.js?v=vmy29c"></script> <script src="js/lib.min.js?v=twgcvb"></script>
<script src="js/bw.min.js?v=vmy29c"></script> <script src="js/bw.min.js?v=twgcvb"></script>
<script src="js/app.min.js?v=vmy29c"></script> <script src="js/app.min.js?v=twgcvb"></script>
</body> </body>
</html> </html>

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
var cacheTag="vmy29c";function loadStylesheetIfMissing(e,t,s){var i=document.getElementsByTagName("SCRIPT"),l=i[i.length-1].previousElementSibling,n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(l):l.currentStyle;if(n&&n[e]!==t)for(var o=0;o<s.length;o++)document.write('<link rel="stylesheet" href="'+s[o]+"?v="+cacheTag+'" />')}loadStylesheetIfMissing("visibility","hidden",["lib/bootstrap/css/bootstrap.min.css"]),loadStylesheetIfMissing("fontFamily","FontAwesome",["lib/font-awesome/css/font-awesome.min.css"]); var cacheTag="twgcvb";function loadStylesheetIfMissing(e,t,s){var i=document.getElementsByTagName("SCRIPT"),l=i[i.length-1].previousElementSibling,n=document.defaultView&&document.defaultView.getComputedStyle?document.defaultView.getComputedStyle(l):l.currentStyle;if(n&&n[e]!==t)for(var o=0;o<s.length;o++)document.write('<link rel="stylesheet" href="'+s[o]+"?v="+cacheTag+'" />')}loadStylesheetIfMissing("visibility","hidden",["lib/bootstrap/css/bootstrap.min.css"]),loadStylesheetIfMissing("fontFamily","FontAwesome",["lib/font-awesome/css/font-awesome.min.css"]);

File diff suppressed because one or more lines are too long

View File

@ -5,6 +5,6 @@
<title>U2F Connector</title> <title>U2F Connector</title>
</head> </head>
<body> <body>
<script src="js/u2f.min.js?v=vmy29c"></script> <script src="js/u2f.min.js?v=twgcvb"></script>
</body> </body>
</html> </html>