diff --git a/README.md b/README.md index 5e86a32..3c3d695 100644 --- a/README.md +++ b/README.md @@ -84,7 +84,8 @@ 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. Takes precedence above `IMPRINT_HTML`. | +| `IMPRINT_HTML` | `""` | Alternative to `IMPRINT_URL`, this can be used to specify the HTML code to show on `/imprint`. Only `IMPRINT_HTML` or `IMPRINT_URL` should be specified, not both.| ## Deployment > ℹ️ `https` is required otherwise browsers will not support the cryptographic functions. diff --git a/packages/backend/src/config.rs b/packages/backend/src/config.rs index 1d86cd0..318b66f 100644 --- a/packages/backend/src/config.rs +++ b/packages/backend/src/config.rs @@ -38,6 +38,14 @@ 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(); +pub static ref IMPRINT_HTML: String = std::env::var("IMPRINT_HTML") + .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..fcec5d2 100644 --- a/packages/backend/src/status/mod.rs +++ b/packages/backend/src/status/mod.rs @@ -12,6 +12,8 @@ pub struct Status { 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, @@ -28,6 +30,8 @@ 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(), + imprint_html: config::IMPRINT_HTML.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..6f8f010 100644 --- a/packages/cli/src/shared/api.ts +++ b/packages/cli/src/shared/api.ts @@ -113,6 +113,8 @@ export type Status = { max_expiration: number allow_advanced: boolean allow_files: boolean + imprint_url: string + imprint_html: 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..6a19497 100644 --- a/packages/frontend/src/lib/views/Footer.svelte +++ b/packages/frontend/src/lib/views/Footer.svelte @@ -1,5 +1,6 @@