From 38337ed69305931ac3991fa817d6c06c58b25a2e Mon Sep 17 00:00:00 2001 From: aterox Date: Sun, 13 Mar 2022 19:28:18 -0400 Subject: [PATCH 1/3] Import conf at build time --- src/utils/ConfigAccumalator.js | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/utils/ConfigAccumalator.js b/src/utils/ConfigAccumalator.js index 6ab294e3..aa5a19ad 100644 --- a/src/utils/ConfigAccumalator.js +++ b/src/utils/ConfigAccumalator.js @@ -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; @@ -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]) { From 79754dc1e9a345c331ceaa2b1523f1eeaf6f9c3f Mon Sep 17 00:00:00 2001 From: aterox Date: Sun, 13 Mar 2022 19:35:19 -0400 Subject: [PATCH 2/3] Revert Dockerfile, but ensure only one conf.yml --- Dockerfile | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) diff --git a/Dockerfile b/Dockerfile index f2b0029f..8d7b15ed 100644 --- a/Dockerfile +++ b/Dockerfile @@ -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 \ No newline at end of file From b05c6ea069c89ab769f6e49eead780d05117de7b Mon Sep 17 00:00:00 2001 From: aterox Date: Sun, 13 Mar 2022 20:30:00 -0400 Subject: [PATCH 3/3] Bump version --- .github/CHANGELOG.md | 12 ++++++++++++ .github/LATEST_CHANGELOG.md | 11 +++++++++-- package.json | 2 +- 3 files changed, 22 insertions(+), 3 deletions(-) diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index e28eba36..bfb29f68 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -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! diff --git a/.github/LATEST_CHANGELOG.md b/.github/LATEST_CHANGELOG.md index 7a2367cb..905abe72 100644 --- a/.github/LATEST_CHANGELOG.md +++ b/.github/LATEST_CHANGELOG.md @@ -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! \ No newline at end of file +### 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 \ No newline at end of file diff --git a/package.json b/package.json index ee320b40..e656b3b6 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Dashy", - "version": "2.0.4", + "version": "2.0.5", "license": "MIT", "main": "server", "author": "Alicia Sykes (https://aliciasykes.com)",