Skip to content

Commit

Permalink
🔀 Merge pull request #1528 from Lissy93/FEAT/Dashy-V3
Browse files Browse the repository at this point in the history
[FEAT] Remove the need for rebuild after config changes
  • Loading branch information
Lissy93 committed Apr 20, 2024
2 parents 6f94ac8 + ff2be31 commit 931915f
Show file tree
Hide file tree
Showing 97 changed files with 3,270 additions and 1,796 deletions.
99 changes: 59 additions & 40 deletions .env
Original file line number Diff line number Diff line change
@@ -1,40 +1,59 @@
# Store environmental variables here. All variables are optional.
# Lines beginning in '#' are ignored.

# Can be either development, production or test
# NODE_ENV=production

# The port to expose the running application on
# PORT=4000

# If you've proved SSL certs, then can set HTTPS port
# SSL_PORT=4001

# The host that Dashy is running on, domain or IP
# HOST=localhost

# The default base path for serving up static assets
# BASE_URL=./

# Optionally, specify the path of SSL private + public keys
# SSL_PRIV_KEY_PATH=/etc/ssl/certs/dashy-priv.key
# SSL_PUB_KEY_PATH=/etc/ssl/certs/dashy-pub.pem

# If SSL enabled, choose whether or not to redirect http to https
# Defaults to true
# REDIRECT_HTTPS=true

# Usually the same as BASE_URL, but accessible in frontend
# VUE_APP_DOMAIN=https://dashy.to

# Should enable SRI for build script and link resources
# INTEGRITY=true

# Computed automatically on build. Indicates if running in container
# IS_DOCKER=true

# Again, set automatically using package.json during build time
# VUE_APP_VERSION=2.0.0

# Directory for conf.yml backups
# BACKUP_DIR=./public/
# Store environmental variables here. All variables are optional.
# Lines beginning in '#' are ignored.

# Can be either development, production or test
# NODE_ENV=production

# The port to expose the running application on
# PORT=4000

# If you've proved SSL certs, then can set HTTPS port
# SSL_PORT=4001

# The host that Dashy is running on, domain or IP
# HOST=localhost

# The default base path for serving up static assets
# BASE_URL=./

# Optionally, specify the path of SSL private + public keys
# SSL_PRIV_KEY_PATH=/etc/ssl/certs/dashy-priv.key
# SSL_PUB_KEY_PATH=/etc/ssl/certs/dashy-pub.pem

# If SSL enabled, choose whether or not to redirect http to https
# Defaults to true
# REDIRECT_HTTPS=true

# The path to the user data directory
# USER_DATA_DIR=user-data

# Override where the path to the configuration file is, can be a remote URL
# VUE_APP_CONFIG_PATH=/conf.yml

# Usually the same as BASE_URL, but accessible in frontend
# VUE_APP_DOMAIN=https://dashy.to

# Override the page title for the frontend app
# VUE_APP_TITLE=''

# Set the default view to load on startup (can be `minimal`, `workspace` or `home`)
# VUE_APP_STARTING_VIEW=home

# Set the Vue app routing mode (can be 'hash', 'history' or 'abstract')
# VUE_APP_ROUTING_MODE=history

# Should enable SRI for build script and link resources
# INTEGRITY=true

# Computed automatically on build. Indicates if running in container
# IS_DOCKER=true

# Again, set automatically using package.json during build time
# VUE_APP_VERSION=2.0.0

# Directory for conf.yml backups
# BACKUP_DIR=./user-data/

# Setup any other user defined vars by prepending VUE_APP_ to the var name
# VUE_APP_pihole_ip=http://your.pihole.ip
# VUE_APP_pihole_key=your_pihole_secret_key
4 changes: 2 additions & 2 deletions .github/AUTHORS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -163,5 +163,5 @@ Lissy93 <Lissy93@users.noreply.github.com> - 222 commits
Alicia Bot <87835202+liss-bot@users.noreply.github.com> - 240 commits
liss-bot <liss-bot@d0h.co> - 244 commits
Alicia Sykes <gh@d0h.co> - 439 commits
Alicia Sykes <alicia@omg.lol> - 505 commits
Alicia Sykes <sykes.alicia@gmail.com> - 1488 commits
Alicia Sykes <alicia@omg.lol> - 471 commits
Alicia Sykes <sykes.alicia@gmail.com> - 1488 commits
1 change: 1 addition & 0 deletions .github/workflows/auto-tag-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ jobs:
bodyFile: ".github/LATEST_CHANGELOG.md"
mark-issue-fixed:
runs-on: ubuntu-latest
if: ${{ github.event_name == 'issues' }}
steps:
- uses: actions/checkout@v2
- name: Label Fixed Issues
Expand Down
14 changes: 0 additions & 14 deletions .github/workflows/broadcast-message.yml

This file was deleted.

1 change: 0 additions & 1 deletion .github/workflows/dependency-updates-summary.yml
Original file line number Diff line number Diff line change
Expand Up @@ -15,4 +15,3 @@ jobs:
collapsibleThreshold: '25'
failOnDowngrade: 'false'
path: 'yarn.lock'
updateComment: 'true'
15 changes: 0 additions & 15 deletions .github/workflows/generate-credits.yml
Original file line number Diff line number Diff line change
Expand Up @@ -66,18 +66,3 @@ jobs:
committer_username: liss-bot
committer_email: liss-bot@d0h.co

make-author-list:
runs-on: ubuntu-latest
steps:
- name: Checkout 🛎️
uses: actions/checkout@v2
with:
fetch-depth: 0
- uses: wow-actions/update-authors@v1.1.4
with:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
sort: commits
bots: true
path: .github/AUTHORS.txt
commit: ':blue_heart: Makes author list'
template: '{{name}} <{{email}}> - {{commits}} commits'
6 changes: 2 additions & 4 deletions .github/workflows/release-commenter.yml
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,8 @@ jobs:
- uses: apexskier/github-release-commenter@v1
with:
GITHUB_TOKEN: ${{ secrets.BOT_GITHUB_TOKEN || secrets.GITHUB_TOKEN }}
label-template: 🛩️ Released {release_tag}, 🔨 Fixed
label-template: 🛩️ Released {release_tag}
comment-template: |
**The fix for this issue has now been released in {release_name} ✨**
**This has now been released in {release_name} ✨**
If you haven't done so already, please [update your instance](https://github.com/Lissy93/dashy/blob/master/docs/management.md#updating) to `{release_tag}` or later. See {release_link} for full info.
Feel free to reach out if you need any more support. If you are enjoying Dashy, consider [supporting the project](https://github.com/Lissy93/dashy/blob/master/docs/contributing.md#contributing).
1 change: 1 addition & 0 deletions .yarnrc.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
nodeLinker: node-modules
4 changes: 1 addition & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ RUN yarn build --mode production
FROM node:20.11.1-alpine3.19

# Define some ENV Vars
ENV PORT=80 \
ENV PORT=8080 \
DIRECTORY=/app \
IS_DOCKER=true

Expand All @@ -40,8 +40,6 @@ RUN apk add --no-cache tzdata

# Copy built application from build phase
COPY --from=BUILD_IMAGE /app ./
# Ensure only one version of conf.yml exists
RUN rm dist/conf.yml

# Finally, run start command to serve up the built application
CMD [ "yarn", "build-and-start" ]
Expand Down
71 changes: 33 additions & 38 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,27 +6,12 @@
<img width="120" src="https://i.ibb.co/yhbt6CY/dashy.png" />
<br/>
<b><a href="./docs/showcase.md">User Showcase</a></b> | <b><a href="https://demo.dashy.to">Live Demo</a></b> | <b><a href="./docs/quick-start.md">Getting Started</a></b> | <b><a href="https://dashy.to/docs">Documentation</a></b> | <b><a href="https://github.com/Lissy93/dashy">GitHub</a></b>
<br/><br/>
<a href="https://github.com/awesome-selfhosted/awesome-selfhosted#personal-dashboards">
<img src="https://cdn.rawgit.com/sindresorhus/awesome/d7305f38d29fed78fa85652e3a63e154dd8e8829/media/badge.svg" alt="Awesome Self-Hosted">
</a>
<a href="./LICENSE">
<img src="https://img.shields.io/badge/License-MIT-0aa8d2?logo=opensourceinitiative&logoColor=fff" alt="License MIT">
</a>
<a href="./.github/CHANGELOG.md">
<img src="https://img.shields.io/github/package-json/v/lissy93/dashy?logo=azurepipelines&amp;color=0aa8d2" alt="Current Version">
</a>
<a href="https://hub.docker.com/r/lissy93/dashy">
<img src="https://img.shields.io/docker/pulls/lissy93/dashy?logo=docker&color=0aa8d2&logoColor=fff" alt="Docker Pulls">
</a>
<a href="http://as93.link/dashy-build-status">
<img src="https://badgen.net/github/status/lissy93/dashy?icon=github" alt="GitHub Status">
</a>
<a href="https://snyk.io/test/github/lissy93/dashy">
<img src="https://snyk.io/test/github/lissy93/dashy/badge.svg" alt="Known Vulnerabilities">
</a>
</p>

> [!NOTE]
> Version [3.0.0](https://github.com/Lissy93/dashy/releases/tag/3.0.0) has been released, and requires some changes to your setup, see [#1529](https://github.com/Lissy93/dashy/discussions/1529) for details.

<details>
<summary><b>Table of Contents</b></summary>
<p>
Expand Down Expand Up @@ -95,7 +80,7 @@

**Screenshots**: Checkout the [Showcase](./docs/showcase.md), to see example dashboards from the community

**Spin up your own demo**: [![One-Click Deploy with PWD](https://img.shields.io/badge/Play--with--Docker-Deploy-2496ed?style=flat-square&logo=docker)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/Lissy93/dashy/master/docker-compose.yml) or [`docker run -p 8080:80 lissy93/dashy`](./docs/quick-start.md)
**Spin up your own demo**: [![One-Click Deploy with PWD](https://img.shields.io/badge/Play--with--Docker-Deploy-2496ed?style=flat-square&logo=docker)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/Lissy93/dashy/master/docker-compose.yml) or [`docker run -p 8080:8080 lissy93/dashy`](./docs/quick-start.md)


<p align="center">
Expand All @@ -116,15 +101,15 @@
You will need [Docker](https://docs.docker.com/get-docker/) installed on your system

```
docker run -p 8080:80 lissy93/dashy
docker run -p 8080:8080 lissy93/dashy
```

Or

```docker
docker run -d \
-p 4000:80 \
-v /root/my-local-conf.yml:/app/public/conf.yml \
-p 4000:8080 \
-v /root/my-local-conf.yml:/app/user-data/conf.yml \
--name my-dashboard \
--restart=always \
lissy93/dashy:latest
Expand All @@ -140,7 +125,7 @@ See also: [examples with Docker Compose](./docs/deployment.md#using-docker-compo
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.

- Clone the Repo: `git clone https://github.com/Lissy93/dashy.git` and `cd dashy`
- Configuration: Fill in your settings in `./public/conf.yml`
- Configuration: Fill in your settings in `./user-data/conf.yml`
- Install dependencies: `yarn`
- Build: `yarn build`
- Run: `yarn start`
Expand Down Expand Up @@ -169,7 +154,7 @@ Dashy supports **1-Click deployments** on several popular cloud platforms. To sp

> For full configuration documentation, see: [**Configuring**](./docs/configuring.md)
Dashy is configured through a YAML file, located at `./public/conf.yml`. In addition, you can find a complete list of available options in the [Configuring Docs](./docs/configuring.md). The config can also be edited and saved directly through the UI.
Dashy is configured through a YAML file, located at `./user-data/conf.yml`. In addition, you can find a complete list of available options in the [Configuring Docs](./docs/configuring.md). The config can also be edited and saved directly through the UI.

**[⬆️ Back to Top](#dashy)**

Expand Down Expand Up @@ -581,7 +566,8 @@ Huge thanks to the sponsors helping to support Dashy's development!
<br />
<sub><b>Shrippen</b></sub>
</a>
</td>
</td></tr>
<tr>
<td align="center">
<a href="https://github.com/bile0026">
<img src="https://avatars.githubusercontent.com/u/5022496?u=aec96ad173c0ea9baaba93807efa8a848af6595c&v=4" width="80;" alt="bile0026"/>
Expand Down Expand Up @@ -843,16 +829,25 @@ For more info, see TLDR Legal's [Explanation of MIT](https://tldrlegal.com/licen

---


<p align="center">
<br>
<a href="https://dashboard.trackgit.com/token/ks0bx7bb14lsvbwoc3ik">
<img src="https://us-central1-trackgit-analytics.cloudfunctions.net/token/ping/ks0bx7bb14lsvbwoc3ik?style=flat-square" />
</a>
<br><br>
<a href="https://github.com/Lissy93/dashy">
<img src="https://github.githubassets.com/images/icons/emoji/octocat.png" />
</a>
<br><br>
<i>Thank you for Visiting</i>
<!-- License + Copyright -->
<p align="center">
<i>© <a href="https://aliciasykes.com">Alicia Sykes</a> 2024</i><br>
<i>Licensed under <a href="https://gist.github.com/Lissy93/143d2ee01ccc5c052a17">MIT</a></i><br>
<a href="https://github.com/lissy93"><img src="https://i.ibb.co/4KtpYxb/octocat-clean-mini.png" /></a><br>
<sup>Thanks for visiting :)</sup>
</p>

<!-- Dinosaurs are Awesome -->
<!--
. - ~ ~ ~ - .
.. _ .-~ ~-.
//| \ `..~ `.
|| | } } / \ \
(\ \\ \~^..' | } \
\`.-~ o / } | / \
(__ | / | / `.
`- - ~ ~ -._| /_ - ~ ~ ^| /- _ `.
| / | / ~-. ~- _
|_____| |_____| ~ - . _ _~_-_
-->

12 changes: 4 additions & 8 deletions docker-compose.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,21 +12,17 @@ services:
# To build from source, replace 'image: lissy93/dashy' with 'build: .'
# build: .

# Or, to use a Dockerfile for your archtecture, uncomment the following
# context: .
# dockerfile: ./docker/Dockerfile-arm32v7

# You can also use an image with a different tag, or pull from a different registry, e.g:
# image: ghcr.io/lissy93/dashy or image: lissy93/dashy:arm64v8
# image: ghcr.io/lissy93/dashy or image: lissy93/dashy:3.0.0

# Pass in your config file below, by specifying the path on your host machine
# volumes:
# - /path/to/my-config.yml:/app/public/conf.yml
# - /path/to/item-icons:/app/public/item-icons
# - /path/to/my-config.yml:/app/user-data/conf.yml
# - /path/to/item-icons:/app/user-data/item-icons/

# Set port that web service will be served on. Keep container port as 80
ports:
- 4000:80
- 4000:8080

# Set any environmental variables
environment:
Expand Down
4 changes: 2 additions & 2 deletions docker/docker-readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@

**Screenshots**: Checkout the [Showcase](https://github.com/Lissy93/dashy/blob/master/docs/showcase.md), to see example dashboards from the community

**Spin up your own demo**: [![One-Click Deploy with PWD](https://img.shields.io/badge/Play--with--Docker-Deploy-2496ed?style=flat-square&logo=docker)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/Lissy93/dashy/master/docker-compose.yml) or [`docker run -p 8080:80 lissy93/dashy`](./docs/quick-start.md)
**Spin up your own demo**: [![One-Click Deploy with PWD](https://img.shields.io/badge/Play--with--Docker-Deploy-2496ed?style=flat-square&logo=docker)](https://labs.play-with-docker.com/?stack=https://raw.githubusercontent.com/Lissy93/dashy/master/docker-compose.yml) or [`docker run -p 8080:8080 lissy93/dashy`](./docs/quick-start.md)


<p align="center">
Expand All @@ -69,7 +69,7 @@

## Getting Started 🛫

To deploy Dashy with Docker, just run `docker run -p 8080:80 lissy93/dashy`, then open `http://localhost:8080`
To deploy Dashy with Docker, just run `docker run -p 8080:8080 lissy93/dashy`, then open `http://localhost:8080`

For full list of options and a Docker compose file, see the [Deployment Docs](https://github.com/Lissy93/dashy/blob/master/docs/deployment.md).

Expand Down
2 changes: 1 addition & 1 deletion docs/assets/CONTRIBUTORS.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 1 addition & 1 deletion docs/assets/repo-visualization.svg
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
9 changes: 7 additions & 2 deletions docs/authentication.md
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,19 @@


> [!IMPORTANT]
> Dashy's built-in auth is not indented to protect a publicly hosted instance against unauthorized access. Instead you should use an auth provider compatible with your reverse proxy, or access Dashy via your VPN.
> Dashy's built-in auth is not indented to protect a publicly hosted instance against unauthorized access. Instead you should use an auth provider compatible with your reverse proxy, or access Dashy via your VPN, or implement your own SSO logic.
>
> In cases where Dashy is only accessibly within your home network, and you just want to add a login page, then the built-in auth may be sufficient, but keep in mind that configuration can still be accessed.
## Built-In Auth

Dashy has a basic login page included, and frontend authentication. You can enable this by adding users to the `auth` section under `appConfig` in your `conf.yml`. If this section is not specified, then no authentication will be required to access the app, and the homepage will resolve to your dashboard.

> [!NOTE]
> Since the auth is initiated in the main app entry point (for security), a rebuild is required to apply changes to the auth configuration.
> You can trigger a rebuild through the UI, under Config --> Rebuild, or by running `yarn build` in the root directory.

### Setting Up Authentication

The `auth` property takes an array of users. Each user needs to include a username, hash and optional user type (`admin` or `normal`). The hash property is a [SHA-256 Hash](https://en.wikipedia.org/wiki/SHA-2) of your desired password.
Expand Down Expand Up @@ -263,7 +268,7 @@ In NGINX you can specify [control access](https://docs.nginx.com/nginx/admin-gui

```text
server {
listen 80;
listen 8080;
server_name www.dashy.example.com;
location / {
root /path/to/dashy/;
Expand Down
2 changes: 2 additions & 0 deletions docs/backup-restore.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
# Cloud Backup and Restore

Beyond the cloud backup/restore service, there are several other self-hosted options you can use to backup Dashy, and any other Docker container data. These are outlined in the Management docs, at: [Docker Backup Options](/docs/management.md#backing-up).

Dashy has a 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.
Expand Down

0 comments on commit 931915f

Please sign in to comment.