1
0
Fork 0
mirror of https://github.com/pawelmalak/flame.git synced 2025-07-30 08:09:35 +02:00
This commit is contained in:
François Darveau 2021-12-20 15:07:04 -05:00
commit 3609fe211b
14 changed files with 74 additions and 19 deletions

View file

@ -2,4 +2,5 @@ node_modules
.github .github
public public
k8s k8s
skaffold.yaml skaffold.yaml
data

2
.env
View file

@ -1,5 +1,5 @@
PORT=5005 PORT=5005
NODE_ENV=development NODE_ENV=development
VERSION=2.1.1 VERSION=2.2.0
PASSWORD=flame_password PASSWORD=flame_password
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b

View file

@ -1,3 +1,7 @@
### 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) ### v2.1.1 (2021-12-02)
- Added support for Docker secrets ([#189](https://github.com/pawelmalak/flame/issues/189)) - 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)) - Changed some messages and buttons to make it easier to open bookmarks editor ([#239](https://github.com/pawelmalak/flame/issues/239))

View file

@ -1 +1 @@
REACT_APP_VERSION=2.1.1 REACT_APP_VERSION=2.2.0

View file

@ -10,6 +10,10 @@
text-transform: uppercase; text-transform: uppercase;
} }
.AppHeader:hover {
cursor: pointer;
}
.AppIcon { .AppIcon {
width: 35px; width: 35px;
height: 35px; height: 35px;

View file

@ -92,7 +92,7 @@ export const AppCard = (props: Props): JSX.Element => {
{app.icon && iconEl} {app.icon && iconEl}
<div className={classes.AppCardDetails}> <div className={classes.AppCardDetails}>
<h5>{app.name}</h5> <h5>{app.name}</h5>
<span>{displayUrl}</span> <span>{!app.description.length ? displayUrl : app.description}</span>
</div> </div>
</a> </a>
); );

View file

@ -143,7 +143,7 @@ export const AppsForm = ({
<ModalForm modalHandler={modalHandler} formHandler={formSubmitHandler}> <ModalForm modalHandler={modalHandler} formHandler={formSubmitHandler}>
{/* NAME */} {/* NAME */}
<InputGroup> <InputGroup>
<label htmlFor="name">App Name</label> <label htmlFor="name">App name</label>
<input <input
type="text" type="text"
name="name" name="name"
@ -189,12 +189,28 @@ export const AppsForm = ({
})} })}
</select> </select>
</InputGroup> </InputGroup>
{/* DESCRIPTION */}
<InputGroup>
<label htmlFor="description">App description</label>
<input
type="text"
name="description"
id="description"
placeholder="My self-hosted app"
value={formData.description}
onChange={(e) => inputChangeHandler(e)}
/>
<span>
Optional - If description is not set, app URL will be displayed
</span>
</InputGroup>
{/* ICON */} {/* ICON */}
{!useCustomIcon ? ( {!useCustomIcon ? (
// mdi // mdi
<InputGroup> <InputGroup>
<label htmlFor="icon">App Icon (optional)</label> <label htmlFor="icon">App icon</label>
<input <input
type="text" type="text"
name="icon" name="icon"

View file

@ -6,6 +6,7 @@ export interface NewApp {
categoryId: number; categoryId: number;
icon: string; icon: string;
isPublic: boolean; isPublic: boolean;
description: string;
} }
export interface App extends Model, NewApp { export interface App extends Model, NewApp {

View file

@ -6,6 +6,7 @@ export const newAppTemplate: NewApp = {
icon: '', icon: '',
categoryId: -1, categoryId: -1,
isPublic: true, isPublic: true,
description: '',
}; };
export const appTemplate: App = { export const appTemplate: App = {

View file

@ -0,0 +1,19 @@
const { DataTypes } = require('sequelize');
const { STRING } = DataTypes;
const up = async (query) => {
await query.addColumn('apps', 'description', {
type: STRING,
allowNull: false,
defaultValue: '',
});
};
const down = async (query) => {
await query.removeColumn('apps', 'description');
};
module.exports = {
up,
down,
};

View file

@ -35,6 +35,11 @@ const App = sequelize.define(
allowNull: true, allowNull: true,
defaultValue: 1, defaultValue: 1,
}, },
description: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: '',
},
}, },
{ {
tableName: 'apps', tableName: 'apps',

14
package-lock.json generated
View file

@ -13,7 +13,7 @@
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"axios": "^0.24.0", "axios": "^0.24.0",
"concurrently": "^6.3.0", "concurrently": "^6.3.0",
"docker-secret": "^1.2.3", "docker-secret": "^1.2.4",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"express": "^4.17.1", "express": "^4.17.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",
@ -1191,9 +1191,9 @@
"integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ=" "integrity": "sha1-YuIDvEF2bGwoyfyEMB2rHFMQ+pQ="
}, },
"node_modules/docker-secret": { "node_modules/docker-secret": {
"version": "1.2.3", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.3.tgz", "resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.4.tgz",
"integrity": "sha512-JFUGiZEiNO0Hi9YzZAdCc5MwUpgQOjz0OeZkkcEv+lH6ZBkXNK97w2gcBQCsg5WRsT+Cj9eKFhuYyDxT8j56+A==", "integrity": "sha512-aH3truzfxV8TikMa0wJES8h0v2FAwhuQZYk116ZVOHFZ1vnDTGutgCOvXmBPyLBG1Lo7yv93FdHVRTvhFFaC/g==",
"engines": { "engines": {
"node": ">= 6" "node": ">= 6"
} }
@ -5335,9 +5335,9 @@
} }
}, },
"docker-secret": { "docker-secret": {
"version": "1.2.3", "version": "1.2.4",
"resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.3.tgz", "resolved": "https://registry.npmjs.org/docker-secret/-/docker-secret-1.2.4.tgz",
"integrity": "sha512-JFUGiZEiNO0Hi9YzZAdCc5MwUpgQOjz0OeZkkcEv+lH6ZBkXNK97w2gcBQCsg5WRsT+Cj9eKFhuYyDxT8j56+A==" "integrity": "sha512-aH3truzfxV8TikMa0wJES8h0v2FAwhuQZYk116ZVOHFZ1vnDTGutgCOvXmBPyLBG1Lo7yv93FdHVRTvhFFaC/g=="
}, },
"dot-prop": { "dot-prop": {
"version": "5.3.0", "version": "5.3.0",

View file

@ -21,7 +21,7 @@
"@types/express": "^4.17.13", "@types/express": "^4.17.13",
"axios": "^0.24.0", "axios": "^0.24.0",
"concurrently": "^6.3.0", "concurrently": "^6.3.0",
"docker-secret": "^1.2.3", "docker-secret": "^1.2.4",
"dotenv": "^10.0.0", "dotenv": "^10.0.0",
"express": "^4.17.1", "express": "^4.17.1",
"jsonwebtoken": "^8.5.1", "jsonwebtoken": "^8.5.1",

View file

@ -3,14 +3,18 @@ const Logger = require('../Logger');
const logger = new Logger(); const logger = new Logger();
const initDockerSecrets = () => { const initDockerSecrets = () => {
const secrets = getSecrets(); try {
const secrets = getSecrets();
for (const property in secrets) { for (const property in secrets) {
const upperProperty = property.toUpperCase(); 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');
} }
}; };