cypto fix in ldaps

This commit is contained in:
Mateusz Gruszczyński
2026-07-28 15:15:21 +02:00
parent 762638a681
commit b4ca59eca2
5 changed files with 68 additions and 38 deletions
Generated
+2 -1
View File
@@ -2581,7 +2581,7 @@ dependencies = [
[[package]]
name = "rustpad"
version = "0.1.16"
version = "0.1.17"
dependencies = [
"argon2",
"aws-config",
@@ -2597,6 +2597,7 @@ dependencies = [
"lettre",
"mime_guess",
"rand_core 0.6.4",
"rustls 0.23.42",
"serde",
"serde_json",
"sha2 0.10.9",
+2 -1
View File
@@ -1,6 +1,6 @@
[package]
name = "rustpad"
version = "0.1.16"
version = "0.1.17"
edition = "2024"
rust-version = "1.94"
description = "Collaborative Markdown notepad built with Axum, WebSockets and SQLite, PostgreSQL and MySQL"
@@ -21,6 +21,7 @@ lettre = { version = "0.11", default-features = false, features = ["builder", "s
ldap3 = { version = "0.12", default-features = false, features = ["tls-rustls-ring"] }
sha2 = "0.10"
rand_core = { version = "0.6", features = ["getrandom"] }
rustls = { version = "0.23", default-features = false, features = ["ring", "std"] }
serde = { version = "1", features = ["derive"] }
serde_json = "1"
slug = "0.1.6"
+4
View File
@@ -23,6 +23,10 @@ use tracing_subscriber::{layer::SubscriberExt, util::SubscriberInitExt};
#[tokio::main]
async fn main() -> Result<(), Box<dyn std::error::Error>> {
rustls::crypto::ring::default_provider()
.install_default()
.map_err(|_| "failed to install rustls ring CryptoProvider")?;
dotenvy::dotenv().ok();
let cli = parse_command()?;
init_tracing();
+14 -7
View File
@@ -98,8 +98,8 @@
<div class="identity-fields">
<label>Nickname<input id="nickname" name="nickname" maxlength="40" autocomplete="off" data-bwignore="true"
placeholder="Your nickname"></label>
<label id="auth-email-field">E-mail<input id="auth-email" name="username" type="email"
maxlength="320" autocomplete="username" required placeholder="you@example.com"></label>
<label id="auth-email-field">E-mail / LDAP Username<input id="auth-email" name="username" type="email"
maxlength="320" autocomplete="username" required placeholder="you@example.com or name.second-name"></label>
<label>Password<input id="auth-password" name="password" type="password" minlength="8" maxlength="128"
autocomplete="current-password" required placeholder="At least 8 characters"></label>
</div>
@@ -127,17 +127,24 @@
<dialog id="profile-dialog" class="app-dialog">
<form id="profile-form" class="dialog-panel identity-panel" autocomplete="off">
<button id="close-profile" class="modal-close" type="button" aria-label="Close dialog">×</button>
<header class="identity-panel__header"><h2>Profile</h2><p id="profile-copy" class="dialog-copy">Manage your local RustPad account.</p></header>
<header class="identity-panel__header">
<h2>Profile</h2>
<p id="profile-copy" class="dialog-copy">Manage your local RustPad account.</p>
</header>
<div class="identity-fields">
<label data-directory-profile-field>Full name<input id="profile-directory-name" readonly></label>
<label data-directory-profile-field>Organization<input id="profile-directory-organization" readonly></label>
<p id="profile-nickname-suggestion" data-directory-profile-field class="profile-suggestion"></p>
<label>Nickname<input id="profile-nickname" maxlength="40" required></label>
<label class="profile-color-field">Editor color<input id="profile-color" type="color" aria-label="Choose your editor color"></label>
<label class="profile-color-field">Editor color<input id="profile-color" type="color"
aria-label="Choose your editor color"></label>
<label data-local-profile-field>Current e-mail<input id="profile-current-email" type="email" readonly></label>
<label data-local-profile-field>New e-mail<input id="profile-email" type="email" maxlength="320" placeholder="Leave empty to keep current"></label>
<label data-local-profile-field>New password<input id="profile-new-password" type="password" minlength="8" maxlength="128" placeholder="Leave empty to keep current"></label>
<label data-local-profile-field>Current password<input id="profile-password" type="password" minlength="8" maxlength="128" placeholder="Required for e-mail or password changes"></label>
<label data-local-profile-field>New e-mail<input id="profile-email" type="email" maxlength="320"
placeholder="Leave empty to keep current"></label>
<label data-local-profile-field>New password<input id="profile-new-password" type="password" minlength="8"
maxlength="128" placeholder="Leave empty to keep current"></label>
<label data-local-profile-field>Current password<input id="profile-password" type="password" minlength="8"
maxlength="128" placeholder="Required for e-mail or password changes"></label>
</div>
<button class="primary-button" type="submit">Save profile</button>
<button id="profile-delete" data-local-profile-field class="danger-button" type="button">Delete account</button>
+46 -29
View File
@@ -13,27 +13,30 @@
<body class="pad-page" data-registration-enabled="__REGISTRATION_ENABLED__">
<header class="app-header">
<div class="app-header__main"><a class="brand home-brand" href="/">RustPad</a><span class="header-divider"></span>
<div class="app-header__main"><a class="brand home-brand" href="/">RustPad</a><span
class="header-divider"></span>
<div class="document-heading">
<h1 id="pad-title">__PAD_TITLE__</h1>
<p id="pad-url" class="document-url"></p>
</div>
</div>
<span class="header-user-control user-color-control"><button id="current-user" class="user-chip"
type="button" title="Change your color"><span class="user-chip__dot" aria-hidden="true"></span><span
<span class="header-user-control user-color-control"><button id="current-user" class="user-chip" type="button"
title="Change your color"><span class="user-chip__dot" aria-hidden="true"></span><span
class="user-chip__name"></span></button><input id="user-color-picker" class="user-color-picker"
type="color" aria-label="Override color for this note"><button id="use-global-color" class="use-global-color" type="button" title="Use global profile color" aria-label="Use global profile color" hidden></button></span>
type="color" aria-label="Override color for this note"><button id="use-global-color"
class="use-global-color" type="button" title="Use global profile color"
aria-label="Use global profile color" hidden></button></span>
<div class="header-navigation">
<button id="header-menu-toggle" class="header-menu-toggle" type="button" aria-expanded="false"
aria-controls="header-actions" aria-label="Open navigation menu">
<span aria-hidden="true"></span><span aria-hidden="true"></span><span aria-hidden="true"></span>
</button>
<div id="header-actions" class="header-actions"><button id="copy-link"
class="secondary-button">Copy link</button><button id="publish-page"
class="secondary-button">Page</button><label class="public-task-toggle"
title="Allow visitors to update task checkboxes on the published page"><input id="public-task-updates"
type="checkbox"> Editable tasks on Page</label><button id="files-button"
class="secondary-button">Files</button><button id="history-button"
<div id="header-actions" class="header-actions"><button id="copy-link" class="secondary-button">Copy
link</button><button id="publish-page" class="secondary-button">Page</button><label
class="public-task-toggle"
title="Allow visitors to update task checkboxes on the published page"><input
id="public-task-updates" type="checkbox"> Editable tasks on Page</label><button
id="files-button" class="secondary-button">Files</button><button id="history-button"
class="secondary-button">History</button></div>
</div>
</header>
@@ -51,7 +54,8 @@
<details id="emoji-picker" class="emoji-picker">
<summary title="Insert emoji" aria-label="Insert emoji">😀 Emoji</summary>
<div class="emoji-picker-panel">
<input id="emoji-search" class="emoji-search" type="search" placeholder="Search emoji…" autocomplete="off" aria-label="Search emoji">
<input id="emoji-search" class="emoji-search" type="search" placeholder="Search emoji…"
autocomplete="off" aria-label="Search emoji">
<div id="emoji-categories" class="emoji-categories" aria-label="Emoji categories"></div>
<div id="emoji-grid" class="emoji-grid" role="listbox" aria-label="Emoji"></div>
<p id="emoji-empty" class="emoji-empty" hidden>No emoji found.</p>
@@ -92,9 +96,10 @@
<option value="22">22</option>
</select></label></div><button id="upload-button"
class="toolbar-action">Image/file</button><input id="file-input" type="file" hidden><label
class="line-toggle"><input id="line-numbers-toggle" type="checkbox" checked> Editor lines</label><label
class="line-toggle"><input id="preview-line-numbers-toggle" type="checkbox"> Preview lines</label><label
class="line-toggle"><input id="compact-toggle" type="checkbox" checked> Compact</label>
class="line-toggle"><input id="line-numbers-toggle" type="checkbox" checked> Editor
lines</label><label class="line-toggle"><input id="preview-line-numbers-toggle" type="checkbox">
Preview lines</label><label class="line-toggle"><input id="compact-toggle" type="checkbox" checked>
Compact</label>
<div class="toolbar-fill"></div><button id="mode-toggle" class="markdown-toggle active"
aria-pressed="true">Markdown</button>
<div class="view-switch"><button data-view="edit">Edit</button><button data-view="split"
@@ -105,7 +110,8 @@
<div class="column-label editor-column-label"><span>Editor</span></div>
<div class="editor-shell">
<div id="line-gutter" class="line-gutter" aria-hidden="true"></div>
<div id="authorship-layer" class="authorship-layer" aria-hidden="true"></div><div id="owner-labels" class="owner-labels" aria-hidden="true"></div><textarea id="editor"
<div id="authorship-layer" class="authorship-layer" aria-hidden="true"></div>
<div id="owner-labels" class="owner-labels" aria-hidden="true"></div><textarea id="editor"
wrap="off" placeholder="Start writing…" spellcheck="false"></textarea>
</div>
</div>
@@ -115,9 +121,12 @@
</div>
</div>
<footer class="editor-footer">
<div class="footer-left"><span id="characters">0 characters</span> · <span id="words">0 words</span><span class="footer-connection-block"> · <span class="footer-status status"><span id="status-dot" class="status__dot"></span><span
id="status-text">Connecting…</span></span> · <span id="socket-latency" class="footer-socket-latency"
title="WebSocket round-trip time">— ms</span></span> · <details id="room-details" class="room-details">
<div class="footer-left"><span id="characters">0 characters</span> · <span id="words">0
words</span><span class="footer-connection-block"> · <span class="footer-status status"><span
id="status-dot" class="status__dot"></span><span
id="status-text">Connecting…</span></span> · <span id="socket-latency"
class="footer-socket-latency" title="WebSocket round-trip time">— ms</span></span> ·
<details id="room-details" class="room-details">
<summary><span id="room-count">0 users</span><span id="chat-unread" class="chat-unread"
hidden></span></summary>
<div class="room-popover">
@@ -135,7 +144,8 @@
</div>
</details>
</div><span class="footer-right"><button id="shortcuts-button" class="footer-link" type="button"
aria-haspopup="dialog">Shortcuts</button> · <span id="access-level" class="footer-access">Access: checking…</span> · <button id="footer-files" class="footer-link"
aria-haspopup="dialog">Shortcuts</button> · <span id="access-level"
class="footer-access">Access: checking…</span> · <button id="footer-files" class="footer-link"
type="button">0 files</button> · <span id="save-state">Changes are saved
automatically</span></span>
</footer>
@@ -186,11 +196,12 @@
guest</button><button id="show-register" class="text-button" type="button">Register</button><button
id="show-login" class="text-button" type="button">Log in</button></div>
<section id="auth-panel" class="auth-panel" hidden>
<h3 id="auth-mode-title">Log in</h3><label id="auth-email-field">E-mail / organization login<input id="auth-email"
name="username" type="email" maxlength="320" autocomplete="username"
placeholder="you@example.com"></label><label>Password<input id="auth-password" name="password"
type="password" minlength="8" maxlength="128" autocomplete="current-password"></label><button
id="auth-submit" class="primary-button" type="submit">Log in and continue</button>
<h3 id="auth-mode-title">Log in</h3><label id="auth-email-field">E-mail / LDAP Username<input
id="auth-email" name="username" type="email" maxlength="320" autocomplete="username"
placeholder="you@example.com or name.second-name"></label><label>Password<input
id="auth-password" name="password" type="password" minlength="8" maxlength="128"
autocomplete="current-password"></label><button id="auth-submit" class="primary-button"
type="submit">Log in and continue</button>
<div class="identity-links"><button id="show-reset" class="text-button" type="button">Forgot
password?</button><button id="auth-back" class="text-button" type="button">Back to
nickname</button><button id="logout-account" class="text-button" type="button">Log out saved
@@ -208,13 +219,19 @@
</form>
</dialog>
<div id="mobile-editor-bubble" class="mobile-editor-bubble" aria-label="Quick editor actions">
<button id="mobile-bubble-drag" class="mobile-bubble-drag" type="button" title="Move quick actions" aria-label="Move quick actions">⋮⋮</button>
<button id="mobile-bubble-drag" class="mobile-bubble-drag" type="button" title="Move quick actions"
aria-label="Move quick actions">⋮⋮</button>
<button id="mobile-files-button" type="button" title="Files" aria-label="Open files">📎</button>
<button id="mobile-color-button" type="button" title="Editor color" aria-label="Change editor color"><span class="mobile-color-dot" aria-hidden="true"></span></button>
<button id="mobile-chat-button" class="mobile-chat-button" type="button" title="Chat" aria-label="Open chat">💬<span id="mobile-chat-unread" class="mobile-chat-unread" hidden></span></button>
<button id="mobile-time-button" class="mobile-time-button" type="button" title="Current time" aria-label="Show current time">🕒</button>
<button id="mobile-color-button" type="button" title="Editor color" aria-label="Change editor color"><span
class="mobile-color-dot" aria-hidden="true"></span></button>
<button id="mobile-chat-button" class="mobile-chat-button" type="button" title="Chat"
aria-label="Open chat">💬<span id="mobile-chat-unread" class="mobile-chat-unread" hidden></span></button>
<button id="mobile-time-button" class="mobile-time-button" type="button" title="Current time"
aria-label="Show current time">🕒</button>
<span id="mobile-time-preview" class="mobile-time-preview" role="status" hidden></span>
<span id="mobile-connection-status" class="mobile-connection-status" title="WebSocket status"><span id="mobile-status-dot" class="status__dot"></span><span id="mobile-status-text">Connecting…</span></span>
<span id="mobile-connection-status" class="mobile-connection-status" title="WebSocket status"><span
id="mobile-status-dot" class="status__dot"></span><span
id="mobile-status-text">Connecting…</span></span>
</div>
<div id="toast" class="toast"></div>
</body>