mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2024-11-28 17:09:14 +03:00
Fixed icons and updated web-vault
This commit is contained in:
parent
d5486670d8
commit
0e644d2711
7 changed files with 17 additions and 15 deletions
|
@ -47,7 +47,7 @@ Clone the web-vault outside the project:
|
|||
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
|
||||
{
|
||||
"appSettings": {
|
||||
|
|
|
@ -16,9 +16,11 @@ pub fn routes() -> Vec<Route> {
|
|||
|
||||
#[get("/<domain>/icon.png")]
|
||||
fn icon(domain: String) -> Content<Vec<u8>> {
|
||||
let icon_type = ContentType::new("image", "x-icon");
|
||||
|
||||
// Validate the domain to avoid directory traversal attacks
|
||||
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);
|
||||
|
@ -26,10 +28,10 @@ fn icon(domain: String) -> Content<Vec<u8>> {
|
|||
// Get the icon, or fallback in case of error
|
||||
let icon = match get_icon_cached(&domain, &url) {
|
||||
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> {
|
||||
|
|
|
@ -32,9 +32,9 @@
|
|||
<title page-title>bitwarden Web Vault</title>
|
||||
|
||||
<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="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">
|
||||
|
@ -46,11 +46,11 @@
|
|||
'control-sidebar-open': main.usingControlSidebar && main.openControlSidebar}">
|
||||
<div ui-view></div>
|
||||
|
||||
<script src="js/fallback-scripts.min.js?v=vmy29c"></script>
|
||||
<script src="js/settings.js?v=vmy29c"></script>
|
||||
<script src="js/fallback-scripts.min.js?v=twgcvb"></script>
|
||||
<script src="js/settings.js?v=twgcvb"></script>
|
||||
|
||||
<script src="js/lib.min.js?v=vmy29c"></script>
|
||||
<script src="js/bw.min.js?v=vmy29c"></script>
|
||||
<script src="js/app.min.js?v=vmy29c"></script>
|
||||
<script src="js/lib.min.js?v=twgcvb"></script>
|
||||
<script src="js/bw.min.js?v=twgcvb"></script>
|
||||
<script src="js/app.min.js?v=twgcvb"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
2
web-vault/js/app.min.js
vendored
2
web-vault/js/app.min.js
vendored
File diff suppressed because one or more lines are too long
2
web-vault/js/fallback-styles.min.js
vendored
2
web-vault/js/fallback-styles.min.js
vendored
|
@ -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"]);
|
2
web-vault/js/lib.min.js
vendored
2
web-vault/js/lib.min.js
vendored
File diff suppressed because one or more lines are too long
|
@ -5,6 +5,6 @@
|
|||
<title>U2F Connector</title>
|
||||
</head>
|
||||
<body>
|
||||
<script src="js/u2f.min.js?v=vmy29c"></script>
|
||||
<script src="js/u2f.min.js?v=twgcvb"></script>
|
||||
</body>
|
||||
</html>
|
||||
|
|
Loading…
Reference in a new issue