diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index 4f9db590b6..532fe10207 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -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 diff --git a/.github/workflows/add-comment-from-tag.yml b/.github/workflows/add-comment-from-tag.yml index 8d2ae5229a..831da95cb2 100644 --- a/.github/workflows/add-comment-from-tag.yml +++ b/.github/workflows/add-comment-from-tag.yml @@ -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: diff --git a/.github/workflows/auto-tag-pr.yml b/.github/workflows/auto-tag-pr.yml index 9000d1bc94..e05948eb1a 100644 --- a/.github/workflows/auto-tag-pr.yml +++ b/.github/workflows/auto-tag-pr.yml @@ -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: diff --git a/.github/workflows/build-app.yml b/.github/workflows/build-app.yml index 25d65190bd..4f29a69dea 100644 --- a/.github/workflows/build-app.yml +++ b/.github/workflows/build-app.yml @@ -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 ] diff --git a/.github/workflows/cache-artifacts.yml b/.github/workflows/cache-artifacts.yml index 498ce16e54..d946b65eaa 100644 --- a/.github/workflows/cache-artifacts.yml +++ b/.github/workflows/cache-artifacts.yml @@ -1,5 +1,5 @@ # Caches artifacts, including NPM dependencies, to speed up build times -name: Caching Atrifacts +name: 🏗️ Caching Artifacts on: push jobs: build: diff --git a/.github/workflows/close-incomplete-issues.yml b/.github/workflows/close-incomplete-issues.yml index a8ec1f5b12..35cdf3f7f3 100644 --- a/.github/workflows/close-incomplete-issues.yml +++ b/.github/workflows/close-incomplete-issues.yml @@ -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] diff --git a/.github/workflows/close-stale-issues.yml b/.github/workflows/close-stale-issues.yml index 79d01c5f1b..1ef583ec30 100644 --- a/.github/workflows/close-stale-issues.yml +++ b/.github/workflows/close-stale-issues.yml @@ -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: diff --git a/.github/workflows/code-linter.yml b/.github/workflows/code-linter.yml index cf2c5964b5..c0a12d0f3b 100644 --- a/.github/workflows/code-linter.yml +++ b/.github/workflows/code-linter.yml @@ -1,5 +1,5 @@ # Lints code merged into master branch -name: Lint Code Base +name: 🌈 Lint Code Base on: pull_request: branches: [master] diff --git a/.github/workflows/code-spell-check.yml b/.github/workflows/code-spell-check.yml index e0ec4c189e..8b162f02ab 100644 --- a/.github/workflows/code-spell-check.yml +++ b/.github/workflows/code-spell-check.yml @@ -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 ] diff --git a/.github/workflows/dependency-updates-summary.yml b/.github/workflows/dependency-updates-summary.yml index daeddaf796..bca9f2d0da 100644 --- a/.github/workflows/dependency-updates-summary.yml +++ b/.github/workflows/dependency-updates-summary.yml @@ -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: diff --git a/.github/workflows/docker-publish.yml b/.github/workflows/docker-publish.yml index acd0db49b7..0847133daf 100644 --- a/.github/workflows/docker-publish.yml +++ b/.github/workflows/docker-publish.yml @@ -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: diff --git a/.github/workflows/generate-credits.yml b/.github/workflows/generate-credits.yml index 06b4dd5089..844494692a 100644 --- a/.github/workflows/generate-credits.yml +++ b/.github/workflows/generate-credits.yml @@ -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: diff --git a/.github/workflows/get-size.yml b/.github/workflows/get-size.yml index 2b602fd000..f2576fef68 100644 --- a/.github/workflows/get-size.yml +++ b/.github/workflows/get-size.yml @@ -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. diff --git a/.github/workflows/issue-spam-control.yml b/.github/workflows/issue-spam-control.yml index 4c24df05b3..c10a652119 100644 --- a/.github/workflows/issue-spam-control.yml +++ b/.github/workflows/issue-spam-control.yml @@ -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] diff --git a/.github/workflows/issue-translator.yml b/.github/workflows/issue-translator.yml index 501e9ebdd0..2f4967c5de 100644 --- a/.github/workflows/issue-translator.yml +++ b/.github/workflows/issue-translator.yml @@ -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] diff --git a/.github/workflows/label-sponsors.yml b/.github/workflows/label-sponsors.yml index f7d129bdac..a18a4b85ad 100644 --- a/.github/workflows/label-sponsors.yml +++ b/.github/workflows/label-sponsors.yml @@ -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] diff --git a/.github/workflows/lgtm-comment.yml b/.github/workflows/lgtm-comment.yml index e9df2440ee..aeb9f99a87 100644 --- a/.github/workflows/lgtm-comment.yml +++ b/.github/workflows/lgtm-comment.yml @@ -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] } diff --git a/.github/workflows/mind-your-language.yml b/.github/workflows/mind-your-language.yml index b32e55ec64..fd97fbc3ba 100644 --- a/.github/workflows/mind-your-language.yml +++ b/.github/workflows/mind-your-language.yml @@ -1,5 +1,5 @@ # Detects offensive language in comments and takes reaction -name: Mind your language +name: 🎯 Mind your language on: issues: types: diff --git a/.github/workflows/pr-commenter.yml b/.github/workflows/pr-commenter.yml index 9b03d9e773..09e737447a 100644 --- a/.github/workflows/pr-commenter.yml +++ b/.github/workflows/pr-commenter.yml @@ -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: diff --git a/.github/workflows/raise-issue-from-todo.yml b/.github/workflows/raise-issue-from-todo.yml index e7fe5b7a4d..f4afd3d535 100644 --- a/.github/workflows/raise-issue-from-todo.yml +++ b/.github/workflows/raise-issue-from-todo.yml @@ -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: diff --git a/.github/workflows/release-commenter.yml b/.github/workflows/release-commenter.yml index c0b580c4db..4a9fe2667a 100644 --- a/.github/workflows/release-commenter.yml +++ b/.github/workflows/release-commenter.yml @@ -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] diff --git a/.github/workflows/repo-visualization.yml b/.github/workflows/repo-visualization.yml new file mode 100644 index 0000000000..23b7ac6d9e --- /dev/null +++ b/.github/workflows/repo-visualization.yml @@ -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 \ No newline at end of file diff --git a/.github/workflows/security-scanning.yml b/.github/workflows/security-scanning.yml index 228b2f2ea2..84f7b474e8 100644 --- a/.github/workflows/security-scanning.yml +++ b/.github/workflows/security-scanning.yml @@ -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: diff --git a/.github/workflows/update-issue-after-pr.yml b/.github/workflows/update-issue-after-pr.yml deleted file mode 100644 index e62678fc83..0000000000 --- a/.github/workflows/update-issue-after-pr.yml +++ /dev/null @@ -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 }} \ No newline at end of file diff --git a/.github/workflows/wiki-sync.yml b/.github/workflows/wiki-sync.yml index f8774e4b6e..24e3070424 100644 --- a/.github/workflows/wiki-sync.yml +++ b/.github/workflows/wiki-sync.yml @@ -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: diff --git a/README.md b/README.md index 8180c93a4c..2ae2082571 100644 --- a/README.md +++ b/README.md @@ -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: />

