Allow changing or regenerating the SMB share password - #2165
Open
TomKalina wants to merge 2 commits into
Open
Conversation
The Files share password was previously a random token that could only be viewed in Settings → File Sharing. There was no way for users to rotate it or set a memorable value to share with other devices. This adds two new tRPC mutations and matching UI in the file-sharing settings: - files.setSharePassword(password): set a custom password (8-127 chars) - files.regenerateSharePassword(): replace with a new random token Both apply the change to Samba via smbpasswd and invalidate the cached password query so the UI reflects the new value immediately. Closes getumbrel#2164
TomKalina
marked this pull request as ready for review
July 6, 2026 15:18
setSharePassword/regenerateSharePassword wrote the new password to the secrets file before calling applySharePassword(). If smbpasswd failed, the file would hold a password Samba never actually accepted, silently desyncing the stored value from the real one. Apply first, persist only on success. Also map the password-too-short/password-too-long/invalid-password error codes in getFilesErrorMessage(), matching the existing convention for every other backend error code (was falling through to the raw bracketed code in the toast).
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Adds the ability to change or regenerate the Files share (SMB) password from Settings → File Sharing. Previously the password was a random token that could only be viewed — there was no way to rotate it or replace it with a memorable value.
Refs #2164.
Changes
Backend (
umbreld)samba.ts: newsetSharePassword(password)andregenerateSharePassword()methods. Validate length (8–127), reject newlines, persist to the existingsecrets/share-passwordfile, and re-apply viasmbpasswd.routes.ts: two new tRPC mutations:files.setSharePassword({password})files.regenerateSharePassword()samba.integration.test.ts: tests for auth, length validation, persistence, and regeneration.Frontend (
ui)share-password-dialog/index.tsx: newAlertDialogwith two modes —custom(input + Save) andregenerate(confirm + Regenerate).file-sharing.tsx: two new buttons under the connection instructions, opening the dialog in the right mode.use-shares.ts: wraps the new mutations and invalidates the cachedsharePasswordquery on success.en.json: new strings for buttons, dialog titles, descriptions, error messages, and toasts.Test plan
Screen: Settings → File Sharing
How to get there: Umbrel UI → click your avatar → Settings → File Sharing. Make sure at least one folder is shared so the connection instructions render.
What to check:
cd packages/umbreld && pnpm test samba.integrationNotes
smbpasswd's interactive limit (127 chars) with a sane 8-char minimum.smbpasswdstdin protocol.