Skip to content

Commit 6d8ce53

Browse files
authored
Merge pull request #262 from pawelmalak/feature
Version 2.2.0
2 parents b08181e + d2f99a5 commit 6d8ce53

File tree

14 files changed

+77
-27
lines changed

14 files changed

+77
-27
lines changed

.dockerignore

+2-1
Original file line numberDiff line numberDiff line change
@@ -2,4 +2,5 @@ node_modules
22
.github
33
public
44
k8s
5-
skaffold.yaml
5+
skaffold.yaml
6+
data

.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
PORT=5005
22
NODE_ENV=development
3-
VERSION=2.1.1
3+
VERSION=2.2.0
44
PASSWORD=flame_password
55
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b

CHANGELOG.md

+4
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,7 @@
1+
### v2.2.0 (2021-12-17)
2+
- Added option to set custom description for apps ([#201](https://github.com/pawelmalak/flame/issues/201))
3+
- Fixed fatal error while deploying Flame to cluster ([#242](https://github.com/pawelmalak/flame/issues/242))
4+
15
### v2.1.1 (2021-12-02)
26
- Added support for Docker secrets ([#189](https://github.com/pawelmalak/flame/issues/189))
37
- Changed some messages and buttons to make it easier to open bookmarks editor ([#239](https://github.com/pawelmalak/flame/issues/239))

README.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ docker pull pawelmalak/flame:2.0.0
3535

3636
```sh
3737
# run container
38-
docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password flame
38+
docker run -p 5005:5005 -v /path/to/data:/app/data -e PASSWORD=flame_password pawelmalak/flame
3939
```
4040

4141
#### Building images

client/.env

+1-1
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
REACT_APP_VERSION=2.1.1
1+
REACT_APP_VERSION=2.2.0

client/src/components/Apps/AppCard/AppCard.tsx

+6-7
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,23 @@ import { State } from '../../../store/reducers';
88

99
interface Props {
1010
app: App;
11-
pinHandler?: Function;
1211
}
1312

14-
export const AppCard = (props: Props): JSX.Element => {
13+
export const AppCard = ({ app }: Props): JSX.Element => {
1514
const { config } = useSelector((state: State) => state.config);
1615

17-
const [displayUrl, redirectUrl] = urlParser(props.app.url);
16+
const [displayUrl, redirectUrl] = urlParser(app.url);
1817

1918
let iconEl: JSX.Element;
20-
const { icon } = props.app;
19+
const { icon } = app;
2120

2221
if (isImage(icon)) {
2322
const source = isUrl(icon) ? icon : `/uploads/${icon}`;
2423

2524
iconEl = (
2625
<img
2726
src={source}
28-
alt={`${props.app.name} icon`}
27+
alt={`${app.name} icon`}
2928
className={classes.CustomIcon}
3029
/>
3130
);
@@ -54,8 +53,8 @@ export const AppCard = (props: Props): JSX.Element => {
5453
>
5554
<div className={classes.AppCardIcon}>{iconEl}</div>
5655
<div className={classes.AppCardDetails}>
57-
<h5>{props.app.name}</h5>
58-
<span>{displayUrl}</span>
56+
<h5>{app.name}</h5>
57+
<span>{!app.description.length ? displayUrl : app.description}</span>
5958
</div>
6059
</a>
6160
);

client/src/components/Apps/AppForm/AppForm.tsx

+18-2
Original file line numberDiff line numberDiff line change
@@ -96,7 +96,7 @@ export const AppForm = ({ modalHandler }: Props): JSX.Element => {
9696
<ModalForm modalHandler={modalHandler} formHandler={formSubmitHandler}>
9797
{/* NAME */}
9898
<InputGroup>
99-
<label htmlFor="name">App Name</label>
99+
<label htmlFor="name">App name</label>
100100
<input
101101
type="text"
102102
name="name"
@@ -122,11 +122,27 @@ export const AppForm = ({ modalHandler }: Props): JSX.Element => {
122122
/>
123123
</InputGroup>
124124

125+
{/* DESCRIPTION */}
126+
<InputGroup>
127+
<label htmlFor="description">App description</label>
128+
<input
129+
type="text"
130+
name="description"
131+
id="description"
132+
placeholder="My self-hosted app"
133+
value={formData.description}
134+
onChange={(e) => inputChangeHandler(e)}
135+
/>
136+
<span>
137+
Optional - If description is not set, app URL will be displayed
138+
</span>
139+
</InputGroup>
140+
125141
{/* ICON */}
126142
{!useCustomIcon ? (
127143
// use mdi icon
128144
<InputGroup>
129-
<label htmlFor="icon">App Icon</label>
145+
<label htmlFor="icon">App icon</label>
130146
<input
131147
type="text"
132148
name="icon"

client/src/interfaces/App.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export interface NewApp {
55
url: string;
66
icon: string;
77
isPublic: boolean;
8+
description: string;
89
}
910

1011
export interface App extends Model, NewApp {

client/src/utility/templateObjects/appTemplate.ts

+1
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@ export const newAppTemplate: NewApp = {
55
url: '',
66
icon: '',
77
isPublic: true,
8+
description: '',
89
};
910

1011
export const appTemplate: App = {

db/migrations/05_app-description.js

+19
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,19 @@
1+
const { DataTypes } = require('sequelize');
2+
const { STRING } = DataTypes;
3+
4+
const up = async (query) => {
5+
await query.addColumn('apps', 'description', {
6+
type: STRING,
7+
allowNull: false,
8+
defaultValue: '',
9+
});
10+
};
11+
12+
const down = async (query) => {
13+
await query.removeColumn('apps', 'description');
14+
};
15+
16+
module.exports = {
17+
up,
18+
down,
19+
};

models/App.js

+5
Original file line numberDiff line numberDiff line change
@@ -31,6 +31,11 @@ const App = sequelize.define(
3131
allowNull: true,
3232
defaultValue: 1,
3333
},
34+
description: {
35+
type: DataTypes.STRING,
36+
allowNull: false,
37+
defaultValue: '',
38+
},
3439
},
3540
{
3641
tableName: 'apps',

package-lock.json

+8-8
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@
2121
"@types/express": "^4.17.13",
2222
"axios": "^0.24.0",
2323
"concurrently": "^6.3.0",
24-
"docker-secret": "^1.2.3",
24+
"docker-secret": "^1.2.4",
2525
"dotenv": "^10.0.0",
2626
"express": "^4.17.1",
2727
"jsonwebtoken": "^8.5.1",

utils/init/initDockerSecrets.js

+9-5
Original file line numberDiff line numberDiff line change
@@ -3,14 +3,18 @@ const Logger = require('../Logger');
33
const logger = new Logger();
44

55
const initDockerSecrets = () => {
6-
const secrets = getSecrets();
6+
try {
7+
const secrets = getSecrets();
78

8-
for (const property in secrets) {
9-
const upperProperty = property.toUpperCase();
9+
for (const property in secrets) {
10+
const upperProperty = property.toUpperCase();
1011

11-
process.env[upperProperty] = secrets[property];
12+
process.env[upperProperty] = secrets[property];
1213

13-
logger.log(`${upperProperty} was overwritten with docker secret value`);
14+
logger.log(`${upperProperty} was overwritten with docker secret value`);
15+
}
16+
} catch (e) {
17+
logger.log(`Failed to initialize docker secrets. Error: ${e}`, 'ERROR');
1418
}
1519
};
1620

0 commit comments

Comments
 (0)