-**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

-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.

@@ -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 diff --git a/docs/configuring.md b/docs/configuring.md index 283d1f36c2..6ef15d1294 100644 --- a/docs/configuring.md +++ b/docs/configuring.md @@ -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)** diff --git a/docs/developing.md b/docs/developing.md index f827b6f85e..1a6603a91c 100644 --- a/docs/developing.md +++ b/docs/developing.md @@ -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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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 diff --git a/docs/privacy.md b/docs/privacy.md index a06c5f15cf..76d3c2719a 100644 --- a/docs/privacy.md +++ b/docs/privacy.md @@ -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` --- diff --git a/docs/readme.md b/docs/readme.md index 922d30a6ab..ee2e218436 100644 --- a/docs/readme.md +++ b/docs/readme.md @@ -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 diff --git a/docs/release-workflow.md b/docs/release-workflow.md new file mode 100644 index 0000000000..82995beab6 --- /dev/null +++ b/docs/release-workflow.md @@ -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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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**
[![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! \ No newline at end of file diff --git a/package.json b/package.json index ba073aa1dc..01dd421f54 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Dashy", - "version": "1.7.6", + "version": "1.7.7", "license": "MIT", "main": "server", "scripts": { diff --git a/src/components/Configuration/AppInfoModal.vue b/src/components/Configuration/AppInfoModal.vue index 8fc237eb8f..8ba9dbc64d 100644 --- a/src/components/Configuration/AppInfoModal.vue +++ b/src/components/Configuration/AppInfoModal.vue @@ -1,26 +1,29 @@ @@ -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
'; - if (swInfo.ready) swStatus += 'Dashy is being served from service worker
'; - if (swInfo.cached) swStatus += 'Content has been cached for offline use
'; - if (swInfo.updateFound) swStatus += 'New content is downloading
'; - if (swInfo.updated) swStatus += 'New content is available; please refresh
'; - if (swInfo.offline) swStatus += 'No internet connection found. App is running in offline mode
'; - if (swInfo.error) swStatus += 'Error during service worker registration
'; - if (swInfo.devMode) swStatus += 'App running in dev mode, no need for service worker
'; + 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; + } } diff --git a/src/components/Configuration/CloudBackupRestore.vue b/src/components/Configuration/CloudBackupRestore.vue index b0341cd974..83b303f469 100644 --- a/src/components/Configuration/CloudBackupRestore.vue +++ b/src/components/Configuration/CloudBackupRestore.vue @@ -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) { diff --git a/src/components/Configuration/CustomCss.vue b/src/components/Configuration/CustomCss.vue index 535c7f8c13..8b3b6262cb 100644 --- a/src/components/Configuration/CustomCss.vue +++ b/src/components/Configuration/CustomCss.vue @@ -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); }, diff --git a/src/components/Configuration/JsonEditor.vue b/src/components/Configuration/JsonEditor.vue index 35ee10a62c..e0123d9fb6 100644 --- a/src/components/Configuration/JsonEditor.vue +++ b/src/components/Configuration/JsonEditor.vue @@ -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() { diff --git a/src/components/Settings/AuthButtons.vue b/src/components/Settings/AuthButtons.vue index 29e082cbdd..ddacc2c10b 100644 --- a/src/components/Settings/AuthButtons.vue +++ b/src/components/Settings/AuthButtons.vue @@ -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'); diff --git a/src/utils/ConfigSchema.json b/src/utils/ConfigSchema.json index d3bf8ff653..acd9e10d1e 100644 --- a/src/utils/ConfigSchema.json +++ b/src/utils/ConfigSchema.json @@ -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", diff --git a/src/utils/CoolConsole.js b/src/utils/CoolConsole.js index 6aaf88492c..09efcd1714 100644 --- a/src/utils/CoolConsole.js +++ b/src/utils/CoolConsole.js @@ -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;', + ); }; diff --git a/src/utils/ErrorHandler.js b/src/utils/ErrorHandler.js index f2a6a2e27b..d0c96f083a 100644 --- a/src/utils/ErrorHandler.js +++ b/src/utils/ErrorHandler.js @@ -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; diff --git a/src/utils/InitServiceWorker.js b/src/utils/InitServiceWorker.js index 03f3b7e07c..7c85428861 100644 --- a/src/utils/InitServiceWorker.js +++ b/src/utils/InitServiceWorker.js @@ -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); }, }); } diff --git a/src/utils/defaults.js b/src/utils/defaults.js index 40365210f9..f7e8e39646 100644 --- a/src/utils/defaults.js +++ b/src/utils/defaults.js @@ -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: { diff --git a/src/views/Login.vue b/src/views/Login.vue index fd9f6a170c..0b159f2cb7 100644 --- a/src/views/Login.vue +++ b/src/views/Login.vue @@ -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 */