mirror of
https://github.com/dani-garcia/vaultwarden.git
synced 2025-05-20 10:33:55 +00:00
Initial version of admin panel, list users and reload user list works. No serious auth method yet, password is 'token123'
This commit is contained in:
parent
9a8cae836b
commit
5fecf09631
8 changed files with 228 additions and 6 deletions
|
@ -13,7 +13,7 @@ use crate::CONFIG;
|
|||
|
||||
pub fn routes() -> Vec<Route> {
|
||||
if CONFIG.web_vault_enabled {
|
||||
routes![web_index, app_id, web_files, attachments, alive]
|
||||
routes![web_index, app_id, web_files, admin_page, attachments, alive]
|
||||
} else {
|
||||
routes![attachments, alive]
|
||||
}
|
||||
|
@ -41,6 +41,11 @@ fn app_id() -> WebHeaders<Content<Json<Value>>> {
|
|||
}))))
|
||||
}
|
||||
|
||||
#[get("/admin")]
|
||||
fn admin_page() -> WebHeaders<io::Result<NamedFile>> {
|
||||
WebHeaders(NamedFile::open("src/static/admin.html")) // TODO: Change this to embed the page in the binary
|
||||
}
|
||||
|
||||
#[get("/<p..>", rank = 1)] // Only match this if the other routes don't match
|
||||
fn web_files(p: PathBuf) -> WebHeaders<io::Result<NamedFile>> {
|
||||
WebHeaders(NamedFile::open(Path::new(&CONFIG.web_vault_folder).join(p)))
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue