🔀 Merge pull request #226 from Lissy93/REFACTOR/improved-error-handling

[REFACTOR] Improved error handling
This commit is contained in:
Alicia Sykes 2021-09-12 22:41:44 +01:00 committed by GitHub
commit c0545f1b97
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
43 changed files with 415 additions and 211 deletions

View File

@ -1,5 +1,11 @@
# Changelog
## ⚡️ 1.7.7 - Improved Error Handling [PR #226](https://github.com/Lissy93/dashy/pull/226)
- Errors can be viewed via the UI (Config menu --> App Info)
- Service workers should be disabled by default
- Also renames actions to be easier to maintain
- Updates docs to include release schedule + merge strategy
## ✨ 1.7.6 - Adds Multi-Search Support with Bangs [PR #224](https://github.com/Lissy93/dashy/pull/224)
- Adds option for user to add custom search bangs, in order to specify search engine/ target app. Re: #206

View File

@ -1,5 +1,5 @@
# Based on a label applied to an issue, the bot will add a comment with some additional info
name: Post Status from Label
name: 🎯 Auto-Reply to Labeled Tickets
on:
issues:
types:

View File

@ -1,5 +1,5 @@
# Creates a new tag, whenever the app version (in package.json) is updated in master
name: Create Tag
name: 🏗️ Create Tag on Version Change
on:
push:
branches:

View File

@ -1,5 +1,5 @@
# This action builds and deploys the master branch
name: Deploy demo of current version
name: 🏗️ Build App to Branch
on:
push:
branches: [ master ]

View File

@ -1,5 +1,5 @@
# Caches artifacts, including NPM dependencies, to speed up build times
name: Caching Atrifacts
name: 🏗️ Caching Artifacts
on: push
jobs:
build:

View File

@ -1,5 +1,5 @@
# Close any issue that does not match any of the issue templates
name: Close Non-Compliant Issues
name: 🎯 Close Incomplete Issues
on:
issues:
types: [opened, edited]

View File

@ -1,5 +1,5 @@
# Closes any issues that no longer have user interaction
name: 'Close stale issues and PRs'
name: 🎯 Close Stale Issues
on:
workflow_dispatch:
schedule:

View File

@ -1,5 +1,5 @@
# Lints code merged into master branch
name: Lint Code Base
name: 🌈 Lint Code Base
on:
pull_request:
branches: [master]

View File

@ -1,5 +1,5 @@
# Finds typos in the English language within the app, submits a PR with fixes
name: Auto-Fix Spelling
name: 🌈 Spelling Auto-Fix
on:
push:
branches: [ master ]

View File

@ -1,6 +1,6 @@
# Shows changes to yarn.lock in PR comment
# Useful for easily understanding dependency changes
name: Yarn Lock Changes
# Shows changes to any yarn.lock in PR comment
# Useful for easily understanding dependency changes and consequences
name: 💡 Show Dependency Changes
on: [pull_request]
jobs:
check:

View File

@ -1,6 +1,6 @@
# Builds a Docker image from with latest tag when master branch is updated
# The publishes it to GitHub container registry as a package
name: Build and Publish Docker Image to GHCR
name: 🏗️ Build + Publish Docker Image to GHCR
on:
workflow_dispatch:
push:

View File

@ -1,6 +1,6 @@
# Inserts list of contributors and community members into ./docs/credits.md
# Also generates an SVG showing all contributors, which is embedded into readme
name: Contributors
name: 📊 Generate Contributor Credits
on:
workflow_dispatch: # Manual dispatch
schedule:

View File

@ -1,9 +1,30 @@
# Adds a comment to new PRs, showing the compressed size and size difference of new code
name: Compressed Size
# And labels the PR based on the number of lines changes
name: 🌈 Check PR Size
on: [pull_request]
jobs:
build:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v2
- uses: preactjs/compressed-size-action@v2
- name: Checkout
uses: actions/checkout@v2
# Find and comment with compressed size
- name: Get Compressed Size
uses: preactjs/compressed-size-action@v2
with:
repo-token: ${{ secrets.BOT_GITHUB_TOKEN }}
pattern: "./dist/**/**"
# Check number of lines of code added
- name: Label based on Lines of Code
uses: codelytv/pr-size-labeler@v1
with:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}
xs_max_size: '10'
s_max_size: '100'
m_max_size: '500'
l_max_size: '1000'
fail_if_xl: 'false'
message_if_xl: >
It looks like this PR is very large (over 1000 lines).
Try to avoid addressing multiple issues in a single PR, and
in the future consider breaking large tasks down into smaller steps.

View File

@ -1,6 +1,6 @@
# Will add a comment and close new issues opened by users that may be spam, or have not starred
# Is still a work in progress, will also detect if user has previous activity in repo and check when joined GH
name: Issue Spam Control
name: 🎯 Issue Spam Control
on:
issues:
types: [opened, reopened]

View File

@ -1,5 +1,5 @@
# Will translate any issues opened in foraign language, and add the English translation as a comment
name: 'Issue Translator'
name: 🎯 Issue Translator
on:
issue_comment:
types: [created]

View File

@ -1,6 +1,6 @@
# Adds a label to any issues raised by a sponsor of Lissy93/Dashy
# In order to allow their request can be prioritized
name: Label sponsors
name: 🎯 Label sponsors
on:
pull_request:
types: [opened]

View File

@ -1,5 +1,5 @@
# Replies with a random looks-good GIF, when a PR is reviewed with a LGTM comment
name: Add Random LGTM GIF
name: 💡 Random LGTM GIF
on:
issue_comment: { types: [created] }
pull_request_review: { types: [submitted] }

View File

@ -1,5 +1,5 @@
# Detects offensive language in comments and takes reaction
name: Mind your language
name: 🎯 Mind your language
on:
issues:
types:

View File

@ -1,5 +1,5 @@
# Adds comments to PR, based on which files are modified
name: PR Commenter
name: 💡 PR Commenter
on: [ pull_request_target ]
jobs:
pr-comment:

View File

@ -1,5 +1,5 @@
# Finds any TODO notes within the code, and opens up an issue for it to be fixed
name: Open issue for Todos
# Finds any TO-DO notes within the code, and opens up an issue for it to be fixed
name: 🌈 Open issue for Todos
on: ["push"]
jobs:
build:

View File

@ -1,5 +1,5 @@
# Adds a comment to all issues & PRs that were fixed on a new release
name: Release Issue Commenter
name: 💡 Update Issue after Release
on:
release:
types: [published]

View File

@ -0,0 +1,20 @@
# Generates diagram showing file breakdown
name: 📊 Generate Repo Visualization
on:
workflow_dispatch: # Manual dispatch
schedule:
- cron: '0 1 * * 0' # At 01:00 on Sunday.
jobs:
build:
runs-on: ubuntu-latest
steps:
- name: Checkout code
uses: actions/checkout@master
- name: Update diagram
uses: githubocto/repo-visualizer@0.7.1
with:
root_path: 'src/'
output_file: docs/assets/repo-visualization.svg
excluded_paths: dist,node_modules
commit_message: ':yellow_heart: Updates repo diagram'
branch: master

View File

@ -1,5 +1,5 @@
# Uses Snyk to check for potential vulnerabilities, then sends results to GH security tab
name: Check for vulnerabilities with Snyk
name: 💡 Vulnerability Scanning
on: push
jobs:
security:

View File

