Skip to content

Implemented file name shortening - #129

Merged
d2dyno1 merged 14 commits into
f_vault4from
f_shortening
May 26, 2026
Merged

Implemented file name shortening#129
d2dyno1 merged 14 commits into
f_vault4from
f_shortening

Conversation

@d2dyno1

@d2dyno1d2dyno1 commented May 21, 2026

Copy link
Copy Markdown
Member

Tasklist

  • [Recycle Bin] Write sidecar files when recovering from the Recycle Bin
  • [Other] Implement shortening for NativePathHelpers
  • [Other] Detect correct shortening threshold when restoring vaults.
  • [FS] Implement shortening in Dokany
  • [FS] Implement shortening in WinFsp
  • [FS] Implement shortening in FUSE
  • [Health] Detect and delete orphan sidecar files
  • [Health] Re-adjust fixing broken names to use sidecars when applicable

@d2dyno1
d2dyno1 changed the base branch from master to f_vault4May 21, 2026 15:18
@d2dyno1d2dyno1 mentioned this pull request May 21, 2026
8 tasks

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR introduces filename-shortening support for encrypted on-disk names by adding a configurable threshold, persisting it in vault configuration, and integrating shortening logic into the path/name helpers and several filesystem backends. It also wires the threshold into the UI (wizard + properties) and updates vault config MAC calculation to include the new field.

Changes:

  • Add ShorteningThreshold to vault/VFS option models and surface it in the vault creation wizard and vault properties view.
  • Implement shortened ciphertext names using deterministic hashes plus .sffsn and sidecar files (.sffsi) to store the full ciphertext name; update core file operations to use “discovery” vs “materialized” name encryption.
  • Update vault config reading/writing helpers and include ShorteningThreshold in the V4 config MAC computation.

Reviewed changes

Copilot reviewed 30 out of 30 changed files in this pull request and generated 5 comments.

Show a summary per file
FileDescription
src/Shared/SecureFolderFS.Storage/VirtualFileSystem/VirtualFileSystemOptions.csAdds VFS-level ShorteningThreshold option and dictionary mapping.
src/Shared/SecureFolderFS.Shared/Models/VaultOptions.csPersists ShorteningThreshold in vault options model.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Wizard/CredentialsWizardViewModel.csAdds wizard field and clamps threshold into vault options.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Vault/VaultPropertiesViewModel.csDisplays shortening threshold in properties when name encryption is enabled.
src/Platforms/SecureFolderFS.Uno/Views/VaultWizard/CredentialsWizardPage.xamlAdds NumberBox UI for configuring shortening threshold.
src/Platforms/SecureFolderFS.Uno/Views/Vault/VaultPropertiesPage.xamlConditionally shows shortening threshold in vault properties UI.
src/Platforms/SecureFolderFS.UI/ServiceImplementation/VaultService.csReturns ShorteningThreshold from vault config in GetVaultOptionsAsync.
src/Platforms/SecureFolderFS.UI/ServiceImplementation/RecycleBinService.csUpdates config write MAC path and config type usage while configuring recycle bin.
src/Core/SecureFolderFS.Core/VaultAccess/VaultWriter.csMakes WriteConfigurationAsync generic (additional config type support).
src/Core/SecureFolderFS.Core/VaultAccess/VaultReader.csAdds V4-typed convenience reads and a generic config read API.
src/Core/SecureFolderFS.Core/VaultAccess/VaultParser.csExtends V4 config MAC input with ShorteningThreshold and changes authenticated fields.
src/Core/SecureFolderFS.Core/Routines/Operational/UnlockRoutine.csSwitches to new V4-typed VaultReader APIs.
src/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.csAttempts to infer a shortening threshold during restore and writes it to config.
src/Core/SecureFolderFS.Core/Routines/Operational/RecoverRoutine.csSwitches to new V4-typed VaultReader config API.
src/Core/SecureFolderFS.Core/Routines/Operational/ModifyCredentialsRoutine.csSwitches to new V4-typed VaultReader keystore API.
src/Core/SecureFolderFS.Core/Routines/Operational/ModifyComplementationRoutine.csSwitches to new V4-typed VaultReader APIs for config/keystore.
src/Core/SecureFolderFS.Core/Models/SecurityWrapper.csExposes ShorteningThreshold into the VFS options contract.
src/Core/SecureFolderFS.Core/DataModels/V4VaultConfigurationDataModel.csAdds persisted ShorteningThreshold with JSON association.
src/Core/SecureFolderFS.Core/Constants.csAdds JSON association key for filename shortening.
src/Core/SecureFolderFS.Core.WinFsp/AppModels/WinFspOptions.csPlumbs ShorteningThreshold into WinFsp options mapping.
src/Core/SecureFolderFS.Core.WebDav/AppModels/WebDavOptions.csPlumbs ShorteningThreshold into WebDav options mapping.
src/Core/SecureFolderFS.Core.FUSE/AppModels/FuseOptions.csPlumbs ShorteningThreshold into FUSE options mapping.
src/Core/SecureFolderFS.Core.Dokany/AppModels/DokanyOptions.csPlumbs ShorteningThreshold into Dokany options mapping.
src/Core/SecureFolderFS.Core.FileSystem/Storage/CryptoFolder.csUses “discovery” vs “use” encryption paths; attempts sidecar cleanup on rename/delete/move.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/RecycleBin/Abstract/AbstractRecycleBinHelpers.Operational.csUses discovery encryption for restore name checks.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/PathHelpers.csTreats .sffsi sidecars as internal/core names.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Shortening.csIntroduces sidecar + shortened-name helper logic.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Paths.csSwitches path traversal to discovery encryption.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Names.csAdds “EncryptNameForUse/Discovery” and resolves shortened names via sidecars during decryption.
src/Core/SecureFolderFS.Core.FileSystem/Constants.csDefines new .sffsn (shortened) and .sffsi (sidecar) extensions.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment threadsrc/Core/SecureFolderFS.Core/VaultAccess/VaultParser.cs
Comment threadsrc/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs Outdated
Comment threadsrc/Platforms/SecureFolderFS.UI/ServiceImplementation/RecycleBinService.cs Outdated

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 39 out of 39 changed files in this pull request and generated 2 comments.

