1
0
Fork 0
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:
Daniel García 2018-12-18 01:53:21 +01:00
parent 9a8cae836b
commit 5fecf09631
No known key found for this signature in database
GPG key ID: FC8A7D14C3CD543A
8 changed files with 228 additions and 6 deletions

View file

@ -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)))