Repository navigation
feat: self-hosted Wiki.js for this repository, no login - #4
Merged
Merged
Conversation
Cloning this repository got you Markdown files. tools/serve.py renders them,
but it is a preview shim rather than the software the content is published
into, so there was no way to see how a page will actually look — or to browse
the wiki offline.
docker compose up -d → http://localhost:3000
Wiki.js 2.5 with PostgreSQL, serving this repository's pages, readable
immediately with no login.
Wiki.js normally needs a browser setup wizard, an admin account and a storage
target configured by hand before it shows a single page. wikijs/bootstrap.py
does all three over Wiki.js's own APIs: it completes the wizard, points the
Local File System target at the mounted repository, imports every page, drops
README (which documents the repository, not the project) and confirms guests
can read anonymously. It is idempotent, so re-running only refreshes content
and repairs drifted configuration.
The checkout is mounted read-only and the disk target is disabled again after
importing, so Wiki.js never writes back into anyone's working tree.
tools/check_wikijs.py fails when a page is missing, returns a non-200, or
bounces an anonymous visitor to a login screen. It deliberately does not follow
redirects: Wiki.js answers an unauthorised guest with a 302 to /login, and that
page returns 200 carrying the site title, so following redirects would let a
locked-down wiki pass. CI runs it against a real stack.
Closes #3
Co-Authored-By: Claude Opus 5 (1M context) <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YY1ekLLeFLkAU2kvdQ8Ey4
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Closes #3
docker compose up -d # → http://localhost:3000Wiki.js 2.5 + PostgreSQL, serving this repository's pages, readable immediately with no
login. One command from a fresh clone — no setup wizard, no account creation.
Why a bootstrap container
Wiki.js needs three manual steps before it shows a single page: a browser setup wizard, an
admin account, and a storage target configured in the admin UI. That is exactly the
friction this issue is about, so
wikijs/bootstrap.pydoes them over Wiki.js's own APIs —POST /finalizefor the wizard, then GraphQL for the rest.It runs once and exits. Re-running only refreshes content and repairs configuration that
has drifted, so it doubles as the reload command.
Design notes
Your checkout is mounted read-only. The Local File System target is a push target —
left enabled it would try to write edits back out. Bootstrap enables it, imports, then
disables it again, so Wiki.js never writes into anyone's working tree.
README is dropped after import. It documents the repository, not the project, so it
does not belong in the published page list.
An admin account exists because Wiki.js requires one, but nothing asks you to use it.
Credentials are in the README; this is a local stack on a throwaway database.
WIKI_PORToverrides the port, since 3000 is commonly taken.Verification
tools/check_wikijs.pyfails when a page is missing, returns a non-200, or bounces ananonymous visitor to a login screen. CI runs it against a real stack (
docker compose up,bootstrap in the foreground so a failure surfaces there, then the check).
From a clean slate —
docker compose down -vthendocker compose up -d:The check bites. With guest read revoked through the admin API, every page fails:
Re-running bootstrap restored it (
[bootstrap] granting guests read access) and the checkwent green again — which is also the idempotency evidence.
One thing worth flagging
My first version of this check passed
/homein that locked-down run. Wiki.js answers anunauthorised guest with a
302to/login, urllib followed it, and the login page returns200carrying the site title — so the title assertion matched and a fully locked-down wikilooked fine. The check now refuses to follow redirects and treats a
3xxas the failure itis. Without that it would have been a check that could not fail for the reason it exists.
Verified on Wiki.js
2.5.314(ghcr.io/requarks/wiki:2.5). CI has not run on this branchyet.