mirror of
https://github.com/dani-garcia/vaultwarden.wiki.git
synced 2026-10-24 02:36:41 +03:00
Add /api/{alive,now,version} endpoints
The added endpoints work the same as in their upstream implementations. Upstream also implements `/api/ip`. This seems to include the server's public IP address (the one that should be hidden behind Cloudflare), which doesn't seem like a great idea.
This commit is contained in:
1 parent
26ad06df7c
commit
df8aeb10e8
2 files changed
+26
-7
No files matched your search
+2
-4
@@ -5,6 +5,7 @@ use rocket::{fs::NamedFile, http::ContentType, Route};
|
||||
use serde_json::Value;
|
||||
|
||||
use crate::{
|
||||
api::core::now,
|
||||
error::Error,
|
||||
util::{Cached, SafeString},
|
||||
CONFIG,
|
||||
@@ -71,10 +72,7 @@ async fn attachments(uuid: SafeString, file_id: SafeString) -> Option<NamedFile>
|
||||
use crate::db::DbConn;
|
||||
#[get("/alive")]
|
||||
fn alive(_conn: DbConn) -> Json<String> {
|
||||
use crate::util::format_date;
|
||||
use chrono::Utc;
|
||||
|
||||
Json(format_date(&Utc::now().naive_utc()))
|
||||
now()
|
||||
}
|
||||
|
||||
#[get("/vw_static/<filename>")]
|
||||
|
||||
Reference in new issue
Block a user