diff --git a/.github/CHANGELOG.md b/.github/CHANGELOG.md index b44873c5..4f23d874 100644 --- a/.github/CHANGELOG.md +++ b/.github/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## ✨ 1.9.8 - More Widgets and Widget Improvements [PR #425](https://github.com/Lissy93/dashy/pull/425) +- Fixes several minor widget issues raised by users +- Adds several new widgets, for monitoring system +- Better widget data requests and error handling +- Implements widget support into Workspace view + ## πŸ› 1.9.7 - Minor UI Editor Bug fixes [PR #416](https://github.com/Lissy93/dashy/pull/416) - Fixes unable to edit item bug (#415) - Fixes unable to add new app bug (#390) diff --git a/docs/management.md b/docs/management.md index fc8336e2..d38881e4 100644 --- a/docs/management.md +++ b/docs/management.md @@ -1,6 +1,6 @@ -# Management +# App Management -_The following article explains aspects of app management, and is useful to know for when self-hosting. It covers everything from keeping the Dashy (or any other app) up-to-date, secure, backed up, to other topics like auto-starting, monitoring, log management, web server configuration and using custom environments. It's like a top-20 list of need-to-know knowledge for self-hosting._ +_The following article is a primer on managing self-hosted apps. It covers everything from keeping the Dashy (or any other app) up-to-date, secure, backed up, to other topics like auto-starting, monitoring, log management, web server configuration and using custom domains._ ## Contents - [Providing Assets](#providing-assets) @@ -15,9 +15,9 @@ _The following article explains aspects of app management, and is useful to know - [Authentication](#authentication) - [Managing with Compose](#managing-containers-with-docker-compose) - [Environmental Variables](#passing-in-environmental-variables) -- [Securing Containers](#container-security) - [Remote Access](#remote-access) - [Custom Domain](#custom-domain) +- [Securing Containers](#container-security) - [Web Server Configuration](#web-server-configuration) - [Running a Modified App](#running-a-modified-version-of-the-app) - [Building your Own Container](#building-your-own-container) @@ -288,6 +288,193 @@ If you've got many environmental variables, you might find it useful to put them --- +## Remote Access + +- [WireGuard](#wireguard) +- [Reverse SSH Tunnel](#reverse-ssh-tunnel) +- [TCP Tunnel](#tcp-tunnel) + +### WireGuard + +Using a VPN is one of the easiest ways to provide secure, full access to your local network from remote locations. [WireGuard](https://www.wireguard.com/) is a reasonably new open source VPN protocol, that was designed with ease of use, performance and security in mind. Unlike OpenVPN, it doesn't need to recreate the tunnel whenever connection is dropped, and it's also much easier to setup, using shared keys instead. + +- **Install Wireguard** - See the [Install Docs](https://www.wireguard.com/install/) for download links + instructions + - On Debian-based systems, it's `sudo apt install wireguard` +- **Generate a Private Key** - Run `wg genkey` on the Wireguard server, and copy it to somewhere safe for later +- **Create Server Config** - Open or create a file at `/etc/wireguard/wg0.conf` and under `[Interface]` add the following (see example below): + - `Address` - as a subnet of all desired IPs + - `PrivateKey` - that you just generated + - `ListenPort` - Default is `51820`, but can be anything +- **Get Client App** - Download the [WG client app](https://www.wireguard.com/install/) for your platform (Linux, Windows, MacOS, Android or iOS are all supported) +- **Create new Client Tunnel** - On your client app, there should be an option to create a new tunnel, when doing so a client private key will be generated (but if not, use the `wg genkey` command again), and keep it somewhere safe. A public key will also be generated, and this will go in our saver config +- **Add Clients to Server Config** - Head back to your `wg0.conf` file on the server, create a `[Peer]` section, and populate the following info + - `AllowedIPs` - List of IP address inside the subnet, the client should have access to + - `PublicKey` - The public key for the client you just generated +- **Start the Server** - You can now start the WG server, using: `wg-quick up wg0` on your server +- **Finish Client Setup** - Head back to your client device, and edit the config file, leave the private key as is, and add the following fields: + - `PublicKey` - The public key of the server + - `Address` - This should match the `AllowedIPs` section on the servers config file + - `DNS` - The DNS server that'll be used when accessing the network through the VPN + - `Endpoint` - The hostname or IP + Port where your WG server is running (you may need to forward this in your firewall's settings) +- **Done** - Your clients should now be able to connect to your WG server :) Depending on your networks firewall rules, you may need to port forward the address of your WG server + +**Example Server Config** + +```ini +# Server file +[Interface] +# Which networks does my interface belong to? Notice: /24 and /64 +Address = 10.5.0.1/24, 2001:470:xxxx:xxxx::1/64 +PrivateKey = xxx +ListenPort = 51820 + +# Peer 1 +[Peer] +PublicKey = xxx +# Which source IPs can I expect from that peer? Notice: /32 and /128 +AllowedIps = 10.5.0.35/32, 2001:470:xxxx:xxxx::746f:786f/128 + +# Peer 2 +[Peer] +PublicKey = xxx +# Which source IPs can I expect from that peer? This one has a LAN which can +# access hosts/jails without NAT. +# Peer 2 has a single IP address inside the VPN: it's 10.5.0.25/32 +AllowedIps = 10.5.0.25/32,10.21.10.0/24,10.21.20.0/24,10.21.30.0/24,10.31.0.0/24,2001:470:xxxx:xxxx::ca:571e/128 +``` + +**Example Client Config** + +```ini +[Interface] +# Which networks does my interface belong to? Notice: /24 and /64 +Address = 10.5.0.35/24, 2001:470:xxxx:xxxx::746f:786f/64 +PrivateKey = xxx + +# Server +[Peer] +PublicKey = xxx +# I want to route everything through the server, both IPv4 and IPv6. All IPs are +# thus available through the Server, and I can expect packets from any IP to +# come from that peer. +AllowedIPs = 0.0.0.0/0, ::0/0 +# Where is the server on the internet? This is a public address. The port +# (:51820) is the same as ListenPort in the [Interface] of the Server file above +Endpoint = 1.2.3.4:51820 +# Usually, clients are behind NAT. to keep the connection running, keep alive. +PersistentKeepalive = 15 +``` + + +A useful tool for getting WG setup is [Algo](https://github.com/trailofbits/algo). It includes scripts and docs which cover almost all devices, platforms and clients, and has best practices implemented, and security features enabled. All of this is better explained in [this blog post](https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/). + + +### Reverse SSH Tunnel + +SSH (or [Secure Shell](https://en.wikipedia.org/wiki/Secure_Shell)) is a secure tunnel that allows you to connect to a remote host. Unlike the VPN methods, an SSH connection does not require an intermediary, and will not be affected by your IP changing. However it only allows you to access a single service at a time. SSH was really designed for terminal access, but because of the latter mentioned benefits it's useful to setup, as a fallback option. + +Directly SSH'ing into your home, would require you to open a port (usually 22), which would be terrible for security, and is not recommended. However a reverse SSH connection is initiated from inside your network. Once the connection is established, the port is redirected, allowing you to use the established connection to SSH into your home network. + +The issue you've probably spotted, is that most public, corporate, and institutional networks will block SSH connections. To overcome this, you'd have to establish a server outside of your homelab that your homelab's device could SSH into to establish the reverse SSH connection. You can then connect to that remote server (the _mothership_), which in turn connects to your home network. + +Now all of this is starting to sound like quite a lot of work, but this is where services like [remot3.it](https://remote.it/) come in. They maintain the intermediary mothership server, and create the tunnel service for you. It's free for personal use, secure and easy. There are several similar services, such as [RemoteIoT](https://remoteiot.com/), or you could create your own on a cloud VPS (see [this tutorial](https://gist.github.com/nileshtrivedi/4c615e8d3c1bf053b0d31176b9e69e42) for more info on that). + +Before getting started, you'll need to head over to [Remote.it](https://app.remote.it/auth/#/sign-up) and create an account. + +Then setup your local device: +1. If you haven't already done so, you'll need to enable and configure SSH. + - This is out-of-scope of this article, but I've explained it in detail in [this post](https://notes.aliciasykes.com/22798/my-server-setup#configure-ssh). +2. Download the Remote.it install script from their [GitHub](https://github.com/remoteit/installer) + - `curl -LkO https://raw.githubusercontent.com/remoteit/installer/master/scripts/auto-install.sh` +3. Make it executable, with `chmod +x ./auto-install.sh`, and then run it with `sudo ./auto-install.sh` +4. Finally, configure your device, by running `sudo connectd_installer` and following the on-screen instructions + +And when you're ready to connect to it: +1. Login to [app.remote.it](https://app.remote.it/), and select the name of your device +2. You should see a list of running services, click SSH +3. You'll then be presented with some SSH credentials that you can now use to securely connect to your home, via the Remote.it servers + +Done :) + +### TCP Tunnel + +If you're running Dashy on your local network, behind a firewall, but need to temporarily share it with someone external, this can be achieved quickly and securely using [Ngrok](https://ngrok.com/). It’s basically a super slick, encrypted TCP tunnel that provides an internet-accessible address that anyone use to access your local service, from anywhere. + +To get started, [Download](https://ngrok.com/download) and install Ngrok for your system, then just run `ngrok http [port]` (replace the port with the http port where Dashy is running, e.g. 8080). When [using https](https://ngrok.com/docs#http-local-https), specify the full local url/ ip including the protocol. + +Some Ngrok features require you to be authenticated, you can [create a free account](https://dashboard.ngrok.com/signup) and generate a token in [your dashboard](https://dashboard.ngrok.com/auth/your-authtoken), then run `ngrok authtoken [token]`. + +It's recommended to use authentication for any publicly accessible service. Dashy has an [Auth](/docs/authentication.md) feature built in, but an even easier method it to use the [`-auth`](https://ngrok.com/docs#http-auth) switch. E.g. `ngrok http -auth=”username:password123” 8080` + +By default, your web app is assigned a randomly generated ngrok domain, but you can also use your own custom domain. Under the [Domains Tab](https://dashboard.ngrok.com/endpoints/domains) of your Ngrok dashboard, add your domain, and follow the CNAME instructions. You can now use your domain, with the [`-hostname`](https://ngrok.com/docs#http-custom-domains) switch, e.g. `ngrok http -region=us -hostname=dashy.example.com 8080`. If you don't have your own domain name, you can instead use a custom sub-domain (e.g. `alicia-dashy.ngrok.io`), using the [`-subdomain`](https://ngrok.com/docs#custom-subdomain-names) switch. + +To integrate this into your docker-compose, take a look at the [gtriggiano/ngrok-tunnel](https://github.com/gtriggiano/ngrok-tunnel) container. + +There's so much more you can do with Ngrok, such as exposing a directory as a file browser, using websockets, relaying requests, rewriting headers, inspecting traffic, TLS and TCP tunnels and lots more. All or which is explained in [the Documentation](https://ngrok.com/docs). + +It's worth noting that Ngrok isn't the only option here, other options include: [FRP](https://github.com/fatedier/frp), [Inlets](https://inlets.dev), [Local Tunnel](https://localtunnel.me/), [TailScale](https://tailscale.com/), etc. Check out [Awesome Tunneling](https://github.com/anderspitman/awesome-tunneling) for a list of alternatives. + +**[⬆️ Back to Top](#management)** + +--- + +## Custom Domain + +- [Using DNS](#using-nginx) +- [Using NGINX](#using-dns) + +### Using DNS +For locally running services, a domain can be set up directly in the DNS records. This method is really quick and easy, and doesn't require you to purchase an actual domain. Just update your networks DNS resolver, to point your desired URL to the local IP where Dashy (or any other app) is running. For example, a line in your hosts file might look something like: `192.168.0.2 dashy.homelab.local`. + +If you're using Pi-Hole, a similar thing can be done in the `/etc/dnsmasq.d/03-custom-dns.conf` file, add a line like: `address=/dashy.example.com/192.168.2.0` for each of your services. + +If you're running OPNSense/ PfSense, then this can be done through the UI with Unbound, it's explained nicely in [this article](https://homenetworkguy.com/how-to/use-custom-domain-name-in-internal-network/), by Dustin Casto. + +### Using NGINX +If you're using NGINX, then you can use your own domain name, with a config similar to the below example. + +``` +upstream dashy { + server 127.0.0.1:32400; +} + +server { + listen 80; + server_name dashy.mydomain.com; + + # Setup SSL + ssl_certificate /var/www/mydomain/sslcert.pem; + ssl_certificate_key /var/www/mydomain/sslkey.pem; + ssl_protocols TLSv1 TLSv1.1 TLSv1.2; + ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; + ssl_session_timeout 5m; + ssl_prefer_server_ciphers on; + + location / { + proxy_pass http://dashy; + proxy_redirect off; + proxy_buffering off; + proxy_set_header host $host; + proxy_set_header X-Real-IP $remote_addr; + proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; + proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; + } +} +``` +Similarly, a basic `Caddyfile` might look like: + +``` +dashy.example.com { + reverse_proxy / nginx:80 +} +``` + +For more info, [this guide](https://thehomelab.wiki/books/dns-reverse-proxy/page/create-domain-records-to-point-to-your-home-server-on-cloudflare-using-nginx-progy-manager) on Setting up Domains with NGINX Proxy Manager and CloudFlare may be useful. + +**[⬆️ Back to Top](#management)** + +--- + ## Container Security - [Keep Docker Up-To-Date](#keep-docker-up-to-date) @@ -429,174 +616,6 @@ Docker supports several modules that let you write your own security profiles. [Seccomp](https://en.wikipedia.org/wiki/Seccomp) (Secure Computing Mode) is a sandboxing facility in the Linux kernel that acts like a firewall for system calls (syscalls). It uses Berkeley Packet Filter (BPF) rules to filter syscalls and control how they are handled. These filters can significantly limit a containers access to the Docker Host’s Linux kernel - especially for simple containers/applications. It requires a Linux-based Docker host, with secomp enabled, and you can check for this by running `docker info | grep seccomp`. A great resource for learning more about this is [DockerLabs](https://training.play-with-docker.com/security-seccomp/). -**[⬆️ Back to Top](#management)** - ---- - -## Remote Access - -- [WireGuard](#wireguard) -- [Reverse SSH Tunnel](#reverse-ssh-tunnel) - -### WireGuard - -Using a VPN is one of the easiest ways to provide secure, full access to your local network from remote locations. [WireGuard](https://www.wireguard.com/) is a reasonably new open source VPN protocol, that was designed with ease of use, performance and security in mind. Unlike OpenVPN, it doesn't need to recreate the tunnel whenever connection is dropped, and it's also much easier to setup, using shared keys instead. - -- **Install Wireguard** - See the [Install Docs](https://www.wireguard.com/install/) for download links + instructions - - On Debian-based systems, it's `sudo apt install wireguard` -- **Generate a Private Key** - Run `wg genkey` on the Wireguard server, and copy it to somewhere safe for later -- **Create Server Config** - Open or create a file at `/etc/wireguard/wg0.conf` and under `[Interface]` add the following (see example below): - - `Address` - as a subnet of all desired IPs - - `PrivateKey` - that you just generated - - `ListenPort` - Default is `51820`, but can be anything -- **Get Client App** - Download the [WG client app](https://www.wireguard.com/install/) for your platform (Linux, Windows, MacOS, Android or iOS are all supported) -- **Create new Client Tunnel** - On your client app, there should be an option to create a new tunnel, when doing so a client private key will be generated (but if not, use the `wg genkey` command again), and keep it somewhere safe. A public key will also be generated, and this will go in our saver config -- **Add Clients to Server Config** - Head back to your `wg0.conf` file on the server, create a `[Peer]` section, and populate the following info - - `AllowedIPs` - List of IP address inside the subnet, the client should have access to - - `PublicKey` - The public key for the client you just generated -- **Start the Server** - You can now start the WG server, using: `wg-quick up wg0` on your server -- **Finish Client Setup** - Head back to your client device, and edit the config file, leave the private key as is, and add the following fields: - - `PublicKey` - The public key of the server - - `Address` - This should match the `AllowedIPs` section on the servers config file - - `DNS` - The DNS server that'll be used when accessing the network through the VPN - - `Endpoint` - The hostname or IP + Port where your WG server is running (you may need to forward this in your firewall's settings) -- **Done** - Your clients should now be able to connect to your WG server :) Depending on your networks firewall rules, you may need to port forward the address of your WG server - -**Example Server Config** - -```ini -# Server file -[Interface] -# Which networks does my interface belong to? Notice: /24 and /64 -Address = 10.5.0.1/24, 2001:470:xxxx:xxxx::1/64 -PrivateKey = xxx -ListenPort = 51820 - -# Peer 1 -[Peer] -PublicKey = xxx -# Which source IPs can I expect from that peer? Notice: /32 and /128 -AllowedIps = 10.5.0.35/32, 2001:470:xxxx:xxxx::746f:786f/128 - -# Peer 2 -[Peer] -PublicKey = xxx -# Which source IPs can I expect from that peer? This one has a LAN which can -# access hosts/jails without NAT. -# Peer 2 has a single IP address inside the VPN: it's 10.5.0.25/32 -AllowedIps = 10.5.0.25/32,10.21.10.0/24,10.21.20.0/24,10.21.30.0/24,10.31.0.0/24,2001:470:xxxx:xxxx::ca:571e/128 -``` - -**Example Client Config** - -```ini -[Interface] -# Which networks does my interface belong to? Notice: /24 and /64 -Address = 10.5.0.35/24, 2001:470:xxxx:xxxx::746f:786f/64 -PrivateKey = xxx - -# Server -[Peer] -PublicKey = xxx -# I want to route everything through the server, both IPv4 and IPv6. All IPs are -# thus available through the Server, and I can expect packets from any IP to -# come from that peer. -AllowedIPs = 0.0.0.0/0, ::0/0 -# Where is the server on the internet? This is a public address. The port -# (:51820) is the same as ListenPort in the [Interface] of the Server file above -Endpoint = 1.2.3.4:51820 -# Usually, clients are behind NAT. to keep the connection running, keep alive. -PersistentKeepalive = 15 -``` - - -A useful tool for getting WG setup is [Algo](https://github.com/trailofbits/algo). It includes scripts and docs which cover almost all devices, platforms and clients, and has best practices implemented, and security features enabled. All of this is better explained in [this blog post](https://blog.trailofbits.com/2016/12/12/meet-algo-the-vpn-that-works/). - - -### Reverse SSH Tunnel - -SSH (or [Secure Shell](https://en.wikipedia.org/wiki/Secure_Shell)) is a secure tunnel that allows you to connect to a remote host. Unlike the VPN methods, an SSH connection does not require an intermediary, and will not be affected by your IP changing. However it only allows you to access a single service at a time. SSH was really designed for terminal access, but because of the latter mentioned benefits it's useful to setup, as a fallback option. - -Directly SSH'ing into your home, would require you to open a port (usually 22), which would be terrible for security, and is not recommended. However a reverse SSH connection is initiated from inside your network. Once the connection is established, the port is redirected, allowing you to use the established connection to SSH into your home network. - -The issue you've probably spotted, is that most public, corporate, and institutional networks will block SSH connections. To overcome this, you'd have to establish a server outside of your homelab that your homelab's device could SSH into to establish the reverse SSH connection. You can then connect to that remote server (the _mothership_), which in turn connects to your home network. - -Now all of this is starting to sound like quite a lot of work, but this is where services like [remot3.it](https://remote.it/) come in. They maintain the intermediary mothership server, and create the tunnel service for you. It's free for personal use, secure and easy. There are several similar services, such as [RemoteIoT](https://remoteiot.com/), or you could create your own on a cloud VPS (see [this tutorial](https://gist.github.com/nileshtrivedi/4c615e8d3c1bf053b0d31176b9e69e42) for more info on that). - -Before getting started, you'll need to head over to [Remote.it](https://app.remote.it/auth/#/sign-up) and create an account. - -Then setup your local device: -1. If you haven't already done so, you'll need to enable and configure SSH. - - This is out-of-scope of this article, but I've explained it in detail in [this post](https://notes.aliciasykes.com/22798/my-server-setup#configure-ssh). -2. Download the Remote.it install script from their [GitHub](https://github.com/remoteit/installer) - - `curl -LkO https://raw.githubusercontent.com/remoteit/installer/master/scripts/auto-install.sh` -3. Make it executable, with `chmod +x ./auto-install.sh`, and then run it with `sudo ./auto-install.sh` -4. Finally, configure your device, by running `sudo connectd_installer` and following the on-screen instructions - -And when you're ready to connect to it: -1. Login to [app.remote.it](https://app.remote.it/), and select the name of your device -2. You should see a list of running services, click SSH -3. You'll then be presented with some SSH credentials that you can now use to securely connect to your home, via the Remote.it servers - -Done :) - -**[⬆️ Back to Top](#management)** - ---- - -## Custom Domain - -- [Using DNS](#using-nginx) -- [Using NGINX](#using-dns) - -### Using DNS -For locally running services, a domain can be set up directly in the DNS records. This method is really quick and easy, and doesn't require you to purchase an actual domain. Just update your networks DNS resolver, to point your desired URL to the local IP where Dashy (or any other app) is running. For example, a line in your hosts file might look something like: `192.168.0.2 dashy.homelab.local`. - -If you're using Pi-Hole, a similar thing can be done in the `/etc/dnsmasq.d/03-custom-dns.conf` file, add a line like: `address=/dashy.example.com/192.168.2.0` for each of your services. - -If you're running OPNSense/ PfSense, then this can be done through the UI with Unbound, it's explained nicely in [this article](https://homenetworkguy.com/how-to/use-custom-domain-name-in-internal-network/), by Dustin Casto. - -### Using NGINX -If you're using NGINX, then you can use your own domain name, with a config similar to the below example. - -``` -upstream dashy { - server 127.0.0.1:32400; -} - -server { - listen 80; - server_name dashy.mydomain.com; - - # Setup SSL - ssl_certificate /var/www/mydomain/sslcert.pem; - ssl_certificate_key /var/www/mydomain/sslkey.pem; - ssl_protocols TLSv1 TLSv1.1 TLSv1.2; - ssl_ciphers 'EECDH+AESGCM:EDH+AESGCM:AES256+EECDH:AES256+EDH'; - ssl_session_timeout 5m; - ssl_prefer_server_ciphers on; - - location / { - proxy_pass http://dashy; - proxy_redirect off; - proxy_buffering off; - proxy_set_header host $host; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; - proxy_next_upstream error timeout invalid_header http_500 http_502 http_503 http_504; - } -} -``` -Similarly, a basic `Caddyfile` might look like: - -``` -dashy.example.com { - reverse_proxy / nginx:80 -} -``` - -For more info, [this guide](https://thehomelab.wiki/books/dns-reverse-proxy/page/create-domain-records-to-point-to-your-home-server-on-cloudflare-using-nginx-progy-manager) on Setting up Domains with NGINX Proxy Manager and CloudFlare may be useful. - **[⬆️ Back to Top](#management)** --- diff --git a/docs/widgets.md b/docs/widgets.md index 852d516a..1861c6d1 100644 --- a/docs/widgets.md +++ b/docs/widgets.md @@ -7,29 +7,33 @@ Dashy has support for displaying dynamic content in the form of widgets. There a > Adding / editing widgets through the UI isn't yet supported, you will need to do this in the YAML config file. ##### Contents -- [General Widgets](#general-widgets) +- **[General Widgets](#general-widgets)** - [Clock](#clock) - [Weather](#weather) - [Weather Forecast](#weather-forecast) + - [RSS Feed](#rss-feed) + - [Public IP Address](#public-ip) - [Crypto Watch List](#crypto-watch-list) - [Crypto Price History](#crypto-token-price-history) - - [RSS Feed](#rss-feed) + - [Crypto Wallet Balance](#wallet-balance) - [Code Stats](#code-stats) + - [Email Aliases (AnonAddy)](#anonaddy) - [Vulnerability Feed](#vulnerability-feed) - - [Sports Scores](#sports-scores) - [Exchange Rates](#exchange-rates) - [Public Holidays](#public-holidays) + - [Covid-19 Status](#covid-19-status) + - [Sports Scores](#sports-scores) + - [News Headlines](#news-headlines) - [TFL Status](#tfl-status) - [Stock Price History](#stock-price-history) + - [ETH Gas Prices](#eth-gas-prices) - [Joke of the Day](#joke) - [XKCD Comics](#xkcd-comics) - - [News Headlines](#news-headlines) - [Flight Data](#flight-data) - [NASA APOD](#astronomy-picture-of-the-day) - [GitHub Trending](#github-trending) - [GitHub Profile Stats](#github-profile-stats) - - [Public IP Address](#public-ip) -- [Self-Hosted Services Widgets](#self-hosted-services-widgets) +- **[Self-Hosted Services Widgets](#self-hosted-services-widgets)** - [System Info](#system-info) - [Cron Monitoring](#cron-monitoring-health-checks) - [CPU History](#cpu-history-netdata) @@ -39,16 +43,31 @@ Dashy has support for displaying dynamic content in the form of widgets. There a - [Pi Hole Queries](#pi-hole-queries) - [Recent Traffic](#recent-traffic) - [Stat Ping Statuses](#stat-ping-statuses) -- [Dynamic Widgets](#dynamic-widgets) +- **[System Resource Monitoring](#system-resource-monitoring)** + - [CPU Usage Current](#current-cpu-usage) + - [CPU Usage Per Core](#cpu-usage-per-core) + - [CPU Usage History](#cpu-usage-history) + - [Memory Usage Current](#current-memory-usage) + - [Memory Usage History](#memory-usage-history) + - [Disk Space](#disk-space) + - [Disk IO](#disk-io) + - [System Load](#system-load) + - [System Load History](#system-load-history) + - [Network Interfaces](#network-interfaces) + - [Network Traffic](#network-traffic) + - [Resource Usage Alerts](#resource-usage-alerts) +- **[Dynamic Widgets](#dynamic-widgets)** - [Iframe Widget](#iframe-widget) - [HTML Embed Widget](#html-embedded-widget) - [API Response](#api-response) - [Prometheus Data](#prometheus-data) - [Data Feed](#data-feed) -- [Usage & Customizations](#usage--customizations) +- **[Usage & Customizations](#usage--customizations)** - [Widget Usage Guide](#widget-usage-guide) - [Continuous Updates](#continuous-updates) + - [Proxying Requests](#proxying-requests) - [Custom CSS Styling](#widget-styling) + - [Customizing Charts](#customizing-charts) - [Language Translations](#language-translations) - [Widget UI Options](#widget-ui-options) - [Building a Widget](#build-your-own-widget) @@ -68,6 +87,7 @@ A simple, live-updating time and date widget with time-zone support. All fields --- | --- | --- | --- **`timeZone`** | `string` | _Optional_ | The time zone to display date and time in.
Specified as Region/City, for example: `Australia/Melbourne`. See the [Time Zone DB](https://timezonedb.com/time-zones) for a full list of supported TZs. Defaults to the browser / device's local time **`format`** | `string` | _Optional_ | A country code for displaying the date and time in local format.
Specified as `[ISO-3166]-[ISO-639]`, for example: `en-AU`. See [here](https://www.fincher.org/Utilities/CountryLanguageList.shtml) for a full list of locales. Defaults to the browser / device's region +**`customCityName`** | `string` | _Optional_ | By default the city from the time-zone is shown, but setting this value will override that text **`hideDate`** | `boolean` | _Optional_ | If set to `true`, the date and city will not be shown. Defaults to `false` ##### Example @@ -129,7 +149,7 @@ Displays the weather (temperature and conditions) for the next few days for a gi **Field** | **Type** | **Required** | **Description** --- | --- | --- | --- -**`apiKey`** | `string` | Required | Your OpenWeatherMap API key. You can get one for free at [openweathermap.org](https://openweathermap.org/) +**`apiKey`** | `string` | Required | Your OpenWeatherMap API key. You can get one at [openweathermap.org](https://openweathermap.org/) or for free via the [OWM Student Plan](https://home.openweathermap.org/students) **`city`** | `string` | Required | A city name to use for fetching weather. This can also be a state code or country code, following the ISO-3166 format **`numDays`** | `number` | _Optional_ | The number of days to display of forecast info to display. Defaults to `4`, max `16` days **`units`** | `string` | _Optional_ | The units to use for displaying data, can be either `metric` or `imperial`. Defaults to `metric` @@ -154,6 +174,63 @@ Displays the weather (temperature and conditions) for the next few days for a gi --- +### RSS Feed + +Display news and updates from any RSS-enabled service. + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`rssUrl`** | `string` | Required | The URL location of your RSS feed +**`apiKey`** | `string` | _Optional_ | An API key for [rss2json](https://rss2json.com/). It's free, and will allow you to make 10,000 requests per day, you can sign up [here](https://rss2json.com/sign-up) +**`limit`** | `number` | _Optional_ | The number of posts to return. If you haven't specified an API key, this will be limited to 10 +**`orderBy`** | `string` | _Optional_ | How results should be sorted. Can be either `pubDate`, `author` or `title`. Defaults to `pubDate` +**`orderDirection`** | `string` | _Optional_ | Order direction of feed items to return. Can be either `asc` or `desc`. Defaults to `desc` + +##### Example + +```yaml +- type: rss-feed + options: + rssUrl: https://www.schneier.com/blog/atom.xml + apiKey: xxxx +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: 🟠 Optional +- **Price**: 🟠 Free Plan (up to 10,000 requests / day) +- **Privacy**: _See [Rss2Json Privacy Policy](https://rss2json.com/privacy-policy)_ + +--- + +### Public IP + +Often find yourself searching "What's my IP", just so you can check your VPN is still connected? This widget displays your public IP address, along with ISP name and approx location. Data is fetched from [IP-API.com](https://ip-api.com/). + +

+ +##### Options + +_No config options._ + +##### Example + +```yaml +- type: public-ip +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: 🟠 Optional +- **Price**: 🟒 Free +- **Host**: Managed Instance Only +- **Privacy**: _See [IP-API Privacy Policy](https://ip-api.com/docs/legal)_ + +--- ### Crypto Watch List @@ -236,36 +313,35 @@ Shows recent price history for a given crypto asset, using price data fetched fr --- -### RSS Feed +### Wallet Balance -Display news and updates from any RSS-enabled service. +Keep track of your crypto balances and see recent transactions. Data is fetched from [BlockCypher](https://www.blockcypher.com/dev/) -

+

##### Options **Field** | **Type** | **Required** | **Description** --- | --- | --- | --- -**`rssUrl`** | `string` | Required | The URL location of your RSS feed -**`apiKey`** | `string` | _Optional_ | An API key for [rss2json](https://rss2json.com/). It's free, and will allow you to make 10,000 requests per day, you can sign up [here](https://rss2json.com/sign-up) -**`limit`** | `number` | _Optional_ | The number of posts to return. If you haven't specified an API key, this will be limited to 10 -**`orderBy`** | `string` | _Optional_ | How results should be sorted. Can be either `pubDate`, `author` or `title`. Defaults to `pubDate` -**`orderDirection`** | `string` | _Optional_ | Order direction of feed items to return. Can be either `asc` or `desc`. Defaults to `desc` +**`coin`** | `string` | Required | Symbol of coin or asset, e.g. `btc`, `eth` or `doge` +**`address`** | `string` | Required | Address to monitor. This is your wallet's **public** / receiving address +**`network`** | `string` | _Optional_ | To use a different network, other than mainnet. Defaults to `main` +**`limit`** | `number` | _Optional_ | Limit the number of transactions to display. Defaults to `10`, set to large number to show all ##### Example ```yaml -- type: rss-feed +- type: wallet-balance options: - rssUrl: https://www.schneier.com/blog/atom.xml - apiKey: xxxx + coin: btc + address: 3853bSxupMjvxEYfwGDGAaLZhTKxB2vEVC ``` ##### Info - **CORS**: 🟒 Enabled -- **Auth**: 🟠 Optional -- **Price**: 🟠 Free Plan (up to 10,000 requests / day) -- **Privacy**: _See [Rss2Json Privacy Policy](https://rss2json.com/privacy-policy)_ +- **Auth**: 🟒 Not Required +- **Price**: 🟒 Free +- **Privacy**: _See [BlockCypher Privacy Policy](https://www.blockcypher.com/privacy.html)_ --- @@ -304,6 +380,50 @@ Display your coding summary. [Code::Stats](https://codestats.net/) is a free and --- +### AnonAddy + +[AnonAddy](https://anonaddy.com/) is a free and open source mail forwarding service. Use it to protect your real email address, by using a different alias for each of your online accounts, and have all emails land in your normal inbox(es). Supports custom domains, email replies, PGP-encryption, multiple recipients and more + +This widget display email addresses / aliases from AnonAddy. Click an email address to copy to clipboard, or use the toggle switch to enable/ disable it. Shows usage stats (bandwidth, used aliases etc), as well as total messages recieved, blocked and sent. Works with both self-hosted and managed instances of AnonAddy. + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`apiKey`** | `string` | Required | Your AnonAddy API Key / Personal Access Token. You can generate this under [Account Settings](https://app.anonaddy.com/settings) +**`hostname`** | `string` | _Optional_ | If your self-hosting AnonAddy, then supply the host name. By default it will use the public hosted instance +**`apiVersion`** | `string` | _Optional_ | If you're using an API version that is not version `v1`, then specify it here +**`limit`** | `number` | _Optional_ | Limit the number of emails shown per page. Defaults to `10` +**`sortBy`** | `string` | _Optional_ | Specify the sort order for email addresses. Defaults to `updated_at`. Can be either: `local_part`, `domain`, `email`, `emails_forwarded`, `emails_blocked`, `emails_replied`, `emails_sent`, `created_at`, `updated_at` or `deleted_at`. Precede with a `-` character to reverse order. +**`searchTerm`** | `string` | _Optional_ | A search term to filter results by, will search the email, description and domain +**`disableControls`** | `boolean` | _Optional_ | Prevent any changes being made to account through the widget. User will not be able to enable or disable aliases through UI when this option is set +**`hideMeta`** | `boolean` | _Optional_ | Don't show account meta info (forward/ block count, quota usage etc) +**`hideAliases`** | `boolean` | _Optional_ | Don't show email address / alias list. Will only show account meta info + +##### Example + +```yaml + - type: anonaddy + options: + apiKey: "xxxxxxxxxxxxxxxxxxxxxxxx\ + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\ + xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx" + limit: 5 + sortBy: created_at + disableControls: true +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: πŸ”΄ Required +- **Price**: 🟠 Free for Self-Hosted / Free Plan available on managed instance or $1/month for premium +- **Host**: Self-Hosted or Managed +- **Privacy**: _See [AnonAddy Privacy Policy](https://anonaddy.com/privacy/)_ + +--- + ### Vulnerability Feed Keep track of recent security advisories and vulnerabilities, with optional filtering by score, exploits, vendor and product. All fields are optional. @@ -349,39 +469,6 @@ or --- -### Sports Scores - -Show recent scores and upcoming matches from your favourite sports team. Data is fetched from [TheSportsDB.com](https://www.thesportsdb.com/). From the UI, you can click any other team to view their scores and upcoming games, or click a league name to see all teams. - -

- -##### Options - -**Field** | **Type** | **Required** | **Description** ---- | --- | --- | --- -**`teamId`** | `string` | __Optional__ | The ID of a team to fetch scores from. You can search for your team on the [Teams Page](https://www.thesportsdb.com/teams_main.php) -**`leagueId`** | `string` | __Optional__ | Alternatively, provide a league ID to fetch all games from. You can find the ID on the [Leagues Page](https://www.thesportsdb.com/Sport/Leagues) -**`pastOrFuture`** | `string` | __Optional__ | Set to `past` to show scores for recent games, or `future` to show upcoming games. Defaults to `past`. You can change this within the UI -**`apiKey`** | `string` | __Optional__ | Optionally specify your API key, which you can sign up for at [TheSportsDB.com](https://www.thesportsdb.com/) -**`limit`** | `number` | __Optional__ | To limit output to a certain number of matches, defaults to `15` - -##### Example - -```yaml -- type: sports-scores - options: - teamId: 133636 -``` - -##### Info -- **CORS**: 🟒 Enabled -- **Auth**: 🟠 Optional -- **Price**: 🟠 Free plan (upto 30 requests / minute, limited endpoints) -- **Host**: Managed Instance Only -- **Privacy**: ⚫ No Policy Available - ---- - ### Exchange Rates Display current FX rates in your native currency. Hover over a row to view more info, or click to show rates in that currency. @@ -452,6 +539,121 @@ Counting down to the next day off work? This widget displays upcoming public hol --- +### Covid-19 Status + +Keep track of the current COVID-19 status. Optionally also show cases by country, and a time-series chart. Uses live data from various sources, computed by [disease.sh](https://disease.sh/) + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`showChart`** | `boolean` | _Optional_ | Also display a time-series chart showing number of recent cases +**`showCountries`** | `boolean` | _Optional_ | Also display a list of cases per country +**`numDays`** | `number` | _Optional_ | Specify number of days worth of history to render on the chart +**`countries`** | `string[]` | _Optional_ | An array of countries to display, specified by their [ISO-3 codes](https://www.iso.org/obp/ui). Leave blank to show all, sorted by most cases. `showCountries` must be set to `true` +**`limit`** | `number` | _Optional_ | If showing all countries, set a limit for number of results to return. Defaults to `10`, no maximum + + +##### Example + +```yaml +- type: covid-stats +``` + +Or + +```yaml +- type: covid-stats + options: + showChart: true + showCountries: true + countries: + - GBR + - USA + - IND + - RUS +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: 🟒 Not Required +- **Price**: 🟒 Free +- **Host**: Managed Instance or Self-Hosted (see [disease-sh/api](https://github.com/disease-sh/api)) +- **Privacy**: ⚫ No Policy Available +- **Conditions**: [Terms of Use](https://github.com/disease-sh/api/blob/master/TERMS.md) + +--- + +### Sports Scores + +Show recent scores and upcoming matches from your favourite sports team. Data is fetched from [TheSportsDB.com](https://www.thesportsdb.com/). From the UI, you can click any other team to view their scores and upcoming games, or click a league name to see all teams. + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`teamId`** | `string` | __Optional__ | The ID of a team to fetch scores from. You can search for your team on the [Teams Page](https://www.thesportsdb.com/teams_main.php) +**`leagueId`** | `string` | __Optional__ | Alternatively, provide a league ID to fetch all games from. You can find the ID on the [Leagues Page](https://www.thesportsdb.com/Sport/Leagues) +**`pastOrFuture`** | `string` | __Optional__ | Set to `past` to show scores for recent games, or `future` to show upcoming games. Defaults to `past`. You can change this within the UI +**`apiKey`** | `string` | __Optional__ | Optionally specify your API key, which you can sign up for at [TheSportsDB.com](https://www.thesportsdb.com/) +**`limit`** | `number` | __Optional__ | To limit output to a certain number of matches, defaults to `15` + +##### Example + +```yaml +- type: sports-scores + options: + teamId: 133636 +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: 🟠 Optional +- **Price**: 🟠 Free plan (upto 30 requests / minute, limited endpoints) +- **Host**: Managed Instance Only +- **Privacy**: ⚫ No Policy Available + +--- + +### News Headlines + +Displays the latest news, click to read full article. Date is fetched from various news sources using [Currents API](https://currentsapi.services/en) + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`apiKey`** | `string` | Required | Your API key for CurrentsAPI. This is free, and you can [get one here](https://currentsapi.services/en/register) +**`country`** | `string` | _Optional_ | Fetch news only from a certain country or region. Specified as a country code, e.g. `GB` or `US`. See [here](https://api.currentsapi.services/v1/available/regions) for a list of supported regions +**`category`** | `string` | _Optional_ | Only return news from within a given category, e.g. `sports`, `programming`, `world`, `science`. The [following categories](https://api.currentsapi.services/v1/available/categories) are supported +**`lang`** | `string` | _Optional_ | Specify the language for returned articles as a 2-digit ISO code (limited article support). The [following languages](https://api.currentsapi.services/v1/available/languages) are supported, defaults to `en` +**`count`** | `number` | _Optional_ | Limit the number of results. Can be between `1` and `200`, defaults to `10` +**`keywords`** | `string` | _Optional_ | Only return articles that contain an exact match within their title or description + +##### Example + +```yaml +- type: news-headlines + options: + apiKey: xxxxxxx + category: world +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: πŸ”΄ Required +- **Price**: 🟠 Free plan (upto 600 requests / day) +- **Host**: Managed Instance Only +- **Privacy**: _See [CurrentsAPI Privacy Policy](https://currentsapi.services/privacy)_ + +--- + ### TFL Status Shows real-time tube status of the London Underground. All fields are optional. @@ -526,6 +728,31 @@ Shows recent price history for a given publicly-traded stock or share --- +### ETH Gas Prices + +Renders the current Gas cost of transactions on the Ethereum network (in both GWEI and USD), along with recent historical prices. Useful for spotting a good time to transact. Uses data from [ethgas.watch](https://ethgas.watch/) + +

+ +##### Options + +_No config options._ + +##### Example + +```yaml +- type: eth-gas-prices +``` + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: 🟒 Not Required +- **Price**: 🟒 Free +- **Host**: Managed Instance or Self-Hosted (see [wslyvh/ethgaswatch](https://github.com/wslyvh/ethgaswatch)) +- **Privacy**: ⚫ No Policy Available + +--- + ### Joke Renders a programming or generic joke. Data is fetched from the [JokesAPI](https://github.com/Sv443/JokeAPI) by @Sv443. All fields are optional. @@ -587,41 +814,6 @@ Have a laugh with the daily comic from [XKCD](https://xkcd.com/). A classic webc --- -### News Headlines - -Displays the latest news, click to read full article. Date is fetched from various news sources using [Currents API](https://currentsapi.services/en) - -

- -##### Options - -**Field** | **Type** | **Required** | **Description** ---- | --- | --- | --- -**`apiKey`** | `string` | Required | Your API key for CurrentsAPI. This is free, and you can [get one here](https://currentsapi.services/en/register) -**`country`** | `string` | _Optional_ | Fetch news only from a certain country or region. Specified as a country code, e.g. `GB` or `US`. See [here](https://api.currentsapi.services/v1/available/regions) for a list of supported regions -**`category`** | `string` | _Optional_ | Only return news from within a given category, e.g. `sports`, `programming`, `world`, `science`. The [following categories](https://api.currentsapi.services/v1/available/categories) are supported -**`lang`** | `string` | _Optional_ | Specify the language for returned articles as a 2-digit ISO code (limited article support). The [following languages](https://api.currentsapi.services/v1/available/languages) are supported, defaults to `en` -**`count`** | `number` | _Optional_ | Limit the number of results. Can be between `1` and `200`, defaults to `10` -**`keywords`** | `string` | _Optional_ | Only return articles that contain an exact match within their title or description - -##### Example - -```yaml -- type: news-headlines - options: - apiKey: xxxxxxx - category: world -``` - -##### Info -- **CORS**: 🟒 Enabled -- **Auth**: πŸ”΄ Required -- **Price**: 🟠 Free plan (upto 600 requests / day) -- **Host**: Managed Instance Only -- **Privacy**: _See [CurrentsAPI Privacy Policy](https://currentsapi.services/privacy)_ - ---- - ### Flight Data Displays airport departure and arrival flights, using data from [AeroDataBox](https://www.aerodatabox.com/). Useful if you live near an airport and often wonder where the flight overhead is going to. Hover over a row for more flight data. @@ -753,31 +945,6 @@ Display stats from your GitHub profile, using embedded cards from [anuraghazra/g --- -### Public IP - -Often find yourself searching "What's my IP", just so you can check your VPN is still connected? This widget displays your public IP address, along with ISP name and approx location. Data is fetched from [IP-API.com](https://ip-api.com/). - -

- -##### Options - -_No config options._ - -##### Example - -```yaml -- type: public-ip -``` - -##### Info -- **CORS**: 🟒 Enabled -- **Auth**: 🟠 Optional -- **Price**: 🟒 Free -- **Host**: Managed Instance Only -- **Privacy**: _See [IP-API Privacy Policy](https://ip-api.com/docs/legal)_ - ---- - ## Self-Hosted Services Widgets @@ -1046,6 +1213,249 @@ Displays the current and recent uptime of your running services, via a self-host --- +## System Resource Monitoring + +The easiest method for displaying system info and resource usage in Dashy is with [Glances](https://nicolargo.github.io/glances/). + +Glances is a cross-platform monitoring tool developed by [@nicolargo](https://github.com/nicolargo). It's similar to top/htop but with a [Rest API](https://glances.readthedocs.io/en/latest/api.html) and many [data exporters](https://glances.readthedocs.io/en/latest/gw/index.html) available. Under the hood, it uses [psutil](https://github.com/giampaolo/psutil) for retrieving system info. + +If you don't already have it installed, either follow the [Installation Guide](https://github.com/nicolargo/glances/blob/master/README.rst) for your system, or setup [with Docker](https://glances.readthedocs.io/en/latest/docker.html), or use the one-line install script: `curl -L https://bit.ly/glances | /bin/bash`. + +Glances can be launched with the `glances` command. You'll need to run it in web server mode, using the `-w` option for the API to be reachable. If you don't plan on using the Web UI, then you can disable it using `--disable-webui`. See the [command reference docs](https://glances.readthedocs.io/en/latest/cmds.html) for more info. + + +##### Options + +All Glance's based widgets require a `hostname`. All other parameters are optional. + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`hostname`** | `string` | Required | The URL or IP + port to your Glances instance (without a trailing slash) +**`username`** | `string` | _Optional_ | If you have setup basic auth on Glances, specify username here (defaults to `glances`) +**`password`** | `string` | _Optional_ | If you have setup basic auth on Glances, specify password here. **Note**: since this password is in plaintext, it is important not to reuse it anywhere else +**`apiVersion`** | `string` | _Optional_ | Specify an API version, defaults to V `3`. Note that support for older versions is limited +**`limit`** | `number` | _Optional_ | For widgets that show a time-series chart, optionally limit the number of data points returned. A higher number will show more historical results, but will take longer to load. A value between 300 - 800 is usually optimal + +##### Info +- **CORS**: 🟒 Enabled +- **Auth**: 🟠 Optional +- **Price**: 🟒 Free +- **Host**: Self-Hosted (see [GitHub - Nicolargo/Glances](https://github.com/nicolargo/glances)) +- **Privacy**: ⚫ No Policy Available + +##### Screenshot +[![example-screenshot](https://i.ibb.co/xfK6BGb/system-monitor-board.png)](https://ibb.co/pR6dMZT) + +--- + +### Current CPU Usage + +Live-updating current CPU usage, as a combined average across alll cores + +

+ +##### Example + +```yaml +- type: gl-current-cpu + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### CPU Usage Per Core + +Live-updating CPU usage breakdown per core + +

+ +##### Example + +```yaml +- type: gl-current-cores + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### CPU Usage History + +Recent CPU usage history, across all cores, and displayed by user and system + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`limit`** | `number` | _Optional_ | Limit the number of results returned, rendering more data points will take longer to load. Defaults to `100` + +##### Example + +```yaml +- type: gl-cpu-history + options: + hostname: http://192.168.130.2:61208 + limit: 60 +``` + +--- + +### Current Memory Usage + +Real-time memory usage gauge, with more info visible on click + +

+ +##### Example + +```yaml +- type: gl-current-mem + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### Memory Usage History + +Recent memory usage chart + +

+ +##### Options + +**Field** | **Type** | **Required** | **Description** +--- | --- | --- | --- +**`limit`** | `number` | _Optional_ | Limit the number of results returned, rendering more data points will take longer to load. Defaults to `100` + + +##### Example + +```yaml +- type: gl-mem-history + options: + hostname: http://localhost:61208 + limit: 80 +``` + +--- + +### Disk Space + +List connected disks, showing free / used space and other info (file system, mount point and space available) + +

+ +##### Example + +```yaml +- type: gl-disk-space + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### Disk IO + +Shows real-time read and write speeds and operations per sec for each disk + +

+ +##### Example + +```yaml +- type: gl-disk-io + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### System Load + +Shows the number of processes waiting in the run-queue, averaged across all cores. Displays for past 5, 10 and 15 minutes + +

+ +##### Example + +```yaml +- type: gl-system-load + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### System Load History + +Shows recent historical system load, calculated from the number of processes waiting in the run-queue, in 1, 5 and 15 minute intervals, and averaged across all cores. Optionally specify `limit` to set number of results returned, defaults to `500`, max `100000`, but the higher the number the longer the load and render times will be. + +

+ +##### Example + +```yaml +- type: gl-load-history + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### Network Interfaces + +Lists visible network interfaces, including real-time upload/ download stats + +

+ +##### Example + +```yaml +- type: gl-network-interfaces + options: + hostname: http://192.168.130.2:61208 +``` + +--- + +### Network Traffic + +Shows amount of data recently uploaded/ downloaded across all network interfaces. Optionally set the `limit` option to specify number historical of data points to return + +

+ +##### Example + +```yaml +- type: gl-network-traffic + options: + hostname: http://192.168.130.2:61208 + limit: 500 +``` + +--- + +### Resource Usage Alerts + +Lists recent high resource usage alerts (e.g. CPU, mem, IO, load, temp) + +

+ +##### Example + +```yaml +- type: gl-alerts + options: + hostname: http://192.168.130.2:61208 +``` + +--- + ## Dynamic Widgets ### Iframe Widget @@ -1195,19 +1605,6 @@ Note that if you have many widgets, and set them to continuously update frequent --- -### Widget Styling - -Like elsewhere in Dashy, all colours can be easily modified with CSS variables. - -Widgets use the following color variables, which can be overridden if desired: -- `--widget-text-color` - Text color, defaults to `--primary` -- `--widget-background-color` - Background color, defaults to `--background-darker` -- `--widget-accent-color` - Accent color, defaults to `--background` - -For more info on how to apply custom variables, see the [Theming Docs](/docs/theming.md#setting-custom-css-in-the-ui) - ---- - ### Proxying Requests If a widget fails to make a data request, and the console shows a CORS error, this means the server is blocking client-side requests. @@ -1233,6 +1630,35 @@ Vary: Origin --- +### Widget Styling + +Like elsewhere in Dashy, all colours can be easily modified with CSS variables. + +Widgets use the following color variables, which can be overridden if desired: +- `--widget-text-color` - Text color, defaults to `--primary` +- `--widget-background-color` - Background color, defaults to `--background-darker` +- `--widget-accent-color` - Accent color, defaults to `--background` + +For more info on how to apply custom variables, see the [Theming Docs](/docs/theming.md#setting-custom-css-in-the-ui) + +--- + +### Customizing Charts + +For widgets that contain charts, you can set an array of colors under `chartColors`. +To specify the chart height, set `chartHeight` to an integer (in `px`), defaults to `300`. +For example: + +```yaml +- type: gl-load-history + options: + hostname: http://192.168.130.2:61208 + chartColors: ['#9b5de5', '#f15bb5', '#00bbf9', '#00f5d4'] + chartHeight: 450 +``` + +--- + ### Language Translations Since most of the content displayed within widgets is fetched from an external API, unless that API supports multiple languages, translating dynamic content is not possible. @@ -1245,13 +1671,13 @@ For more info about multi-language support, see the [Internationalization Docs]( ### Widget UI Options -Widgets can be opened in full-page view, by clicking the Arrow icon (top-right). The URL in your address bar will also update, and visiting that web address will take you straight to the selected widget. +Widgets can be opened in full-page view, by clicking the Arrow icon (top-right). The URL in your address bar will also update, and visiting that web address directly will take you straight to that widget. You can reload the data of any widget, by clicking the Refresh Data icon (also in top-right). This will only affect the widget where the action was triggered from. -All [config options](/docs/configuring.md#section) that can be applied to sections, can also be applied to widget sections. For example, to make a widget span multiple columns, set `displayData.cols: 2` within the parent section. You can collapse a widget (by clicking the section title), and collapse state will be saved locally. +All [config options](/docs/configuring.md#section) that can be applied to sections, can also be applied to widget sections. For example, to make a widget section double the width, set `displayData.cols: 2` within the parent section. You can collapse a widget (by clicking the section title), and collapse state will be saved locally. -Widgets cannot currently be edited through the UI. This feature is in development, and will be released soon. In the meantime, you can either use the JSON config editor, or use VS Code or SSH into your box to edit the conf.yml file directly. +Widgets cannot currently be edited through the UI. This feature is in development, and will be released soon. In the meantime, you can either use the JSON config editor, or use [VS Code Server](https://github.com/coder/code-server), or just SSH into your box and edit the conf.yml file directly. --- @@ -1261,7 +1687,7 @@ Widgets are built in a modular fashion, making it easy for anyone to create thei For a full tutorial on creating your own widget, you can follow [this guide](/docs/development-guides.md#building-a-widget), or take a look at [here](https://github.com/Lissy93/dashy/commit/3da76ce2999f57f76a97454c0276301e39957b8e) for a code example. -Alternatively, for displaying simple data, you could also just use the either the [iframe](#iframe-widget), [embed](#html-embedded-widget), [Data Feed](#data-feed) or [API response](#api-response) widgets. +Alternatively, for displaying simple data, you could also just use the either the [iframe](#iframe-widget), [embed](#html-embedded-widget), [data feed](#data-feed) or [API response](#api-response) widgets. --- diff --git a/package.json b/package.json index 3eae86ad..f966d3de 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "Dashy", - "version": "1.9.7", + "version": "1.9.8", "license": "MIT", "main": "server", "author": "Alicia Sykes (https://aliciasykes.com)", diff --git a/services/cors-proxy.js b/services/cors-proxy.js index 97ac63b3..9c51214c 100644 --- a/services/cors-proxy.js +++ b/services/cors-proxy.js @@ -23,7 +23,7 @@ module.exports = (req, res) => { // Get desired URL, from Target-URL header const targetURL = req.header('Target-URL'); if (!targetURL) { - res.send(500, { error: 'There is no Target-Endpoint header in the request' }); + res.status(500).send({ error: 'There is no Target-Endpoint header in the request' }); return; } // Apply any custom headers, if needed @@ -40,8 +40,8 @@ module.exports = (req, res) => { // Make the request, and respond with result axios.request(requestConfig) .then((response) => { - res.send(200, response.data); + res.status(200).send(response.data); }).catch((error) => { - res.send(500, { error }); + res.status(500).send({ error }); }); }; diff --git a/src/assets/locales/en.json b/src/assets/locales/en.json index 2e25af9a..6f7e1cd6 100644 --- a/src/assets/locales/en.json +++ b/src/assets/locales/en.json @@ -271,6 +271,15 @@ "mem-breakdown-title": "Memory Breakdown", "load-chart-title": "System Load" }, + "glances": { + "disk-space-free": "Free", + "disk-space-used": "Used", + "disk-mount-point": "Mount Point", + "disk-file-system": "File System", + "disk-io-read": "Read", + "disk-io-write": "Write", + "system-load-desc": "Number of processes waiting in the run-queue, averaged across all cores" + }, "system-info": { "uptime": "Uptime" }, diff --git a/src/components/Charts/Gauge.vue b/src/components/Charts/Gauge.vue new file mode 100644 index 00000000..d4edc5cb --- /dev/null +++ b/src/components/Charts/Gauge.vue @@ -0,0 +1,366 @@ + + + + + diff --git a/src/components/Charts/PercentageChart.vue b/src/components/Charts/PercentageChart.vue new file mode 100644 index 00000000..d4b4b539 --- /dev/null +++ b/src/components/Charts/PercentageChart.vue @@ -0,0 +1,137 @@ + + + + + diff --git a/src/components/FormElements/Toggle.vue b/src/components/FormElements/Toggle.vue new file mode 100644 index 00000000..5471956c --- /dev/null +++ b/src/components/FormElements/Toggle.vue @@ -0,0 +1,142 @@ + + + + + diff --git a/src/components/Widgets/AnonAddy.vue b/src/components/Widgets/AnonAddy.vue new file mode 100644 index 00000000..0e466c05 --- /dev/null +++ b/src/components/Widgets/AnonAddy.vue @@ -0,0 +1,400 @@ + + + + + diff --git a/src/components/Widgets/Clock.vue b/src/components/Widgets/Clock.vue index 04bae1cc..aa5ccc51 100644 --- a/src/components/Widgets/Clock.vue +++ b/src/components/Widgets/Clock.vue @@ -1,7 +1,7 @@ + + diff --git a/src/components/Widgets/Weather.vue b/src/components/Widgets/Weather.vue index a2928d4b..364e1bb4 100644 --- a/src/components/Widgets/Weather.vue +++ b/src/components/Widgets/Weather.vue @@ -23,7 +23,6 @@ @@ -218,6 +189,9 @@ export default { &:not(:last-child) { border-bottom: 1px dashed var(--widget-text-color); } + span.lbl { + text-transform: capitalize; + } } } } diff --git a/src/components/Widgets/WeatherForecast.vue b/src/components/Widgets/WeatherForecast.vue index 83f883f8..3f77e4ea 100644 --- a/src/components/Widgets/WeatherForecast.vue +++ b/src/components/Widgets/WeatherForecast.vue @@ -31,8 +31,8 @@ @@ -266,6 +239,9 @@ export default { margin: 0.1rem 0.5rem; padding: 0.1rem 0; color: var(--widget-text-color); + span.lbl { + text-transform: capitalize; + } &:not(:last-child) { border-bottom: 1px dashed var(--widget-text-color); } diff --git a/src/components/Widgets/WidgetBase.vue b/src/components/Widgets/WidgetBase.vue index 3b810030..4691dd74 100644 --- a/src/components/Widgets/WidgetBase.vue +++ b/src/components/Widgets/WidgetBase.vue @@ -1,7 +1,7 @@