@ -1,11 +0,0 @@
# After a PR is merged, the linked issue will be updated with a comment, based on commit message
name: Update Issue After PR
on: push
jobs:
checkCommit:
name: Comment From Commit
runs-on: ubuntu-latest
steps:
- uses: adamzolyak/commit-issue-commenter-action@master
env:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN }}

View File

@ -1,5 +1,5 @@
# Uses the contents of the ./docs directory for Dashy's GH Wiki page
name: Wiki Sync
name: 📊 Wiki Sync
on:
workflow_dispatch: # Manual dispatch
schedule:

View File

@ -54,6 +54,7 @@
- [💖 Supporting Dashy](#supporting-dashy-)
- [🏆 Credits](#credits-)
- [🧱 Developing](#developing-)
- [🗞️ Release Schedule](#release-schedule-)
- [📘 Documentation](#documentation-)
- [🛣️ Roadmap](#roadmap-)
- [🙌 Alternatives](#alternatives-)
@ -255,7 +256,7 @@ You can also specify an time interval in seconds under `appConfig.statusCheckInt
> For full authentication documentation, see: [**Authentication**](./docs/authentication.md)
Dashy now has full support for secure single-sign-on using [Keycloak](https://www.keycloak.org/)! See [setup docs](/docs/authentication.md#keycloak) for a full usage guide
Dashy now has full support for secure single-sign-on using [Keycloak](https://www.keycloak.org/)! This provides secure, easy single-sign on. See [setup docs](/docs/authentication.md#keycloak) for a full usage guide
There is also a simple login feature for basic access control, which doesn't require any additional setup. To enable this feature, add an `auth` attribute under `appConfig`, containing an array of `users`, each with a username, SHA-256 hashed password and optional user type.
@ -284,7 +285,7 @@ appConfig:
/>
</p>
**Note**: Using the above method involves access control being handled on the frontend, and therefore in security-critical situations, it is recommended to use an alternate method for authentication. Keycloak is [natively supported](docs/authentication.md#keycloak), but you could also use [Authelia](https://www.authelia.com/), a VPN or web server and firewall rules. Instructions for all of these can be found [in the docs](docs/authentication.md#alternative-authentication-methods).
**Note**: The simple auth method handles access control on the frontend, and therefore in security-critical situations, it is recommended to use an alternate method for authentication, like [Keycloak](docs/authentication.md#keycloak) or one of the [alternatives](docs/authentication.md#alternative-authentication-methods).
**[⬆️ Back to Top](#dashy)**
@ -308,7 +309,7 @@ In the workspace view, you can keep previously opened websites/ apps open in the
<img width="500" src="https://i.ibb.co/vmZdSRt/dashy-context-menu-2.png" />
</p>
The modal and workspace views work by rendering the target application in an iframe. For this to work, the HTTP response header [`X-Frame-Options`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) for a given application needs to be set to `ALLOW`. If you are getting a `Refused to Connect` error then this header is set to `DENY` (or `SAMEORIGIN` and it's on a different host). Here are [instructions on how to do this](./docs/troubleshooting.md#refused-to-connect-in-modal-or-workspace-view) with common web servers.
The modal and workspace views work by rendering the target application in an iframe. If you are getting a a `Refused to Connect` error, then you need to set the HTTP response header [`X-Frame-Options`](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/X-Frame-Options) to `ALLOW [url-for-dashy]`. See [the docs](./docs/troubleshooting.md#refused-to-connect-in-modal-or-workspace-view) for instructions on how to do this.
---
@ -368,10 +369,24 @@ To search the web directly through Dashy, just press enter after typing your que
To disable web search all together, set: `webSearch: { disableWebSearch: true }`
```yaml
appConfig:
webSearch:
searchEngine: duckduckgo
openingMethod: newtab
webSearch:
searchEngine: duckduckgo
openingMethod: newtab
```
With the web search, you can also define your own bangs, to redirect results to any given app, website or search engine, when the query is preceded with a certain character sequence (usually beginning in `/`, `!` or `:`).
For example, with the below code, typing `:git dashy` will search GitHub for Dashy, or `/w docker` will open the Docker Wikipedia page.
```yaml
webSearch:
searchBangs:
/r: reddit
/w: wikipedia
/s: https://whoogle.local/search?q=
':wolf': wolframalpha
':so': stackoverflow
':git': github
```
Hit `Esc` at anytime to close any open apps, clear the search field, or hide any modals.
@ -403,9 +418,9 @@ A full list of available config options can be found [here](./docs/configuring.m
Dashy has an **optional** built-in feature for securely backing up your config to a hosted cloud service, and then restoring it on another instance. This feature is totally optional, and if you do not enable it, then Dashy will not make any external network requests.
This is useful not only for backing up your configuration off-site, but it also enables Dashy to be used without having write a YAML config file, and makes it possible to use a public hosted instance, without the need to self-host.
This is useful not only for backing up your configuration off-site, but it also enables Dashy to be used without having write a YAML config file, and in the future there will allow the use of the public hosted instance of Dashy for users without a server.
All data is encrypted before being sent to the backend. In Dashy, this is done in [`CloudBackup.js`](https://github.com/Lissy93/dashy/blob/master/src/utils/CloudBackup.js), using [crypto.js](https://github.com/brix/crypto-js)'s AES method, using the users chosen password as the key. The data is then sent to a [Cloudflare worker](https://developers.cloudflare.com/workers/learning/how-workers-works) (a platform for running serverless functions), and stored in a [KV](https://developers.cloudflare.com/workers/learning/how-kv-works) data store.
All data is fully E2E encrypted before being sent to the backend. In Dashy, this is done in [`CloudBackup.js`](https://github.com/Lissy93/dashy/blob/master/src/utils/CloudBackup.js), using [crypto.js](https://github.com/brix/crypto-js)'s AES method, with the users chosen password as the key. The data is then sent to a [Cloudflare worker](https://developers.cloudflare.com/workers/learning/how-workers-works), and stored in a [KV](https://developers.cloudflare.com/workers/learning/how-kv-works) data store.
<p align="center">
<img width="400" src="https://i.ibb.co/yBrVN4N/dashy-cloud-sync.png" />
@ -534,11 +549,13 @@ Huge thanks to the sponsors helping to support Dashy's development!
#### Packages
Dashy was made possible thanks to the following packages and components. For more details on each, see [Dependency Credits](./docs/credits.md#dependencies-). Full credit to their respective authors.
- Utils: [`crypto-js`](https://github.com/brix/crypto-js), [`axios`](https://github.com/axios/axios), [`ajv`](https://github.com/ajv-validator/ajv)
- Components: [`vue-select`](https://github.com/sagalbot/vue-select) by @sagalbot, [`vue-js-modal`](https://github.com/euvl/vue-js-modal) by @euvl, [`v-tooltip`](https://github.com/Akryum/v-tooltip) by @Akryum, [`vue-material-tabs`](https://github.com/jairoblatt/vue-material-tabs) by @jairoblatt, [`JsonEditor`](https://github.com/josdejong/jsoneditor) by @josdejong, [`vue-toasted`](https://github.com/shakee93/vue-toasted) by @shakee93
- Core: Vue.js, TypeScript, SCSS, Node.js, ESLint
- The backup & sync server uses [Cloudflare workers](https://workers.cloudflare.com/) plus [KV](https://developers.cloudflare.com/workers/runtime-apis/kv) and [web crypto](https://developers.cloudflare.com/workers/runtime-apis/web-crypto)
- Services: The 1-Click demo uses [Play-with-Docker Labs](https://play-with-docker.com/). Code is hosted on [GitHub](https://github.com), Docker image is hosted on [DockerHub](https://hub.docker.com/), and the demos are hosted on [Netlify](https://www.netlify.com/).
- **Utils**: [`crypto-js`](https://github.com/brix/crypto-js), [`axios`](https://github.com/axios/axios), [`ajv`](https://github.com/ajv-validator/ajv)
- **Components**: [`vue-select`](https://github.com/sagalbot/vue-select) by @sagalbot, [`vue-js-modal`](https://github.com/euvl/vue-js-modal) by @euvl, [`v-tooltip`](https://github.com/Akryum/v-tooltip) by @Akryum, [`vue-material-tabs`](https://github.com/jairoblatt/vue-material-tabs) by @jairoblatt, [`JsonEditor`](https://github.com/josdejong/jsoneditor) by @josdejong, [`vue-toasted`](https://github.com/shakee93/vue-toasted) by @shakee93
- **Core**: Vue.js, TypeScript, SCSS, Node.js, ESLint
- **Backup & sync**: This server uses [Cloudflare workers](https://workers.cloudflare.com/) plus [KV](https://developers.cloudflare.com/workers/runtime-apis/kv) and [web crypto](https://developers.cloudflare.com/workers/runtime-apis/web-crypto)
- **Services**: The 1-Click demo uses [Play-with-Docker Labs](https://play-with-docker.com/). Code is hosted on [GitHub](https://github.com), Docker image is hosted on [DockerHub](https://hub.docker.com/), and the demos are hosted on [Netlify](https://www.netlify.com/).
- **Actions**: [`action-autotag`](https://github.com/butlerlogic/action-autotag) by @butlerlogic, [`contributors-list`](https://github.com/bubkoo/contributors-list), [`github-pages-deploy-action`](https://github.com/JamesIves/github-pages-deploy-action), [`is-sponsor-label-action`](https://github.com/JasonEtco/is-sponsor-label-action), [`issues-translate-action`](https://github.com/tomsun28/issues-translate-action) by @tomsun28, [`pr-commenter-action`](https://github.com/exercism/pr-commenter-action) by @exercism, [`snyk node`](https://github.com/snyk/actions/node) by @snyk, and [`yarn-lock-changes`](https://github.com/Simek/yarn-lock-changes) by @Simek. See [all action credits](/docs/credits.md#actions)
**[⬆️ Back to Top](#dashy)**
@ -586,6 +603,23 @@ If you're new to web development, I've put together a short [list of resources](
**[⬆️ Back to Top](#dashy)**
---
## Release Schedule 🗞️
> For full release, automation and CI documentation, see: [**Releases & Workflows**](./docs/release-workflow.md)
Dashy is under active development, with features, improvements and changes pushed almost daily.
We're using [Semantic Versioning](https://semver.org/), to indicate major, minor and patch versions. You can find the current version number in the readme, and check your apps version under the config menu. The version number is pulled from the [package.json](https://github.com/Lissy93/dashy/blob/master/package.json#L3) file.
Typically there is a new major release every 2 weeks, usually on Sunday, and you can view these under the [Releases Page](https://github.com/Lissy93/dashy/releases). Each release will create a new [tag on GitHub](https://github.com/Lissy93/dashy/tags), and each major release will also result in the creation of a new [tag on DockerHub](https://hub.docker.com/r/lissy93/dashy/tags), so that you can fix your container to a certain version.
For a full breakdown of each change, you can view the [Changelog](https://github.com/Lissy93/dashy/blob/master/.github/CHANGELOG.md). Each new feature or significant change needs to be submitted through a pull request, which makes it easy to review and track these changes, and roll back if needed.
**[⬆️ Back to Top](#dashy)**
---
## Documentation 📘
> For full docs, see: **[Documentation Contents](./docs/readme.md)**
#### Running Dashy
@ -601,6 +635,7 @@ If you're new to web development, I've put together a short [list of resources](
- 💖 [Contributing](/docs/contributing.md) - How to contribute to Dashy
- 🌟 [Showcase](/docs/showcase.md) - See how others are using Dashy, and share your dashboard
- 🏆 [Credits](/docs/credits.md) - Shout out to the amazing people who have contributed so far
- 🗞️ [Release Workflow](/docs/release-workflow.md) - Info about releases, CI and automated tasks
#### Feature Docs
- 🛡️ [Authentication](/docs/authentication.md) - Guide to setting up authentication to protect your dashboard

View File

@ -96,7 +96,7 @@ Tips:
**`sentryDsn`** | `boolean` | _Optional_ | If you need to monitor errors in your instance, then you can use Sentry to collect and process bug reports. Sentry can be self-hosted, or used as SaaS, once your instance is setup, then all you need to do is pass in the DSN here, and enable error reporting. You can learn more on the [Sentry DSN Docs](https://docs.sentry.io/product/sentry-basics/dsn-explainer/). Note that this will only ever be used if `enableErrorReporting` is explicitly enabled.
**`disableSmartSort`** | `boolean` | _Optional_ | For the most-used and last-used app sort functions to work, a basic open-count is stored in local storage. If you do not want this to happen, then disable smart sort here, but you wil no longer be able to use these sort options. Defaults to `false`.
**`disableUpdateChecks`** | `boolean` | _Optional_ | If set to true, Dashy will not check for updates. Defaults to `false`.
**`disableServiceWorker`** | `boolean` | _Optional_ | Service workers cache web applications to improve load times and offer basic offline functionality, and are enabled by default in Dashy. The service worker can sometimes cause older content to be cached, requiring the app to be hard-refreshed. If you do not want SW functionality, or are having issues with caching, set this property to `true` to disable all service workers.
**`enableServiceWorker`** | `boolean` | _Optional_ | Service workers cache web applications to improve load times and offer basic offline functionality, and are enabled by default in Dashy. The service worker can sometimes cause older content to be cached, requiring the app to be hard-refreshed. If you do not want SW functionality, or are having issues with caching, set this property to `true` to disable all service workers.
**`disableContextMenu`** | `boolean` | _Optional_ | If set to `true`, the custom right-click context menu will be disabled. Defaults to `false`.
**[⬆️ Back to Top](#configuring)**

View File

@ -19,8 +19,6 @@ If you're adding new features, you may want to check out the [Development Guides
- [Code Style Guide](#style-guide)
- [Application Structure](#application-structure)
- [Development Tools](#development-tools)
- [Release Schedule](#release-schedule)
- [Automated Workflows](#automated-workflows)
- [Misc / Notes](#notes)
## Setting up the Dev Environment
@ -302,68 +300,6 @@ The easiest method of checking performance is to use Chromium's build in auditin
---
## Release Schedule
We're using [Semantic Versioning](https://semver.org/), to indicate major, minor and patch versions. You can find the current version number in the readme, and check your apps version under the config menu. The version number is pulled from the [package.json](https://github.com/Lissy93/dashy/blob/master/package.json#L3) file. Typically there is a new major release every 2 weeks, usually on Sunday, and you can view these under the [Releases Page](https://github.com/Lissy93/dashy/releases). Each release will create a new [tag on GitHub](https://github.com/Lissy93/dashy/tags), and each major release will also result in the creation of a new [tag on DockerHub](https://hub.docker.com/r/lissy93/dashy/tags), so that you can fix your container to a certain version. For a full breakdown of each change, you can view the [Changelog](https://github.com/Lissy93/dashy/blob/master/.github/CHANGELOG.md). Each new feature or significant change needs to be submitted through a pull request, which makes it easy to review and track these changes, and roll back if needed.
---
## Automated Workflows
Dashy makes heavy use of [GitHub Actions](https://github.com/features/actions) to fully automate the checking, testing, building, deploying of the project, as well as administration tasks like management of issues, tags, releases and documentation. The following section outlines each workflow, along with a link the the action file, current status and short description. A lot of these automations were made possible using community actions contributed to GH marketplace by some amazing people.
### Code Processing
Action | Description
--- | ---
**Code Linter**<br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/code-linter.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/code-linter.yml) | After a pull request is created, all new code changes will be linted, and the CI will fail with a helpful message if the code has any formatting inconsistencies
**Code Spell Check**<br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/code-spell-check.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/code-spell-check.yml) | After a PR submitted, all auto-fixable spelling errors will be detected, then Liss-Bot will create a separate PR to propose the fixes
**Dependency Update Summary** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/dependency-updates-summary.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/dependency-updates-summary.yml) | After a PR is submitted, if any of the dependencies are modified, then Liss-Bot will add a comment, explaining which packages have been added, removed, updated or downgraded, as well as other helpful info
**Get Size** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/get-size.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/get-size.yml) | Adds comment to PR if the size of the built + bundled application has changed compared to the previous version
**Security Scan** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/security-scanning.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/security-scanning.yml) | Uses Snyk to scan the code and dependencies after a PR. Will add a comment and cause the build to fail if a new vulnerability or potential issue is present
### Releases
Action | Description
--- | ---
**Create Tag** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/auto-tag-pr.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/auto-tag-pr.yml) | Whenever the version indicated in package.json is updates, a new GitHub tag will be created for that point in time
**Build App** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/build-app.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/build-app.yml) | After changes are merged into the master branch, the app will be build, with output pushed to the `dev-demo` branch
**Cache Artifacts** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/cache-artifacts.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/cache-artifacts.yml) | After build, returned files will be cached for future actions for that commit
**Docker Publish** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/docker-publish.yml) | After PR is merged, the multi-architecture Docker container will be built, and then published to GHCR
### Issue Management
Action | Description
--- | ---
**Close Incomplete Issues** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/close-incomplete-issues.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/close-incomplete-issues.yml) | Issues which do not match any of the issue templates will be closed, and a comment posted explaining why
**Close Stale Issues** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/close-stale-issues.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/close-stale-issues.yml) | Issues which have not been updated for 6 weeks will have a comment posted to them. If the author does not reply within the next week, then the issue will be marked as stale and closed. The original author may still reopen the issue at any time
**Close Potential Spam Issues** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/issue-spam-control.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/issue-spam-control.yml) | Auto-closes issues, and adds a comment if it was submitted by a user who hasn't yet interacted with the repo, is new to GitHub and has not starred the repository. The comment will advise them to check their issue is complete, and then allow them to reopen it
**Issue Translator** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/issue-translator.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/issue-translator.yml) | Auto-translates any comments and issues that were written in any language other than English, and posts the translation as a comment below
**Label Sponsors** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/label-sponsors.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/label-sponsors.yml) | Adds a special label to any issues or pull requests raised by users who are sponsoring the project via GitHub, so that they can get priority support
**LGTM Comment**<br/>[![Add Random LGTM GIF](https://github.com/Lissy93/dashy/actions/workflows/lgtm-comment.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/lgtm-comment.yml) | When a PR review contains the words LGTM (looks good to me), the Liss-Bot will reply with a random celebratory or thumbs up GIF, just as a bit of fun
**Mind your Language** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/mind-your-language.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/mind-your-language.yml) | Replies to any comment (on issue or PR) that contains profanities, offensive or inappropriate language with a polite note reminding the user of the code of conduct
**Release Notifier** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/release-commenter.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/release-commenter.yml) | Once a release has been published which fixes an issue, a comment will be added to the relevant issues informing the user who raised it that it was fixed in the current release
**Update Issue after Merge** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/update-issue-after-pr.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/update-issue-after-pr.yml) | After a PR which fixes an issue is merged, Liss-Bot will add a comment to said issue based on the git commit message
**Auto Add Comment Based on Tag** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/add-comment-from-tag.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/add-comment-from-tag.yml) | Will add comment with useful info to certain issues, based on the tag applied
### PR Management
Action | Description
--- | ---
**PR Commenter** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/pr-commenter.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/pr-commenter.yml) | Adds comment with helpful info to pull requests, based on which files have been changes
**Issue from Todo Code** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/raise-issue-from-todo.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/raise-issue-from-todo.yml) | When a `todo` note is found in the code after a PR, then Liss-Bot will automatically raise an issue, so that the todo can be addressed/ implemented. The issue will be closed once the todo has been implemented or removed
### Documentation & Reports
Action | Description
--- | ---
**Generate Credits** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/generate-credits.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/generate-credits.yml) | Generates a report, including contributors, collaborators, sponsors, bots and helpful users. Will then insert a markdown table with thanks to these GitHub users and links to their profiles into the Credits page, as well as a summary of sponsors and top contributors into the main readme
**Generate Issue Summary** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/generate-issue-summary.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/generate-issue-summary.yml) | Creates a markdown report of opened and closed linked-issues, sorted by category
**Wiki Sync** <br/>[![Workflow Status](https://github.com/Lissy93/dashy/actions/workflows/wiki-sync.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/wiki-sync.yml) | Generates and publishes the repositories wiki page using the markdown files within the docs directory
---
## Notes
### Known Warnings

View File

@ -111,13 +111,13 @@ Dashy supports both basic auth, as well as server-based SSO using Keycloak. Full
## Disabling Features
You may wish to disable features that you don't want to use, if they involve storing data in the browser or making network requests.
- To disable update checks (makes external request to GH), set `appConfig.disableUpdateChecks: true`
- To disable the service worker (stores cache of app in browser data), set `appConfig.disableServiceWorker: true`
- To disable smart-sort (uses local storage), set `appConfig.disableSmartSort: true`
- To disable update checks (makes external request to GH), set `appConfig.disableUpdateChecks: true`
- To disable web search (redirect to external / internal content), set `appConfig.disableWebSearch: true`
- To keep status checks disabled (external/ internal requests), set `appConfig.statusCheck: false`
- To keep font-awesome icons disabled (external requests), set `appConfig.enableFontAwesome: false`
- To keep error reporting disabled (external requests and data collection), set `appConfig.enableErrorReporting: false`
- To keep status checks disabled (external/ internal requests), set `appConfig.statusCheck: false`
- To keep the service worker disabled (stores cache of app in browser data), set `appConfig.enableServiceWorker: false`
---

View File

@ -13,6 +13,7 @@
- [Contributing](/docs/contributing.md) - How you can help keep Dashy alive
- [Showcase](/docs/showcase.md) - See how others are using Dashy, and share your dashboard
- [Credits](/docs/credits.md) - List of people and projects that have made Dashy possible
- [Release Workflow](/docs/release-workflow.md) - Info about releases, CI and automated tasks
### Feature Docs
- [Authentication](/docs/authentication.md) - Guide to setting up authentication to protect your dashboard

131
docs/release-workflow.md Normal file
View File

@ -0,0 +1,131 @@
# Releases and Workflows
- [Release Schedule](#release-schedule)
- [Automated Workflows](#automated-workflows)
- [Git Strategy](#git-strategy)
## Release Schedule
We're using [Semantic Versioning](https://semver.org/), to indicate major, minor and patch versions. You can find the current version number in the readme, and check your apps version under the config menu. The version number is pulled from the [package.json](https://github.com/Lissy93/dashy/blob/master/package.json#L3) file.
Typically there is a new major release every 2 weeks, usually on Sunday, and you can view these under the [Releases Page](https://github.com/Lissy93/dashy/releases). Each release will create a new [tag on GitHub](https://github.com/Lissy93/dashy/tags), and each major release will also result in the creation of a new [tag on DockerHub](https://hub.docker.com/r/lissy93/dashy/tags), so that you can fix your container to a certain version.
For a full breakdown of each change, you can view the [Changelog](https://github.com/Lissy93/dashy/blob/master/.github/CHANGELOG.md). Each new feature or significant change needs to be submitted through a pull request, which makes it easy to review and track these changes, and roll back if needed.
---
## Automated Workflows
Dashy makes heavy use of [GitHub Actions](https://github.com/features/actions) to fully automate the checking, testing, building, deploying of the project, as well as administration tasks like management of issues, tags, releases and documentation. The following section outlines each workflow, along with a link the the action file, current status and short description. A lot of these automations were made possible using community actions contributed to GH marketplace by some amazing people.
### Code Processing
Action | Description
--- | ---
**Code Linter**<br/>[![code-linter.yml](https://github.com/Lissy93/dashy/actions/workflows/code-linter.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/code-linter.yml) | After a pull request is created, all new code changes will be linted, and the CI will fail with a helpful message if the code has any formatting inconsistencies
**Code Spell Check**<br/>[![code-spell-check.yml](https://github.com/Lissy93/dashy/actions/workflows/code-spell-check.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/code-spell-check.yml) | After a PR submitted, all auto-fixable spelling errors will be detected, then Liss-Bot will create a separate PR to propose the fixes
**Dependency Update Summary** <br/>[![dependency-updates-summary.yml](https://github.com/Lissy93/dashy/actions/workflows/dependency-updates-summary.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/dependency-updates-summary.yml) | After a PR is submitted, if any of the dependencies are modified, then Liss-Bot will add a comment, explaining which packages have been added, removed, updated or downgraded, as well as other helpful info
**Get Size** <br/>[![get-size.yml](https://github.com/Lissy93/dashy/actions/workflows/get-size.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/get-size.yml) | Adds comment to PR if the size of the built + bundled application has changed compared to the previous version
**Security Scan** <br/>[![security-scanning.yml](https://github.com/Lissy93/dashy/actions/workflows/security-scanning.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/security-scanning.yml) | Uses Snyk to scan the code and dependencies after a PR. Will add a comment and cause the build to fail if a new vulnerability or potential issue is present
### Releases
Action | Description
--- | ---
**Create Tag** <br/>[![auto-tag-pr.yml](https://github.com/Lissy93/dashy/actions/workflows/auto-tag-pr.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/auto-tag-pr.yml) | Whenever the version indicated in package.json is updates, a new GitHub tag will be created for that point in time
**Build App** <br/>[![build-app.yml](https://github.com/Lissy93/dashy/actions/workflows/build-app.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/build-app.yml) | After changes are merged into the master branch, the app will be build, with output pushed to the `dev-demo` branch
**Cache Artifacts** <br/>[![cache-artifacts.yml](https://github.com/Lissy93/dashy/actions/workflows/cache-artifacts.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/cache-artifacts.yml) | After build, returned files will be cached for future actions for that commit
**Docker Publish** <br/>[![docker-publish.yml](https://github.com/Lissy93/dashy/actions/workflows/docker-publish.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/docker-publish.yml) | After PR is merged, the multi-architecture Docker container will be built, and then published to GHCR
### Issue Management
Action | Description
--- | ---
**Close Incomplete Issues** <br/>[![close-incomplete-issues.yml](https://github.com/Lissy93/dashy/actions/workflows/close-incomplete-issues.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/close-incomplete-issues.yml) | Issues which do not match any of the issue templates will be closed, and a comment posted explaining why
**Close Stale Issues** <br/>[![close-stale-issues.yml](https://github.com/Lissy93/dashy/actions/workflows/close-stale-issues.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/close-stale-issues.yml) | Issues which have not been updated for 6 weeks will have a comment posted to them. If the author does not reply within the next week, then the issue will be marked as stale and closed. The original author may still reopen the issue at any time
**Close Potential Spam Issues** <br/>[![issue-spam-control.yml](https://github.com/Lissy93/dashy/actions/workflows/issue-spam-control.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/issue-spam-control.yml) | Auto-closes issues, and adds a comment if it was submitted by a user who hasn't yet interacted with the repo, is new to GitHub and has not starred the repository. The comment will advise them to check their issue is complete, and then allow them to reopen it
**Issue Translator** <br/>[![issue-translator.yml](https://github.com/Lissy93/dashy/actions/workflows/issue-translator.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/issue-translator.yml) | Auto-translates any comments and issues that were written in any language other than English, and posts the translation as a comment below
**Label Sponsors** <br/>[![label-sponsors.yml](https://github.com/Lissy93/dashy/actions/workflows/label-sponsors.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/label-sponsors.yml) | Adds a special label to any issues or pull requests raised by users who are sponsoring the project via GitHub, so that they can get priority support
**LGTM Comment**<br/>[![lgtm-comment.yml](https://github.com/Lissy93/dashy/actions/workflows/lgtm-comment.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/lgtm-comment.yml) | When a PR review contains the words LGTM (looks good to me), the Liss-Bot will reply with a random celebratory or thumbs up GIF, just as a bit of fun
**Mind your Language** <br/>[![mind-your-language.yml](https://github.com/Lissy93/dashy/actions/workflows/mind-your-language.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/mind-your-language.yml) | Replies to any comment (on issue or PR) that contains profanities, offensive or inappropriate language with a polite note reminding the user of the code of conduct
**Release Notifier** <br/>[![release-commenter.yml](https://github.com/Lissy93/dashy/actions/workflows/release-commenter.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/release-commenter.yml) | Once a release has been published which fixes an issue, a comment will be added to the relevant issues informing the user who raised it that it was fixed in the current release
**Update Issue after Merge** <br/>[![update-issue-after-pr.yml](https://github.com/Lissy93/dashy/actions/workflows/update-issue-after-pr.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/update-issue-after-pr.yml) | After a PR which fixes an issue is merged, Liss-Bot will add a comment to said issue based on the git commit message
**Auto Add Comment Based on Tag** <br/>[![add-comment-from-tag.yml](https://github.com/Lissy93/dashy/actions/workflows/add-comment-from-tag.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/add-comment-from-tag.yml) | Will add comment with useful info to certain issues, based on the tag applied
### PR Management
Action | Description
--- | ---
**PR Commenter** <br/>[![pr-commenter.yml](https://github.com/Lissy93/dashy/actions/workflows/pr-commenter.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/pr-commenter.yml) | Adds comment with helpful info to pull requests, based on which files have been changes
**Issue from Todo Code** <br/>[![raise-issue-from-todo.yml](https://github.com/Lissy93/dashy/actions/workflows/raise-issue-from-todo.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/raise-issue-from-todo.yml) | When a `todo` note is found in the code after a PR, then Liss-Bot will automatically raise an issue, so that the todo can be addressed/ implemented. The issue will be closed once the todo has been implemented or removed
### Documentation & Reports
Action | Description
--- | ---
**Generate Credits** <br/>[![generate-credits.yml](https://github.com/Lissy93/dashy/actions/workflows/generate-credits.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/generate-credits.yml) | Generates a report, including contributors, collaborators, sponsors, bots and helpful users. Will then insert a markdown table with thanks to these GitHub users and links to their profiles into the Credits page, as well as a summary of sponsors and top contributors into the main readme
**Wiki Sync** <br/>[![wiki-sync.yml](https://github.com/Lissy93/dashy/actions/workflows/wiki-sync.yml/badge.svg)](https://github.com/Lissy93/dashy/actions/workflows/wiki-sync.yml) | Generates and publishes the repositories wiki page using the markdown files within the docs directory
---
## Git Strategy
### Git Flow
Like most Git repos, we are following the [Github Flow](https://guides.github.com/introduction/flow) standard.
1. Create a branch (or fork if you don'd have write acces)
2. Code some awesome stuff, then add and commit your changes
3. Create a Pull Request, complete the checklist and ensure the build succeeds
4. Follow up with any reviews on your code
5. Merge 🎉
### Git Branch Naming
The format of your branch name should be something similar to: `[TYPE]/[TICKET]_[TITLE]`
For example, `FEATURE/420_Awesome-feature` or `FIX/690_login-server-error`
### Commit Emojis
Using a single emoji at the start of each commit message, to indicate the type task, makes the commit ledger easier to understand, plus it looks cool.
- 🎨 `:art:` - Improve structure / format of the code.
- ⚡️ `:zap:` - Improve performance.
- 🔥 `:fire:` - Remove code or files.
- 🐛 `:bug:` - Fix a bug.
- 🚑️ `:ambulance:` - Critical hotfix
- ✨ `:sparkles:` - Introduce new features.
- 📝 `:memo:` - Add or update documentation.
- 🚀 `:rocket:` - Deploy stuff.
- 💄 `:lipstick:` - Add or update the UI and style files.
- 🎉 `:tada:` - Begin a project.
- ✅ `:white_check_mark:` - Add, update, or pass tests.
- 🔒️ `:lock:` - Fix security issues.
- 🔖 `:bookmark:` - Make a Release or Version tag.
- 🚨 `:rotating_light:` - Fix compiler / linter warnings.
- 🚧 `:construction:` - Work in progress.
- ⬆️ `:arrow_up:` - Upgrade dependencies.
- 👷 `:construction_worker:` - Add or update CI build system.
- ♻️ `:recycle:` - Refactor code.
- 🩹 `:adhesive_bandage:` - Simple fix for a non-critical issue.
- 🔧 `:wrench:` - Add or update configuration files.
- 🍱 `:bento:` - Add or update assets.
- 🗃️ `:card_file_box:` - Perform database schema related changes.
- ✏️ `:pencil2:` - Fix typos.
- 🌐 `:globe_with_meridians:` - Internationalization and translations.
For a full list of options, see [gitmoji.dev](https://gitmoji.dev/)
### PR Guidelines
Once you've made your changes, and pushed them to your fork or branch, you're ready to open a pull request!
For a pull request to be merged, it must:
- Must be backwards compatible
- The build, lint and tests (run by GH actions) must pass
- There must not be any merge conflicts
When you submit your PR, include the required info, by filling out the PR template. Including:
- A brief description of your changes
- The issue, ticket or discussion number (if applicable)
- For UI relate updates include a screenshot
- If any dependencies were added, explain why it was needed, state the cost associated, and confirm it does not introduce any security issues
- Finally, check the checkboxes, to confirm that the standards are met, and hit submit!

View File

@ -1,6 +1,6 @@
{
"name": "Dashy",
"version": "1.7.6",
"version": "1.7.7",
"license": "MIT",
"main": "server",
"scripts": {

View File

@ -1,26 +1,29 @@
<template>
<modal :name="modalName" :resizable="true" width="40%" height="60%" classes="dashy-modal">
<modal :name="modalName" :resizable="true" width="60%" height="60%" classes="dashy-modal">
<div class="about-modal">
<router-link to="/about">
<h2>Dashy</h2>
</router-link>
<AppVersion />
<router-link to="/about" class="title"><h2>App Info</h2></router-link>
<!-- App Version -->
<h3>Version</h3>
<AppVersion class="app-version" />
<!-- Error Log -->
<h3>Error Log</h3>
<pre v-if="errorLog" class="logs"><code>{{ errorLog }}</code></pre>
<p v-else>No recent errors detected :)</p>
<!-- Service Worker Status -->
<h3>Service Worker Status</h3>
<code v-html="serviceWorkerInfo">{{ serviceWorkerInfo }}</code>
<br>
<pre class="logs"><code>{{ serviceWorkerInfo }}</code></pre>
<!-- Config Validation Status -->
<h3>Config Validation Status</h3>
<code>{{getIsConfigValidStatus()}}</code>
<br>
<pre class="logs"><code>{{getIsConfigValidStatus()}}</code></pre>
<hr />
<!-- Help Links -->
<h3>Help & Support</h3>
<ul>
<li><a href="https://git.io/JnqPR">Report a Bug</a></li>
<li><a href="https://git.io/JnDxL">Request a Feature</a></li>
<li><a href="https://git.io/JnDxs">Ask a Question</a></li>
<li><a href="https://git.io/JnDxn">Leave Feedback</a></li>
<li><a href="https://github.com/Lissy93/dashy/discussions">Join the Discussion</a></li>
<li><a href="https://github.com/Lissy93/dashy/discussions">Get Support</a></li>
<li><a href="https://github.com/Lissy93/dashy/issues/new/choose">Report a Bug</a></li>
</ul>
<p class="small-note">Please include the following info in your bug report:</p>
<a @click="showInfo = !showInfo">{{ showInfo ? 'Hide' : 'Show'}} system info</a>
<span class="small-note">Please include the following info in your bug report: </span>
<a class="info" @click="showInfo = !showInfo">{{ showInfo ? 'Hide' : 'Show'}} system info</a>
<div class="system-info" v-if="showInfo">
<h4>System Info</h4>
<code><b>Dashy Version:</b> V {{appVersion}}</code><br>
@ -28,13 +31,16 @@
<code><b>Is Mobile?</b> {{systemInfo.isMobile ? 'Yes' : 'No'}}</code><br>
<code><b>OS:</b> {{systemInfo.os}}</code><br>
</div>
<!-- About App -->
<h3>About</h3>
<p class="about-text">
Documentation and Source Code available on
<a href="https://github.com/lissy93/dashy">GitHub</a>
Source: <a href="https://github.com/lissy93/dashy">github.com/lissy93/dashy</a><br>
Documentation: <a href="https://dashy.to/docs">dashy.to/docs</a>
</p>
<!-- License -->
<h3>License</h3>
<code>Licensed under MIT X11. Copyright © 2021</code>
<p>Licensed under MIT X11. Copyright © 2021</p>
<br><br>
</div>
</modal>
</template>
@ -53,6 +59,7 @@ export default {
modalName: modalNames.ABOUT_APP,
appVersion: process.env.VUE_APP_VERSION,
systemInfo: this.getSystemInfo(),
errorLog: this.getErrorLog(),
serviceWorkerInfo: 'Checking...',
showInfo: false,
};
@ -63,6 +70,9 @@ export default {
}, 100);
},
methods: {
getErrorLog() {
return sessionStorage.getItem(sessionStorageKeys.ERROR_LOG) || '';
},
getIsConfigValidStatus() {
const isValidVar = process.env.VUE_APP_CONFIG_VALID;
if (isValidVar === undefined) return 'Config validation status is missing';
@ -72,14 +82,14 @@ export default {
const sessionData = sessionStorage[sessionStorageKeys.SW_STATUS];
const swInfo = sessionData ? JSON.parse(sessionData) : {};
let swStatus = '';
if (swInfo.registered) swStatus += 'Service worker registered<br>';
if (swInfo.ready) swStatus += 'Dashy is being served from service worker<br>';
if (swInfo.cached) swStatus += 'Content has been cached for offline use<br>';
if (swInfo.updateFound) swStatus += 'New content is downloading<br>';
if (swInfo.updated) swStatus += 'New content is available; please refresh<br>';
if (swInfo.offline) swStatus += 'No internet connection found. App is running in offline mode<br>';
if (swInfo.error) swStatus += 'Error during service worker registration<br>';
if (swInfo.devMode) swStatus += 'App running in dev mode, no need for service worker<br>';
if (swInfo.registered) swStatus += 'Service worker registered\n';
if (swInfo.ready) swStatus += 'Dashy is being served from service worker\n';
if (swInfo.cached) swStatus += 'Content has been cached for offline use\n';
if (swInfo.updateFound) swStatus += 'New content is downloading\n';
if (swInfo.updated) swStatus += 'New content is available; please refresh\n';
if (swInfo.offline) swStatus += 'No internet connection found. App is running in offline mode\n';
if (swInfo.error) swStatus += 'Error during service worker registration\n';
if (swInfo.devMode) swStatus += 'App running in dev mode, no need for service worker\n';
if (swStatus.length === 0) swStatus += 'No service worker info available';
return swStatus;
},
@ -123,49 +133,30 @@ span.options-label {
color: var(--settings-text-color);
}
.display-options {
color: var(--settings-text-color);
svg {
path {
fill: var(--settings-text-color);
}
width: 1rem;
height: 1rem;
margin: 0.2rem;
padding: 0.2rem;
text-align: center;
background: var(--background);
border: 1px solid currentColor;
border-radius: var(--curve-factor);
cursor: pointer;
&:hover, &.selected {
background: var(--settings-text-color);
path { fill: var(--background); }
}
}
}
div.about-modal {
background: var(--about-page-background);
color: var(--about-page-color);
padding: 1rem;
overflow-y: auto;
padding: 0 1rem;
height: 100%;
hr {
border-color: var(--about-page-accent);
p, ul li, a {
font-size: 1rem;
}
h2 {
a.title {
text-decoration: none;
font-size: 1.8rem;
text-align: center;
margin: 0.2rem;
h2 {
font-size: 1.8rem;
text-align: center;
margin: 1rem;
}
}
h3 {
font-size: 1.3rem;
margin: 0.75rem 0 0.2rem 0;
margin: 1rem 0 0.2rem 0;
color: var(--about-page-accent);
}
p.small-note {
font-size: 0.9rem;
margin: 0.2rem 0;
}
p.about-text {
@ -177,6 +168,10 @@ div.about-modal {
ul {
margin-top: 0.2rem;
}
a.info {
text-decoration: underline;
margin-left: 0.2rem;
}
.system-info {
font-size: 0.8rem;
background: var(--black);
@ -191,6 +186,20 @@ div.about-modal {
text-decoration: underline;
}
}
.app-version {
text-align: left;
}
pre.logs {
max-height: 200px;
overflow-y: auto;
padding: 1rem;
font-size: 0.75rem;
border-radius: var(--curve-factor-small);
text-align: left;
color: var(--white);
background: var(--black);
white-space: pre-wrap;
}
}
</style>

View File

@ -66,6 +66,7 @@ import IconBackup from '@/assets/interface-icons/config-backup.svg';
import IconRestore from '@/assets/interface-icons/config-restore.svg';
import { backup, update, restore } from '@/utils/CloudBackup';
import { localStorageKeys } from '@/utils/defaults';
import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler';
export default {
name: 'CloudBackupRestore',
@ -160,9 +161,11 @@ export default {
this.backupPassword = '';
},
showErrorMsg(errorMsg) {
ErrorHandler(errorMsg);
this.$toasted.show(errorMsg, { className: 'toast-error' });
},
showSuccessMsg(msg) {
InfoHandler(msg, 'Cloud Backup');
this.$toasted.show(msg, { className: 'toast-success' });
},
makeHash(pass) {

View File

@ -21,6 +21,7 @@
import CustomThemeMaker from '@/components/Settings/CustomThemeMaker';
import { getTheme } from '@/utils/ConfigHelpers';
import { localStorageKeys } from '@/utils/defaults';
import { InfoHandler } from '@/utils/ErrorHandler';
export default {
name: 'StyleEditor',
@ -49,10 +50,12 @@ export default {
appConfig.customCss = this.customCss;
localStorage.setItem(localStorageKeys.APP_CONFIG, JSON.stringify(appConfig));
msg = 'Changes saved successfully';
InfoHandler('User syles has been saved', 'Custom CSS Update');
this.inject(this.customCss);
if (this.customCss === '') setTimeout(() => { location.reload(); }, 1500); // eslint-disable-line no-restricted-globals
} else {
msg = 'Error - Invalid CSS';
InfoHandler(msg, 'Custom CSS Update');
}
this.$toasted.show(msg);
},

View File

@ -61,9 +61,10 @@
import axios from 'axios';
import ProgressBar from 'rsup-progress';
import VJsoneditor from 'v-jsoneditor';
import { localStorageKeys } from '@/utils/defaults';
import ErrorHandler, { InfoHandler } from '@/utils/ErrorHandler';
import configSchema from '@/utils/ConfigSchema.json';
import JsonToYaml from '@/utils/JsonToYaml';
import { localStorageKeys } from '@/utils/defaults';
import { isUserAdmin } from '@/utils/Auth';
export default {
@ -135,12 +136,14 @@ export default {
} else {
this.showToast(this.$t('config-editor.error-msg-cannot-save'), false);
}
InfoHandler('Config has been written to disk succesfully', 'Config Update');
this.progress.end();
})
.catch((error) => {
this.saveSuccess = false;
this.responseText = error;
this.showToast(error, false);
ErrorHandler(`Failed to save config. ${error}`);
this.progress.end();
});
},
@ -159,6 +162,7 @@ export default {
if (data.appConfig.theme) {
localStorage.setItem(localStorageKeys.THEME, data.appConfig.theme);
}
InfoHandler('Config has succesfully been saved in browser storage', 'Config Update');
this.showToast(this.$t('config-editor.success-msg-local'), true);
},
carefullyClearLocalStorage() {

View File

@ -57,7 +57,7 @@ export default {
makeText() {
if (this.userType === userStateEnum.loggedIn) {
const username = localStorage[localStorageKeys.USERNAME];
return this.$t('settings.sign-in-welcome', { username });
return username ? this.$t('settings.sign-in-welcome', { username }) : '';
}
if (this.userType === userStateEnum.guestAccess) {
return this.$t('settings.sign-in-tooltip');

View File

@ -357,10 +357,10 @@
"default": true,
"description": "Can user write changes to conf.yml file from the UI. If set to false, preferences are only stored locally"
},
"disableServiceWorker": {
"enableServiceWorker": {
"type": "boolean",
"default": false,
"description": "If set to true, then service workers will not be used to cache page contents"
"description": "If set to true, then service workers will be used to cache page contents"
},
"disableContextMenu": {
"type": "boolean",

View File

@ -1,10 +1,12 @@
/* eslint no-console: ["error", { allow: ["log", "info"] }] */
/* Prints the app name and version, helpful for debugging */
export const welcomeMsg = () => {
const v = process.env.VUE_APP_VERSION ? `V${process.env.VUE_APP_VERSION}` : '';
console.log(`\n%cDashy ${v} 🚀`, 'color:#0dd8d8; background:#0b1021; font-size:1.5rem; padding:0.15rem 0.25rem; margin: 1rem auto; font-family: Rockwell; border: 2px solid #0dd8d8; border-radius: 4px;font-weight: bold; text-shadow: 1px 1px 1px #00af87bf;');
};
/* Prints warning message, usually when there is a configuration error */
export const warningMsg = (message) => {
console.info(
`\n%c⚠ Warning ⚠️%c \n${message} \n\n%cThis is likely not an issue with Dashy, but rather your configuration. If you think it is a bug, please open a ticket on GitHub: https://git.io/JukXk`,
@ -14,6 +16,21 @@ export const warningMsg = (message) => {
);
};
export const raiseBug = () => {
console.log('%c🐛If you have found a bug, raise an issue on GitHub, at:\nhttps://git.io/JukXk', "color:#dddd10; font-size: 14px; font-family: 'Trebuchet MS', Helvetica;");
/* Prints status message */
export const statusMsg = (title, msg) => {
console.log(
`%c${title || ''}\n%c${msg}`,
'font-weight: bold; color: #0dd8d8; text-decoration: underline;',
'color: #ceb73f;',
);
};
/* Prints status message, with a stack trace */
export const statusErrorMsg = (title, msg, errorLog) => {
console.log(
`%c${title || ''}\n%c${msg} \n%c${errorLog}`,
'font-weight: bold; color: #0dd8d8; text-decoration: underline;',
'color: #ff025a',
'color: #ff025a80;',
);
};

View File

@ -1,6 +1,20 @@
/* eslint no-console: ["error", { allow: ["warn", "error"] }] */
import * as Sentry from '@sentry/vue';
import { warningMsg } from '@/utils/CoolConsole';
import { warningMsg, statusMsg } from '@/utils/CoolConsole';
import { sessionStorageKeys } from '@/utils/defaults';
/* Makes the current time, like hh:mm:ss */
const makeTime = () => {
const now = new Date();
const pad = (digit) => String(digit).padStart(2, '0');
return `${pad(now.getHours())}:${pad(now.getMinutes())}:${pad(now.getSeconds())}`;
};
/* Appends recent errors to local storage, for viewing in the UI */
const appendToErrorLog = (msg) => {
let errorLog = sessionStorage.getItem(sessionStorageKeys.ERROR_LOG) || '';
errorLog += `[${makeTime()}] ${msg}\n`;
sessionStorage.setItem(sessionStorageKeys.ERROR_LOG, errorLog);
};
/**
* Function called when an error happens
@ -9,8 +23,14 @@ import { warningMsg } from '@/utils/CoolConsole';
* If you wish to use your own error logging service, put code for it here
*/
const ErrorHandler = function handler(msg) {
warningMsg(msg);
Sentry.captureMessage(`[USER-WARN] ${msg || 'Uncaptured Message'}`);
warningMsg(msg); // Print to console
appendToErrorLog(msg); // Save to local storage
Sentry.captureMessage(`[USER-WARN] ${msg}`); // Report to bug tracker (if enabled)
};
/* Similar to error handler, but for recording general info */
export const InfoHandler = (msg, title) => {
statusMsg(title || 'Info', msg);
};
export default ErrorHandler;

View File

@ -1,7 +1,6 @@
/* eslint-disable no-console */
import { register } from 'register-service-worker';
import { sessionStorageKeys } from '@/utils/defaults';
import { statusMsg, statusErrorMsg } from '@/utils/CoolConsole';
import conf from '../../public/conf.yml';
/* Sets a local storage item with the state from the SW lifecycle */
@ -23,7 +22,7 @@ const setSwStatus = (swStateToSet) => {
const newSwState = { ...currentSwState, ...swStateToSet };
sessionStorage.setItem(sessionStorageKeys.SW_STATUS, JSON.stringify(newSwState));
} catch (e) {
console.warn('Error setting SW data', e);
statusErrorMsg('Service Worker Status', 'Error Updating SW Status', e);
}
};
@ -33,53 +32,58 @@ const setSwStatus = (swStateToSet) => {
* Or disable if user specified to disable
*/
const shouldEnableServiceWorker = () => {
let shouldEnable = true;
if (conf && conf.appConfig) { // Check if app Config available
if (conf.appConfig.disableServiceWorker) { // Disable if user requested
shouldEnable = false;
setSwStatus({ disabledByUser: true });
}
}
if (process.env.NODE_ENV !== 'production') {
shouldEnable = false; // Disable if not in production
if (conf && conf.appConfig && conf.appConfig.enableServiceWorker) {
setSwStatus({ disabledByUser: false });
return true;
} else if (process.env.NODE_ENV !== 'production') {
setSwStatus({ devMode: true });
return false;
}
return shouldEnable;
setSwStatus({ disabledByUser: true });
return false;
};
/* Calls to the print status function */
const printSwStatus = (msg) => {
statusMsg('Service Worker Status', msg);
};
const swUrl = `${process.env.BASE_URL || '/'}service-worker.js`;
/* If service worker enabled, then register it, and print message when status changes */
const registerServiceWorker = () => {
if (shouldEnableServiceWorker()) {
register(`${process.env.BASE_URL}service-worker.js`, {
register(swUrl, {
ready() {
setSwStatus({ ready: true });
console.log(
'App is being served from cache by a service worker.\n'
printSwStatus(
'Dashy is being served from cache by a service worker.\n'
+ 'For more details, visit https://goo.gl/AFskqB',
);
},
registered() {
setSwStatus({ registered: true });
console.log('Service worker has been registered.');
printSwStatus('Service worker has been registered.');
},
cached() {
setSwStatus({ cached: true });
console.log('Content has been cached for offline use.');
printSwStatus('App has been cached for offline use.');
},
updatefound() {
setSwStatus({ updateFound: true });
console.log('New content is downloading.');
printSwStatus('New content is downloading...');
},
updated() {
setSwStatus({ updated: true });
console.log('New content is available; please refresh.');
printSwStatus('New content is available; please refresh the page.');
},
offline() {
setSwStatus({ offline: true });
console.log('No internet connection found. App is running in offline mode.');
printSwStatus('No internet connection found. Dashy is running in offline mode.');
},
error(error) {
setSwStatus({ error: true });
console.error('Error during service worker registration:', error);
statusErrorMsg('Service Worker Status', 'Error during SW registration', error);
},
});
}

View File

@ -103,6 +103,7 @@ module.exports = {
/* Key names for session storage identifiers */
sessionStorageKeys: {
SW_STATUS: 'serviceWorkerStatus',
ERROR_LOG: 'errorLog',
},
/* Unique IDs of modals within the app */
modalNames: {

View File

@ -76,6 +76,7 @@ import router from '@/router';
import Button from '@/components/FormElements/Button';
import Input from '@/components/FormElements/Input';
import Defaults, { localStorageKeys } from '@/utils/defaults';
import { InfoHandler } from '@/utils/ErrorHandler';
import {
checkCredentials,
login,
@ -157,6 +158,9 @@ export default {
if (response.correct) { // Yay, credentials were correct :)
login(this.username, this.password, timeout); // Login, to set the cookie
this.goHome();
InfoHandler(`Succesfully signed in as ${this.username}`, 'Authentication');
} else {
InfoHandler(`Unable to Sign In - ${this.message}`, 'Authentication');
}
},
/* Calls function to double-check guest access enabled, then log in as guest */