Skip to content

Read-only server by default with authenticated write access #312

Closed

Description

@messeant

Hello

Summary
The cook server command should operate in read-only (consultation) mode by default. Any mutating operation — adding or editing a recipe, modifying the shopping list/cart, or any other state-changing action — must require prior authentication. The authenticated session must persist across browser restarts (no re-login on page refresh or next visit).

Motivation
Currently, the server exposes all operations without any access control. This is a problem for users who self-host and want to share their cookbook publicly (read access) while keeping write operations private. A two-tier access model (anonymous read / authenticated write) is the standard pattern for self-hosted tools and would make cook server production-ready for personal or family use.

Operation Anonymous Authenticated
Browse / view recipes ✅ ✅
Search recipes ✅ ✅
View shopping list / cart ✅ ✅
Add or edit a recipe ❌ 401 ✅
Delete a recipe ❌ 401 ✅
Add / modify / clear the cart ❌ 401 ✅
Any other write operation ❌ 401 ✅

for example

[server.auth]
  username = "admin"
  # bcrypt hash or plain text with a warning
  password_hash = "$2b$12$..."

and

# Start with auth enabled (write-protected)
cook server --auth

# Disable auth entirely for local/trusted networks (current behavior, opt-in)
cook server --no-auth

Eric

Activity

  1. changed the title [-]New feature ; Read-only server by default with persistent authenticated write access[/-] [+]New feature : Read-only server by default with persistent authenticated write access[/+] on Apr 6, 2026
  2. therealfakemoot commented on Apr 6, 2026

    @therealfakemoot

    Yes please. Just upgraded to the latest version and was surprised to find that my recipes were editable to the open internet. Not catastrophic, I can just throw htauth or something on my reverse proxy but it would be nice to have a safer default.

  3. changed the title [-]New feature : Read-only server by default with persistent authenticated write access[/-] [+]Read-only server by default with authenticated write access[/+] on Aug 7, 2026
  4. added
    area: server
    on Aug 7, 2026
  5. added 2 commits that reference this issue on Sep 25, 2026
    e8609d9
    7e6fa50
  6. added a commit that references this issue on Sep 28, 2026
    0e8dacf
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