Fix admin auth config behind /admin
This commit is contained in:
@@ -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.
|
||||||
+11
-10
@@ -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 {
|
export default {
|
||||||
url: "https://blog.giersig.eu",
|
|
||||||
debug: "indiekit:*",
|
debug: "indiekit:*",
|
||||||
application: {
|
application: {
|
||||||
name: "Indiekit",
|
name: "Indiekit",
|
||||||
admin: {
|
url: adminUrl,
|
||||||
username: "admin@blog.giersig.eu",
|
authorizationEndpoint: new URL("auth", adminUrl).href,
|
||||||
password: process.env.INDIEKIT_PASSWORD
|
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`,
|
||||||
"@indiekit/endpoint-auth": {
|
|
||||||
publicUrl: "https://blog.giersig.eu"
|
|
||||||
},
|
},
|
||||||
publication: {
|
publication: {
|
||||||
me: "https://blog.giersig.eu",
|
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: [
|
plugins: [
|
||||||
"@indiekit/store-github",
|
"@indiekit/store-github",
|
||||||
"@rmdes/indiekit-endpoint-posts",
|
"@rmdes/indiekit-endpoint-posts",
|
||||||
|
|||||||
Reference in New Issue
Block a user