Skip to content

Move frontpage selection into the administrator setup workflow - #170

Open
snoopdave wants to merge 1 commit into
masterfrom
frontpage-setup-workflow
Open

Move frontpage selection into the administrator setup workflow#170
snoopdave wants to merge 1 commit into
masterfrom
frontpage-setup-workflow

Conversation

@snoopdave

Copy link
Copy Markdown
Contributor

The setup page is reachable without a login so a freshly installed site can be
bootstrapped before any user exists. This change makes that page a read-only
bootstrap view and moves the frontpage-weblog selection into a separate
global-administrator action.

What changed

  • While the site has zero users, show only a minimal public bootstrap page —
    no weblog lists, counts, or mutating action.
  • Make the initial frontpage selection a separate POST action requiring global
    administrator permission, allowed only while no frontpage weblog has been set.
  • Route later changes through GlobalConfig.
  • Centralize canonical-handle resolution and enabled-weblog validation in one
    service used by both write paths; reject blank, missing, nonexistent, and
    disabled weblogs and treat a missing aggregation checkbox as false.
  • Persist both properties together and invalidate local site-wide page/feed
    caches, including the site-wide last-modified value.
  • Fail closed when users.firstUserAdmin=false until a global administrator is
    provisioned.

Tests

  • Anonymous zero-user page; anonymous and non-admin access after users exist;
    disabled admin and global-admin callers.
  • Both first-user-admin settings; initial, concurrent, and already-configured
    writes; the retired setup!save action no longer resolves.
  • Invalid weblog handles, null aggregation, successful reads, and local cache
    invalidation through both write paths.

Setup is a read-only bootstrap page. Choosing the initial frontpage weblog is a
separate global-administrator action reached by POST (FrontpageSetup); later
changes go through global configuration, which resolves the handle through the
shared FrontpageSettings service. The service stores the weblog's canonical
handle, treats a missing aggregation checkbox as false, writes both properties
before a single flush, and clears the site-wide, page and feed caches so the
change is visible on this node. save() rejects non-POST requests.

Peers pick the change up when their own cache entries expire; Roller has no
cross-node invalidation transport and this does not add one.

Claude-Session: https://claude.ai/code/session_01A1fhY1E2PCFU6UAPXu2WtV
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant