Skip to content

Commit

Permalink
🔀 Merge pull request gchq#168 from Lissy93/REFACTOR/deployment-files
Browse files Browse the repository at this point in the history
[REFACTOR] - Reduce bundle size, update workflows, docs and app config
  • Loading branch information
Lissy93 committed Aug 19, 2021
2 parents a491817 + 3c7fbd9 commit 522bbca
Show file tree
Hide file tree
Showing 22 changed files with 654 additions and 576 deletions.
9 changes: 9 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Files specified here are not required for Docker
# so ignoring them helps to reduce the container size
# The Docker container MUST have the following files:
# package.json yarn.lock server.js vue.config.js src/ services/

node_modules
docs
.git
.github
5 changes: 5 additions & 0 deletions .env
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
# Store environmental variables here. All variables are optional.

# PORT=4000 # The port to expose the running application on
# NODE_ENV=production # Can be either development, production or test
# BASE_URL=/ # The default base path for serving up static assets
8 changes: 8 additions & 0 deletions .github/CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,13 @@
# Changelog

## ✨ 1.6.3 - Dependency and Build File Updates [PR #168](https://github.com/Lissy93/dashy/pull/168)
- Removes any dependencies which are not 100% essential
- Moves packages that are only used for building into devDependencies
- Updates dependencies to latest version
- Adds a .dockerignore, so that non-essential files are not included in the container
- Updates deployment config files for Netlify, Heroku and GH actions
- Made a brand new bug-report template, with input fields and validation!

## ✨ 1.6.2 - Support for Guest Access [PR #167](https://github.com/Lissy93/dashy/pull/167)
- Adds functionality for optional read-only guest access to dashboards with authentication
- Can be enabled by setting `appConfig.enableGuestAccess: true`
Expand Down
22 changes: 0 additions & 22 deletions .github/ISSUE_TEMPLATE/bug-report.md

This file was deleted.

60 changes: 60 additions & 0 deletions .github/ISSUE_TEMPLATE/bug.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,60 @@
name: Bug Report 🐛
description: Report something that's not working the way it's (probably) intended to
title: '[BUG] <title>'
labels: '\U0001F41B Bug'
body:
- type: dropdown
id: environment
attributes:
label: Environment
description: Where are you running Dashy?
options:
- Self-Hosted (Docker)
- Self-Hosted (Bare Metal)
- Cloud Service (Static)
validations:
required: true
- type: input
id: version
attributes:
label: Version
description: What version of Dashy are you running?
placeholder: 1.6.9 ← should look like this (check config menu)
validations:
required: false
- type: textarea
id: repro
attributes:
label: Describe the problem
description: Please describe exactly what is not working, include the steps to reproduce, actual result and expected result
validations:
required: true
- type: textarea
id: logs
attributes:
label: Additional info
description: Logs? Screenshots? Yes, please.
validations:
required: false
- type: checkboxes
id: idiot-check
attributes:
label: Please tick the boxes
description: Before submitting, please ensure that
options:
- label: You are using the latest, or recent version of Dashy
required: true
- label: You've checked that this [issue hasn't already been raised](https://github.com/Lissy93/dashy/issues?q=is%3Aissue)
required: true
- label: You've checked the [docs](https://github.com/Lissy93/dashy/tree/master/docs#readme) and [troubleshooting](https://github.com/Lissy93/dashy/blob/master/docs/troubleshooting.md#troubleshooting) guide
required: true
- label: You agree to the [code of conduct](https://github.com/Lissy93/dashy/blob/master/.github/CODE_OF_CONDUCT.md#contributor-covenant-code-of-conduct)
required: true
- type: markdown
attributes:
value: |-
## Thanks 🙏
Sorry you are having issues with Dashy, and thank you for raising this ticket - in doing so you are helping to make the app better for everyone 💪
You should expect a reply within the next 48 hours :)
validations:
required: false
36 changes: 0 additions & 36 deletions .github/LEGAL.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,6 @@ The following 3rd-party software packages may be used by or distributed with **d
| **[highlight.js (11.1.0)](#highlight.js-11-1-0)** | **Multi-license:** BSD-2-Clause _OR_ BSD-3-Clause, BSD-3-Clause |
| **[js-yaml (4.1.0)](#js-yaml-4-1-0)** | MIT |
| **[npm-run-all (4.1.5)](#npm-run-all-4-1-5)** | MIT |
| **[prismjs (1.24.1)](#prismjs-1-24-1)** | MIT |
| **[register-service-worker (1.7.2)](#register-service-worker-1-7-2)** | MIT |
| **[remedial (1.0.8)](#remedial-1-0-8)** | **Multi-license:** Apache-2.0 _OR_ MIT |
| **[serve-static (1.14.1)](#serve-static-1-14-1)** | MIT |
Expand Down Expand Up @@ -392,41 +391,6 @@ The following 3rd-party software packages may be used by or distributed with **d

---

#### **prismjs (1.24.1)**

- Declared License(s)

- MIT

- Attribution:
MIT LICENSE

Copyright (c) 2012 Lea Verou

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in
all copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
THE SOFTWARE.

- Discovered License(s)

---

---

#### **register-service-worker (1.7.2)**

- Declared License(s)
Expand Down
18 changes: 17 additions & 1 deletion .github/workflows/generate-credits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,23 @@ jobs:
userNameHeight: 20
svgWidth: 830
commitMessage: ':blue_heart: Updates contributor SVG'
# Job #2 - Update the Credits page
# Job #2 - Fetches sponsors and inserts into readme and credits page
insert-sponsors:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
- name: Generate Sponsors in Readme 💖
uses: JamesIves/github-sponsors-readme-action@1.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: 'README.md'
- name: Generate Sponsors in Credits 💖
uses: JamesIves/github-sponsors-readme-action@1.0.5
with:
token: ${{ secrets.GITHUB_TOKEN }}
file: 'docs/credits.md'
# Job #3 - Update the Credits page
insert-credits:
runs-on: ubuntu-latest
name: Inserts contributors into credits.md
Expand Down
23 changes: 0 additions & 23 deletions .github/workflows/insert-sponsors.yml

This file was deleted.

14 changes: 7 additions & 7 deletions .github/workflows/wiki-sync.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ jobs:
steps:
- uses: actions/checkout@master
- name: Sync Wiki
uses: cmbrose/github-docs-to-wiki@v0.24
uses: joeizzard/action-wiki-sync@master
with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
defaultBranch: master
rootDocsFolder: ./docs
convertRootReadmeToHomePage: true
useHeaderForWikiName: true
customCommitMessageFormat: ':gem: Chore: Sync Docs to GH Wiki'
username: example
access_token: ${{ secrets.GITHUB_TOKEN }}
wiki_folder: ./docs
commit_username: 'liss-bot'
commit_email: 'liss-bot@d0h.co'
commit_message: '📕 Chore: Sync Wiki'
3 changes: 3 additions & 0 deletions Procfile
Original file line number Diff line number Diff line change
@@ -1 +1,4 @@
# Heroku config - Specifies the commands to execute when the app starts
# See docs for more info: https://devcenter.heroku.com/articles/procfile

web: node server.js
5 changes: 2 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ The image defaults to `:latest`, but you can instead specify a specific version,

You will need [git](https://git-scm.com/downloads), the latest or LTS version of [Node.js](https://nodejs.org/) and (optionally) [Yarn](https://yarnpkg.com/) installed on your system.

- Get Code: `git clone git@github.com:Lissy93/dashy.git` and `cd dashy`
- Get Code: `git clone https://github.com/Lissy93/dashy.git` and `cd dashy`
- Configuration: Fill in you're settings in `./public/conf.yml`
- Install dependencies: `yarn`
- Build: `yarn build`
Expand Down Expand Up @@ -489,7 +489,6 @@ Huge thanks to the sponsors helping to support Dashy's development!
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
[`prism.js`](https://github.com/PrismJS/prism)
- 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/).
Expand All @@ -505,7 +504,7 @@ Dashy was made possible thanks to the following packages and components. For mor
Before getting started, you'll need [Git](https://git-scm.com/downloads), [Node](https://nodejs.org/en/download/) and optionally [Yarn](https://yarnpkg.com/) (run `npm i -g yarn`) installed.

To set up the development environment:
1. Get Code: `git clone git@github.com:Lissy93/dashy.git` and `cd dashy`
1. Get Code: `git clone https://github.com/Lissy93/dashy.git` and `cd dashy`
2. Install dependencies: `yarn`
3. Start dev server: `yarn dev`

Expand Down
7 changes: 3 additions & 4 deletions docs/credits.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
<!-- readme: sponsors -end -->

## Contributors
<!-- readme: contributors -start -->
<!-- readme: contributors, BeginCI/-, deepsourcebot/- -start -->
<table>
<tr>
<td align="center">
Expand Down Expand Up @@ -90,7 +90,8 @@
</a>
</td></tr>
</table>
<!-- readme: contributors -end -->
<!-- readme: contributors, BeginCI/-, deepsourcebot/- -end -->


## Helpful Users
<!-- readme: EVOTk,shadowking001,turnrye,Robert-Ernst,Niklashere,evroon,MilesTEG1 -start -->
Expand Down Expand Up @@ -190,8 +191,6 @@ At it's core, the application uses [Vue.js](https://github.com/vuejs/vue), as we
- [`VJsoneditor`](https://github.com/yansenlei/VJsoneditor) - Interactive JSON editor component by @yansenlei `MIT`
- Forked from [`JsonEditor`](https://github.com/josdejong/jsoneditor) by @josdejong `Apache-2.0 License`
- [`vue-toasted`](https://github.com/shakee93/vue-toasted) - Toast notification component by @shakee93 `MIT`
- [`vue-prism-editor`](https://github.com/koca/vue-prism-editor) - Lightweight code editor by @koca `MIT`
- Forked from [`prism.js`](https://github.com/PrismJS/prism) `MIT`
- [`vue-swatches`](https://github.com/saintplay/vue-swatches) - Color palete picker by @saintplay `MIT`

##### Backup & Sync Server
Expand Down
8 changes: 4 additions & 4 deletions docs/deployment.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@
Welcome to Dashy, so glad you're here :) Deployment is super easy, and there are several methods available depending on what type of system you're using. If you're self-hosting, then deploying with Docker (or similar container engine) is the recommended approach.

#### Quick Start
If you want to skip the fuss, and [get straight down to it](./docs/quick-start.md), then you can spin up a new instance of Dashy by running:
If you want to skip the fuss, and [get straight down to it](/docs/quick-start.md), then you can spin up a new instance of Dashy by running:
```
docker run -p 8080:80 lissy93/dashy
```

See [Management Docs](./docs/management.md) for info about securing, monitoring, updating, health checks, auto starting, web server configuration, etc
See [Management Docs](/docs/management.md) for info about securing, monitoring, updating, health checks, auto starting, web server configuration, etc

Once you've got Dashy up and running, you'll want to configure it with your own content, for this you can reference the [configuring docs](./docs/configuring.md).
Once you've got Dashy up and running, you'll want to configure it with your own content, for this you can reference the [configuring docs](/docs/configuring.md).

## Deployment Methods

Expand Down Expand Up @@ -110,7 +110,7 @@ If you are building from source, and would like to use one of the [other Dockerf

If you do not want to use Docker, you can run Dashy directly on your host system. For this, you will need both [git](https://git-scm.com/downloads) and the latest or LTS version of [Node.js](https://nodejs.org/) installed, and optionally [yarn](https://yarnpkg.com/)

1. Get Code: `git clone git@github.com:Lissy93/dashy.git` and `cd dashy`
1. Get Code: `git clone https://github.com/Lissy93/dashy.git` and `cd dashy`
2. Configuration: Fill in you're settings in `./public/conf.yml`
3. Install dependencies: `yarn`
4. Build: `yarn build`
Expand Down
4 changes: 2 additions & 2 deletions docs/developing.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ You will need either the latest or LTS version of **[Node.js](https://nodejs.org

### Running the Project

1. Get Code: `git clone git@github.com:Lissy93/dashy.git`
1. Get Code: `git clone https://github.com/Lissy93/dashy.git`
2. Navigate into the directory: `cd dashy`
3. Install dependencies: `yarn`
4. Start dev server: `yarn dev`
Expand Down Expand Up @@ -231,7 +231,7 @@ Styleguides:
│ │ ├── Nav.vue # Navigation bar, includes a list of links
│ │ ╰── PageTitle.vue # Page title and sub-title, visible within the Header
│ ╰── Settings # Components relating to the quick-settings, in the top-right
│ ├── AppButtons.vue # Logout button and other app info
│ ├── AuthButtons.vue # Logout button and other app info
│ ├── ConfigLauncher.vue # Icon that when clicked will launch the Configuration component
│ ├── CustomThemeMaker.vue # Color pickers for letting user build their own theme
│ ├── ItemSizeSelector.vue # Set of buttons used to set and save item size
Expand Down
22 changes: 22 additions & 0 deletions docs/quick-start.md
Original file line number Diff line number Diff line change
Expand Up @@ -104,3 +104,25 @@ For more info, check out the [Documentation](https://github.com/Lissy93/dashy/tr
Enjoy your dashboard :)

---

## Alternative Deployment Method 1 - From Source

You can also easily run the app on your system without Docker. For this [Git](https://git-scm.com/downloads), [Node.js](https://nodejs.org/), and [Yarn](https://yarnpkg.com/) are required.

```
git clone https://github.com/Lissy93/dashy.git && cd dashy
yarn # Install dependencies
yarn build # Build the app
yarn start # Start the app
```
Then edit `./public/conf.yml` and rebuild the app with `yarn build`
---
## Alternative Deployment Method 2 - Netlify
Don't have a server? No problem! You can run Dashy for free on Netlify (as well as many [other cloud providers](./docs/deployment.md#deploy-to-cloud-service)). All you need it a GitHub account.
1. Fork Dashy's repository on GitHub
2. [Log in](app.netlify.com/login/) to Netlify with GitHub
3. Click "New site from Git" and select your forked repo, then click **Deploy**!
4. You can then edit the config in `./public/conf.yml` in your repo, and Netlify will rebuild the app
Loading

0 comments on commit 522bbca

Please sign in to comment.