@d2dyno1
d2dyno1 marked this pull request as ready for review May 26, 2026 14:48
@d2dyno1
d2dyno1 requested a review from CopilotMay 26, 2026 14:48

CopilotAI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Copilot reviewed 55 out of 55 changed files in this pull request and generated 5 comments.

Comment threadsrc/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs Outdated
Comment on lines +28 to +39
private void Shortening_TextChanged(object? sender, TextChangedEventArgs e)
{
if (sender is not Entry entry)
return;

if (!int.TryParse(entry.Text, out var value))
value = 0;

value = Math.Max(0, Math.Min(value, 250));
entry.Text = value.ToString();
ViewModel.ShorteningThreshold = value;
}
Comment threadsrc/Core/SecureFolderFS.Core.FUSE/Callbacks/OnDeviceFuse.cs
Comment threadsrc/Core/SecureFolderFS.Core.FUSE/Callbacks/OnDeviceFuse.cs

CopilotAI commented May 26, 2026

Copy link
Copy Markdown

Just as a heads up, I was blocked by some firewall rules while working on your feedback. Expand below for details.

Warning

Firewall rules blocked me from connecting to one or more addresses (expand for details)

I tried to connect to the following addresses, but was blocked by firewall rules:

  • crl.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true -s REDACTED (dns block)
  • ocsp.godaddy.com
    • Triggering command: /usr/bin/dotnet dotnet restore --no-dependencies /home/REDACTED/work/SecureFolderFS/SecureFolderFS/src/Platforms/SecureFolderFS.Uno/SecureFolderFS.Uno.csproj --packages /tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/packages /p:DisableImplicitNuGetFallbackFolder=true --verbosity normal /p:TargetFrameworkRootPath=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:NetCoreTargetingPackRoot=/tmp/codeql-scratch-d52628fd4f0752cc/dbs/csharp/working/emptyFakeDotnetRoot /p:AllowMissingPrunePackageData=true -s REDACTED (dns block)

If you need me to access, download, or install something from one of these locations, you can either:

@d2dyno1d2dyno1 added the approved The pull request has been reviewed and approved label May 26, 2026
@d2dyno1
d2dyno1 merged commit fdf95a4 into f_vault4May 26, 2026
13 checks passed
@d2dyno1
d2dyno1 deleted the f_shortening branch May 26, 2026 17:17
Sign up for freeto join this conversation on GitHub. Already have an account? Sign in to comment

Labels

approvedThe pull request has been reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@d2dyno1