Skip to content

Respect custom Docker mounts in setup warnings - #430

Merged
Forceu merged 1 commit into
Forceu:masterfrom
justadityaraj:fix/387-custom-mount-warning
Sep 12, 2026
Merged

Forceu merged 1 commit into
Forceu:masterfrom
justadityaraj:fix/387-custom-mount-warning

Conversation

@justadityaraj

Copy link
Copy Markdown
Contributor

Description

Context

The setup page checks only /app/data and /app/config when deciding whether Docker storage is persistent. Custom GOKAPI_DATA_DIR and GOKAPI_CONFIG_DIR values therefore trigger data-loss warnings even when those directories live under a mounted parent volume.

Fixes #387

Changes

  • Check the resolved data and config directories from the existing environment parser.
  • Treat a non-root parent mount as persistent while excluding the container root filesystem.
  • Preserve the default relative data and config paths by resolving them under /app.
  • Add regression coverage for custom parent mounts, relative defaults, and root-only mounts.

User impact

Docker deployments that place both directories below one custom volume no longer receive false data-loss warnings. Unmounted directories continue to warn.

Type of Change

  • Bug fix (non-breaking change which fixes an issue)

Technical Details

  • Database changes: No
  • Storage backend affected: No
  • Usage of AI: Yes — AI-assisted implementation and test drafting; the complete diff and verification output were reviewed before submission.

How Has This Been Tested?

  • go test --tags=test,noaws ./internal/configuration/setup -run TestIsPathMounted -count=1 — passed.
  • go vet --tags=test,noaws ./internal/configuration/setup — passed.
  • go build --tags=noaws ./... — passed.
  • go generate ./... — passed with no generated diff.
  • Both repository test matrices (test,noaws and test,awsmock) were attempted sequentially. The changed regression passes; the broader Windows run retains existing path-separator, open-file cleanup, setup-port timeout, and certificate-date failures. Representative path and setup-timeout failures reproduce on clean origin/master.
  • Environment: Windows 11, Go 1.26.7; Linux /proc/mounts input covered through a deterministic parser test.

Checklist

  • I have performed a self-review of my own code.
  • Comments were not added because the mount-boundary logic is direct and covered by tests.
  • Documentation changes are not required because configured paths and setup procedures are unchanged.
  • My changes generate no new warnings.

@Forceu
Forceu merged commit 630dae1 into Forceu:master Sep 12, 2026
1 check passed
@Forceu

Forceu commented Sep 12, 2026

Copy link
Copy Markdown
Owner

Thank you very much!

@justadityaraj

Copy link
Copy Markdown
Contributor Author

Thank you very much!

Anytime!

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.

[Bug] Docker missing mount warning doesn't respect *_DIR Environment Variables

2 participants