Skip to content

feat(server): show guests only the recipes #620

Closed

Description

@LeMyst

Problem

Sharing a recipe collection with cook server --host exposes everything to whoever opens it. Even with sign-in on (#534, roles #559), a guest can read the shopping list, the pantry, the preferences page (which names the server's recipe directory and config paths), the API docs and stats, and any file in the recipe directory through /api/static, including .shopping-list.

There is no way to say "people who are not signed in should only see the recipes".

Proposal

A cook server --recipes-only flag, also settable with COOK_RECIPES_ONLY=1 for containers:

  • Guests (not signed in) can browse, search and read recipes and menus, follow the feeds, and pick a language. Everything else is hidden: the Shopping/Pantry links, Edit / Add to shopping list / New buttons, and every preferences section except the language picker. Requests for anything else ask them to sign in: 401 for the API, a redirect to /login?next= for pages.
  • Signed-in users keep everything their role allows, as today.
  • Without a users file nobody can sign in, so every visitor gets the recipes only and the rest answers 404. That gives a read-only public cookbook.

What a guest may open should be an allowlist, so a route added later stays hidden from guests by default.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions