Add webmentions proxy endpoint integration
This commit is contained in:
@@ -20,6 +20,13 @@ WEBMENTION_SENDER_TIMEOUT=10000
|
||||
# User-Agent used for target endpoint discovery and sends
|
||||
WEBMENTION_SENDER_USER_AGENT=
|
||||
|
||||
# Optional webmentions proxy endpoint settings
|
||||
# Default mount path in indiekit.config.mjs is /webmentions-api
|
||||
WEBMENTIONS_PROXY_MOUNT_PATH=/webmentions-api
|
||||
|
||||
# Cache TTL in seconds for proxied webmention.io API responses
|
||||
WEBMENTIONS_PROXY_CACHE_TTL=60
|
||||
|
||||
# Syndication endpoint mount path
|
||||
# Default in indiekit.config.mjs is /syndicate
|
||||
SYNDICATE_MOUNT_PATH=/syndicate
|
||||
|
||||
@@ -18,6 +18,7 @@
|
||||
- Posts management: `/posts`
|
||||
- Files: `/files`
|
||||
- Webmentions moderation + API: `/webmentions`
|
||||
- Webmentions proxy API: `/webmentions-api`
|
||||
- Webmention sender + API: `/webmention-sender`
|
||||
- Homepage builder UI + API: `/homepage`
|
||||
- Conversations + API: `/conversations`
|
||||
@@ -102,6 +103,15 @@
|
||||
- `WEBMENTION_SENDER_USER_AGENT` (default `${SITE_NAME} Webmention Sender`)
|
||||
- `POST /webmention-sender` requires authentication (`update` scope) and sends pending webmentions for unpublished targets.
|
||||
|
||||
## Webmentions proxy
|
||||
|
||||
- Webmentions proxy endpoint is enabled via `@rmdes/indiekit-endpoint-webmentions-proxy` and mounted at `/webmentions-api` by default.
|
||||
- Optional environment variables:
|
||||
- `WEBMENTIONS_PROXY_MOUNT_PATH` (default `/webmentions-api`)
|
||||
- `WEBMENTIONS_PROXY_CACHE_TTL` (default `60`, cache TTL in seconds)
|
||||
- Uses existing `WEBMENTION_IO_TOKEN` and `WEBMENTION_IO_DOMAIN` configuration for upstream webmention.io requests.
|
||||
- Public JSON API route: `GET /webmentions-api/api/mentions` (supports `page`, `per-page`, `target`, `wm-property` query parameters).
|
||||
|
||||
## ActivityPub
|
||||
|
||||
- ActivityPub federation is enabled via `@rmdes/indiekit-endpoint-activitypub`.
|
||||
|
||||
@@ -78,6 +78,15 @@ const webmentionSenderTimeout = Number.isFinite(webmentionSenderTimeoutRaw)
|
||||
: 10000;
|
||||
const webmentionSenderUserAgent =
|
||||
process.env.WEBMENTION_SENDER_USER_AGENT || `${siteName} Webmention Sender`;
|
||||
const webmentionsProxyMountPath =
|
||||
process.env.WEBMENTIONS_PROXY_MOUNT_PATH || "/webmentions-api";
|
||||
const webmentionsProxyCacheTtlRaw = Number.parseInt(
|
||||
process.env.WEBMENTIONS_PROXY_CACHE_TTL || "60",
|
||||
10,
|
||||
);
|
||||
const webmentionsProxyCacheTtl = Number.isFinite(webmentionsProxyCacheTtlRaw)
|
||||
? webmentionsProxyCacheTtlRaw
|
||||
: 60;
|
||||
const authorName = process.env.AUTHOR_NAME || "";
|
||||
const authorBio = process.env.AUTHOR_BIO || "";
|
||||
const authorAvatar = (() => {
|
||||
@@ -208,6 +217,7 @@ export default {
|
||||
"@rmdes/indiekit-preset-eleventy",
|
||||
"@rmdes/indiekit-endpoint-github",
|
||||
"@rmdes/indiekit-endpoint-webmention-io",
|
||||
"@rmdes/indiekit-endpoint-webmentions-proxy",
|
||||
"@rmdes/indiekit-endpoint-webmention-sender",
|
||||
"@rmdes/indiekit-endpoint-homepage",
|
||||
"@rmdes/indiekit-endpoint-conversations",
|
||||
@@ -248,6 +258,12 @@ export default {
|
||||
token: process.env.WEBMENTION_IO_TOKEN,
|
||||
domain: webmentionDomain,
|
||||
},
|
||||
"@rmdes/indiekit-endpoint-webmentions-proxy": {
|
||||
mountPath: webmentionsProxyMountPath,
|
||||
token: process.env.WEBMENTION_IO_TOKEN,
|
||||
domain: webmentionDomain,
|
||||
cacheTtl: webmentionsProxyCacheTtl,
|
||||
},
|
||||
"@rmdes/indiekit-endpoint-webmention-sender": {
|
||||
mountPath: webmentionSenderMountPath,
|
||||
timeout: webmentionSenderTimeout,
|
||||
|
||||
Generated
+16
@@ -23,6 +23,7 @@
|
||||
"@rmdes/indiekit-endpoint-posts": "^1.0.0-beta.25",
|
||||
"@rmdes/indiekit-endpoint-webmention-io": "^1.0.7",
|
||||
"@rmdes/indiekit-endpoint-webmention-sender": "^1.0.6",
|
||||
"@rmdes/indiekit-endpoint-webmentions-proxy": "^1.0.3",
|
||||
"@rmdes/indiekit-post-type-page": "^1.0.4",
|
||||
"@rmdes/indiekit-preset-eleventy": "^1.0.0-beta.33",
|
||||
"@rmdes/indiekit-syndicator-bluesky": "^1.0.19",
|
||||
@@ -2518,6 +2519,21 @@
|
||||
"url": "https://opencollective.com/node-fetch"
|
||||
}
|
||||
},
|
||||
"node_modules/@rmdes/indiekit-endpoint-webmentions-proxy": {
|
||||
"version": "1.0.3",
|
||||
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-endpoint-webmentions-proxy/-/indiekit-endpoint-webmentions-proxy-1.0.3.tgz",
|
||||
"integrity": "sha512-lVaE/zy0HvDgyC4Lp9vOp7AaYFHAZdfXDuLBmrTD+j5TWi9U3/dzjKe0xRs9h7wo9jIyk+M7zAnWhLtaoY90OA==",
|
||||
"license": "MIT",
|
||||
"dependencies": {
|
||||
"express": "^5.0.0"
|
||||
},
|
||||
"engines": {
|
||||
"node": ">=20"
|
||||
},
|
||||
"peerDependencies": {
|
||||
"@indiekit/indiekit": ">=1.0.0-beta.25"
|
||||
}
|
||||
},
|
||||
"node_modules/@rmdes/indiekit-post-type-page": {
|
||||
"version": "1.0.4",
|
||||
"resolved": "https://registry.npmjs.org/@rmdes/indiekit-post-type-page/-/indiekit-post-type-page-1.0.4.tgz",
|
||||
|
||||
@@ -35,6 +35,7 @@
|
||||
"@rmdes/indiekit-endpoint-posts": "^1.0.0-beta.25",
|
||||
"@rmdes/indiekit-endpoint-webmention-io": "^1.0.7",
|
||||
"@rmdes/indiekit-endpoint-webmention-sender": "^1.0.6",
|
||||
"@rmdes/indiekit-endpoint-webmentions-proxy": "^1.0.3",
|
||||
"@rmdes/indiekit-post-type-page": "^1.0.4",
|
||||
"@rmdes/indiekit-preset-eleventy": "^1.0.0-beta.33",
|
||||
"@rmdes/indiekit-syndicator-bluesky": "^1.0.19",
|
||||
|
||||
Reference in New Issue
Block a user