Skip to content

armgit / kaneo

Public Imported from GitHub
0

⚡ Project management that doesn't become the project. Boards, Gantt charts, and GitHub integration. Self-host it or use Kaneo Cloud.

feat(notifications): opt-in flag to allow private webhook destinations

Andrej412c56879d11
diff --git a/ENVIRONMENT_SETUP.md b/ENVIRONMENT_SETUP.md
index 40dd961e9..ed0a7e890 100644
--- a/ENVIRONMENT_SETUP.md
+++ b/ENVIRONMENT_SETUP.md
@@ -49,6 +49,7 @@ Kaneo supports many optional configuration options including:
- Access control settings
- CORS configuration
- Redis for horizontal scaling
+- Private-network notification receivers (`KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS=true` lets ntfy/Gotify/webhook destinations resolve to private addresses; off by default to prevent SSRF)
#### Redis Configuration
diff --git a/apps/api/src/plugins/generic-webhook/config.ts b/apps/api/src/plugins/generic-webhook/config.ts
index f864426bb..e77e81858 100644
--- a/apps/api/src/plugins/generic-webhook/config.ts
+++ b/apps/api/src/plugins/generic-webhook/config.ts
@@ -61,6 +61,15 @@ export async function assertPublicWebhookDestination(
throw new Error("Generic webhook URL must use http or https");
}
+ // Self-hosters whose receivers (Gotify, ntfy, ...) live on a private network
+ // can opt out of the SSRF/private-address guard. Default off keeps protection on.
+ if (
+ process.env.KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS === "true" ||
+ process.env.KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS === "1"
+ ) {
+ return;
+ }
+
if (isDisallowedAddress(url.hostname)) {
throw new Error(
"Generic webhook destination resolves to a non-routable address",
diff --git a/apps/docs/core/functional/account-notifications.mdx b/apps/docs/core/functional/account-notifications.mdx
index 63669bd53..9dad13a31 100644
--- a/apps/docs/core/functional/account-notifications.mdx
+++ b/apps/docs/core/functional/account-notifications.mdx
@@ -132,6 +132,8 @@ This applies to:
If you are using a self-hosted ntfy instance, Gotify instance, or webhook receiver, it must be reachable from the API with an accepted public or routable hostname.
+If your receiver only exists on a private network, set `KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS=true` on the API to bypass this guard. It is off by default, the `http`/`https` protocol requirement still applies, and enabling it re-opens the SSRF surface the check protects against. Only turn it on for a trusted, isolated deployment.
+
## Troubleshooting
### Notifications show in Kaneo but are not delivered
diff --git a/apps/docs/core/installation/environment-variables.mdx b/apps/docs/core/installation/environment-variables.mdx
index ac5a30c14..4c493befa 100644
--- a/apps/docs/core/installation/environment-variables.mdx
+++ b/apps/docs/core/installation/environment-variables.mdx
@@ -40,10 +40,10 @@ This section will cover all the variables related to the database.
Name | Description |
--- | --- |
-| `DATABASE_URL` | The URL of the PostgreSQL database.
-| `POSTGRES_DB` | The name of the PostgreSQL database.
-| `POSTGRES_USER` | The username for the PostgreSQL database.
-| `POSTGRES_PASSWORD` | The password for the PostgreSQL database.
+| `DATABASE_URL` | The full PostgreSQL connection string, in the format `postgresql://[user]:[password]@[host]:[port]/[database]`. Example: `postgresql://kaneo:kaneo@localhost:5432/kaneo`. The user/password/database must match the `POSTGRES_*` values below.
+| `POSTGRES_DB` | The name of the PostgreSQL database. Example: `kaneo`.
+| `POSTGRES_USER` | The username for the PostgreSQL database. Example: `kaneo`.
+| `POSTGRES_PASSWORD` | The password for the PostgreSQL database. Use a strong value in production.
### Authentication
@@ -86,6 +86,12 @@ Name | Description | Default |
| `DISABLE_LOGIN_FORM` | Hide the email/password login form on the sign-in page. When set to `true`, only SSO/OAuth buttons are shown. Useful when you want to enforce authentication exclusively through an external identity provider. | `false` |
| `CUSTOM_OAUTH_AUTO_LOGIN` | Automatically redirect to the custom OAuth/OIDC provider instead of showing the sign-in page. When set to `true`, users are immediately redirected to your identity provider without seeing the login page. Requires a custom OAuth provider to be configured. | `false` |
+### Notifications
+
+Name | Description | Default |
+--- | --- | --- |
+| `KANEO_ALLOW_PRIVATE_WEBHOOK_DESTINATIONS` | Allow outbound notification destinations (ntfy, Gotify, generic webhooks) that resolve to private or non-routable addresses. Off by default to prevent SSRF; the `http`/`https` requirement still applies. Only enable on a trusted, isolated deployment. | `false` |
+
### GitHub SSO
Sign in with GitHub uses a [GitHub OAuth App](https://docs.github.com/en/apps/oauth-apps/building-oauth-apps/creating-an-oauth-app). Set `GITHUB_OAUTH_CLIENT_ID` and `GITHUB_OAUTH_CLIENT_SECRET` (or rely on the legacy variables below).