mirror of
https://github.com/plankanban/planka.git
synced 2025-12-29 17:25:05 +03:00
feat: Move webhooks configuration from environment variable to UI
This commit is contained in:
@@ -93,6 +93,4 @@ module.exports.custom = {
|
||||
smtpPassword: process.env.SMTP_PASSWORD,
|
||||
smtpFrom: process.env.SMTP_FROM,
|
||||
smtpTlsRejectUnauthorized: process.env.SMTP_TLS_REJECT_UNAUTHORIZED !== 'false',
|
||||
|
||||
webhooks: JSON.parse(process.env.WEBHOOKS || '[]'), // TODO: validate structure
|
||||
};
|
||||
|
||||
@@ -18,6 +18,11 @@ module.exports.policies = {
|
||||
|
||||
'*': 'is-authenticated',
|
||||
|
||||
'webhooks/index': ['is-admin'],
|
||||
'webhooks/create': ['is-admin'],
|
||||
'webhooks/update': ['is-admin'],
|
||||
'webhooks/delete': ['is-admin'],
|
||||
|
||||
'users/create': ['is-authenticated', 'is-admin'],
|
||||
'users/delete': ['is-authenticated', 'is-admin'],
|
||||
|
||||
|
||||
@@ -64,6 +64,11 @@ function staticDirServer(prefix, dirFn) {
|
||||
module.exports.routes = {
|
||||
'GET /api/config': 'config/show',
|
||||
|
||||
'GET /api/webhooks': 'webhooks/index',
|
||||
'POST /api/webhooks': 'webhooks/create',
|
||||
'PATCH /api/webhooks/:id': 'webhooks/update',
|
||||
'DELETE /api/webhooks/:id': 'webhooks/delete',
|
||||
|
||||
'POST /api/access-tokens': 'access-tokens/create',
|
||||
'POST /api/access-tokens/exchange-with-oidc': 'access-tokens/exchange-with-oidc',
|
||||
'DELETE /api/access-tokens/me': 'access-tokens/delete',
|
||||
|
||||
Reference in New Issue
Block a user