Split GitHub tokens for content and activity
This commit is contained in:
@@ -12,3 +12,11 @@
|
|||||||
- Preferred: set a full `MONGO_URL` (example: `mongodb://user:pass@host:27017/indiekit?authSource=admin`).
|
- 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`.
|
- 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 ||
|
process.env.MONGO_URL ||
|
||||||
`mongodb://${mongoCredentials}${mongoHost}:${mongoPort}/${mongoDatabase}${mongoQuery}`;
|
`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 {
|
export default {
|
||||||
debug: "indiekit:*",
|
debug: "indiekit:*",
|
||||||
application: {
|
application: {
|
||||||
@@ -66,16 +72,17 @@ export default {
|
|||||||
//"@rmdes/indiekit-endpoint-activitypub",
|
//"@rmdes/indiekit-endpoint-activitypub",
|
||||||
],
|
],
|
||||||
"@indiekit/store-github": {
|
"@indiekit/store-github": {
|
||||||
user: "svemagie",
|
user: githubUsername,
|
||||||
repo: "blog",
|
repo: "blog",
|
||||||
branch: "main",
|
branch: "main",
|
||||||
|
token: githubContentToken,
|
||||||
},
|
},
|
||||||
"@rmdes/indiekit-endpoint-posts": {
|
"@rmdes/indiekit-endpoint-posts": {
|
||||||
mountPath: "/blog",
|
mountPath: "/blog",
|
||||||
},
|
},
|
||||||
"@rmdes/indiekit-endpoint-github": {
|
"@rmdes/indiekit-endpoint-github": {
|
||||||
token: process.env.GITHUB_TOKEN,
|
token: githubActivityToken,
|
||||||
user: "svemagie",
|
username: githubUsername,
|
||||||
},
|
},
|
||||||
"@rmdes/indiekit-endpoint-webmention-io": {
|
"@rmdes/indiekit-endpoint-webmention-io": {
|
||||||
token: process.env.WEBMENTION_IO_TOKEN,
|
token: process.env.WEBMENTION_IO_TOKEN,
|
||||||
|
|||||||
Reference in New Issue
Block a user