Skip to content

refactor(config): remove allow_symlinks_on_windows flag#607

Merged
javi11 merged 1 commit into
mainfrom
session/modest-meninsky-7a6b37
May 22, 2026
Merged

refactor(config): remove allow_symlinks_on_windows flag#607
javi11 merged 1 commit into
mainfrom
session/modest-meninsky-7a6b37

Conversation

@javi11
Copy link
Copy Markdown
Owner

@javi11 javi11 commented May 22, 2026

Summary

  • Remove the allow_symlinks_on_windows opt-in flag from the config schema, YAML sample, frontend types, and Workers UI.
  • Drop the Windows-specific os.Symlink guard (windowsSymlinkAllowed) from the importer post-processor; both call sites now call os.Symlink directly.
  • Drop the matching runtime.GOOS == "windows" block from internal/api/health_handlers.go (library file regeneration) so it matches the importer behavior.
  • Remove the now-unused runtime import from both Go files and the toggle + warning alert from WorkersConfigSection.tsx.

Why

The importer respected the user's opt-in, but the health regeneration handler ignored the flag entirely and always errored on Windows — two different behaviors for the same OS-level operation. Collapsing both paths to call os.Symlink directly makes a Windows symlink failure (when Developer Mode isn't on, or the user lacks the privilege) surface as a normal OS error, matching every other filesystem call in the codebase.

Test plan

  • go build ./... clean
  • go vet ./... clean
  • Grep confirms no remaining AllowSymlinksOnWindows / allow_symlinks_on_windows / windowsSymlinkAllowed references
  • Frontend bun run check (not run — node_modules not installed in the worktree; changes are pure field deletions with all references removed)
  • Manual: with import_strategy: SYMLINK, trigger POST /api/health/regenerate-symlinks on Linux — symlinks created as before
  • Manual: open the Workers config UI with SYMLINK selected and confirm the "Allow Symlinks on Windows" toggle is gone

Drop the Windows-specific opt-in guard around os.Symlink in both the
importer post-processor and the health regeneration handler. Symlink
creation now always calls os.Symlink directly; any Windows privilege
error surfaces as a normal OS error to the caller. Removes the flag
from the Go config struct, YAML sample, frontend types, and the
Workers UI control.
@javi11 javi11 merged commit c96c699 into main May 22, 2026
2 checks passed
@javi11 javi11 deleted the session/modest-meninsky-7a6b37 branch May 22, 2026 08:09
fatbob01 added a commit to fatbob01/altmount that referenced this pull request May 22, 2026
javi11#607 removed the guards in symlink_creator.go and health_handlers.go
but two more remained:
- internal/config/manager.go: validator rejecting SYMLINK on Windows at startup
- internal/health/library_sync.go: guard blocking symlink updates in library sync

Remove both blocks and their now-unused runtime imports.

Co-Authored-By: Claude Sonnet 4.6 <noreply@anthropic.com>
javi11 pushed a commit that referenced this pull request May 22, 2026
Co-authored-by: Claude Sonnet 4.6 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant