Skip to content

fix(server): show the server's paths on Preferences to admins only - #642

Merged
LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/preferences-paths
Oct 8, 2026
Merged

LeMyst merged 1 commit into
cooklang:mainfrom
LeMyst:fix/preferences-paths

Conversation

@LeMyst

@LeMyst LeMyst commented Oct 7, 2026

Copy link
Copy Markdown
Collaborator

Closes #637.

The Preferences page listed the full paths of the aisle file, the pantry file and the recipe directory (/home/<user>/recipes/config/aisle.conf) to anyone who could open it. With sign-in on, that includes guests. It came with the new UI in e200582; since #621 (d682b15) only --recipes-only blanked them.

What changes

Viewer Aisle / pantry file Recipe Directory card
Admin, or anyone with sign-in off full path, as before shown, full path
Guest, reader, shopper, editor config/aisle.conf, or Global configuration for a file outside the recipe directory hidden
--recipes-only visitor unchanged (nothing) hidden
  • preferences_page (src/server/ui.rs) picks the path to show with viewer.can_admin(), the same check that already gates the sync section.
  • "Not configured" now goes through the existing pref-not-configured key instead of being hard-coded in English; pref-global-config is added in every locale.

Tests

tests/server_auth_test.rs:

  • open server: the full path is still shown;
  • guest: no recipe directory, config/pantry.conf relative, and a global aisle.conf shown as "Global configuration" without naming the config directory;
  • each role: only admin gets the full paths.

The guest and role tests fail on main. cargo fmt, cargo clippy --all-targets (no warnings) and cargo test pass.

🤖 Generated with Claude Code

The Preferences page listed the full paths of the aisle file, the pantry
file and the recipe directory to anyone who could open it, which with
sign-in on includes guests. That told any visitor the server's directory
layout and, usually, the account it runs as. It came with the new UI in
e200582; since cooklang#621 (d682b15) only `--recipes-only` blanked them.

Admins still get the full paths; with sign-in off that is everyone, so a
local server looks as before. Everyone else sees where a file is inside
the recipe directory (`config/aisle.conf`), "Global configuration" for
one outside it, and no Recipe Directory card. "Not configured" is now
translated through the existing `pref-not-configured` key.

Closes cooklang#637

Co-Authored-By: Claude Opus 5.5 <[email protected]>
@LeMyst
LeMyst marked this pull request as ready for review October 7, 2026 21:22
@LeMyst
LeMyst merged commit 4983af0 into cooklang:main Oct 8, 2026
6 checks passed
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.

Preferences page shows the server's absolute paths to any visitor

1 participant