From 8ad600ec70ba9e5b444ca0d257f59476bbff9193 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 22:13:34 +0100 Subject: [PATCH 01/30] :beers: Stupid ARM image failing to build on Docker Hub --- Dockerfile-arm32v7 | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index 437d1ebf..fa6036ba 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,4 +1,6 @@ -FROM arm32v7/node:latest +FROM alpine:3.8 + +RUN apk add --no-cache nodejs yarn --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community # Define some ENV Vars ENV PORT 80 @@ -12,20 +14,20 @@ WORKDIR ${DIRECTORY} COPY package.json ./ COPY yarn.lock ./ -# Install dependencies +# Install project dependencies RUN yarn # Copy over all project files and folders to the working directory COPY . . -# Build Dashy for production +# Build initial app for production RUN yarn build -# Expose users port +# Expose given port EXPOSE ${PORT} # Finally, run start command to serve up the built application CMD [ "yarn", "build-and-start"] -# Enable Docker healthcecks, to ensure Dashy is running correctly +# Run simple healthchecks every 5 mins, to check the Dashy's everythings great HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check From c26184265939ef0ebbc7cf47925284be1bf9c744 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 22:14:16 +0100 Subject: [PATCH 02/30] :beers: Run dos2unix over dockerfile in a desperate attempt to fix it --- Dockerfile-arm64v8 | 62 +++++++++++++++++++++++----------------------- 1 file changed, 31 insertions(+), 31 deletions(-) diff --git a/Dockerfile-arm64v8 b/Dockerfile-arm64v8 index c5fd92f6..c6173499 100644 --- a/Dockerfile-arm64v8 +++ b/Dockerfile-arm64v8 @@ -1,31 +1,31 @@ -FROM arm64v8/node:latest - -# Define some ENV Vars -ENV PORT 80 -ENV DIRECTORY /app -ENV IS_DOCKER true - -# Create and set the working directory -WORKDIR ${DIRECTORY} - -# Copy over both 'package.json' and 'package-lock.json' (if available) -COPY package.json ./ -COPY yarn.lock ./ - -# Install project dependencies -RUN yarn - -# Copy over all project files and folders to the working directory -COPY . . - -# Build initial app for production -RUN yarn build - -# Expose given port -EXPOSE ${PORT} - -# Finally, run start command to serve up the built application -CMD [ "yarn", "build-and-start"] - -# Run simple healthchecks every 5 mins, to check the Dashy's everythings great -HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check +FROM arm64v8/node:latest + +# Define some ENV Vars +ENV PORT 80 +ENV DIRECTORY /app +ENV IS_DOCKER true + +# Create and set the working directory +WORKDIR ${DIRECTORY} + +# Copy over both 'package.json' and 'package-lock.json' (if available) +COPY package.json ./ +COPY yarn.lock ./ + +# Install project dependencies +RUN yarn + +# Copy over all project files and folders to the working directory +COPY . . + +# Build initial app for production +RUN yarn build + +# Expose given port +EXPOSE ${PORT} + +# Finally, run start command to serve up the built application +CMD [ "yarn", "build-and-start"] + +# Run simple healthchecks every 5 mins, to check the Dashy's everythings great +HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check From b5b50bc154b64606c730b7f7759aeac37434fd0e Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 22:25:27 +0100 Subject: [PATCH 03/30] :confounded: Attempting to fix Docker ARM build --- Dockerfile-arm32v7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index fa6036ba..44941b1c 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,6 +1,6 @@ FROM alpine:3.8 -RUN apk add --no-cache nodejs yarn --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community +RUN apk add --no-cache nodejs=14.17.4-r0 yarn --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community # Define some ENV Vars ENV PORT 80 From f7eac66d6529f76ec66adeafadf03ab060205a8b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 22:34:33 +0100 Subject: [PATCH 04/30] :confounded: Attempting to fix Docker ARM build --- Dockerfile-arm32v7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index 44941b1c..3ecd7742 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,6 +1,6 @@ FROM alpine:3.8 -RUN apk add --no-cache nodejs=14.17.4-r0 yarn --repository=http://dl-cdn.alpinelinux.org/alpine/edge/community +RUN apk add --update --no-cache nodejs npm yarn # Define some ENV Vars ENV PORT 80 From c8c730f9912bcb33e7fdf6e9db2dc6170177c6ee Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 22:45:46 +0100 Subject: [PATCH 05/30] :confounded: Attempting to fix Docker ARM build --- Dockerfile-arm32v7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index 3ecd7742..774013f1 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,4 +1,4 @@ -FROM alpine:3.8 +FROM alpine:3.14 RUN apk add --update --no-cache nodejs npm yarn From 4fdaf27191bb66a7a49c456df8eef7df00f0635d Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 22:56:53 +0100 Subject: [PATCH 06/30] :neutral_face: Build almost working --- Dockerfile-arm32v7 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 index 774013f1..8da83fa2 100644 --- a/Dockerfile-arm32v7 +++ b/Dockerfile-arm32v7 @@ -1,4 +1,4 @@ -FROM alpine:3.14 +FROM arm32v7/alpine:3.14 RUN apk add --update --no-cache nodejs npm yarn From 84080433f77c7c95707182d193d1a5c28272d355 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Fri, 6 Aug 2021 23:23:57 +0100 Subject: [PATCH 07/30] :put_litter_in_its_place: Binned the ARM Docker containers, as DockerHub cannot build --- Dockerfile-arm32v7 | 33 --------------------------------- Dockerfile-arm64v8 | 31 ------------------------------- 2 files changed, 64 deletions(-) delete mode 100644 Dockerfile-arm32v7 delete mode 100644 Dockerfile-arm64v8 diff --git a/Dockerfile-arm32v7 b/Dockerfile-arm32v7 deleted file mode 100644 index 8da83fa2..00000000 --- a/Dockerfile-arm32v7 +++ /dev/null @@ -1,33 +0,0 @@ -FROM arm32v7/alpine:3.14 - -RUN apk add --update --no-cache nodejs npm yarn - -# Define some ENV Vars -ENV PORT 80 -ENV DIRECTORY /app -ENV IS_DOCKER true - -# Create and set the working directory -WORKDIR ${DIRECTORY} - -# Copy over both 'package.json' and 'yarn.lock' -COPY package.json ./ -COPY yarn.lock ./ - -# Install project dependencies -RUN yarn - -# Copy over all project files and folders to the working directory -COPY . . - -# Build initial app for production -RUN yarn build - -# Expose given port -EXPOSE ${PORT} - -# Finally, run start command to serve up the built application -CMD [ "yarn", "build-and-start"] - -# Run simple healthchecks every 5 mins, to check the Dashy's everythings great -HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check diff --git a/Dockerfile-arm64v8 b/Dockerfile-arm64v8 deleted file mode 100644 index c6173499..00000000 --- a/Dockerfile-arm64v8 +++ /dev/null @@ -1,31 +0,0 @@ -FROM arm64v8/node:latest - -# Define some ENV Vars -ENV PORT 80 -ENV DIRECTORY /app -ENV IS_DOCKER true - -# Create and set the working directory -WORKDIR ${DIRECTORY} - -# Copy over both 'package.json' and 'package-lock.json' (if available) -COPY package.json ./ -COPY yarn.lock ./ - -# Install project dependencies -RUN yarn - -# Copy over all project files and folders to the working directory -COPY . . - -# Build initial app for production -RUN yarn build - -# Expose given port -EXPOSE ${PORT} - -# Finally, run start command to serve up the built application -CMD [ "yarn", "build-and-start"] - -# Run simple healthchecks every 5 mins, to check the Dashy's everythings great -HEALTHCHECK --interval=5m --timeout=2s --start-period=30s CMD yarn health-check From 79d8d1b036b4981b5cdda97cc99e1fd380994d77 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 14:15:45 +0100 Subject: [PATCH 08/30] :globe_with_meridians: Re: #126 - Adds missing translations --- src/assets/locales/en.json | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index b0ae0e40..6a3a6175 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -17,7 +17,13 @@ "remember-me-never": "Never", "remember-me-hour": "4 Hours", "remember-me-day": "1 Day", - "remember-me-week": "1 Week" + "remember-me-week": "1 Week", + "error-missing-username": "Missing Username", + "error-missing-password": "Missing Password", + "error-incorrect-username": "User not found", + "error-incorrect-password": "Incorrect Password", + "success-message": "Logging in...", + "logout-message": "Logged Out" }, "config": { "main-tab": "Config", @@ -59,7 +65,9 @@ "item-size-small": "Small", "item-size-medium": "Medium", "item-size-large": "Large", - "config-launcher-label": "Config" + "config-launcher-label": "Config", + "config-launcher-tooltip": "Update Configuration", + "sign-out-tooltip": "Sign Out" }, "updates": { "app-version-note": "Dashy version", From 9f33bacf1618e42956a9e1e22810650f7a531844 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 14:17:01 +0100 Subject: [PATCH 09/30] :bug: Re: #127 - Fixes translations not being picked up in dropdown --- src/views/Login.vue | 40 +++++++++++++++++++++++++++++++--------- 1 file changed, 31 insertions(+), 9 deletions(-) diff --git a/src/views/Login.vue b/src/views/Login.vue index 1dd35b15..22a6673e 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -40,6 +40,10 @@ import { checkCredentials, login } from '@/utils/Auth'; export default { name: 'login', + components: { + Button, + Input, + }, props: { appConfig: Object, }, @@ -50,23 +54,41 @@ export default { message: '', status: 'waiting', // wating, error, success timeout: { label: this.$t('login.remember-me-never'), time: 0 }, - dropDownMenu: [ // Data for timeout dropdown menu, translated label + value in ms + }; + }, + computed: { + /* Data for timeout dropdown menu, translated label + value in ms */ + dropDownMenu() { + return [ { label: this.$t('login.remember-me-never'), time: 0 }, { label: this.$t('login.remember-me-hour'), time: 14400 * 1000 }, { label: this.$t('login.remember-me-day'), time: 86400 * 1000 }, { label: this.$t('login.remember-me-week'), time: 604800 * 1000 }, - ], - }; - }, - components: { - Button, - Input, + ]; + }, + /* Translations for login response messages */ + responseMessages() { + return { + missingUsername: this.$t('login.error-missing-username'), + missingPassword: this.$t('login.error-missing-password'), + incorrectUsername: this.$t('login.error-incorrect-username'), + incorrectPassword: this.$t('login.error-incorrect-password'), + successMsg: this.$t('login.success-message'), + }; + }, }, methods: { /* Checks form is filled in, then initiates the login, and redirects to /home */ submitLogin() { + // Use selected timeout, if available,else revedrt to zero const timeout = this.timeout ? this.timeout.time : 0; - const response = checkCredentials(this.username, this.password, this.appConfig.auth || []); + // Check users credentials + const response = checkCredentials( + this.username, + this.password, + this.appConfig.auth || [], // All users + this.responseMessages, // Translated response messages + ); this.message = response.msg; // Show error or success message to the user this.status = response.correct ? 'success' : 'error'; if (response.correct) { // Yay, credentials were correct :) @@ -76,7 +98,7 @@ export default { }, 250); } }, - /* Since we don't have the Theme setter at this point, we must manually set users theme */ + /* Since Theme setter isn't loaded at this point, we must manually get and apply users theme */ setTheme() { const theme = localStorage[localStorageKeys.THEME] || Defaults.theme; document.getElementsByTagName('html')[0].setAttribute('data-theme', theme); From 7a669d6ee4246c2d208234faa3f2a9263b025090 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 14:19:28 +0100 Subject: [PATCH 10/30] :globe_with_meridians: Re: #126 - Implements missing translations for Login action --- src/components/Settings/AppButtons.vue | 4 ++-- src/utils/Auth.js | 18 +++++++++--------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/src/components/Settings/AppButtons.vue b/src/components/Settings/AppButtons.vue index 8425fefc..875ae11b 100644 --- a/src/components/Settings/AppButtons.vue +++ b/src/components/Settings/AppButtons.vue @@ -1,7 +1,7 @@ diff --git a/yarn.lock b/yarn.lock index e7fba661..2543963f 100644 --- a/yarn.lock +++ b/yarn.lock @@ -5045,11 +5045,6 @@ highlight.js@^10.7.1: resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-10.7.3.tgz#697272e3991356e40c3cac566a74eef681756531" integrity sha512-tzcUFauisWKNHaRkN4Wjl/ZA07gENAjFl3J/c480dprkGTg5EQstgaNFqBfUqCq54kZRIEcreTsAgF/m2quD7A== -highlight.js@^11.0.0: - version "11.1.0" - resolved "https://registry.yarnpkg.com/highlight.js/-/highlight.js-11.1.0.tgz#0198f7326e64ddfbea5f76b00e84ab542cf24ae8" - integrity sha512-X9VVhYKHQPPuwffO8jk4bP/FVj+ibNCy3HxZZNDXFtJrq4O5FdcdCDRIkDis5MiMnjh7UwEdHgRZJcHFYdzDdA== - hmac-drbg@^1.0.1: version "1.0.1" resolved "https://registry.yarnpkg.com/hmac-drbg/-/hmac-drbg-1.0.1.tgz#d2745701025a6c775a6c545793ed502fc0c649a1" From 1ea00ec863f7d8b845a754915ab9833ec154974b Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 14:24:31 +0100 Subject: [PATCH 12/30] :fire: Removed obsolete lougout code, and adds translations --- src/components/Settings/ConfigLauncher.vue | 2 +- src/components/Settings/SettingsContainer.vue | 27 ------------------- 2 files changed, 1 insertion(+), 28 deletions(-) diff --git a/src/components/Settings/ConfigLauncher.vue b/src/components/Settings/ConfigLauncher.vue index ac06658b..92cf2311 100644 --- a/src/components/Settings/ConfigLauncher.vue +++ b/src/components/Settings/ConfigLauncher.vue @@ -4,7 +4,7 @@ {{ $t('settings.config-launcher-label') }}
+ v-tooltip="tooltip($t('settings.config-launcher-tooltip'))" />
diff --git a/src/components/Settings/SettingsContainer.vue b/src/components/Settings/SettingsContainer.vue index 00637f08..9c6a1bf6 100644 --- a/src/components/Settings/SettingsContainer.vue +++ b/src/components/Settings/SettingsContainer.vue @@ -37,7 +37,6 @@ import ItemSizeSelector from '@/components/Settings/ItemSizeSelector'; import AppButtons from '@/components/Settings/AppButtons'; import KeyboardShortcutInfo from '@/components/Settings/KeyboardShortcutInfo'; import AppInfoModal from '@/components/Configuration/AppInfoModal'; -import { logout as registerLogout } from '@/utils/Auth'; import IconOpen from '@/assets/interface-icons/config-open-settings.svg'; import IconClose from '@/assets/interface-icons/config-close.svg'; import { @@ -88,13 +87,6 @@ export default { getInitialTheme() { return this.appConfig.theme || ''; }, - logout() { - registerLogout(); - this.$toasted.show('Logged Out'); - setTimeout(() => { - location.reload(true); // eslint-disable-line no-restricted-globals - }, 100); - }, isUserLoggedIn() { return !!localStorage[localStorageKeys.USERNAME]; }, @@ -199,25 +191,6 @@ export default { } } - svg.logout-icon { - path { - fill: var(--settings-text-color); - } - width: 1rem; - height: 1rem; - margin: 0.35rem 0.2rem; - padding: 0.2rem; - text-align: center; - background: var(--background); - border: 1px solid var(--settings-text-color);; - border-radius: var(--curve-factor); - cursor: pointer; - &:hover, &.selected { - background: var(--settings-text-color); - path { fill: var(--background); } - } - } - @include tablet { section { display: block; From 4ead7b6742fb78abb9aeaa47f39489eb35578032 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 14:31:18 +0100 Subject: [PATCH 13/30] :adhesive_bandage: Re: #123 - Fixes cut-off text --- src/components/Settings/ConfigLauncher.vue | 1 + 1 file changed, 1 insertion(+) diff --git a/src/components/Settings/ConfigLauncher.vue b/src/components/Settings/ConfigLauncher.vue index 92cf2311..c9b0f267 100644 --- a/src/components/Settings/ConfigLauncher.vue +++ b/src/components/Settings/ConfigLauncher.vue @@ -73,6 +73,7 @@ export default { display: flex; flex-direction: column; color: var(--settings-text-color); + min-width: 3.2rem; svg { path { fill: var(--settings-text-color); From 179c9edbdf05f203f82a6b083de8c8f5628c53e2 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 15:12:30 +0100 Subject: [PATCH 14/30] :man_astronaut: Adds Owners file for PR assignments --- .github/CODEOWNERS | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) create mode 100644 .github/CODEOWNERS diff --git a/.github/CODEOWNERS b/.github/CODEOWNERS new file mode 100644 index 00000000..90d307e9 --- /dev/null +++ b/.github/CODEOWNERS @@ -0,0 +1,16 @@ +# Code Owners helps give greater control to those who developed a feature +# PR's which modify files that you own will be marked as trusted +# After developing a feature, you can add yourself as it's owner +# Each line starts with file pattern, followed by one or more owners +# Codeowners Docs: https://github.blog/2017-07-06-introducing-code-owners/ + +# Repo Owner +* @lissy93 + +# Translations +src/assets/locales/de.json @niklashere +src/assets/locales/nl.json @evroon + +# Bot PR Permissions +docs/assets/CONTRIBUTORS.svg @liss-bot +docs/*.md @liss-bot From 61a3e6ba54996c098a5e672476b3dc28533f5997 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 15:13:01 +0100 Subject: [PATCH 15/30] :construction_worker: Adds GH action to assign reviewer based on code owner --- .github/workflows/assign-reviewer.yml | 13 +++++++++++++ 1 file changed, 13 insertions(+) create mode 100644 .github/workflows/assign-reviewer.yml diff --git a/.github/workflows/assign-reviewer.yml b/.github/workflows/assign-reviewer.yml new file mode 100644 index 00000000..f6f8d1a5 --- /dev/null +++ b/.github/workflows/assign-reviewer.yml @@ -0,0 +1,13 @@ +# Automatically assigns a reviewer to a PR, based on who owns the modified files +# Uses the ./.github/CODEOWNERS file to determine ownership of file patterns +on: [pull_request] +jobs: + autolabeler-codeowners: + runs-on: ubuntu-latest + name: Assign Reviewer + steps: + - uses: actions/checkout@v1 + - name: Find code owner, assign reviewer + uses: pratikmallya/autolabeler-codeowners@master + with: + githubToken: ${{ secrets.GITHUB_TOKEN }} From c29e7105e22111288653e84250f5c90f1b33c6f2 Mon Sep 17 00:00:00 2001 From: Alicia Sykes Date: Sat, 7 Aug 2021 15:15:53 +0100 Subject: [PATCH 16/30] :adhesive_bandage: Fixed a bunch of minor UI things --- src/components/Configuration/JsonEditor.vue | 5 ++++- src/components/Settings/ThemeSelector.vue | 6 +++++- src/styles/color-themes.scss | 7 ++++++- src/views/Home.vue | 2 +- 4 files changed, 16 insertions(+), 4 deletions(-) diff --git a/src/components/Configuration/JsonEditor.vue b/src/components/Configuration/JsonEditor.vue index 99f0cffe..a9ae07f5 100644 --- a/src/components/Configuration/JsonEditor.vue +++ b/src/components/Configuration/JsonEditor.vue @@ -4,7 +4,6 @@
@@ -293,6 +292,10 @@ div.save-options { } } +.jsoneditor-container.min-box { + height: 58vh; +} + .jsoneditor, .jsoneditor-menu { border-color: var(--primary); } diff --git a/src/components/Settings/ThemeSelector.vue b/src/components/Settings/ThemeSelector.vue index 3b6dc3ea..f5574628 100644 --- a/src/components/Settings/ThemeSelector.vue +++ b/src/components/Settings/ThemeSelector.vue @@ -126,6 +126,7 @@ export default {