Browse Source
Remove references to "bwrs"
The only remaining one is getting the version of the web vault, which requires coordinating with the web vault patching.
pull/2195/head
Jake Howard
4 years ago
No known key found for this signature in database
GPG Key ID: 57AFB45680EDD477
10 changed files with
30 additions and
29 deletions
build.rs
src/api/admin.rs
src/api/core/mod.rs
src/api/web.rs
src/main.rs
src/static/templates/admin/base.hbs
src/static/templates/admin/organizations.hbs
src/static/templates/admin/users.hbs
src/static/templates/email/email_footer.hbs
src/static/templates/email/email_header.hbs
@ -15,8 +15,8 @@ fn main() {
"You need to enable one DB backend. To build with previous defaults do: cargo build --features sqlite"
) ;
if let Ok ( version ) = env ::var ( "BWRS _VERSION" ) {
println ! ( "cargo:rustc-env=BWRS _VERSION={}" , version ) ;
if let Ok ( version ) = env ::var ( "VW _VERSION" ) {
println ! ( "cargo:rustc-env=VW _VERSION={}" , version ) ;
println ! ( "cargo:rustc-env=CARGO_PKG_VERSION={}" , version ) ;
} else {
read_git_info ( ) . ok ( ) ;
@ -64,7 +64,7 @@ fn read_git_info() -> Result<(), std::io::Error> {
format ! ( "{}-{}" , last_tag , rev_short )
} ;
println ! ( "cargo:rustc-env=BWRS _VERSION={}" , version ) ;
println ! ( "cargo:rustc-env=VW _VERSION={}" , version ) ;
println ! ( "cargo:rustc-env=CARGO_PKG_VERSION={}" , version ) ;
// To access these values, use:
@ -72,7 +72,7 @@ fn read_git_info() -> Result<(), std::io::Error> {
// env!("GIT_LAST_TAG")
// env!("GIT_BRANCH")
// env!("GIT_REV")
// env!("BWRS _VERSION")
// env!("VW _VERSION")
Ok ( ( ) )
}
@ -21,7 +21,7 @@ use crate::{
util ::{
docker_base_image , format_naive_datetime_local , get_display_size , get_reqwest_client , is_running_in_docker ,
} ,
CONFIG ,
CONFIG , VERSION ,
} ;
pub fn routes ( ) -> Vec < Route > {
@ -74,11 +74,10 @@ fn admin_disabled() -> &'static str {
"The admin panel is disabled, please configure the 'ADMIN_TOKEN' variable to enable it"
}
const COOKIE_NAME : & str = "BWRS _ADMIN" ;
const COOKIE_NAME : & str = "VW _ADMIN" ;
const ADMIN_PATH : & str = "/admin" ;
const BASE_TEMPLATE : & str = "admin/base" ;
const VERSION : Option < & str > = option_env ! ( "BWRS_VERSION" ) ;
fn admin_path ( ) -> String {
format ! ( "{}{}" , CONFIG . domain_path ( ) , ADMIN_PATH )
@ -170,7 +170,7 @@ fn hibp_breach(username: String) -> JsonResult {
"BreachDate" : "2019-08-18T00:00:00Z" ,
"AddedDate" : "2019-08-18T00:00:00Z" ,
"Description" : format ! ( "Go to: <a href=\"https://haveibeenpwned.com/account/{account}\" target=\"_blank\" rel=\"noreferrer\">https://haveibeenpwned.com/account/{account}</a> for a manual check.<br/><br/>HaveIBeenPwned API key not set!<br/>Go to <a href=\"https://haveibeenpwned.com/API/Key\" target=\"_blank\" rel=\"noreferrer\">https://haveibeenpwned.com/API/Key</a> to purchase an API key from HaveIBeenPwned.<br/><br/>" , account = username ) ,
"LogoPath" : "bwrs _static/hibp.png" ,
"LogoPath" : "vw _static/hibp.png" ,
"PwnCount" : 0 ,
"DataClasses" : [
"Error - No API key set!"
@ -77,7 +77,7 @@ fn alive(_conn: DbConn) -> Json<String> {
Json ( format_date ( & Utc ::now ( ) . naive_utc ( ) ) )
}
#[ get( " /bwrs _static/<filename> " ) ]
#[ get( " /vw _static/<filename> " ) ]
fn static_files ( filename : String ) -> Result < Content < & 'static [ u8 ] > , Error > {
match filename . as_ref ( ) {
"mail-github.png" = > Ok ( Content ( ContentType ::PNG , include_bytes ! ( "../static/images/mail-github.png" ) ) ) ,
@ -76,16 +76,18 @@ const HELP: &str = "\
- v , - - version Prints the app version
" ;
pub const VERSION : Option < & str > = option_env ! ( "VW_VERSION" ) ;
fn parse_args ( ) {
const NO_VERSION : & str = "(Version info from Git not present)" ;
let mut pargs = pico_args ::Arguments ::from_env ( ) ;
let version = VERSION . unwrap_or ( "(Version info from Git not present)" ) ;
if pargs . contains ( [ "-h" , "--help" ] ) {
println ! ( "vaultwarden {}" , option_env ! ( "BWRS_VERSION" ) . unwrap_or ( NO_VERSION ) ) ;
println ! ( "vaultwarden {}" , version ) ;
print ! ( "{}" , HELP ) ;
exit ( 0 ) ;
} else if pargs . contains ( [ "-v" , "--version" ] ) {
println ! ( "vaultwarden {}" , option_env ! ( "BWRS_VERSION" ) . unwrap_or ( NO_VERSION ) ) ;
println ! ( "vaultwarden {}" , version ) ;
exit ( 0 ) ;
}
}
@ -94,7 +96,7 @@ fn launch_info() {
println ! ( "/--------------------------------------------------------------------\\" ) ;
println ! ( "| Starting Vaultwarden |" ) ;
if let Some ( version ) = option_env ! ( "BWRS_ VERSION" ) {
if let Some ( version ) = VERSION {
println ! ( "|{:^68}|" , format ! ( "Version {}" , version ) ) ;
}
@ -4,9 +4,9 @@
<meta http-equiv="content-type" content="text/html; charset=UTF-8" />
<meta name="viewport" content="width=device-width, initial-scale=1, shrink-to-fit=no" />
<meta name="robots" content="noindex,nofollow" />
<link rel="icon" type="image/png" href=" {{ urlpath }} /bwrs _static/vaultwarden-icon.png">
<link rel="icon" type="image/png" href=" {{ urlpath }} /vw _static/vaultwarden-icon.png">
<title>Vaultwarden Admin Panel</title>
<link rel="stylesheet" href=" {{ urlpath }} /bwrs _static/bootstrap.css" />
<link rel="stylesheet" href=" {{ urlpath }} /vw _static/bootstrap.css" />
<style>
body {
padding-top: 75px;
@ -21,7 +21,7 @@
margin: -5px 0 0 0;
}
</style>
<script src=" {{ urlpath }} /bwrs _static/identicon.js"></script>
<script src=" {{ urlpath }} /vw _static/identicon.js"></script>
<script>
'use strict';
@ -85,7 +85,7 @@
<body class="bg-light">
<nav class="navbar navbar-expand-md navbar-dark bg-dark mb-4 shadow fixed-top">
<div class="container-xl">
<a class="navbar-brand" href=" {{ urlpath }} /admin"><img class="vaultwarden-icon" src=" {{ urlpath }} /bwrs _static/vaultwarden-icon.png" alt="V">aultwarden Admin</a>
<a class="navbar-brand" href=" {{ urlpath }} /admin"><img class="vaultwarden-icon" src=" {{ urlpath }} /vw _static/vaultwarden-icon.png" alt="V">aultwarden Admin</a>
<button class="navbar-toggler" type="button" data-bs-toggle="collapse" data-bs-target="#navbarCollapse"
aria-controls="navbarCollapse" aria-expanded="false" aria-label="Toggle navigation">
<span class="navbar-toggler-icon"></span>
@ -135,6 +135,6 @@
}
})();
</script>
<script src=" {{ urlpath }} /bwrs _static/bootstrap-native.js"></script>
<script src=" {{ urlpath }} /vw _static/bootstrap-native.js"></script>
</body>
</html>
@ -48,9 +48,9 @@
</div>
</main>
<link rel="stylesheet" href=" {{ urlpath }} /bwrs _static/datatables.css" />
<script src=" {{ urlpath }} /bwrs _static/jquery-3.6.0.slim.js"></script>
<script src=" {{ urlpath }} /bwrs _static/datatables.js"></script>
<link rel="stylesheet" href=" {{ urlpath }} /vw _static/datatables.css" />
<script src=" {{ urlpath }} /vw _static/jquery-3.6.0.slim.js"></script>
<script src=" {{ urlpath }} /vw _static/datatables.js"></script>
<script>
'use strict';
@ -135,9 +135,9 @@
</div>
</main>
<link rel="stylesheet" href=" {{ urlpath }} /bwrs _static/datatables.css" />
<script src=" {{ urlpath }} /bwrs _static/jquery-3.6.0.slim.js"></script>
<script src=" {{ urlpath }} /bwrs _static/datatables.js"></script>
<link rel="stylesheet" href=" {{ urlpath }} /vw _static/datatables.css" />
<script src=" {{ urlpath }} /vw _static/jquery-3.6.0.slim.js"></script>
<script src=" {{ urlpath }} /vw _static/datatables.js"></script>
<script>
'use strict';
@ -10,7 +10,7 @@
<td class="aligncenter social-icons" align="center" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; margin: 0; padding: 15px 0 0 0;" valign="top">
<table cellpadding="0" cellspacing="0" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0 auto;">
<tr style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0;">
<td style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; margin: 0; padding: 0 10px;" valign="top"><a href="https://github.com/dani-garcia/vaultwarden" target="_blank" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; margin: 0; text-decoration: underline;"><img src=" {{ url }} /bwrs _static/mail-github.png" alt="GitHub" width="30" height="30" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; border: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0; max-width: 100%;" /></a></td>
<td style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; margin: 0; padding: 0 10px;" valign="top"><a href="https://github.com/dani-garcia/vaultwarden" target="_blank" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #999; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 12px; line-height: 20px; margin: 0; text-decoration: underline;"><img src=" {{ url }} /vw _static/mail-github.png" alt="GitHub" width="30" height="30" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; border: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0; max-width: 100%;" /></a></td>
</tr>
</table>
</td>
@ -81,7 +81,7 @@
<table class="body-wrap" cellpadding="0" cellspacing="0" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0; width: 100%;" bgcolor="#f6f6f6">
<tr style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0;">
<td valign="middle" class="aligncenter middle logo" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0; padding: 20px 0 10px;" align="center">
<img src=" {{ url }} /bwrs _static/logo-gray.png" alt="" width="190" height="39" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; border: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0; max-width: 100%;" />
<img src=" {{ url }} /vw _static/logo-gray.png" alt="" width="190" height="39" style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; border: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0; max-width: 100%;" />
</td>
</tr>
<tr style="-webkit-font-smoothing: antialiased; -webkit-text-size-adjust: none; box-sizing: border-box; color: #333; font-family: 'Helvetica Neue', Helvetica, Arial, sans-serif; font-size: 16px; line-height: 25px; margin: 0;">