From a536ad49eaaed50362a1ce88c547f7a382228241 Mon Sep 17 00:00:00 2001 From: Joe Longendyke Date: Mon, 6 Dec 2021 12:37:28 +0900 Subject: [PATCH 1/7] Remove fatal error from docker secrets This commit fixes #242 by catching the error thrown by getSecrets(). The underlying issue exists in docker-secret and has to do with the serviceAccount secret installed automatically by kubernetes. --- package-lock.json | 2 +- utils/init/initDockerSecrets.js | 14 +++++++++----- 2 files changed, 10 insertions(+), 6 deletions(-) diff --git a/package-lock.json b/package-lock.json index ef91c52..2b444e4 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7754,4 +7754,4 @@ "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==" } } -} \ No newline at end of file +} diff --git a/utils/init/initDockerSecrets.js b/utils/init/initDockerSecrets.js index 4a66320..dda3b2a 100644 --- a/utils/init/initDockerSecrets.js +++ b/utils/init/initDockerSecrets.js @@ -3,14 +3,18 @@ const Logger = require('../Logger'); const logger = new Logger(); const initDockerSecrets = () => { - const secrets = getSecrets(); + try { + const secrets = getSecrets(); - for (const property in secrets) { - const upperProperty = property.toUpperCase(); + for (const property in secrets) { + const upperProperty = property.toUpperCase(); - process.env[upperProperty] = secrets[property]; + process.env[upperProperty] = secrets[property]; - logger.log(`${upperProperty} was overwritten with docker secret value`); + logger.log(`${upperProperty} was overwritten with docker secret value`); + } + } catch(e) { + logger.log('Failed to initialize docker secrets. Error: ' + e, 'ERROR'); } }; From 531ede0adf0c815a880e5e59f4aa07f51f229a11 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Tue, 7 Dec 2021 16:48:24 +0100 Subject: [PATCH 2/7] Added option to set custom description for apps --- CHANGELOG.md | 3 +++ .../src/components/Apps/AppCard/AppCard.tsx | 13 ++++++------ .../src/components/Apps/AppForm/AppForm.tsx | 20 +++++++++++++++++-- client/src/interfaces/App.ts | 1 + .../utility/templateObjects/appTemplate.ts | 1 + db/migrations/05_app-description.js | 19 ++++++++++++++++++ models/App.js | 5 +++++ 7 files changed, 53 insertions(+), 9 deletions(-) create mode 100644 db/migrations/05_app-description.js diff --git a/CHANGELOG.md b/CHANGELOG.md index e0766ae..72d77a1 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,3 +1,6 @@ +### v2.2.0 (TBA) +- Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201)) + ### v2.1.1 (2021-12-02) - Added support for Docker secrets ([#189](https://github.com/pawelmalak/flame/issues/189)) - Changed some messages and buttons to make it easier to open bookmarks editor ([#239](https://github.com/pawelmalak/flame/issues/239)) diff --git a/client/src/components/Apps/AppCard/AppCard.tsx b/client/src/components/Apps/AppCard/AppCard.tsx index 2fe3b21..98ec7ec 100644 --- a/client/src/components/Apps/AppCard/AppCard.tsx +++ b/client/src/components/Apps/AppCard/AppCard.tsx @@ -8,16 +8,15 @@ import { State } from '../../../store/reducers'; interface Props { app: App; - pinHandler?: Function; } -export const AppCard = (props: Props): JSX.Element => { +export const AppCard = ({ app }: Props): JSX.Element => { const { config } = useSelector((state: State) => state.config); - const [displayUrl, redirectUrl] = urlParser(props.app.url); + const [displayUrl, redirectUrl] = urlParser(app.url); let iconEl: JSX.Element; - const { icon } = props.app; + const { icon } = app; if (isImage(icon)) { const source = isUrl(icon) ? icon : `/uploads/${icon}`; @@ -25,7 +24,7 @@ export const AppCard = (props: Props): JSX.Element => { iconEl = ( {`${props.app.name} ); @@ -54,8 +53,8 @@ export const AppCard = (props: Props): JSX.Element => { >
{iconEl}
-
{props.app.name}
- {displayUrl} +
{app.name}
+ {!app.description.length ? displayUrl : app.description}
); diff --git a/client/src/components/Apps/AppForm/AppForm.tsx b/client/src/components/Apps/AppForm/AppForm.tsx index 8679f82..c2dc07a 100644 --- a/client/src/components/Apps/AppForm/AppForm.tsx +++ b/client/src/components/Apps/AppForm/AppForm.tsx @@ -96,7 +96,7 @@ export const AppForm = ({ modalHandler }: Props): JSX.Element => { {/* NAME */} - + { /> + {/* DESCRIPTION */} + + + inputChangeHandler(e)} + /> + + Optional - If description is not set, app URL will be displayed + + + {/* ICON */} {!useCustomIcon ? ( // use mdi icon - + { + await query.addColumn('apps', 'description', { + type: STRING, + allowNull: false, + defaultValue: '', + }); +}; + +const down = async (query) => { + await query.removeColumn('apps', 'description'); +}; + +module.exports = { + up, + down, +}; diff --git a/models/App.js b/models/App.js index 8971d60..7eb022f 100644 --- a/models/App.js +++ b/models/App.js @@ -31,6 +31,11 @@ const App = sequelize.define( allowNull: true, defaultValue: 1, }, + description: { + type: DataTypes.STRING, + allowNull: false, + defaultValue: '', + }, }, { tableName: 'apps', From edc01a341cfd40ae5cea575dc1b32a06443fd760 Mon Sep 17 00:00:00 2001 From: Joe Longendyke Date: Wed, 8 Dec 2021 06:12:37 +0900 Subject: [PATCH 3/7] Modify package.json for fixed docker-secret --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index 39a25d6..312809b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@types/express": "^4.17.13", "axios": "^0.24.0", "concurrently": "^6.3.0", - "docker-secret": "^1.2.3", + "docker-secret": "idevjoe/docker-secret#master", "dotenv": "^10.0.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", From c8436aaf0393784bd2a62eb06591bb70a2d99668 Mon Sep 17 00:00:00 2001 From: Joe Longendyke Date: Wed, 8 Dec 2021 08:19:42 +0900 Subject: [PATCH 4/7] Use tagged idevjoe/docker-secret --- package-lock.json | 11 +++++------ package.json | 2 +- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2b444e4..154be9d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@types/express": "^4.17.13", "axios": "^0.24.0", "concurrently": "^6.3.0", - "docker-secret": "^1.2.3", + "docker-secret": "idevjoe/docker-secret#1.2.4", "dotenv": "^10.0.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", @@ -1192,8 +1192,8 @@ }, "node_modules/docker-secret": { "version": "1.2.3", - "resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.3.tgz", - "integrity": "sha512-JFUGiZEiNO0Hi9YzZAdCc5MwUpgQOjz0OeZkkcEv+lH6ZBkXNK97w2gcBQCsg5WRsT+Cj9eKFhuYyDxT8j56+A==", + "resolved": "git+ssh://git@github.com/idevjoe/docker-secret.git#556bce1313193c1a599767e2651f50730b934f86", + "license": "MIT", "engines": { "node": ">= 6" } @@ -5335,9 +5335,8 @@ } }, "docker-secret": { - "version": "1.2.3", - "resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.3.tgz", - "integrity": "sha512-JFUGiZEiNO0Hi9YzZAdCc5MwUpgQOjz0OeZkkcEv+lH6ZBkXNK97w2gcBQCsg5WRsT+Cj9eKFhuYyDxT8j56+A==" + "version": "git+ssh://git@github.com/idevjoe/docker-secret.git#556bce1313193c1a599767e2651f50730b934f86", + "from": "docker-secret@idevjoe/docker-secret#1.2.4" }, "dot-prop": { "version": "5.3.0", diff --git a/package.json b/package.json index 312809b..71a950b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@types/express": "^4.17.13", "axios": "^0.24.0", "concurrently": "^6.3.0", - "docker-secret": "idevjoe/docker-secret#master", + "docker-secret": "idevjoe/docker-secret#1.2.4", "dotenv": "^10.0.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", From 55a064c2a408a097331056954a16151defee6df9 Mon Sep 17 00:00:00 2001 From: Graham Helton Date: Sat, 11 Dec 2021 23:39:23 -0500 Subject: [PATCH 5/7] Changed docker-run syntax to be more user friendly --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 1907682..290f230 100644 --- a/README.md +++ b/README.md @@ -35,7 +35,7 @@ docker pull pawelmalak/flame:2.0.0 ```sh # run container -docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password flame +docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password pawelmalak/flame ``` #### Building images From ee044ed2ff7d08f53a873bc8b0550bfc6c54fdb2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Fri, 17 Dec 2021 12:28:37 +0100 Subject: [PATCH 6/7] Fixed fatal error while deploying flame to cluster --- package-lock.json | 13 +++++++------ package.json | 2 +- utils/init/initDockerSecrets.js | 4 ++-- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/package-lock.json b/package-lock.json index 154be9d..62e1aba 100644 --- a/package-lock.json +++ b/package-lock.json @@ -13,7 +13,7 @@ "@types/express": "^4.17.13", "axios": "^0.24.0", "concurrently": "^6.3.0", - "docker-secret": "idevjoe/docker-secret#1.2.4", + "docker-secret": "^1.2.4", "dotenv": "^10.0.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", @@ -1191,9 +1191,9 @@ "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" }, "node_modules/docker-secret": { - "version": "1.2.3", - "resolved": "git+ssh://git@github.com/idevjoe/docker-secret.git#556bce1313193c1a599767e2651f50730b934f86", - "license": "MIT", + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.4.tgz", + "integrity": "sha512-aH3truzfxV8TikMa0wJES8h0v2FAwhuQZYk116ZVOHFZ1vnDTGutgCOvXmBPyLBG1Lo7yv93FdHVRTvhFFaC/g==", "engines": { "node": ">= 6" } @@ -5335,8 +5335,9 @@ } }, "docker-secret": { - "version": "git+ssh://git@github.com/idevjoe/docker-secret.git#556bce1313193c1a599767e2651f50730b934f86", - "from": "docker-secret@idevjoe/docker-secret#1.2.4" + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.4.tgz", + "integrity": "sha512-aH3truzfxV8TikMa0wJES8h0v2FAwhuQZYk116ZVOHFZ1vnDTGutgCOvXmBPyLBG1Lo7yv93FdHVRTvhFFaC/g==" }, "dot-prop": { "version": "5.3.0", diff --git a/package.json b/package.json index 71a950b..1b3c92b 100644 --- a/package.json +++ b/package.json @@ -21,7 +21,7 @@ "@types/express": "^4.17.13", "axios": "^0.24.0", "concurrently": "^6.3.0", - "docker-secret": "idevjoe/docker-secret#1.2.4", + "docker-secret": "^1.2.4", "dotenv": "^10.0.0", "express": "^4.17.1", "jsonwebtoken": "^8.5.1", diff --git a/utils/init/initDockerSecrets.js b/utils/init/initDockerSecrets.js index dda3b2a..c38a33f 100644 --- a/utils/init/initDockerSecrets.js +++ b/utils/init/initDockerSecrets.js @@ -13,8 +13,8 @@ const initDockerSecrets = () => { logger.log(`${upperProperty} was overwritten with docker secret value`); } - } catch(e) { - logger.log('Failed to initialize docker secrets. Error: ' + e, 'ERROR'); + } catch (e) { + logger.log(`Failed to initialize docker secrets. Error: ${e}`, 'ERROR'); } }; From d2f99a5ec04ef36b5570a09da7b3e79b09223173 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Pawe=C5=82=20Malak?= Date: Fri, 17 Dec 2021 12:56:51 +0100 Subject: [PATCH 7/7] Pushed version 2.2.0 --- .dockerignore | 3 ++- .env | 2 +- CHANGELOG.md | 3 ++- client/.env | 2 +- 4 files changed, 6 insertions(+), 4 deletions(-) diff --git a/.dockerignore b/.dockerignore index 134be5d..7168b60 100644 --- a/.dockerignore +++ b/.dockerignore @@ -2,4 +2,5 @@ node_modules .github public k8s -skaffold.yaml \ No newline at end of file +skaffold.yaml +data \ No newline at end of file diff --git a/.env b/.env index 64e6517..71d9fdb 100644 --- a/.env +++ b/.env @@ -1,5 +1,5 @@ PORT=5005 NODE_ENV=development -VERSION=2.1.1 +VERSION=2.2.0 PASSWORD=flame_password SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b \ No newline at end of file diff --git a/CHANGELOG.md b/CHANGELOG.md index 72d77a1..008f899 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,6 @@ -### v2.2.0 (TBA) +### v2.2.0 (2021-12-17) - Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201)) +- Fixed fatal error while deploying Flame to cluster ([#242](https://github.com/pawelmalak/flame/issues/242)) ### v2.1.1 (2021-12-02) - Added support for Docker secrets ([#189](https://github.com/pawelmalak/flame/issues/189)) diff --git a/client/.env b/client/.env index ea56cdf..b41b338 100644 --- a/client/.env +++ b/client/.env @@ -1 +1 @@ -REACT_APP_VERSION=2.1.1 \ No newline at end of file +REACT_APP_VERSION=2.2.0 \ No newline at end of file