Skip to content

Commit

Permalink
🔀 Merge pull request #559 from Ateroz/fix-several-issues-with-conf-no…
Browse files Browse the repository at this point in the history
…t-loaded

Fix several issues with conf not loaded
  • Loading branch information
Lissy93 committed Mar 14, 2022
2 parents 55396e9 + b05c6ea commit f39cdb5
Show file tree
Hide file tree
Showing 5 changed files with 30 additions and 11 deletions.
12 changes: 12 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,17 @@
# Changelog

## 2.0.5 - Bug Fixes and a few New Features

### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
This change requires a rebuild of the application when several options under `appConfig` are changed.
Fixes #544 #555

### Several other changes since 2.0.4, including:
The `Add New Section` button on the UI editor now displays if no sections are present. #536
When using SSL, the server can now redirect from HTTP to HTTPS. This is enabled by default when using SSL. #538
Section context menus are now accessible on mobile, and will no longer clip off the screen. #541
Italian translations have been added. #556

## :sparkles: 2.0.4 - Dynamic Config Loading [PR #528](https://github.com/Lissy93/dashy/pull/528)
- `conf.yml` is now loaded dynamically and the app now only needs a browser refresh on config change, not a full rebuild!

Expand Down
11 changes: 9 additions & 2 deletions .github/LATEST_CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,9 @@
## :sparkles: Dynamic Config Loading [PR #528](https://github.com/Lissy93/dashy/pull/528)
- `conf.yml` is now loaded dynamically and the app now only needs a browser refresh on config change, not a full rebuild!
### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
This change requires a rebuild of the application when several options under `appConfig` are changed.
Fixes #544 #555

### Several other changes since 2.0.4, including:
The `Add New Section` button on the UI editor now displays if no sections are present. #536
When using SSL, the server can now redirect from HTTP to HTTPS. This is enabled by default when using SSL. #538
Section context menus are now accessible on mobile, and will no longer clip off the screen. #541
Italian translations have been added. #556
12 changes: 5 additions & 7 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -39,18 +39,16 @@ WORKDIR ${DIRECTORY}
RUN apk add --no-cache tzdata tini

# Copy built application from build phase
COPY --from=BUILD_IMAGE /app/dist/ public/
COPY --from=BUILD_IMAGE /app/node_modules/ node_modules/
COPY services/ services/
COPY src/utils/ src/utils/
COPY package.json yarn.lock server.js ./
COPY --from=BUILD_IMAGE /app ./
# Ensure only one version of conf.yml exists
RUN rm dist/conf.yml

# Finally, run start command to serve up the built application
ENTRYPOINT [ "/sbin/tini", "--" ]
CMD [ "yarn", "start" ]
CMD [ "yarn", "build-and-start" ]

# Expose the port
EXPOSE ${PORT}

# Run simple healthchecks every 5 mins, to check that everythings still great
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "Dashy",
"version": "2.0.4",
"version": "2.0.5",
"license": "MIT",
"main": "server",
"author": "Alicia Sykes <[email protected]> (https://aliciasykes.com)",
Expand Down
4 changes: 3 additions & 1 deletion src/utils/ConfigAccumalator.js
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,8 @@ import ErrorHandler from '@/utils/ErrorHandler';
import { applyItemId } from '@/utils/SectionHelpers';
import $store from '@/store';

import buildConf from '../../public/conf.yml';

export default class ConfigAccumulator {
constructor() {
this.conf = $store.state.remoteConfig;
Expand All @@ -25,7 +27,7 @@ export default class ConfigAccumulator {
appConfig() {
let appConfigFile = {};
// Set app config from file
if (this.conf) appConfigFile = this.conf.appConfig || {};
if (this.conf) appConfigFile = this.conf.appConfig || buildConf.appConfig || {};
// Fill in defaults if anything missing
let usersAppConfig = defaultAppConfig;
if (localStorage[localStorageKeys.APP_CONFIG]) {
Expand Down

0 comments on commit f39cdb5

Please sign in to comment.