Enable optional Funkwhale and Last.fm listening endpoints
This commit is contained in:
@@ -20,6 +20,8 @@
|
|||||||
- Webmentions moderation + API: `/webmentions`
|
- Webmentions moderation + API: `/webmentions`
|
||||||
- Conversations + API: `/conversations`
|
- Conversations + API: `/conversations`
|
||||||
- GitHub activity + API: `/github`
|
- GitHub activity + API: `/github`
|
||||||
|
- Funkwhale activity + API: `/funkwhale` (enabled when `FUNKWHALE_INSTANCE`, `FUNKWHALE_USERNAME`, `FUNKWHALE_TOKEN` are set)
|
||||||
|
- Last.fm activity + API: `/lastfmapi` (enabled when `LASTFM_API_KEY`, `LASTFM_USERNAME` are set)
|
||||||
|
|
||||||
## MongoDB
|
## MongoDB
|
||||||
|
|
||||||
@@ -64,6 +66,17 @@
|
|||||||
- `GITHUB_USERNAME`: GitHub user/owner name.
|
- `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`.
|
- Backward compatibility: if `GH_CONTENT_TOKEN` or `GH_ACTIVITY_TOKEN` are not set, config falls back to `GITHUB_TOKEN`.
|
||||||
|
|
||||||
|
## Listening tokens
|
||||||
|
|
||||||
|
- Funkwhale endpoint requirements:
|
||||||
|
- `FUNKWHALE_INSTANCE` (for example `https://your-funkwhale.example`)
|
||||||
|
- `FUNKWHALE_USERNAME`
|
||||||
|
- `FUNKWHALE_TOKEN` (read API token)
|
||||||
|
- Last.fm endpoint requirements:
|
||||||
|
- `LASTFM_API_KEY`
|
||||||
|
- `LASTFM_USERNAME`
|
||||||
|
- If these variables are missing, the related endpoint plugin is not enabled and `/listening` will show no listening history.
|
||||||
|
|
||||||
## Startup script
|
## Startup script
|
||||||
|
|
||||||
- `start.sh` is intentionally ignored by Git (`.gitignore`) so server secrets are not committed.
|
- `start.sh` is intentionally ignored by Git (`.gitignore`) so server secrets are not committed.
|
||||||
|
|||||||
@@ -31,6 +31,15 @@ const githubContentToken =
|
|||||||
process.env.GH_CONTENT_TOKEN || process.env.GITHUB_TOKEN;
|
process.env.GH_CONTENT_TOKEN || process.env.GITHUB_TOKEN;
|
||||||
const githubActivityToken =
|
const githubActivityToken =
|
||||||
process.env.GH_ACTIVITY_TOKEN || process.env.GITHUB_TOKEN;
|
process.env.GH_ACTIVITY_TOKEN || process.env.GITHUB_TOKEN;
|
||||||
|
const funkwhaleInstance = process.env.FUNKWHALE_INSTANCE;
|
||||||
|
const funkwhaleUsername = process.env.FUNKWHALE_USERNAME;
|
||||||
|
const funkwhaleToken = process.env.FUNKWHALE_TOKEN;
|
||||||
|
const lastfmApiKey = process.env.LASTFM_API_KEY;
|
||||||
|
const lastfmUsername = process.env.LASTFM_USERNAME;
|
||||||
|
const enableFunkwhaleEndpoint = Boolean(
|
||||||
|
funkwhaleInstance && funkwhaleUsername && funkwhaleToken,
|
||||||
|
);
|
||||||
|
const enableLastfmEndpoint = Boolean(lastfmApiKey && lastfmUsername);
|
||||||
const publicationBaseUrl = (
|
const publicationBaseUrl = (
|
||||||
process.env.PUBLICATION_URL || "https://blog.giersig.eu"
|
process.env.PUBLICATION_URL || "https://blog.giersig.eu"
|
||||||
).replace(/\/+$/, "");
|
).replace(/\/+$/, "");
|
||||||
@@ -118,6 +127,8 @@ export default {
|
|||||||
"@rmdes/indiekit-endpoint-github",
|
"@rmdes/indiekit-endpoint-github",
|
||||||
"@rmdes/indiekit-endpoint-webmention-io",
|
"@rmdes/indiekit-endpoint-webmention-io",
|
||||||
"@rmdes/indiekit-endpoint-conversations",
|
"@rmdes/indiekit-endpoint-conversations",
|
||||||
|
...(enableFunkwhaleEndpoint ? ["@rmdes/indiekit-endpoint-funkwhale"] : []),
|
||||||
|
...(enableLastfmEndpoint ? ["@rmdes/indiekit-endpoint-lastfm"] : []),
|
||||||
//"@rmdes/indiekit-endpoint-activitypub",
|
//"@rmdes/indiekit-endpoint-activitypub",
|
||||||
],
|
],
|
||||||
"@indiekit/store-github": {
|
"@indiekit/store-github": {
|
||||||
@@ -140,6 +151,17 @@ export default {
|
|||||||
"@rmdes/indiekit-endpoint-conversations": {
|
"@rmdes/indiekit-endpoint-conversations": {
|
||||||
mountPath: "/conversations",
|
mountPath: "/conversations",
|
||||||
},
|
},
|
||||||
|
"@rmdes/indiekit-endpoint-funkwhale": {
|
||||||
|
mountPath: "/funkwhale",
|
||||||
|
instanceUrl: funkwhaleInstance,
|
||||||
|
username: funkwhaleUsername,
|
||||||
|
token: funkwhaleToken,
|
||||||
|
},
|
||||||
|
"@rmdes/indiekit-endpoint-lastfm": {
|
||||||
|
mountPath: "/lastfmapi",
|
||||||
|
apiKey: lastfmApiKey,
|
||||||
|
username: lastfmUsername,
|
||||||
|
},
|
||||||
"@rmdes/indiekit-endpoint-activitypub": {
|
"@rmdes/indiekit-endpoint-activitypub": {
|
||||||
username: "blog.giersig.eu",
|
username: "blog.giersig.eu",
|
||||||
},
|
},
|
||||||
|
|||||||
Generated
+35
@@ -13,7 +13,9 @@
|
|||||||
"@indiekit/indiekit": "^1.0.0-beta.25",
|
"@indiekit/indiekit": "^1.0.0-beta.25",
|
||||||
"@indiekit/store-github": "^1.0.0-beta.25",
|
"@indiekit/store-github": "^1.0.0-beta.25",
|
||||||
"@rmdes/indiekit-endpoint-conversations": "^2.1.6",
|
"@rmdes/indiekit-endpoint-conversations": "^2.1.6",
|
||||||
|
"@rmdes/indiekit-endpoint-funkwhale": "^1.0.11",
|
||||||
"@rmdes/indiekit-endpoint-github": "^1.2.3",
|
"@rmdes/indiekit-endpoint-github": "^1.2.3",
|
||||||
|
"@rmdes/indiekit-endpoint-lastfm": "^1.0.12",
|
||||||
"@rmdes/indiekit-endpoint-posts": "^1.0.0-beta.25",
|
"@rmdes/indiekit-endpoint-posts": "^1.0.0-beta.25",
|
||||||
"@rmdes/indiekit-endpoint-webmention-io": "^1.0.7",
|
"@rmdes/indiekit-endpoint-webmention-io": "^1.0.7",
|
||||||
"@rmdes/indiekit-post-type-page": "^1.0.4",
|
"@rmdes/indiekit-post-type-page": "^1.0.4",
|
||||||
@@ -1784,6 +1786,22 @@
|
|||||||
"node": ">=20"
|
"node": ">=20"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@rmdes/indiekit-endpoint-funkwhale": {
|
||||||
|
"version": "1.0.11",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-funkwhale/-/indiekit-endpoint-funkwhale-1.0.11.tgz",
|
||||||
|
"integrity": "sha512-AbPobqh5P/2SG8l+fJ4IGJmelGr0u0lfNsNHOxkOfhEckC5iIELssj/1e/E+eW42y58StpzsdQ+xqPIT5ur9PA==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@indiekit/error": "^1.0.0-beta.25",
|
||||||
|
"express": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@indiekit/indiekit": ">=1.0.0-beta.25"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@rmdes/indiekit-endpoint-github": {
|
"node_modules/@rmdes/indiekit-endpoint-github": {
|
||||||
"version": "1.2.3",
|
"version": "1.2.3",
|
||||||
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-github/-/indiekit-endpoint-github-1.2.3.tgz",
|
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-github/-/indiekit-endpoint-github-1.2.3.tgz",
|
||||||
@@ -1800,6 +1818,22 @@
|
|||||||
"@indiekit/indiekit": ">=1.0.0-beta.25"
|
"@indiekit/indiekit": ">=1.0.0-beta.25"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@rmdes/indiekit-endpoint-lastfm": {
|
||||||
|
"version": "1.0.12",
|
||||||
|
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-lastfm/-/indiekit-endpoint-lastfm-1.0.12.tgz",
|
||||||
|
"integrity": "sha512-emR3teALxLqj7o3wpxeF6zvTiahf6+Fi0qUblytuV9tZ1W0NOKUKGh8Tf5aeC0Gzt6+XJBS2JLP6AHAlTiW5Mg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@indiekit/error": "^1.0.0-beta.25",
|
||||||
|
"express": "^5.0.0"
|
||||||
|
},
|
||||||
|
"engines": {
|
||||||
|
"node": ">=20"
|
||||||
|
},
|
||||||
|
"peerDependencies": {
|
||||||
|
"@indiekit/indiekit": ">=1.0.0-beta.25"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@rmdes/indiekit-endpoint-posts": {
|
"node_modules/@rmdes/indiekit-endpoint-posts": {
|
||||||
"version": "1.0.0-beta.25",
|
"version": "1.0.0-beta.25",
|
||||||
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-posts/-/indiekit-endpoint-posts-1.0.0-beta.25.tgz",
|
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-posts/-/indiekit-endpoint-posts-1.0.0-beta.25.tgz",
|
||||||
@@ -5556,6 +5590,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz",
|
"resolved": "https://registry.npmjs.org/socks/-/socks-2.8.7.tgz",
|
||||||
"integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==",
|
"integrity": "sha512-HLpt+uLy/pxB+bum/9DzAgiKS8CX1EvbWxI4zlmgGCExImLdiad2iCwXT5Z4c9c3Eq8rP2318mPW2c+QbtjK8A==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"ip-address": "^10.0.1",
|
"ip-address": "^10.0.1",
|
||||||
"smart-buffer": "^4.2.0"
|
"smart-buffer": "^4.2.0"
|
||||||
|
|||||||
@@ -25,7 +25,9 @@
|
|||||||
"@indiekit/indiekit": "^1.0.0-beta.25",
|
"@indiekit/indiekit": "^1.0.0-beta.25",
|
||||||
"@indiekit/store-github": "^1.0.0-beta.25",
|
"@indiekit/store-github": "^1.0.0-beta.25",
|
||||||
"@rmdes/indiekit-endpoint-conversations": "^2.1.6",
|
"@rmdes/indiekit-endpoint-conversations": "^2.1.6",
|
||||||
|
"@rmdes/indiekit-endpoint-funkwhale": "^1.0.11",
|
||||||
"@rmdes/indiekit-endpoint-github": "^1.2.3",
|
"@rmdes/indiekit-endpoint-github": "^1.2.3",
|
||||||
|
"@rmdes/indiekit-endpoint-lastfm": "^1.0.12",
|
||||||
"@rmdes/indiekit-endpoint-posts": "^1.0.0-beta.25",
|
"@rmdes/indiekit-endpoint-posts": "^1.0.0-beta.25",
|
||||||
"@rmdes/indiekit-endpoint-webmention-io": "^1.0.7",
|
"@rmdes/indiekit-endpoint-webmention-io": "^1.0.7",
|
||||||
"@rmdes/indiekit-post-type-page": "^1.0.4",
|
"@rmdes/indiekit-post-type-page": "^1.0.4",
|
||||||
|
|||||||
Reference in New Issue
Block a user