Compare commits

...

2 Commits
main ... wip

Author SHA1 Message Date
Manos Pitsidianakis fb1d9ce2ee
wip2 2023-09-25 18:21:51 +03:00
Manos Pitsidianakis 1d1d6d7a17
wip1 2023-09-25 18:21:44 +03:00
4 changed files with 567 additions and 639 deletions

1197
Cargo.lock generated

File diff suppressed because it is too large Load Diff

View File

@ -43,7 +43,10 @@ fn new_state(conf: Configuration) -> Arc<AppState> {
fn create_app(shared_state: Arc<AppState>) -> Router {
let store = MemoryStore::new();
let secret = rand::thread_rng().gen::<[u8; 128]>();
#[cfg(debug_assertions)]
let secret = std::env::var("SECRET").ok().and_then(|s| s.into_bytes().try_into().ok()).unwrap_or_else(|| rand::thread_rng().gen::<[u8; 128]>());
#[cfg(not(debug_assertions))]
let secret = std::env::var("SECRET").ok().and_then(|s| s.into_bytes().try_into().ok()).expect("environment variable SECRET must be set for production use. It must be a slice of 128 bytes. Try this command: SECRET=\"$(dd if=/dev/urandom bs=1 count=128)\"");
let session_layer = SessionLayer::new(store, &secret).with_secure(false);
let auth_layer = AuthLayer::new(shared_state.clone(), &secret);

View File

@ -827,7 +827,7 @@
font-weight: 400;
width: auto;
height: 26rem;
max-width: min(71ch, 100%);
max-width: min(73ch, 100%);
overflow-wrap: break-word;
overflow: auto;
white-space: pre;

View File

@ -9,7 +9,7 @@
<span>Address: <span class="value">{{ user.address }}</span></span>
</div>
<div class="entry">
<span>PGP public key: <span class="value{% if not user.public_key %} empty{% endif %}">{{ user.public_key if user.public_key else "None." }}</span></span>
{% if user.public_key %}<details style="overflow: auto;"><summary>PGP public key: </summary><pre style="font-size: 1em;max-width: 64ch;font-size: 1em;font-size: monospace;">{{ user.public_key | escape }}</pre></details>{% else %}<span>PGP public key: <span class"value empty">None.</span></span>{% endif %}
</div>
<div class="entry">
<span>SSH public key: <span class="value{% if not user.password %} empty{% endif %}">{{ user.password if user.password else "None." }}</span></span>