Skip to content

Commit

Permalink
🔀 Merge pull request #226 from Lissy93/REFACTOR/improved-error-handling
Browse files Browse the repository at this point in the history
[REFACTOR] Improved error handling
  • Loading branch information
Lissy93 authored Sep 12, 2021
2 parents c564121 + 97ddcb3 commit c0545f1
Show file tree
Hide file tree
Showing 43 changed files with 415 additions and 211 deletions.
6 changes: 6 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -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

Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/add-comment-from-tag.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/auto-tag-pr.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/build-app.yml
Original file line number Diff line number Diff line change
@@ -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 ]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/cache-artifacts.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Caches artifacts, including NPM dependencies, to speed up build times
name: Caching Atrifacts
name: 🏗️ Caching Artifacts
on: push
jobs:
build:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-incomplete-issues.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/close-stale-issues.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-linter.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Lints code merged into master branch
name: Lint Code Base
name: 🌈 Lint Code Base
on:
pull_request:
branches: [master]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/code-spell-check.yml
Original file line number Diff line number Diff line change
@@ -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 ]
Expand Down
6 changes: 3 additions & 3 deletions .github/workflows/dependency-updates-summary.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/docker-publish.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/generate-credits.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
27 changes: 24 additions & 3 deletions .github/workflows/get-size.yml
Original file line number Diff line number Diff line change
@@ -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.
2 changes: 1 addition & 1 deletion .github/workflows/issue-spam-control.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/issue-translator.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/label-sponsors.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/lgtm-comment.yml
Original file line number Diff line number Diff line change
@@ -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] }
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/mind-your-language.yml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
# Detects offensive language in comments and takes reaction
name: Mind your language
name: 🎯 Mind your language
on:
issues:
types:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/pr-commenter.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
4 changes: 2 additions & 2 deletions .github/workflows/raise-issue-from-todo.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
2 changes: 1 addition & 1 deletion .github/workflows/release-commenter.yml
Original file line number Diff line number Diff line change
@@ -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]
Expand Down
20 changes: 20 additions & 0 deletions .github/workflows/repo-visualization.yml
Original file line number Diff line number Diff line change
@@ -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
2 changes: 1 addition & 1 deletion .github/workflows/security-scanning.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
11 changes: 0 additions & 11 deletions .github/workflows/update-issue-after-pr.yml

This file was deleted.

2 changes: 1 addition & 1 deletion .github/workflows/wiki-sync.yml
Original file line number Diff line number Diff line change
@@ -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:
Expand Down
63 changes: 49 additions & 14 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,7 @@
- [💖 Supporting Dashy](#supporting-dashy-)
- [🏆 Credits](#credits-)
- [🧱 Developing](#developing-)
- [🗞️ Release Schedule](#release-schedule-)
- [📘 Documentation](#documentation-)
- [🛣️ Roadmap](#roadmap-)
- [🙌 Alternatives](#alternatives-)
Expand Down Expand Up @@ -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.

Expand Down Expand Up @@ -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)**

Expand All @@ -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.

---

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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" />
Expand Down Expand Up @@ -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)**

Expand Down Expand Up @@ -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
Expand All @@ -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
Expand Down
Loading

0 comments on commit c0545f1

Please sign in to comment.