Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
72896a66b3 | ||
|
|
4be4783251 | ||
|
|
5c6c6a0bcf | ||
|
|
ba178d66fa | ||
|
|
270ce29f87 | ||
|
|
de1ed3c784 | ||
|
|
caf8790f28 | ||
|
|
81436b373d | ||
|
|
cc1e886a31 | ||
|
|
f0e9fe7904 | ||
|
|
5fcea5d651 |
@@ -15,13 +15,13 @@ type: application
|
|||||||
# This is the chart version. This version number should be incremented each time you make changes
|
# This is the chart version. This version number should be incremented each time you make changes
|
||||||
# to the chart and its templates, including the app version.
|
# to the chart and its templates, including the app version.
|
||||||
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
# Versions are expected to follow Semantic Versioning (https://semver.org/)
|
||||||
version: 0.1.34
|
version: 0.2.2
|
||||||
|
|
||||||
# This is the version number of the application being deployed. This version number should be
|
# This is the version number of the application being deployed. This version number should be
|
||||||
# incremented each time you make changes to the application. Versions are not expected to
|
# incremented each time you make changes to the application. Versions are not expected to
|
||||||
# follow Semantic Versioning. They should reflect the version the application is using.
|
# follow Semantic Versioning. They should reflect the version the application is using.
|
||||||
# It is recommended to use it with quotes.
|
# It is recommended to use it with quotes.
|
||||||
appVersion: "1.18.0"
|
appVersion: "1.19.1"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- alias: postgresql
|
- alias: postgresql
|
||||||
|
|||||||
@@ -90,17 +90,37 @@ spec:
|
|||||||
value: http://localhost:3000
|
value: http://localhost:3000
|
||||||
{{- end }}
|
{{- end }}
|
||||||
- name: SECRET_KEY
|
- name: SECRET_KEY
|
||||||
|
{{- if .Values.existingSecretkeySecret }}
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Values.existingSecretkeySecret }}
|
||||||
|
key: key
|
||||||
|
{{- else }}
|
||||||
value: {{ required "A secret key needs to be generated using 'openssl rand -hex 64' and assigned to secretkey." .Values.secretkey }}
|
value: {{ required "A secret key needs to be generated using 'openssl rand -hex 64' and assigned to secretkey." .Values.secretkey }}
|
||||||
|
{{- end }}
|
||||||
- name: TRUST_PROXY
|
- name: TRUST_PROXY
|
||||||
value: "0"
|
value: "0"
|
||||||
- name: DEFAULT_ADMIN_EMAIL
|
- name: DEFAULT_ADMIN_EMAIL
|
||||||
value: {{ .Values.admin_email }}
|
value: {{ .Values.admin_email }}
|
||||||
- name: DEFAULT_ADMIN_PASSWORD
|
|
||||||
value: {{ .Values.admin_password }}
|
|
||||||
- name: DEFAULT_ADMIN_NAME
|
- name: DEFAULT_ADMIN_NAME
|
||||||
value: {{ .Values.admin_name }}
|
value: {{ .Values.admin_name }}
|
||||||
|
{{- if .Values.existingAdminCredsSecret }}
|
||||||
|
- name: DEFAULT_ADMIN_USERNAME
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Values.existingAdminCredsSecret }}
|
||||||
|
key: username
|
||||||
|
- name: DEFAULT_ADMIN_PASSWORD
|
||||||
|
valueFrom:
|
||||||
|
secretKeyRef:
|
||||||
|
name: {{ .Values.existingAdminCredsSecret }}
|
||||||
|
key: password
|
||||||
|
{{- else }}
|
||||||
- name: DEFAULT_ADMIN_USERNAME
|
- name: DEFAULT_ADMIN_USERNAME
|
||||||
value: {{ .Values.admin_username }}
|
value: {{ .Values.admin_username }}
|
||||||
|
- name: DEFAULT_ADMIN_PASSWORD
|
||||||
|
value: {{ .Values.admin_password }}
|
||||||
|
{{- end }}
|
||||||
{{ range $k, $v := .Values.env }}
|
{{ range $k, $v := .Values.env }}
|
||||||
- name: {{ $k | quote }}
|
- name: {{ $k | quote }}
|
||||||
value: {{ $v | quote }}
|
value: {{ $v | quote }}
|
||||||
|
|||||||
@@ -17,6 +17,16 @@ fullnameOverride: ""
|
|||||||
# Generate a secret using openssl rand -base64 45
|
# Generate a secret using openssl rand -base64 45
|
||||||
secretkey: ""
|
secretkey: ""
|
||||||
|
|
||||||
|
## @param existingSecretkeySecret Name of an existing secret containing the session key string
|
||||||
|
## NOTE: Must contain key `key`
|
||||||
|
## NOTE: When it's set, the secretkey parameter is ignored
|
||||||
|
existingSecretkeySecret: ""
|
||||||
|
|
||||||
|
## @param existingAdminCredsSecret Name of an existing secret containing the admin username and password
|
||||||
|
## NOTE: Must contain keys `username` and `password`
|
||||||
|
## NOTE: When it's set, the `admin_username` and `admin_password` parameters are ignored
|
||||||
|
existingAdminCredsSecret: ""
|
||||||
|
|
||||||
# Base url for Planka. Will override `ingress.hosts[0].host`
|
# Base url for Planka. Will override `ingress.hosts[0].host`
|
||||||
# Defaults to `http://localhost:3000` if ingress is disabled.
|
# Defaults to `http://localhost:3000` if ingress is disabled.
|
||||||
baseUrl: ""
|
baseUrl: ""
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
REACT_APP_VERSION=1.18.0
|
REACT_APP_VERSION=1.19.1
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
import React, { useCallback, useRef } from 'react';
|
import React, { useCallback, useRef, useState } from 'react';
|
||||||
import PropTypes from 'prop-types';
|
import PropTypes from 'prop-types';
|
||||||
import classNames from 'classnames';
|
import classNames from 'classnames';
|
||||||
import { useTranslation } from 'react-i18next';
|
import { useTranslation } from 'react-i18next';
|
||||||
@@ -81,6 +81,7 @@ const CardModal = React.memo(
|
|||||||
onClose,
|
onClose,
|
||||||
}) => {
|
}) => {
|
||||||
const [t] = useTranslation();
|
const [t] = useTranslation();
|
||||||
|
const [isLinkCopied, setIsLinkCopied] = useState(false);
|
||||||
|
|
||||||
const isGalleryOpened = useRef(false);
|
const isGalleryOpened = useRef(false);
|
||||||
|
|
||||||
@@ -146,6 +147,14 @@ const CardModal = React.memo(
|
|||||||
onClose();
|
onClose();
|
||||||
}, [onDuplicate, onClose]);
|
}, [onDuplicate, onClose]);
|
||||||
|
|
||||||
|
const handleCopyLinkClick = useCallback(() => {
|
||||||
|
navigator.clipboard.writeText(window.location.href);
|
||||||
|
setIsLinkCopied(true);
|
||||||
|
setTimeout(() => {
|
||||||
|
setIsLinkCopied(false);
|
||||||
|
}, 5000);
|
||||||
|
}, []);
|
||||||
|
|
||||||
const handleGalleryOpen = useCallback(() => {
|
const handleGalleryOpen = useCallback(() => {
|
||||||
isGalleryOpened.current = true;
|
isGalleryOpened.current = true;
|
||||||
}, []);
|
}, []);
|
||||||
@@ -506,6 +515,14 @@ const CardModal = React.memo(
|
|||||||
<Icon name="copy outline" className={styles.actionIcon} />
|
<Icon name="copy outline" className={styles.actionIcon} />
|
||||||
{t('action.duplicate')}
|
{t('action.duplicate')}
|
||||||
</Button>
|
</Button>
|
||||||
|
<Button fluid className={styles.actionButton} onClick={handleCopyLinkClick}>
|
||||||
|
<Icon name={isLinkCopied ? 'linkify' : 'unlink'} className={styles.actionIcon} />
|
||||||
|
{isLinkCopied
|
||||||
|
? t('common.linkIsCopied')
|
||||||
|
: t('action.copyLink', {
|
||||||
|
context: 'title',
|
||||||
|
})}
|
||||||
|
</Button>
|
||||||
<DeletePopup
|
<DeletePopup
|
||||||
title="common.deleteCard"
|
title="common.deleteCard"
|
||||||
content="common.areYouSureYouWantToDeleteThisCard"
|
content="common.areYouSureYouWantToDeleteThisCard"
|
||||||
|
|||||||
@@ -20,7 +20,6 @@
|
|||||||
|
|
||||||
.actionIcon {
|
.actionIcon {
|
||||||
color: #17394d;
|
color: #17394d;
|
||||||
display: inline;
|
|
||||||
margin-right: 8px;
|
margin-right: 8px;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -6,12 +6,13 @@ import entryActions from '../entry-actions';
|
|||||||
import Projects from '../components/Projects';
|
import Projects from '../components/Projects';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
const { allowAllToCreateProjects } = selectors.selectConfig(state);
|
||||||
const { isAdmin } = selectors.selectCurrentUser(state);
|
const { isAdmin } = selectors.selectCurrentUser(state);
|
||||||
const projects = selectors.selectProjectsForCurrentUser(state);
|
const projects = selectors.selectProjectsForCurrentUser(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: projects,
|
items: projects,
|
||||||
canAdd: isAdmin,
|
canAdd: allowAllToCreateProjects || isAdmin,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -104,6 +104,7 @@ export default {
|
|||||||
language: 'Sprache',
|
language: 'Sprache',
|
||||||
leaveBoard_title: 'Board verlassen',
|
leaveBoard_title: 'Board verlassen',
|
||||||
leaveProject_title: 'Projekt verlassen',
|
leaveProject_title: 'Projekt verlassen',
|
||||||
|
linkIsCopied: 'Link kopiert',
|
||||||
list: 'Listen',
|
list: 'Listen',
|
||||||
listActions_title: 'Aufgaben auflisten',
|
listActions_title: 'Aufgaben auflisten',
|
||||||
managers: 'Manager',
|
managers: 'Manager',
|
||||||
@@ -169,6 +170,7 @@ export default {
|
|||||||
addTask: 'Aufgabe hinzufügen',
|
addTask: 'Aufgabe hinzufügen',
|
||||||
addToCard: 'Zu Karte hinzufügen',
|
addToCard: 'Zu Karte hinzufügen',
|
||||||
addUser: 'Benutzer hinzufügen',
|
addUser: 'Benutzer hinzufügen',
|
||||||
|
copyLink_title: 'Link kopieren',
|
||||||
createBoard: 'Board erstellen',
|
createBoard: 'Board erstellen',
|
||||||
createFile: 'Datei erstellen',
|
createFile: 'Datei erstellen',
|
||||||
createLabel: 'Label erstellen',
|
createLabel: 'Label erstellen',
|
||||||
|
|||||||
@@ -106,6 +106,7 @@ export default {
|
|||||||
language: 'Language',
|
language: 'Language',
|
||||||
leaveBoard_title: 'Leave Board',
|
leaveBoard_title: 'Leave Board',
|
||||||
leaveProject_title: 'Leave Project',
|
leaveProject_title: 'Leave Project',
|
||||||
|
linkIsCopied: 'Link is copied',
|
||||||
list: 'List',
|
list: 'List',
|
||||||
listActions_title: 'List Actions',
|
listActions_title: 'List Actions',
|
||||||
managers: 'Managers',
|
managers: 'Managers',
|
||||||
@@ -183,6 +184,7 @@ export default {
|
|||||||
addTask: 'Add task',
|
addTask: 'Add task',
|
||||||
addToCard: 'Add to card',
|
addToCard: 'Add to card',
|
||||||
addUser: 'Add user',
|
addUser: 'Add user',
|
||||||
|
copyLink_title: 'Copy Link',
|
||||||
createBoard: 'Create board',
|
createBoard: 'Create board',
|
||||||
createFile: 'Create file',
|
createFile: 'Create file',
|
||||||
createLabel: 'Create label',
|
createLabel: 'Create label',
|
||||||
|
|||||||
@@ -1,7 +1,6 @@
|
|||||||
version: '3.8'
|
version: '3.8'
|
||||||
|
|
||||||
services:
|
services:
|
||||||
|
|
||||||
server:
|
server:
|
||||||
build:
|
build:
|
||||||
context: ./server
|
context: ./server
|
||||||
@@ -13,6 +12,7 @@ services:
|
|||||||
- NODE_ENV=development
|
- NODE_ENV=development
|
||||||
- DATABASE_URL=postgresql://user:password@postgres:5432/planka_db
|
- DATABASE_URL=postgresql://user:password@postgres:5432/planka_db
|
||||||
- SECRET_KEY=notsecretkey
|
- SECRET_KEY=notsecretkey
|
||||||
|
|
||||||
# - TRUST_PROXY=0
|
# - TRUST_PROXY=0
|
||||||
# - TOKEN_EXPIRES_IN=365 # In days
|
# - TOKEN_EXPIRES_IN=365 # In days
|
||||||
|
|
||||||
@@ -23,6 +23,9 @@ services:
|
|||||||
|
|
||||||
# Configure knex to accept SSL certificates
|
# Configure knex to accept SSL certificates
|
||||||
# - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
|
# - KNEX_REJECT_UNAUTHORIZED_SSL_CERTIFICATE=false
|
||||||
|
|
||||||
|
# - ALLOW_ALL_TO_CREATE_PROJECTS=true
|
||||||
|
|
||||||
# - OIDC_ISSUER=
|
# - OIDC_ISSUER=
|
||||||
# - OIDC_CLIENT_ID=
|
# - OIDC_CLIENT_ID=
|
||||||
# - OIDC_CLIENT_SECRET=
|
# - OIDC_CLIENT_SECRET=
|
||||||
@@ -56,7 +59,6 @@ services:
|
|||||||
|
|
||||||
# - SLACK_BOT_TOKEN=
|
# - SLACK_BOT_TOKEN=
|
||||||
# - SLACK_CHANNEL_ID=
|
# - SLACK_CHANNEL_ID=
|
||||||
|
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
command: ["sh", "-c", "npm run start"]
|
command: ["sh", "-c", "npm run start"]
|
||||||
depends_on:
|
depends_on:
|
||||||
@@ -85,11 +87,11 @@ services:
|
|||||||
dockerfile: ../config/development/Dockerfile.server
|
dockerfile: ../config/development/Dockerfile.server
|
||||||
environment:
|
environment:
|
||||||
- DATABASE_URL=postgresql://user:password@postgres:5432/planka_db
|
- DATABASE_URL=postgresql://user:password@postgres:5432/planka_db
|
||||||
|
|
||||||
# - DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted
|
# - DEFAULT_ADMIN_EMAIL=demo@demo.demo # Do not remove if you want to prevent this user from being edited/deleted
|
||||||
# - DEFAULT_ADMIN_PASSWORD=demo
|
# - DEFAULT_ADMIN_PASSWORD=demo
|
||||||
# - DEFAULT_ADMIN_NAME=Demo Demo
|
# - DEFAULT_ADMIN_NAME=Demo Demo
|
||||||
# - DEFAULT_ADMIN_USERNAME=demo
|
# - DEFAULT_ADMIN_USERNAME=demo
|
||||||
|
|
||||||
working_dir: /app
|
working_dir: /app
|
||||||
command: ["sh", "-c", "npm run db:init"]
|
command: ["sh", "-c", "npm run db:init"]
|
||||||
volumes:
|
volumes:
|
||||||
@@ -126,6 +128,5 @@ services:
|
|||||||
- server
|
- server
|
||||||
- client
|
- client
|
||||||
|
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
db-data:
|
db-data:
|
||||||
|
|||||||
@@ -31,6 +31,8 @@ services:
|
|||||||
# - DEFAULT_ADMIN_NAME=Demo Demo
|
# - DEFAULT_ADMIN_NAME=Demo Demo
|
||||||
# - DEFAULT_ADMIN_USERNAME=demo
|
# - DEFAULT_ADMIN_USERNAME=demo
|
||||||
|
|
||||||
|
# - ALLOW_ALL_TO_CREATE_PROJECTS=true
|
||||||
|
|
||||||
# - OIDC_ISSUER=
|
# - OIDC_ISSUER=
|
||||||
# - OIDC_CLIENT_ID=
|
# - OIDC_CLIENT_ID=
|
||||||
# - OIDC_CLIENT_SECRET=
|
# - OIDC_CLIENT_SECRET=
|
||||||
|
|||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.18.0",
|
"version": "1.19.1",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.18.0",
|
"version": "1.19.1",
|
||||||
"hasInstallScript": true,
|
"hasInstallScript": true,
|
||||||
"license": "AGPL-3.0",
|
"license": "AGPL-3.0",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
|||||||
+1
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.18.0",
|
"version": "1.19.1",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://plankanban.github.io/planka",
|
"homepage": "https://plankanban.github.io/planka",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -22,6 +22,8 @@ SECRET_KEY=notsecretkey
|
|||||||
# DEFAULT_ADMIN_NAME=Demo Demo
|
# DEFAULT_ADMIN_NAME=Demo Demo
|
||||||
# DEFAULT_ADMIN_USERNAME=demo
|
# DEFAULT_ADMIN_USERNAME=demo
|
||||||
|
|
||||||
|
# ALLOW_ALL_TO_CREATE_PROJECTS=true
|
||||||
|
|
||||||
# OIDC_ISSUER=
|
# OIDC_ISSUER=
|
||||||
# OIDC_CLIENT_ID=
|
# OIDC_CLIENT_ID=
|
||||||
# OIDC_CLIENT_SECRET=
|
# OIDC_CLIENT_SECRET=
|
||||||
|
|||||||
@@ -1,3 +1,9 @@
|
|||||||
|
const Errors = {
|
||||||
|
NOT_ENOUGH_RIGHTS: {
|
||||||
|
notEnoughRights: 'Not enough rights',
|
||||||
|
},
|
||||||
|
};
|
||||||
|
|
||||||
module.exports = {
|
module.exports = {
|
||||||
inputs: {
|
inputs: {
|
||||||
name: {
|
name: {
|
||||||
@@ -6,9 +12,19 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
exits: {
|
||||||
|
notEnoughRights: {
|
||||||
|
responseType: 'forbidden',
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const { currentUser } = this.req;
|
const { currentUser } = this.req;
|
||||||
|
|
||||||
|
if (!currentUser.isAdmin && !sails.config.custom.allowAllToCreateProjects) {
|
||||||
|
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||||
|
}
|
||||||
|
|
||||||
const values = _.pick(inputs, ['name']);
|
const values = _.pick(inputs, ['name']);
|
||||||
|
|
||||||
const { project, projectManager } = await sails.helpers.projects.createOne.with({
|
const { project, projectManager } = await sails.helpers.projects.createOne.with({
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ module.exports = {
|
|||||||
return {
|
return {
|
||||||
item: {
|
item: {
|
||||||
oidc,
|
oidc,
|
||||||
|
allowAllToCreateProjects: sails.config.custom.allowAllToCreateProjects,
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
},
|
},
|
||||||
|
|||||||
@@ -1,3 +1,58 @@
|
|||||||
|
const EVENT_TYPES = {
|
||||||
|
ACTION_CREATE: 'actionCreate',
|
||||||
|
ACTION_DELETE: 'actionDelete',
|
||||||
|
ACTION_UPDATE: 'actionUpdate',
|
||||||
|
|
||||||
|
ATTACHMENT_CREATE: 'attachmentCreate',
|
||||||
|
ATTACHMENT_DELETE: 'attachmentDelete',
|
||||||
|
ATTACHMENT_UPDATE: 'attachmentUpdate',
|
||||||
|
|
||||||
|
BOARD_CREATE: 'boardCreate',
|
||||||
|
BOARD_DELETE: 'boardDelete',
|
||||||
|
BOARD_UPDATE: 'boardUpdate',
|
||||||
|
|
||||||
|
BOARD_MEMBERSHIP_CREATE: 'boardMembershipCreate',
|
||||||
|
BOARD_MEMBERSHIP_DELETE: 'boardMembershipDelete',
|
||||||
|
BOARD_MEMBERSHIP_UPDATE: 'boardMembershipUpdate',
|
||||||
|
|
||||||
|
CARD_CREATE: 'cardCreate',
|
||||||
|
CARD_DELETE: 'cardDelete',
|
||||||
|
CARD_UPDATE: 'cardUpdate',
|
||||||
|
|
||||||
|
CARD_LABEL_CREATE: 'cardLabelCreate',
|
||||||
|
CARD_LABEL_DELETE: 'cardLabelDelete',
|
||||||
|
|
||||||
|
CARD_MEMBERSHIP_CREATE: 'cardMembershipCreate',
|
||||||
|
CARD_MEMBERSHIP_DELETE: 'cardMembershipDelete',
|
||||||
|
|
||||||
|
LABEL_CREATE: 'labelCreate',
|
||||||
|
LABEL_DELETE: 'labelDelete',
|
||||||
|
LABEL_UPDATE: 'labelUpdate',
|
||||||
|
|
||||||
|
LIST_CREATE: 'listCreate',
|
||||||
|
LIST_DELETE: 'listDelete',
|
||||||
|
LIST_SORT: 'listSort',
|
||||||
|
LIST_UPDATE: 'listUpdate',
|
||||||
|
|
||||||
|
NOTIFICATION_CREATE: 'notificationCreate',
|
||||||
|
NOTIFICATION_UPDATE: 'notificationUpdate',
|
||||||
|
|
||||||
|
PROJECT_CREATE: 'projectCreate',
|
||||||
|
PROJECT_DELETE: 'projectDelete',
|
||||||
|
PROJECT_UPDATE: 'projectUpdate',
|
||||||
|
|
||||||
|
PROJECT_MANAGER_CREATE: 'projectManagerCreate',
|
||||||
|
PROJECT_MANAGER_DELETE: 'projectManagerDelete',
|
||||||
|
|
||||||
|
TASK_CREATE: 'taskCreate',
|
||||||
|
TASK_DELETE: 'taskDelete',
|
||||||
|
TASK_UPDATE: 'taskUpdate',
|
||||||
|
|
||||||
|
USER_CREATE: 'userCreate',
|
||||||
|
USER_DELETE: 'userDelete',
|
||||||
|
USER_UPDATE: 'userUpdate',
|
||||||
|
};
|
||||||
|
|
||||||
const jsonifyData = (data) => {
|
const jsonifyData = (data) => {
|
||||||
const nextData = {};
|
const nextData = {};
|
||||||
|
|
||||||
@@ -22,18 +77,33 @@ const jsonifyData = (data) => {
|
|||||||
return nextData;
|
return nextData;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} Included
|
||||||
|
* @property {any[]} [projects] - Array of projects (optional).
|
||||||
|
* @property {any[]} [boards] - Array of boards (optional).
|
||||||
|
* @property {any[]} [lists] - Array of lists (optional).
|
||||||
|
* @property {any[]} [cards] - Array of cards (optional).
|
||||||
|
*/
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @typedef {Object} Data
|
||||||
|
* @property {any} item - Actual event data.
|
||||||
|
* @property {Included} [included] - Optional included data.
|
||||||
|
*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Sends a webhook notification to a configured URL.
|
* Sends a webhook notification to a configured URL.
|
||||||
*
|
*
|
||||||
* @param {*} webhook - Webhook configuration.
|
* @param {*} webhook - Webhook configuration.
|
||||||
* @param {string} event - The event (see {@link Events}).
|
* @param {string} event - The event (see {@link EVENT_TYPES}).
|
||||||
* @param {*} data - The actual data related to the event.
|
* @param {Data} data - The data object containing event data and optionally included data.
|
||||||
* @param {ref} user - User object associated with the event.
|
* @param {ref} user - User object associated with the event.
|
||||||
* @returns {Promise<void>}
|
* @returns {Promise<void>}
|
||||||
*/
|
*/
|
||||||
async function sendWebhook(webhook, event, data, user) {
|
async function sendWebhook(webhook, event, data, user) {
|
||||||
const headers = {
|
const headers = {
|
||||||
'Content-Type': 'application/json',
|
'Content-Type': 'application/json',
|
||||||
|
'User-Agent': `planka (+${sails.config.custom.baseUrl})`,
|
||||||
};
|
};
|
||||||
|
|
||||||
if (webhook.accessToken) {
|
if (webhook.accessToken) {
|
||||||
@@ -68,6 +138,7 @@ module.exports = {
|
|||||||
event: {
|
event: {
|
||||||
type: 'string',
|
type: 'string',
|
||||||
required: true,
|
required: true,
|
||||||
|
isIn: Object.values(EVENT_TYPES),
|
||||||
},
|
},
|
||||||
data: {
|
data: {
|
||||||
type: 'ref',
|
type: 'ref',
|
||||||
|
|||||||
@@ -34,6 +34,8 @@ module.exports.custom = {
|
|||||||
defaultAdminEmail:
|
defaultAdminEmail:
|
||||||
process.env.DEFAULT_ADMIN_EMAIL && process.env.DEFAULT_ADMIN_EMAIL.toLowerCase(),
|
process.env.DEFAULT_ADMIN_EMAIL && process.env.DEFAULT_ADMIN_EMAIL.toLowerCase(),
|
||||||
|
|
||||||
|
allowAllToCreateProjects: process.env.ALLOW_ALL_TO_CREATE_PROJECTS === 'true',
|
||||||
|
|
||||||
oidcIssuer: process.env.OIDC_ISSUER,
|
oidcIssuer: process.env.OIDC_ISSUER,
|
||||||
oidcClientId: process.env.OIDC_CLIENT_ID,
|
oidcClientId: process.env.OIDC_CLIENT_ID,
|
||||||
oidcClientSecret: process.env.OIDC_CLIENT_SECRET,
|
oidcClientSecret: process.env.OIDC_CLIENT_SECRET,
|
||||||
@@ -60,7 +62,7 @@ module.exports.custom = {
|
|||||||
smtpPassword: process.env.SMTP_PASSWORD,
|
smtpPassword: process.env.SMTP_PASSWORD,
|
||||||
smtpFrom: process.env.SMTP_FROM,
|
smtpFrom: process.env.SMTP_FROM,
|
||||||
|
|
||||||
webhooks: JSON.parse(process.env.WEBHOOKS), // TODO: validate structure
|
webhooks: JSON.parse(process.env.WEBHOOKS || '[]'), // TODO: validate structure
|
||||||
|
|
||||||
slackBotToken: process.env.SLACK_BOT_TOKEN,
|
slackBotToken: process.env.SLACK_BOT_TOKEN,
|
||||||
slackChannelId: process.env.SLACK_CHANNEL_ID,
|
slackChannelId: process.env.SLACK_CHANNEL_ID,
|
||||||
|
|||||||
@@ -21,8 +21,6 @@ module.exports.policies = {
|
|||||||
'users/create': ['is-authenticated', 'is-admin'],
|
'users/create': ['is-authenticated', 'is-admin'],
|
||||||
'users/delete': ['is-authenticated', 'is-admin'],
|
'users/delete': ['is-authenticated', 'is-admin'],
|
||||||
|
|
||||||
'projects/create': ['is-authenticated', 'is-admin'],
|
|
||||||
|
|
||||||
'show-config': true,
|
'show-config': true,
|
||||||
'access-tokens/create': true,
|
'access-tokens/create': true,
|
||||||
'access-tokens/exchange-using-oidc': true,
|
'access-tokens/exchange-using-oidc': true,
|
||||||
|
|||||||
Reference in New Issue
Block a user