Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
73a641b935 | ||
|
|
6802a0dc69 | ||
|
|
81d6c43cd9 | ||
|
|
ca6a1a14f5 | ||
|
|
c096444acb | ||
|
|
51d05f3cd3 | ||
|
|
221da3c455 | ||
|
|
92098e136c | ||
|
|
fd5c33dd5d | ||
|
|
0c1c7e2192 | ||
|
|
b8d262f745 |
+8
-3
@@ -6,7 +6,7 @@ RUN apk -U upgrade \
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY server/package.json server/package-lock.json .
|
COPY server/package.json server/package-lock.json ./
|
||||||
|
|
||||||
RUN npm install npm@latest --global \
|
RUN npm install npm@latest --global \
|
||||||
&& npm install pnpm --global \
|
&& npm install pnpm --global \
|
||||||
@@ -17,7 +17,7 @@ FROM node:lts AS client
|
|||||||
|
|
||||||
WORKDIR /app
|
WORKDIR /app
|
||||||
|
|
||||||
COPY client/package.json client/package-lock.json .
|
COPY client/package.json client/package-lock.json ./
|
||||||
|
|
||||||
RUN npm install npm@latest --global \
|
RUN npm install npm@latest --global \
|
||||||
&& npm install pnpm --global \
|
&& npm install pnpm --global \
|
||||||
@@ -38,6 +38,7 @@ WORKDIR /app
|
|||||||
|
|
||||||
COPY --chown=node:node start.sh .
|
COPY --chown=node:node start.sh .
|
||||||
COPY --chown=node:node server .
|
COPY --chown=node:node server .
|
||||||
|
COPY --chown=node:node healthcheck.js .
|
||||||
|
|
||||||
RUN mv .env.sample .env
|
RUN mv .env.sample .env
|
||||||
|
|
||||||
@@ -52,4 +53,8 @@ VOLUME /app/private/attachments
|
|||||||
|
|
||||||
EXPOSE 1337
|
EXPOSE 1337
|
||||||
|
|
||||||
CMD ["./start.sh"]
|
HEALTHCHECK --interval=10s --timeout=2s --start-period=15s \
|
||||||
|
CMD node ./healthcheck.js
|
||||||
|
|
||||||
|
|
||||||
|
CMD [ "bash", "start.sh" ]
|
||||||
|
|||||||
@@ -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.16
|
version: 0.1.18
|
||||||
|
|
||||||
# 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.15.5"
|
appVersion: "1.15.7"
|
||||||
|
|
||||||
dependencies:
|
dependencies:
|
||||||
- alias: postgresql
|
- alias: postgresql
|
||||||
|
|||||||
+1
-1
@@ -1 +1 @@
|
|||||||
REACT_APP_VERSION=1.15.5
|
REACT_APP_VERSION=1.15.7
|
||||||
|
|||||||
@@ -94,7 +94,7 @@ const AttachmentAddZone = React.memo(({ children, onCreate }) => {
|
|||||||
return (
|
return (
|
||||||
<>
|
<>
|
||||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||||
<div {...getRootProps()} className={styles.wrapper}>
|
<div {...getRootProps()}>
|
||||||
{isDragActive && <div className={styles.dropzone}>{t('common.dropFileToUpload')}</div>}
|
{isDragActive && <div className={styles.dropzone}>{t('common.dropFileToUpload')}</div>}
|
||||||
{children}
|
{children}
|
||||||
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
{/* eslint-disable-next-line react/jsx-props-no-spreading */}
|
||||||
|
|||||||
@@ -12,8 +12,4 @@
|
|||||||
width: 100%;
|
width: 100%;
|
||||||
z-index: 2001;
|
z-index: 2001;
|
||||||
}
|
}
|
||||||
|
|
||||||
.wrapper {
|
|
||||||
overflow: hidden;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -68,6 +68,7 @@ const Login = React.memo(
|
|||||||
isSubmittingUsingOidc,
|
isSubmittingUsingOidc,
|
||||||
error,
|
error,
|
||||||
withOidc,
|
withOidc,
|
||||||
|
isOidcEnforced,
|
||||||
onAuthenticate,
|
onAuthenticate,
|
||||||
onAuthenticateUsingOidc,
|
onAuthenticateUsingOidc,
|
||||||
onMessageDismiss,
|
onMessageDismiss,
|
||||||
@@ -107,8 +108,10 @@ const Login = React.memo(
|
|||||||
}, [onAuthenticate, data]);
|
}, [onAuthenticate, data]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
emailOrUsernameField.current.focus();
|
if (!isOidcEnforced) {
|
||||||
}, []);
|
emailOrUsernameField.current.focus();
|
||||||
|
}
|
||||||
|
}, [isOidcEnforced]);
|
||||||
|
|
||||||
useEffect(() => {
|
useEffect(() => {
|
||||||
if (wasSubmitting && !isSubmitting && error) {
|
if (wasSubmitting && !isSubmitting && error) {
|
||||||
@@ -159,51 +162,57 @@ const Login = React.memo(
|
|||||||
onDismiss={onMessageDismiss}
|
onDismiss={onMessageDismiss}
|
||||||
/>
|
/>
|
||||||
)}
|
)}
|
||||||
<Form size="large" onSubmit={handleSubmit}>
|
{!isOidcEnforced && (
|
||||||
<div className={styles.inputWrapper}>
|
<Form size="large" onSubmit={handleSubmit}>
|
||||||
<div className={styles.inputLabel}>{t('common.emailOrUsername')}</div>
|
<div className={styles.inputWrapper}>
|
||||||
<Input
|
<div className={styles.inputLabel}>{t('common.emailOrUsername')}</div>
|
||||||
fluid
|
<Input
|
||||||
ref={emailOrUsernameField}
|
fluid
|
||||||
name="emailOrUsername"
|
ref={emailOrUsernameField}
|
||||||
value={data.emailOrUsername}
|
name="emailOrUsername"
|
||||||
readOnly={isSubmitting}
|
value={data.emailOrUsername}
|
||||||
className={styles.input}
|
readOnly={isSubmitting}
|
||||||
onChange={handleFieldChange}
|
className={styles.input}
|
||||||
|
onChange={handleFieldChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div className={styles.inputWrapper}>
|
||||||
|
<div className={styles.inputLabel}>{t('common.password')}</div>
|
||||||
|
<Input.Password
|
||||||
|
fluid
|
||||||
|
ref={passwordField}
|
||||||
|
name="password"
|
||||||
|
value={data.password}
|
||||||
|
readOnly={isSubmitting}
|
||||||
|
className={styles.input}
|
||||||
|
onChange={handleFieldChange}
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<Form.Button
|
||||||
|
primary
|
||||||
|
size="large"
|
||||||
|
icon="right arrow"
|
||||||
|
labelPosition="right"
|
||||||
|
content={t('action.logIn')}
|
||||||
|
floated="right"
|
||||||
|
loading={isSubmitting}
|
||||||
|
disabled={isSubmitting || isSubmittingUsingOidc}
|
||||||
/>
|
/>
|
||||||
</div>
|
</Form>
|
||||||
<div className={styles.inputWrapper}>
|
)}
|
||||||
<div className={styles.inputLabel}>{t('common.password')}</div>
|
|
||||||
<Input.Password
|
|
||||||
fluid
|
|
||||||
ref={passwordField}
|
|
||||||
name="password"
|
|
||||||
value={data.password}
|
|
||||||
readOnly={isSubmitting}
|
|
||||||
className={styles.input}
|
|
||||||
onChange={handleFieldChange}
|
|
||||||
/>
|
|
||||||
</div>
|
|
||||||
<Form.Button
|
|
||||||
primary
|
|
||||||
size="large"
|
|
||||||
icon="right arrow"
|
|
||||||
labelPosition="right"
|
|
||||||
content={t('action.logIn')}
|
|
||||||
floated="right"
|
|
||||||
loading={isSubmitting}
|
|
||||||
disabled={isSubmitting || isSubmittingUsingOidc}
|
|
||||||
/>
|
|
||||||
</Form>
|
|
||||||
{withOidc && (
|
{withOidc && (
|
||||||
<Button
|
<Button
|
||||||
type="button"
|
type="button"
|
||||||
|
fluid={isOidcEnforced}
|
||||||
|
primary={isOidcEnforced}
|
||||||
|
size={isOidcEnforced ? 'large' : undefined}
|
||||||
|
icon={isOidcEnforced ? 'right arrow' : undefined}
|
||||||
|
labelPosition={isOidcEnforced ? 'right' : undefined}
|
||||||
|
content={t('action.logInWithSSO')}
|
||||||
loading={isSubmittingUsingOidc}
|
loading={isSubmittingUsingOidc}
|
||||||
disabled={isSubmitting || isSubmittingUsingOidc}
|
disabled={isSubmitting || isSubmittingUsingOidc}
|
||||||
onClick={onAuthenticateUsingOidc}
|
onClick={onAuthenticateUsingOidc}
|
||||||
>
|
/>
|
||||||
{t('action.logInWithSSO')}
|
|
||||||
</Button>
|
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
@@ -242,6 +251,7 @@ Login.propTypes = {
|
|||||||
isSubmittingUsingOidc: PropTypes.bool.isRequired,
|
isSubmittingUsingOidc: PropTypes.bool.isRequired,
|
||||||
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
error: PropTypes.object, // eslint-disable-line react/forbid-prop-types
|
||||||
withOidc: PropTypes.bool.isRequired,
|
withOidc: PropTypes.bool.isRequired,
|
||||||
|
isOidcEnforced: PropTypes.bool.isRequired,
|
||||||
onAuthenticate: PropTypes.func.isRequired,
|
onAuthenticate: PropTypes.func.isRequired,
|
||||||
onAuthenticateUsingOidc: PropTypes.func.isRequired,
|
onAuthenticateUsingOidc: PropTypes.func.isRequired,
|
||||||
onMessageDismiss: PropTypes.func.isRequired,
|
onMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ import Item from './Item';
|
|||||||
const UsersModal = React.memo(
|
const UsersModal = React.memo(
|
||||||
({
|
({
|
||||||
items,
|
items,
|
||||||
|
canAdd,
|
||||||
onUpdate,
|
onUpdate,
|
||||||
onUsernameUpdate,
|
onUsernameUpdate,
|
||||||
onUsernameUpdateMessageDismiss,
|
onUsernameUpdateMessageDismiss,
|
||||||
@@ -130,11 +131,13 @@ const UsersModal = React.memo(
|
|||||||
</Table.Body>
|
</Table.Body>
|
||||||
</Table>
|
</Table>
|
||||||
</Modal.Content>
|
</Modal.Content>
|
||||||
<Modal.Actions>
|
{canAdd && (
|
||||||
<UserAddPopupContainer>
|
<Modal.Actions>
|
||||||
<Button positive content={t('action.addUser')} />
|
<UserAddPopupContainer>
|
||||||
</UserAddPopupContainer>
|
<Button positive content={t('action.addUser')} />
|
||||||
</Modal.Actions>
|
</UserAddPopupContainer>
|
||||||
|
</Modal.Actions>
|
||||||
|
)}
|
||||||
</Modal>
|
</Modal>
|
||||||
);
|
);
|
||||||
},
|
},
|
||||||
@@ -142,6 +145,7 @@ const UsersModal = React.memo(
|
|||||||
|
|
||||||
UsersModal.propTypes = {
|
UsersModal.propTypes = {
|
||||||
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
items: PropTypes.array.isRequired, // eslint-disable-line react/forbid-prop-types
|
||||||
|
canAdd: PropTypes.bool.isRequired,
|
||||||
onUpdate: PropTypes.func.isRequired,
|
onUpdate: PropTypes.func.isRequired,
|
||||||
onUsernameUpdate: PropTypes.func.isRequired,
|
onUsernameUpdate: PropTypes.func.isRequired,
|
||||||
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
onUsernameUpdateMessageDismiss: PropTypes.func.isRequired,
|
||||||
|
|||||||
@@ -20,6 +20,7 @@ const mapStateToProps = (state) => {
|
|||||||
isSubmittingUsingOidc,
|
isSubmittingUsingOidc,
|
||||||
error,
|
error,
|
||||||
withOidc: !!oidcConfig,
|
withOidc: !!oidcConfig,
|
||||||
|
isOidcEnforced: oidcConfig && oidcConfig.isEnforced,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,12 @@ import entryActions from '../entry-actions';
|
|||||||
import UsersModal from '../components/UsersModal';
|
import UsersModal from '../components/UsersModal';
|
||||||
|
|
||||||
const mapStateToProps = (state) => {
|
const mapStateToProps = (state) => {
|
||||||
|
const oidcConfig = selectors.selectOidcConfig(state);
|
||||||
const users = selectors.selectUsersExceptCurrent(state);
|
const users = selectors.selectUsersExceptCurrent(state);
|
||||||
|
|
||||||
return {
|
return {
|
||||||
items: users,
|
items: users,
|
||||||
|
canAdd: !oidcConfig || !oidcConfig.isEnforced,
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|||||||
+14
-11
@@ -3,15 +3,7 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
planka:
|
planka:
|
||||||
image: ghcr.io/plankanban/planka:master
|
image: ghcr.io/plankanban/planka:master
|
||||||
command: >
|
restart: on-failure
|
||||||
bash -c
|
|
||||||
"for i in `seq 1 30`; do
|
|
||||||
./start.sh &&
|
|
||||||
s=$$? && break || s=$$?;
|
|
||||||
echo \"Tried $$i times. Waiting 5 seconds...\";
|
|
||||||
sleep 5;
|
|
||||||
done; (exit $$s)"
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
volumes:
|
||||||
- user-avatars:/app/public/user-avatars
|
- user-avatars:/app/public/user-avatars
|
||||||
- project-background-images:/app/public/project-background-images
|
- project-background-images:/app/public/project-background-images
|
||||||
@@ -44,19 +36,30 @@ services:
|
|||||||
# - OIDC_CLIENT_SECRET=
|
# - OIDC_CLIENT_SECRET=
|
||||||
# - OIDC_SCOPES=openid email profile
|
# - OIDC_SCOPES=openid email profile
|
||||||
# - OIDC_ADMIN_ROLES=admin
|
# - OIDC_ADMIN_ROLES=admin
|
||||||
|
# - OIDC_EMAIL_ATTRIBUTE=email
|
||||||
|
# - OIDC_NAME_ATTRIBUTE=name
|
||||||
|
# - OIDC_USERNAME_ATTRIBUTE=preferred_username
|
||||||
# - OIDC_ROLES_ATTRIBUTE=groups
|
# - OIDC_ROLES_ATTRIBUTE=groups
|
||||||
|
# - OIDC_IGNORE_USERNAME=true
|
||||||
# - OIDC_IGNORE_ROLES=true
|
# - OIDC_IGNORE_ROLES=true
|
||||||
|
# - OIDC_ENFORCED=true
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:14-alpine
|
image: postgres:14-alpine
|
||||||
restart: unless-stopped
|
restart: on-failure
|
||||||
volumes:
|
volumes:
|
||||||
- db-data:/var/lib/postgresql/data
|
- db-data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_DB=planka
|
- POSTGRES_DB=planka
|
||||||
- POSTGRES_HOST_AUTH_METHOD=trust
|
- POSTGRES_HOST_AUTH_METHOD=trust
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
user-avatars:
|
user-avatars:
|
||||||
|
|||||||
+10
-11
@@ -3,15 +3,7 @@ version: '3'
|
|||||||
services:
|
services:
|
||||||
planka:
|
planka:
|
||||||
image: ghcr.io/plankanban/planka:latest
|
image: ghcr.io/plankanban/planka:latest
|
||||||
command: >
|
restart: on-failure
|
||||||
bash -c
|
|
||||||
"for i in `seq 1 30`; do
|
|
||||||
./start.sh &&
|
|
||||||
s=$$? && break || s=$$?;
|
|
||||||
echo \"Tried $$i times. Waiting 5 seconds...\";
|
|
||||||
sleep 5;
|
|
||||||
done; (exit $$s)"
|
|
||||||
restart: unless-stopped
|
|
||||||
volumes:
|
volumes:
|
||||||
- user-avatars:/app/public/user-avatars
|
- user-avatars:/app/public/user-avatars
|
||||||
- project-background-images:/app/public/project-background-images
|
- project-background-images:/app/public/project-background-images
|
||||||
@@ -50,17 +42,24 @@ services:
|
|||||||
# - OIDC_ROLES_ATTRIBUTE=groups
|
# - OIDC_ROLES_ATTRIBUTE=groups
|
||||||
# - OIDC_IGNORE_USERNAME=true
|
# - OIDC_IGNORE_USERNAME=true
|
||||||
# - OIDC_IGNORE_ROLES=true
|
# - OIDC_IGNORE_ROLES=true
|
||||||
|
# - OIDC_ENFORCED=true
|
||||||
depends_on:
|
depends_on:
|
||||||
- postgres
|
postgres:
|
||||||
|
condition: service_healthy
|
||||||
|
|
||||||
postgres:
|
postgres:
|
||||||
image: postgres:14-alpine
|
image: postgres:14-alpine
|
||||||
restart: unless-stopped
|
restart: on-failure
|
||||||
volumes:
|
volumes:
|
||||||
- db-data:/var/lib/postgresql/data
|
- db-data:/var/lib/postgresql/data
|
||||||
environment:
|
environment:
|
||||||
- POSTGRES_DB=planka
|
- POSTGRES_DB=planka
|
||||||
- POSTGRES_HOST_AUTH_METHOD=trust
|
- POSTGRES_HOST_AUTH_METHOD=trust
|
||||||
|
healthcheck:
|
||||||
|
test: ["CMD-SHELL", "pg_isready -U postgres -d planka"]
|
||||||
|
interval: 10s
|
||||||
|
timeout: 5s
|
||||||
|
retries: 5
|
||||||
|
|
||||||
volumes:
|
volumes:
|
||||||
user-avatars:
|
user-avatars:
|
||||||
|
|||||||
@@ -0,0 +1,23 @@
|
|||||||
|
const http = require('http');
|
||||||
|
const options = {
|
||||||
|
host: 'localhost',
|
||||||
|
port: 1337,
|
||||||
|
timeout: 2000
|
||||||
|
};
|
||||||
|
|
||||||
|
const healthCheck = http.request(options, (res) => {
|
||||||
|
console.log(`HEALTHCHECK STATUS: ${res.statusCode}`);
|
||||||
|
if (res.statusCode == 200) {
|
||||||
|
process.exit(0);
|
||||||
|
}
|
||||||
|
else {
|
||||||
|
process.exit(1);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
|
healthCheck.on('error', function (err) {
|
||||||
|
console.error('ERROR');
|
||||||
|
process.exit(1);
|
||||||
|
});
|
||||||
|
|
||||||
|
healthCheck.end();
|
||||||
Generated
+2
-2
@@ -1,12 +1,12 @@
|
|||||||
{
|
{
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.15.5",
|
"version": "1.15.7",
|
||||||
"lockfileVersion": 2,
|
"lockfileVersion": 2,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "planka",
|
"name": "planka",
|
||||||
"version": "1.15.5",
|
"version": "1.15.7",
|
||||||
"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.15.5",
|
"version": "1.15.7",
|
||||||
"private": true,
|
"private": true,
|
||||||
"homepage": "https://plankanban.github.io/planka",
|
"homepage": "https://plankanban.github.io/planka",
|
||||||
"repository": {
|
"repository": {
|
||||||
|
|||||||
@@ -33,6 +33,7 @@ SECRET_KEY=notsecretkey
|
|||||||
# OIDC_ROLES_ATTRIBUTE=groups
|
# OIDC_ROLES_ATTRIBUTE=groups
|
||||||
# OIDC_IGNORE_USERNAME=true
|
# OIDC_IGNORE_USERNAME=true
|
||||||
# OIDC_IGNORE_ROLES=true
|
# OIDC_IGNORE_ROLES=true
|
||||||
|
# OIDC_ENFORCED=true
|
||||||
|
|
||||||
## Do not edit this
|
## Do not edit this
|
||||||
|
|
||||||
|
|||||||
@@ -46,8 +46,11 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
const remoteAddress = getRemoteAddress(this.req);
|
if (sails.config.custom.oidcEnforced) {
|
||||||
|
throw Errors.USE_SINGLE_SIGN_ON;
|
||||||
|
}
|
||||||
|
|
||||||
|
const remoteAddress = getRemoteAddress(this.req);
|
||||||
const user = await sails.helpers.users.getOneByEmailOrUsername(inputs.emailOrUsername);
|
const user = await sails.helpers.users.getOneByEmailOrUsername(inputs.emailOrUsername);
|
||||||
|
|
||||||
if (!user) {
|
if (!user) {
|
||||||
|
|||||||
@@ -29,6 +29,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
canComment: {
|
canComment: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
allowNull: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -17,6 +17,7 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
canComment: {
|
canComment: {
|
||||||
type: 'boolean',
|
type: 'boolean',
|
||||||
|
allowNull: true,
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
|
|||||||
@@ -10,6 +10,7 @@ module.exports = {
|
|||||||
response_mode: 'fragment',
|
response_mode: 'fragment',
|
||||||
}),
|
}),
|
||||||
endSessionUrl: oidcClient.issuer.end_session_endpoint ? oidcClient.endSessionUrl({}) : null,
|
endSessionUrl: oidcClient.issuer.end_session_endpoint ? oidcClient.endSessionUrl({}) : null,
|
||||||
|
isEnforced: sails.config.custom.oidcEnforced,
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,6 +1,9 @@
|
|||||||
const zxcvbn = require('zxcvbn');
|
const zxcvbn = require('zxcvbn');
|
||||||
|
|
||||||
const Errors = {
|
const Errors = {
|
||||||
|
NOT_ENOUGH_RIGHTS: {
|
||||||
|
notEnoughRights: 'Not enough rights',
|
||||||
|
},
|
||||||
EMAIL_ALREADY_IN_USE: {
|
EMAIL_ALREADY_IN_USE: {
|
||||||
emailAlreadyInUse: 'Email already in use',
|
emailAlreadyInUse: 'Email already in use',
|
||||||
},
|
},
|
||||||
@@ -56,6 +59,9 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
exits: {
|
exits: {
|
||||||
|
notEnoughRights: {
|
||||||
|
responseType: 'forbidden',
|
||||||
|
},
|
||||||
emailAlreadyInUse: {
|
emailAlreadyInUse: {
|
||||||
responseType: 'conflict',
|
responseType: 'conflict',
|
||||||
},
|
},
|
||||||
@@ -65,6 +71,10 @@ module.exports = {
|
|||||||
},
|
},
|
||||||
|
|
||||||
async fn(inputs) {
|
async fn(inputs) {
|
||||||
|
if (sails.config.custom.oidcEnforced) {
|
||||||
|
throw Errors.NOT_ENOUGH_RIGHTS;
|
||||||
|
}
|
||||||
|
|
||||||
const values = _.pick(inputs, [
|
const values = _.pick(inputs, [
|
||||||
'email',
|
'email',
|
||||||
'password',
|
'password',
|
||||||
|
|||||||
@@ -107,6 +107,7 @@ module.exports = {
|
|||||||
position: trelloCard.pos,
|
position: trelloCard.pos,
|
||||||
name: trelloCard.name,
|
name: trelloCard.name,
|
||||||
description: trelloCard.desc || null,
|
description: trelloCard.desc || null,
|
||||||
|
dueDate: trelloCard.due,
|
||||||
}).fetch();
|
}).fetch();
|
||||||
|
|
||||||
await importCardLabels(plankaCard, trelloCard);
|
await importCardLabels(plankaCard, trelloCard);
|
||||||
|
|||||||
@@ -31,7 +31,8 @@ module.exports.custom = {
|
|||||||
attachmentsPath: path.join(sails.config.appPath, 'private', 'attachments'),
|
attachmentsPath: path.join(sails.config.appPath, 'private', 'attachments'),
|
||||||
attachmentsUrl: `${process.env.BASE_URL}/attachments`,
|
attachmentsUrl: `${process.env.BASE_URL}/attachments`,
|
||||||
|
|
||||||
defaultAdminEmail: process.env.DEFAULT_ADMIN_EMAIL,
|
defaultAdminEmail:
|
||||||
|
process.env.DEFAULT_ADMIN_EMAIL && process.env.DEFAULT_ADMIN_EMAIL.toLowerCase(),
|
||||||
|
|
||||||
oidcIssuer: process.env.OIDC_ISSUER,
|
oidcIssuer: process.env.OIDC_ISSUER,
|
||||||
oidcClientId: process.env.OIDC_CLIENT_ID,
|
oidcClientId: process.env.OIDC_CLIENT_ID,
|
||||||
@@ -44,6 +45,7 @@ module.exports.custom = {
|
|||||||
oidcRolesAttribute: process.env.OIDC_ROLES_ATTRIBUTE || 'groups',
|
oidcRolesAttribute: process.env.OIDC_ROLES_ATTRIBUTE || 'groups',
|
||||||
oidcIgnoreUsername: process.env.OIDC_IGNORE_USERNAME === 'true',
|
oidcIgnoreUsername: process.env.OIDC_IGNORE_USERNAME === 'true',
|
||||||
oidcIgnoreRoles: process.env.OIDC_IGNORE_ROLES === 'true',
|
oidcIgnoreRoles: process.env.OIDC_IGNORE_ROLES === 'true',
|
||||||
|
oidcEnforced: process.env.OIDC_ENFORCED === 'true',
|
||||||
|
|
||||||
// TODO: move client base url to environment variable?
|
// TODO: move client base url to environment variable?
|
||||||
oidcRedirectUri: `${
|
oidcRedirectUri: `${
|
||||||
|
|||||||
@@ -13,7 +13,7 @@ const buildData = () => {
|
|||||||
data.name = process.env.DEFAULT_ADMIN_NAME;
|
data.name = process.env.DEFAULT_ADMIN_NAME;
|
||||||
}
|
}
|
||||||
if (process.env.DEFAULT_ADMIN_USERNAME) {
|
if (process.env.DEFAULT_ADMIN_USERNAME) {
|
||||||
data.username = process.env.DEFAULT_ADMIN_USERNAME;
|
data.username = process.env.DEFAULT_ADMIN_USERNAME.toLowerCase();
|
||||||
}
|
}
|
||||||
|
|
||||||
return data;
|
return data;
|
||||||
@@ -24,16 +24,17 @@ exports.seed = async (knex) => {
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
const email = process.env.DEFAULT_ADMIN_EMAIL.toLowerCase();
|
||||||
const data = buildData();
|
const data = buildData();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
await knex('user_account').insert({
|
await knex('user_account').insert({
|
||||||
...data,
|
...data,
|
||||||
email: process.env.DEFAULT_ADMIN_EMAIL,
|
email,
|
||||||
subscribeToOwnCards: false,
|
subscribeToOwnCards: false,
|
||||||
createdAt: new Date().toISOString(),
|
createdAt: new Date().toISOString(),
|
||||||
});
|
});
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
await knex('user_account').update(data).where('email', process.env.DEFAULT_ADMIN_EMAIL);
|
await knex('user_account').update(data).where('email', email);
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|||||||
Reference in New Issue
Block a user