Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Version 2.2.0 #262

Merged
merged 10 commits into from
Dec 17, 2021
Merged
3 changes: 2 additions & 1 deletion .dockerignore
Original file line number Diff line number Diff line change
Expand Up @@ -2,4 +2,5 @@ node_modules
.github
public
k8s
skaffold.yaml
skaffold.yaml
data
2 changes: 1 addition & 1 deletion .env
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
PORT=5005
NODE_ENV=development
VERSION=2.1.1
VERSION=2.2.0
PASSWORD=flame_password
SECRET=e02eb43d69953658c6d07311d6313f2d4467672cb881f96b29368ba1f3f4da4b
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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)
- 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))
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
2 changes: 1 addition & 1 deletion client/.env
Original file line number Diff line number Diff line change
@@ -1 +1 @@
REACT_APP_VERSION=2.1.1
REACT_APP_VERSION=2.2.0
13 changes: 6 additions & 7 deletions client/src/components/Apps/AppCard/AppCard.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -8,24 +8,23 @@ 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}`;

iconEl = (
<img
src={source}
alt={`${props.app.name} icon`}
alt={`${app.name} icon`}
className={classes.CustomIcon}
/>
);
Expand Down Expand Up @@ -54,8 +53,8 @@ export const AppCard = (props: Props): JSX.Element => {
>
<div className={classes.AppCardIcon}>{iconEl}</div>
<div className={classes.AppCardDetails}>
<h5>{props.app.name}</h5>
<span>{displayUrl}</span>
<h5>{app.name}</h5>
<span>{!app.description.length ? displayUrl : app.description}</span>
</div>
</a>
);
Expand Down
20 changes: 18 additions & 2 deletions client/src/components/Apps/AppForm/AppForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,7 @@ export const AppForm = ({ modalHandler }: Props): JSX.Element => {
<ModalForm modalHandler={modalHandler} formHandler={formSubmitHandler}>
{/* NAME */}
<InputGroup>
<label htmlFor="name">App Name</label>
<label htmlFor="name">App name</label>
<input
type="text"
name="name"
Expand All @@ -122,11 +122,27 @@ export const AppForm = ({ modalHandler }: Props): JSX.Element => {
/>
</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 */}
{!useCustomIcon ? (
// use mdi icon
<InputGroup>
<label htmlFor="icon">App Icon</label>
<label htmlFor="icon">App icon</label>
<input
type="text"
name="icon"
Expand Down
1 change: 1 addition & 0 deletions client/src/interfaces/App.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export interface NewApp {
url: string;
icon: string;
isPublic: boolean;
description: string;
}

export interface App extends Model, NewApp {
Expand Down
1 change: 1 addition & 0 deletions client/src/utility/templateObjects/appTemplate.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ export const newAppTemplate: NewApp = {
url: '',
icon: '',
isPublic: true,
description: '',
};

export const appTemplate: App = {
Expand Down
19 changes: 19 additions & 0 deletions db/migrations/05_app-description.js
Original file line number Diff line number Diff line change
@@ -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,
};
5 changes: 5 additions & 0 deletions models/App.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,11 @@ const App = sequelize.define(
allowNull: true,
defaultValue: 1,
},
description: {
type: DataTypes.STRING,
allowNull: false,
defaultValue: '',
},
},
{
tableName: 'apps',
Expand Down
16 changes: 8 additions & 8 deletions package-lock.json

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
"@types/express": "^4.17.13",
"axios": "^0.24.0",
"concurrently": "^6.3.0",
"docker-secret": "^1.2.3",
"docker-secret": "^1.2.4",
"dotenv": "^10.0.0",
"express": "^4.17.1",
"jsonwebtoken": "^8.5.1",
Expand Down
14 changes: 9 additions & 5 deletions utils/init/initDockerSecrets.js
Original file line number Diff line number Diff line change
Expand Up @@ -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');
}
};

Expand Down