diff --git a/README.md b/README.md index 5e86a32..6c4c085 100644 --- a/README.md +++ b/README.md @@ -84,6 +84,7 @@ of the notes even if it tried to. | `THEME_PAGE_TITLE` | `""` | Custom text the page title | | `THEME_FAVICON` | `""` | Custom url for the favicon. Must be publicly reachable | | `THEME_NEW_NOTE_NOTICE` | `true` | Show the message about how notes are stored in the memory and may be evicted after creating a new note. Defaults to `true`. | +| `IMPRINT_URL` | `""` | Custom url for an Imprint hosted somewhere else. Must be publicly reachable. | ## Deployment diff --git a/packages/backend/src/config.rs b/packages/backend/src/config.rs index 1d86cd0..6dbd700 100644 --- a/packages/backend/src/config.rs +++ b/packages/backend/src/config.rs @@ -38,6 +38,10 @@ pub static ref ALLOW_FILES: bool = std::env::var("ALLOW_FILES") .unwrap_or("true".to_string()) .parse() .unwrap(); +pub static ref IMPRINT_URL: String = std::env::var("IMPRINT_URL") + .unwrap_or("".to_string()) + .parse() + .unwrap(); } // THEME diff --git a/packages/backend/src/status/mod.rs b/packages/backend/src/status/mod.rs index 80deeae..db8a4d9 100644 --- a/packages/backend/src/status/mod.rs +++ b/packages/backend/src/status/mod.rs @@ -12,6 +12,7 @@ pub struct Status { pub max_expiration: u32, pub allow_advanced: bool, pub allow_files: bool, + pub imprint_url: String, // Theme pub theme_image: String, pub theme_text: String, @@ -28,6 +29,7 @@ pub async fn get_status() -> (StatusCode, Json) { max_expiration: *config::MAX_EXPIRATION, allow_advanced: *config::ALLOW_ADVANCED, allow_files: *config::ALLOW_FILES, + imprint_url: config::IMPRINT_URL.to_string(), theme_new_note_notice: *config::THEME_NEW_NOTE_NOTICE, theme_image: config::THEME_IMAGE.to_string(), theme_text: config::THEME_TEXT.to_string(), diff --git a/packages/cli/src/shared/api.ts b/packages/cli/src/shared/api.ts index fa085ac..abc50f9 100644 --- a/packages/cli/src/shared/api.ts +++ b/packages/cli/src/shared/api.ts @@ -113,6 +113,7 @@ export type Status = { max_expiration: number allow_advanced: boolean allow_files: boolean + imprint_url: string theme_image: string theme_text: string theme_favicon: string diff --git a/packages/frontend/src/lib/views/Footer.svelte b/packages/frontend/src/lib/views/Footer.svelte index 7753373..481139e 100644 --- a/packages/frontend/src/lib/views/Footer.svelte +++ b/packages/frontend/src/lib/views/Footer.svelte @@ -1,5 +1,6 @@