mirror of
https://github.com/cupcakearmy/cryptgeon.git
synced 2024-12-22 08:16:28 +00:00
NEW_NOTE_NOTICE feature flag
This commit is contained in:
parent
4781882c72
commit
e70f06f99f
@ -70,6 +70,7 @@ of the notes even if it tried to.
|
|||||||
| `MAX_EXPIRATION` | `360` | Maximal expiration in minutes. |
|
| `MAX_EXPIRATION` | `360` | Maximal expiration in minutes. |
|
||||||
| `ALLOW_ADVANCED` | `true` | Allow custom configuration. If set to `false` all notes will be one view only. |
|
| `ALLOW_ADVANCED` | `true` | Allow custom configuration. If set to `false` all notes will be one view only. |
|
||||||
| `ALLOW_FILES` | `true` | Allow uploading files. If set to `false`, users will only be allowed to create text notes. |
|
| `ALLOW_FILES` | `true` | Allow uploading files. If set to `false`, users will only be allowed to create text notes. |
|
||||||
|
| `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`. |
|
||||||
| `ID_LENGTH` | `32` | Set the size of the note `id` in bytes. By default this is `32` bytes. This is useful for reducing link size. _This setting does not affect encryption strength_. |
|
| `ID_LENGTH` | `32` | Set the size of the note `id` in bytes. By default this is `32` bytes. This is useful for reducing link size. _This setting does not affect encryption strength_. |
|
||||||
| `VERBOSITY` | `warn` | Verbosity level for the backend. [Possible values](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) are: `error`, `warn`, `info`, `debug`, `trace` |
|
| `VERBOSITY` | `warn` | Verbosity level for the backend. [Possible values](https://docs.rs/env_logger/latest/env_logger/#enabling-logging) are: `error`, `warn`, `info`, `debug`, `trace` |
|
||||||
| `THEME_IMAGE` | `""` | Custom image for replacing the logo. Must be publicly reachable |
|
| `THEME_IMAGE` | `""` | Custom image for replacing the logo. Must be publicly reachable |
|
||||||
|
@ -14,30 +14,34 @@ lazy_static! {
|
|||||||
|
|
||||||
// CONFIG
|
// CONFIG
|
||||||
lazy_static! {
|
lazy_static! {
|
||||||
pub static ref LIMIT: usize =
|
pub static ref LIMIT: usize =
|
||||||
Byte::from_str(std::env::var("SIZE_LIMIT").unwrap_or("1 KiB".to_string()))
|
Byte::from_str(std::env::var("SIZE_LIMIT").unwrap_or("1 KiB".to_string()))
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.get_bytes() as usize;
|
.get_bytes() as usize;
|
||||||
pub static ref MAX_VIEWS: u32 = std::env::var("MAX_VIEWS")
|
pub static ref MAX_VIEWS: u32 = std::env::var("MAX_VIEWS")
|
||||||
.unwrap_or("100".to_string())
|
.unwrap_or("100".to_string())
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
pub static ref MAX_EXPIRATION: u32 = std::env::var("MAX_EXPIRATION")
|
pub static ref MAX_EXPIRATION: u32 = std::env::var("MAX_EXPIRATION")
|
||||||
.unwrap_or("360".to_string()) // 6 hours in minutes
|
.unwrap_or("360".to_string()) // 6 hours in minutes
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
pub static ref ALLOW_ADVANCED: bool = std::env::var("ALLOW_ADVANCED")
|
pub static ref ALLOW_ADVANCED: bool = std::env::var("ALLOW_ADVANCED")
|
||||||
.unwrap_or("true".to_string())
|
.unwrap_or("true".to_string())
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
pub static ref ID_LENGTH: u32 = std::env::var("ID_LENGTH")
|
pub static ref ID_LENGTH: u32 = std::env::var("ID_LENGTH")
|
||||||
.unwrap_or("32".to_string())
|
.unwrap_or("32".to_string())
|
||||||
.parse()
|
.parse()
|
||||||
.unwrap();
|
.unwrap();
|
||||||
pub static ref ALLOW_FILES: bool = std::env::var("ALLOW_FILES")
|
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 NEW_NOTE_NOTICE: bool = std::env::var("NEW_NOTE_NOTICE")
|
||||||
|
.unwrap_or("true".to_string())
|
||||||
|
.parse()
|
||||||
|
.unwrap();
|
||||||
}
|
}
|
||||||
|
|
||||||
// THEME
|
// THEME
|
||||||
|
@ -10,6 +10,7 @@ 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 new_note_notice: bool,
|
||||||
// Theme
|
// Theme
|
||||||
pub theme_image: String,
|
pub theme_image: String,
|
||||||
pub theme_text: String,
|
pub theme_text: String,
|
||||||
|
@ -12,6 +12,7 @@ async fn get_status() -> impl Responder {
|
|||||||
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,
|
||||||
|
new_note_notice: *config::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(),
|
||||||
theme_page_title: config::THEME_PAGE_TITLE.to_string(),
|
theme_page_title: config::THEME_PAGE_TITLE.to_string(),
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
import { t } from 'svelte-intl-precompile'
|
import { t } from 'svelte-intl-precompile'
|
||||||
|
import { status } from '$lib/stores/status'
|
||||||
import Button from '$lib/ui/Button.svelte'
|
import Button from '$lib/ui/Button.svelte'
|
||||||
import TextInput from '$lib/ui/TextInput.svelte'
|
import TextInput from '$lib/ui/TextInput.svelte'
|
||||||
import Canvas from './Canvas.svelte'
|
import Canvas from './Canvas.svelte'
|
||||||
@ -35,9 +35,11 @@
|
|||||||
<Canvas value={url} />
|
<Canvas value={url} />
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<p>
|
{#if $status?.new_note_notice}
|
||||||
{@html $t('home.new_note_notice')}
|
<p>
|
||||||
</p>
|
{@html $t('home.new_note_notice')}
|
||||||
|
</p>
|
||||||
|
{/if}
|
||||||
<br />
|
<br />
|
||||||
<Button on:click={reset}>{$t('home.new_note')}</Button>
|
<Button on:click={reset}>{$t('home.new_note')}</Button>
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user