4.5 KiB
4.5 KiB
indiekit-blog
Admin login
- The IndieKit admin is expected to run behind
/admin. - Set
INDIEKIT_ADMIN_URLto the public admin base URL, including trailing slash (example:https://blog.giersig.eu/admin/). - When
INDIEKIT_ADMIN_URLis set, config wires absolute auth endpoints/callback base (/auth,/auth/token,/auth/introspect) to that URL to keep login redirects on/admin/*. - Login uses
PASSWORD_SECRET(bcrypt hash), notINDIEKIT_PASSWORD. - If no
PASSWORD_SECRETexists yet, open/admin/auth/new-passwordonce to generate it. - Post management UI should use
/posts(@indiekit/endpoint-posts.mountPath). - Do not set post-management
mountPathto frontend routes like/blog, otherwise backend publishing can be shadowed by the public site.
Backend endpoints
- Configured endpoint mount paths:
- Posts management:
/posts - Files:
/files - Webmentions moderation + API:
/webmentions - Conversations + API:
/conversations - GitHub activity + API:
/github - If IndieKit is reverse-proxied behind
/admin, these become/admin/posts,/admin/files, etc.
MongoDB
- Preferred: set a full
MONGO_URL(example:mongodb://user:pass@host:27017/indiekit?authSource=admin). - If
MONGO_URLis not set, setMONGO_USERNAMEandMONGO_PASSWORDexplicitly; config builds the URL fromMONGO_USERNAME,MONGO_PASSWORD,MONGO_HOST,MONGO_PORT,MONGO_DATABASE,MONGO_AUTH_SOURCE. - Startup scripts now fail fast when
MONGO_URLis absent andMONGO_USERNAMEis missing, to avoid silent auth mismatches. - Startup now runs
scripts/preflight-mongo-connection.mjsbefore boot. InNODE_ENV=productionthis is strict and aborts start on Mongo auth/connect failures. - For
MongoServerError: Authentication failed, first verifyMONGO_PASSWORD, then tryMONGO_AUTH_SOURCE=admin.
Content paths
- This setup writes post files to the content repo
blogundercontent/. - Current paths in
publication.postTypesare: content/articles/{slug}.mdcontent/notes/{slug}.mdcontent/bookmarks/{slug}.mdcontent/likes/{slug}.mdcontent/photos/{slug}.mdcontent/replies/{slug}.mdcontent/pages/{slug}.md- If these paths do not match the content repo structure, edit/delete actions can fail with GitHub
Not Found. - Reposts are handled as property-based posts (
repostOf/repost_of) and rendered through therepostscollection in the Eleventy theme.
Post URLs
- Current post URLs in
publication.postTypesare: https://blog.giersig.eu/articles/{slug}/https://blog.giersig.eu/notes/{slug}/https://blog.giersig.eu/bookmarks/{slug}/https://blog.giersig.eu/likes/{slug}/https://blog.giersig.eu/photos/{slug}/https://blog.giersig.eu/replies/{slug}/https://blog.giersig.eu/{slug}/(page post type)
GitHub tokens
- Recommended for two-repo setups:
GH_CONTENT_TOKEN: token for content repo (blog), used by@indiekit/store-github.GH_ACTIVITY_TOKEN: token for GitHub dashboard/activity endpoint, used by@rmdes/indiekit-endpoint-github.GITHUB_USERNAME: GitHub user/owner name.- Backward compatibility: if
GH_CONTENT_TOKENorGH_ACTIVITY_TOKENare not set, config falls back toGITHUB_TOKEN.
Startup script
start.shis intentionally ignored by Git (.gitignore) so server secrets are not committed.- Use
start.example.shas the tracked template and keep real credentials in environment variables (or.envon the server). - Startup scripts parse
.envwith thedotenvparser (not shellsource), so values containing spaces are handled safely. - Startup scripts run preflight + patch helpers before boot (
scripts/preflight-mongo-connection.mjs,scripts/patch-lightningcss.mjs,scripts/patch-endpoint-media-scope.mjs,scripts/patch-endpoint-files-upload-route.mjs,scripts/patch-frontend-serviceworker-file.mjs,scripts/patch-conversations-collection-guards.mjs). - The media scope patch fixes a known upstream issue where file uploads can fail if the token scope is
create update deletewithout explicitmedia. - The files upload route patch fixes browser multi-upload by posting to
/files/upload(session-authenticated) instead of direct/mediacalls without bearer token. - The frontend serviceworker patch ensures
@indiekit/frontend/lib/serviceworker.jsexists at runtime to avoid ENOENT in the offline/service worker route. - The conversations guard patch prevents
Cannot read properties of undefined (reading 'find')when theconversation_itemscollection is temporarily unavailable.