mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-23 00:36:28 +00:00
Compare commits
5 Commits
a47b8a482c
...
c7ec587a2d
Author | SHA1 | Date | |
---|---|---|---|
c7ec587a2d | |||
3e8e82f51c | |||
|
c314d4b485 | ||
|
57ea5f0b28 | ||
|
fca8761515 |
@ -84,7 +84,8 @@ of the notes even if it tried to.
|
|||||||
| `THEME_PAGE_TITLE` | `""` | Custom text the page title |
|
| `THEME_PAGE_TITLE` | `""` | Custom text the page title |
|
||||||
| `THEME_FAVICON` | `""` | Custom url for the favicon. Must be publicly reachable |
|
| `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`. |
|
| `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
|
## Deployment
|
||||||
|
|
||||||
> ℹ️ `https` is required otherwise browsers will not support the cryptographic functions.
|
> ℹ️ `https` is required otherwise browsers will not support the cryptographic functions.
|
||||||
|
2
packages/backend/Cargo.lock
generated
2
packages/backend/Cargo.lock
generated
@ -261,7 +261,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "cryptgeon"
|
name = "cryptgeon"
|
||||||
version = "2.8.2"
|
version = "2.8.3"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"axum",
|
"axum",
|
||||||
"bs62",
|
"bs62",
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "cryptgeon"
|
name = "cryptgeon"
|
||||||
version = "2.8.2"
|
version = "2.8.3"
|
||||||
authors = ["cupcakearmy <hi@nicco.io>"]
|
authors = ["cupcakearmy <hi@nicco.io>"]
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
rust-version = "1.80"
|
rust-version = "1.80"
|
||||||
|
@ -38,6 +38,14 @@ pub static ref ALLOW_FILES: bool = std::env::var("ALLOW_FILES")
|
|||||||
.unwrap_or("true".to_string())
|
.unwrap_or("true".to_string())
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.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
|
// THEME
|
||||||
|
@ -12,6 +12,8 @@ pub struct Status {
|
|||||||
pub max_expiration: u32,
|
pub max_expiration: u32,
|
||||||
pub allow_advanced: bool,
|
pub allow_advanced: bool,
|
||||||
pub allow_files: bool,
|
pub allow_files: bool,
|
||||||
|
pub imprint_url: String,
|
||||||
|
pub imprint_html: String,
|
||||||
// Theme
|
// Theme
|
||||||
pub theme_image: String,
|
pub theme_image: String,
|
||||||
pub theme_text: String,
|
pub theme_text: String,
|
||||||
@ -28,6 +30,8 @@ pub async fn get_status() -> (StatusCode, Json<Status>) {
|
|||||||
max_expiration: *config::MAX_EXPIRATION,
|
max_expiration: *config::MAX_EXPIRATION,
|
||||||
allow_advanced: *config::ALLOW_ADVANCED,
|
allow_advanced: *config::ALLOW_ADVANCED,
|
||||||
allow_files: *config::ALLOW_FILES,
|
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_new_note_notice: *config::THEME_NEW_NOTE_NOTICE,
|
||||||
theme_image: config::THEME_IMAGE.to_string(),
|
theme_image: config::THEME_IMAGE.to_string(),
|
||||||
theme_text: config::THEME_TEXT.to_string(),
|
theme_text: config::THEME_TEXT.to_string(),
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "cryptgeon",
|
"name": "cryptgeon",
|
||||||
"version": "2.8.2",
|
"version": "2.8.3",
|
||||||
"homepage": "https://github.com/cupcakearmy/cryptgeon",
|
"homepage": "https://github.com/cupcakearmy/cryptgeon",
|
||||||
"repository": {
|
"repository": {
|
||||||
"type": "git",
|
"type": "git",
|
||||||
|
@ -113,6 +113,8 @@ export type Status = {
|
|||||||
max_expiration: number
|
max_expiration: number
|
||||||
allow_advanced: boolean
|
allow_advanced: boolean
|
||||||
allow_files: boolean
|
allow_files: boolean
|
||||||
|
imprint_url: string
|
||||||
|
imprint_html: string
|
||||||
theme_image: string
|
theme_image: string
|
||||||
theme_text: string
|
theme_text: string
|
||||||
theme_favicon: string
|
theme_favicon: string
|
||||||
|
@ -1,5 +1,6 @@
|
|||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import ThemeToggle from '$lib/ui/ThemeToggle.svelte'
|
import ThemeToggle from '$lib/ui/ThemeToggle.svelte'
|
||||||
|
import { status } from '$lib/stores/status'
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<footer>
|
<footer>
|
||||||
@ -7,6 +8,11 @@
|
|||||||
<nav>
|
<nav>
|
||||||
<a href="/">/home</a>
|
<a href="/">/home</a>
|
||||||
<a href="/about">/about</a>
|
<a href="/about">/about</a>
|
||||||
|
{#if $status?.imprint_url}
|
||||||
|
<a href={$status.imprint_url} target="_blank" rel="noopener noreferrer">/imprint</a>
|
||||||
|
{:else if $status?.imprint_html}
|
||||||
|
<a href="/imprint">/imprint</a>
|
||||||
|
{/if}
|
||||||
<a href="https://github.com/cupcakearmy/cryptgeon" target="_blank" rel="noopener noreferrer">
|
<a href="https://github.com/cupcakearmy/cryptgeon" target="_blank" rel="noopener noreferrer">
|
||||||
code
|
code
|
||||||
</a>
|
</a>
|
||||||
|
35
packages/frontend/src/routes/imprint/+page.svelte
Normal file
35
packages/frontend/src/routes/imprint/+page.svelte
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
<script lang="ts">
|
||||||
|
import { get } from 'svelte/store';
|
||||||
|
import { goto } from '$app/navigation';
|
||||||
|
import { status } from '$lib/stores/status'
|
||||||
|
|
||||||
|
status.subscribe((config) => {
|
||||||
|
if (config != null) {
|
||||||
|
if (config.imprint_url) {
|
||||||
|
window.location = config.imprint_url;
|
||||||
|
}
|
||||||
|
else if (config.imprint_html == "") {
|
||||||
|
goto("/about");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
</script>
|
||||||
|
|
||||||
|
<svelte:head>
|
||||||
|
<title>Imprint</title>
|
||||||
|
</svelte:head>
|
||||||
|
|
||||||
|
<section class="content">
|
||||||
|
{#if $status?.imprint_html}
|
||||||
|
{@html $status.imprint_html}
|
||||||
|
{/if}
|
||||||
|
</section>
|
||||||
|
|
||||||
|
<style>
|
||||||
|
section {
|
||||||
|
width: 100%;
|
||||||
|
display: flex;
|
||||||
|
flex-direction: column;
|
||||||
|
gap: 2rem;
|
||||||
|
}
|
||||||
|
</style>
|
Loading…
Reference in New Issue
Block a user