Skip to content

Commit f39cdb5

Browse files
authored
🔀 Merge pull request Lissy93#559 from Ateroz/fix-several-issues-with-conf-not-loaded
Fix several issues with conf not loaded
2 parents 55396e9 + b05c6ea commit f39cdb5

File tree

5 files changed

+30
-11
lines changed

5 files changed

+30
-11
lines changed

‎.github/CHANGELOG.md

+12
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,17 @@
11
# Changelog
22

3+
## 2.0.5 - Bug Fixes and a few New Features
4+
5+
### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
6+
This change requires a rebuild of the application when several options under `appConfig` are changed.
7+
Fixes #544 #555
8+
9+
### Several other changes since 2.0.4, including:
10+
The `Add New Section` button on the UI editor now displays if no sections are present. #536
11+
When using SSL, the server can now redirect from HTTP to HTTPS. This is enabled by default when using SSL. #538
12+
Section context menus are now accessible on mobile, and will no longer clip off the screen. #541
13+
Italian translations have been added. #556
14+
315
## :sparkles: 2.0.4 - Dynamic Config Loading [PR #528](https://github.com/Lissy93/dashy/pull/528)
416
- `conf.yml` is now loaded dynamically and the app now only needs a browser refresh on config change, not a full rebuild!
517

‎.github/LATEST_CHANGELOG.md

+9-2
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,9 @@
1-
## :sparkles: Dynamic Config Loading [PR #528](https://github.com/Lissy93/dashy/pull/528)
2-
- `conf.yml` is now loaded dynamically and the app now only needs a browser refresh on config change, not a full rebuild!
1+
### Partially revert 2.0.4, fixing several issues caused by `conf.yml` not being loaded at startup.
2+
This change requires a rebuild of the application when several options under `appConfig` are changed.
3+
Fixes #544 #555
4+
5+
### Several other changes since 2.0.4, including:
6+
The `Add New Section` button on the UI editor now displays if no sections are present. #536
7+
When using SSL, the server can now redirect from HTTP to HTTPS. This is enabled by default when using SSL. #538
8+
Section context menus are now accessible on mobile, and will no longer clip off the screen. #541
9+
Italian translations have been added. #556

‎Dockerfile

+5-7
Original file line numberDiff line numberDiff line change
@@ -39,18 +39,16 @@ WORKDIR ${DIRECTORY}
3939
RUN apk add --no-cache tzdata tini
4040

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

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

5250
# Expose the port
5351
EXPOSE ${PORT}
5452

5553
# Run simple healthchecks every 5 mins, to check that everythings still great
56-
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check
54+
HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check

‎package.json

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "Dashy",
3-
"version": "2.0.4",
3+
"version": "2.0.5",
44
"license": "MIT",
55
"main": "server",
66
"author": "Alicia Sykes <[email protected]> (https://aliciasykes.com)",

‎src/utils/ConfigAccumalator.js

+3-1
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@ import ErrorHandler from '@/utils/ErrorHandler';
1616
import { applyItemId } from '@/utils/SectionHelpers';
1717
import $store from '@/store';
1818

19+
import buildConf from '../../public/conf.yml';
20+
1921
export default class ConfigAccumulator {
2022
constructor() {
2123
this.conf = $store.state.remoteConfig;
@@ -25,7 +27,7 @@ export default class ConfigAccumulator {
2527
appConfig() {
2628
let appConfigFile = {};
2729
// Set app config from file
28-
if (this.conf) appConfigFile = this.conf.appConfig || {};
30+
if (this.conf) appConfigFile = this.conf.appConfig || buildConf.appConfig || {};
2931
// Fill in defaults if anything missing
3032
let usersAppConfig = defaultAppConfig;
3133
if (localStorage[localStorageKeys.APP_CONFIG]) {

0 commit comments

Comments
 (0)