Split GitHub tokens for content and activity
This commit is contained in:
@@ -11,4 +11,12 @@
|
||||
|
||||
- Preferred: set a full `MONGO_URL` (example: `mongodb://user:pass@host:27017/indiekit?authSource=admin`).
|
||||
- If `MONGO_URL` is not set, config builds the URL from `MONGO_USERNAME`, `MONGO_PASSWORD`, `MONGO_HOST`, `MONGO_PORT`, `MONGO_DATABASE`, `MONGO_AUTH_SOURCE`.
|
||||
- For `MongoServerError: Authentication failed`, first verify `MONGO_PASSWORD`, then try `MONGO_AUTH_SOURCE=admin`.
|
||||
- For `MongoServerError: Authentication failed`, first verify `MONGO_PASSWORD`, then try `MONGO_AUTH_SOURCE=admin`.
|
||||
|
||||
## 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_TOKEN` or `GH_ACTIVITY_TOKEN` are not set, config falls back to `GITHUB_TOKEN`.
|
||||
+10
-3
@@ -22,6 +22,12 @@ const mongoUrl =
|
||||
process.env.MONGO_URL ||
|
||||
`mongodb://${mongoCredentials}${mongoHost}:${mongoPort}/${mongoDatabase}${mongoQuery}`;
|
||||
|
||||
const githubUsername = process.env.GITHUB_USERNAME || "svemagie";
|
||||
const githubContentToken =
|
||||
process.env.GH_CONTENT_TOKEN || process.env.GITHUB_TOKEN;
|
||||
const githubActivityToken =
|
||||
process.env.GH_ACTIVITY_TOKEN || process.env.GITHUB_TOKEN;
|
||||
|
||||
export default {
|
||||
debug: "indiekit:*",
|
||||
application: {
|
||||
@@ -66,16 +72,17 @@ export default {
|
||||
//"@rmdes/indiekit-endpoint-activitypub",
|
||||
],
|
||||
"@indiekit/store-github": {
|
||||
user: "svemagie",
|
||||
user: githubUsername,
|
||||
repo: "blog",
|
||||
branch: "main",
|
||||
token: githubContentToken,
|
||||
},
|
||||
"@rmdes/indiekit-endpoint-posts": {
|
||||
mountPath: "/blog",
|
||||
},
|
||||
"@rmdes/indiekit-endpoint-github": {
|
||||
token: process.env.GITHUB_TOKEN,
|
||||
user: "svemagie",
|
||||
token: githubActivityToken,
|
||||
username: githubUsername,
|
||||
},
|
||||
"@rmdes/indiekit-endpoint-webmention-io": {
|
||||
token: process.env.WEBMENTION_IO_TOKEN,
|
||||
|
||||
Reference in New Issue
Block a user