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
Copy link
Copy Markdown
Member

@d2dyno1 d2dyno1 commented May 21, 2026

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_vault4 May 21, 2026 15:18
@d2dyno1 d2dyno1 mentioned this pull request May 21, 2026
8 tasks
Copy link
Copy Markdown

Copilot AI left a comment

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
File Description
src/Shared/SecureFolderFS.Storage/VirtualFileSystem/VirtualFileSystemOptions.cs Adds VFS-level ShorteningThreshold option and dictionary mapping.
src/Shared/SecureFolderFS.Shared/Models/VaultOptions.cs Persists ShorteningThreshold in vault options model.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Wizard/CredentialsWizardViewModel.cs Adds wizard field and clamps threshold into vault options.
src/Sdk/SecureFolderFS.Sdk/ViewModels/Views/Vault/VaultPropertiesViewModel.cs Displays shortening threshold in properties when name encryption is enabled.
src/Platforms/SecureFolderFS.Uno/Views/VaultWizard/CredentialsWizardPage.xaml Adds NumberBox UI for configuring shortening threshold.
src/Platforms/SecureFolderFS.Uno/Views/Vault/VaultPropertiesPage.xaml Conditionally shows shortening threshold in vault properties UI.
src/Platforms/SecureFolderFS.UI/ServiceImplementation/VaultService.cs Returns ShorteningThreshold from vault config in GetVaultOptionsAsync.
src/Platforms/SecureFolderFS.UI/ServiceImplementation/RecycleBinService.cs Updates config write MAC path and config type usage while configuring recycle bin.
src/Core/SecureFolderFS.Core/VaultAccess/VaultWriter.cs Makes WriteConfigurationAsync generic (additional config type support).
src/Core/SecureFolderFS.Core/VaultAccess/VaultReader.cs Adds V4-typed convenience reads and a generic config read API.
src/Core/SecureFolderFS.Core/VaultAccess/VaultParser.cs Extends V4 config MAC input with ShorteningThreshold and changes authenticated fields.
src/Core/SecureFolderFS.Core/Routines/Operational/UnlockRoutine.cs Switches to new V4-typed VaultReader APIs.
src/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs Attempts to infer a shortening threshold during restore and writes it to config.
src/Core/SecureFolderFS.Core/Routines/Operational/RecoverRoutine.cs Switches to new V4-typed VaultReader config API.
src/Core/SecureFolderFS.Core/Routines/Operational/ModifyCredentialsRoutine.cs Switches to new V4-typed VaultReader keystore API.
src/Core/SecureFolderFS.Core/Routines/Operational/ModifyComplementationRoutine.cs Switches to new V4-typed VaultReader APIs for config/keystore.
src/Core/SecureFolderFS.Core/Models/SecurityWrapper.cs Exposes ShorteningThreshold into the VFS options contract.
src/Core/SecureFolderFS.Core/DataModels/V4VaultConfigurationDataModel.cs Adds persisted ShorteningThreshold with JSON association.
src/Core/SecureFolderFS.Core/Constants.cs Adds JSON association key for filename shortening.
src/Core/SecureFolderFS.Core.WinFsp/AppModels/WinFspOptions.cs Plumbs ShorteningThreshold into WinFsp options mapping.
src/Core/SecureFolderFS.Core.WebDav/AppModels/WebDavOptions.cs Plumbs ShorteningThreshold into WebDav options mapping.
src/Core/SecureFolderFS.Core.FUSE/AppModels/FuseOptions.cs Plumbs ShorteningThreshold into FUSE options mapping.
src/Core/SecureFolderFS.Core.Dokany/AppModels/DokanyOptions.cs Plumbs ShorteningThreshold into Dokany options mapping.
src/Core/SecureFolderFS.Core.FileSystem/Storage/CryptoFolder.cs Uses “discovery” vs “use” encryption paths; attempts sidecar cleanup on rename/delete/move.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/RecycleBin/Abstract/AbstractRecycleBinHelpers.Operational.cs Uses discovery encryption for restore name checks.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/PathHelpers.cs Treats .sffsi sidecars as internal/core names.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Shortening.cs Introduces sidecar + shortened-name helper logic.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Paths.cs Switches path traversal to discovery encryption.
src/Core/SecureFolderFS.Core.FileSystem/Helpers/Paths/Abstract/AbstractPathHelpers.Names.cs Adds “EncryptNameForUse/Discovery” and resolves shortened names via sidecars during decryption.
src/Core/SecureFolderFS.Core.FileSystem/Constants.cs Defines new .sffsn (shortened) and .sffsi (sidecar) extensions.

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

Comment thread src/Core/SecureFolderFS.Core/VaultAccess/VaultParser.cs
Comment thread src/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs Outdated
Comment thread src/Platforms/SecureFolderFS.UI/ServiceImplementation/RecycleBinService.cs Outdated
Copy link
Copy Markdown

Copilot AI left a comment

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.

Comment thread src/Core/SecureFolderFS.Core.FileSystem/Helpers/Health/HealthHelpers.Sidecar.cs Outdated
@d2dyno1 d2dyno1 marked this pull request as ready for review May 26, 2026 14:48
@d2dyno1 d2dyno1 requested a review from Copilot May 26, 2026 14:48
Copy link
Copy Markdown

Copilot AI left a comment

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 thread src/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs Outdated
Comment thread src/Core/SecureFolderFS.Core/Routines/Operational/RestoreRoutine.cs
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 thread src/Core/SecureFolderFS.Core.FUSE/Callbacks/OnDeviceFuse.cs
Comment thread src/Core/SecureFolderFS.Core.FUSE/Callbacks/OnDeviceFuse.cs
Copy link
Copy Markdown

Copilot AI commented May 26, 2026

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:

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

Labels

approved The pull request has been reviewed and approved

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants