mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2026-06-10 11:16:48 +00:00
e8c3b53e49
- https://github.com/cupcakearmy/cryptgeon/issues/198: Replace abandoned license-checker with license-checker-evergreen - https://github.com/cupcakearmy/cryptgeon/issues/188: Fix Polish locale number formatting by using {n} instead of # in ICU plural forms - https://github.com/cupcakearmy/cryptgeon/issues/190: Add THEME_HOME_LINK env var to conditionally hide the /home link (defaults to true) - Fix Rust 2024 never-type-fallback compatibility in store.rs
46 lines
1.4 KiB
Rust
46 lines
1.4 KiB
Rust
use crate::config;
|
|
use axum::{http::StatusCode, Json};
|
|
use serde::Serialize;
|
|
|
|
#[derive(Serialize)]
|
|
pub struct Status {
|
|
// General
|
|
pub version: String,
|
|
// Config
|
|
pub max_size: u32,
|
|
pub max_views: u32,
|
|
pub max_expiration: u32,
|
|
pub allow_advanced: bool,
|
|
pub allow_files: bool,
|
|
pub imprint_url: String,
|
|
pub imprint_html: String,
|
|
// Theme
|
|
pub theme_image: String,
|
|
pub theme_text: String,
|
|
pub theme_page_title: String,
|
|
pub theme_favicon: String,
|
|
pub theme_new_note_notice: bool,
|
|
pub theme_home_link: bool,
|
|
}
|
|
|
|
pub async fn get_status() -> (StatusCode, Json<Status>) {
|
|
let status = Status {
|
|
version: config::VERSION.to_string(),
|
|
max_size: *config::LIMIT as u32,
|
|
max_views: *config::MAX_VIEWS,
|
|
max_expiration: *config::MAX_EXPIRATION,
|
|
allow_advanced: *config::ALLOW_ADVANCED,
|
|
allow_files: *config::ALLOW_FILES,
|
|
imprint_url: config::IMPRINT_URL.to_string(),
|
|
imprint_html: config::IMPRINT_HTML.to_string(),
|
|
theme_new_note_notice: *config::THEME_NEW_NOTE_NOTICE,
|
|
theme_home_link: *config::THEME_HOME_LINK,
|
|
theme_image: config::THEME_IMAGE.to_string(),
|
|
theme_text: config::THEME_TEXT.to_string(),
|
|
theme_page_title: config::THEME_PAGE_TITLE.to_string(),
|
|
theme_favicon: config::THEME_FAVICON.to_string(),
|
|
};
|
|
|
|
(StatusCode::OK, Json(status))
|
|
}
|