Fix admin auth config behind /admin

This commit is contained in:
svemagie
2026-03-07 18:44:41 +01:00
parent c3ec43758e
commit 396b3e51e1
2 changed files with 19 additions and 11 deletions

View File

@@ -1 +1,8 @@
# indiekit-blog
# indiekit-blog
## Admin login
- The IndieKit admin is expected to run behind `/admin`.
- Set `INDIEKIT_ADMIN_URL` to the public admin base URL, including trailing slash (example: `https://blog.giersig.eu/admin/`).
- Login uses `PASSWORD_SECRET` (bcrypt hash), not `INDIEKIT_PASSWORD`.
- If no `PASSWORD_SECRET` exists yet, open `/admin/auth/new-password` once to generate it.

View File

@@ -1,15 +1,18 @@
const rawAdminUrl =
process.env.INDIEKIT_ADMIN_URL || "https://blog.giersig.eu/admin/";
const adminUrl = new URL(
rawAdminUrl.endsWith("/") ? rawAdminUrl : `${rawAdminUrl}/`,
).href;
export default {
url: "https://blog.giersig.eu",
debug: "indiekit:*",
application: {
name: "Indiekit",
admin: {
username: "admin@blog.giersig.eu",
password: process.env.INDIEKIT_PASSWORD
}
},
"@indiekit/endpoint-auth": {
publicUrl: "https://blog.giersig.eu"
url: adminUrl,
authorizationEndpoint: new URL("auth", adminUrl).href,
introspectionEndpoint: new URL("auth/introspect", adminUrl).href,
tokenEndpoint: new URL("auth/token", adminUrl).href,
mongodbUrl: `mongodb://indiekit:${process.env.MONGO_PASSWORD}@10.100.0.20:27017/indiekit`,
},
publication: {
me: "https://blog.giersig.eu",
@@ -41,8 +44,6 @@ export default {
],
},
secret: process.env.SECRET,
mongodbUrl: `mongodb://indiekit:${process.env.MONGO_PASSWORD}@10.100.0.20:27017/indiekit`,
plugins: [
"@indiekit/store-github",
"@rmdes/indiekit-endpoint-posts",