This reverts commit 93c18a8077.
Revert "Fix synology param encoding"
This reverts commit bc3adf1f2a.
Revert "I think this will actually fix the synology handler"
This reverts commit 30fd42dba4.
* Added cookie support for auth on ESPHome widget
* Lint
* Use credentialedProxyHandler instead
---------
Co-authored-by: shamoon <4887959+shamoon@users.noreply.github.com>
* Restrict emby endpoints and proxy segments
* Dont allow path traversal in segments
* Restrict qbittorrent proxy endpoints
* Restrict npm proxy endpoints
* Restrict flood proxy endpoints
* Restrict tdarr proxy endpoints
* Restrict xteve proxy endpoints
* Restrict transmission proxy endpoints
* disallow non-mapped endpoints
this change drops all requests that have un-mapped endpoint queries
allowedEndpoints is added as a method to pass proxy requests via a regex on the endpoint
most widgets with custom proxies use either no endpoint, or a static one
Co-Authored-By: Ben Phelps <ben@phelps.io>
* Restrict emby endpoints and proxy segments
* Dont allow path traversal in segments
* Restrict qbittorrent proxy endpoints
* Restrict npm proxy endpoints
* Restrict flood proxy endpoints
* Restrict tdarr proxy endpoints
* Restrict xteve proxy endpoints
* Restrict transmission proxy endpoints
* disallow non-mapped endpoints
this change drops all requests that have un-mapped endpoint queries
allowedEndpoints is added as a method to pass proxy requests via a regex on the endpoint
most widgets with custom proxies use either no endpoint, or a static one
Co-Authored-By: Ben Phelps <ben@phelps.io>
description:Please include output from your [troubleshooting tests](https://gethomepage.dev/latest/more/troubleshooting/#service-widget-errors), if relevant.
description:Please include output from your [troubleshooting steps](https://gethomepage.dev/more/troubleshooting/#service-widget-errors), if relevant.
validations:
required:true
- type:markdown
attributes:
value:|
## ⚠️ STOP ⚠️
Before you submit this support request, please ensure you have entered your configuration files and actually followed the steps from the troubleshooting guide linked above *and posted the output*, if relevant. The troubleshooting steps often help to solve the problem or at least can help figure it out.
*Please remember that this project is maintained by regular people **just like you**, so if you don't take the time to fill out the requested information, don't expect a reply back.*
⚠️ Before opening this pull request please review the guidelines in the checklist below.
If this PR does not meet those guidelines it will not be accepted, and everyone will be sad.
-->
## Proposed change
<!--
Please include a summary of the change. Screenshots and/or videos can also be helpful if appropriate.
*** Please see the development guidelines for new widgets: https://gethomepage.dev/latest/more/development/#service-widget-guidelines
*** If you do not follow these guidelines your PR will likely be closed without review.
New service widgets should include example(s) of relevant API output as well as updates to the docs for the new widget.
-->
@@ -19,13 +28,13 @@ What type of change does your PR introduce to Homepage?
- [ ] New service widget
- [ ] Bug fix (non-breaking change which fixes an issue)
- [ ] New feature (non-breaking change which adds functionality)
- [ ] New feature or enhancement (non-breaking change which adds functionality)
- [ ] Documentation only
- [ ] Other (please explain)
## Checklist:
- [ ] If applicable, I have added corresponding documentation changes.
- [ ] If applicable, I have reviewed the [feature](https://gethomepage.dev/latest/more/development/#new-feature-guidelines) and / or [service widget guidelines](https://gethomepage.dev/latest/more/development/#service-widget-guidelines).
- [ ] I have checked that all code style checks pass using [pre-commit hooks](https://gethomepage.dev/latest/more/development/#code-formatting-with-pre-commit-hooks) and [linting checks](https://gethomepage.dev/latest/more/development/#code-linting).
- [ ] If applicable, I have reviewed the [feature / enhancement](https://gethomepage.dev/more/development/#new-feature-guidelines) and / or [service widget guidelines](https://gethomepage.dev/more/development/#service-widget-guidelines).
- [ ] I have checked that all code style checks pass using [pre-commit hooks](https://gethomepage.dev/more/development/#code-formatting-with-pre-commit-hooks) and [linting checks](https://gethomepage.dev/more/development/#code-linting).
- [ ] If applicable, I have tested my code for new features & regressions on both mobile & desktop devices, using the latest version of major browsers.
@@ -38,11 +38,11 @@ People _love_ thorough bug reports. I'm not even kidding.
## Development Guidelines
Please see the [documentation regarding development](https://gethomepage.dev/latest/more/development/) and specifically the [guidelines for new service widgets](https://gethomepage.dev/latest/more/development/#service-widget-guidelines) if you are considering making one.
Please see the [documentation regarding development](https://gethomepage.dev/more/development/) and specifically the [guidelines for new service widgets](https://gethomepage.dev/more/development/#service-widget-guidelines) if you are considering making one.
## Use a Consistent Coding Style
Please see information in the docs regarding [code formatting with pre-commit hooks](https://gethomepage.dev/latest/more/development/#code-formatting-with-pre-commit-hooks).
Please see information in the docs regarding [code formatting with pre-commit hooks](https://gethomepage.dev/more/development/#code-formatting-with-pre-commit-hooks).
## License
@@ -63,7 +63,7 @@ The homepage team appreciates all effort and interest from the community in fili
- Issues, pull requests and discussions that are closed will be locked after 30 days of inactivity.
- Discussions with a marked answer will be automatically closed.
- Discussions in the 'General' or 'Support' categories will be closed after 180 days of inactivity.
- Feature requests that do not meet the following thresholds will be closed: 5 "up-votes" after 180 days of inactivity or 10 "up-votes" after 365 days.
- Feature requests that do not meet the following thresholds will be closed: 10 "up-votes" after 180 days of inactivity or 20 "up-votes" after 365 days.
In all cases, threads can be re-opened by project maintainers and, of course, users can always create a new discussion for related concerns.
Finally, remember that all information remains searchable and 'closed' feature requests can still serve as inspiration for new features.
&& apk add --no-cache --virtual .gyp python3 make g++ \
&& npm install -g pnpm
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store pnpm fetch | grep -v "cross-device link not permitted\|Falling back to copying packages from store"
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store pnpm install -r --offline
RUN --mount=type=cache,id=pnpm-store,target=/root/.local/share/pnpm/store pnpm fetch | grep -v "cross-device link not permitted\|Falling back to copying packages from store"
<em>Homepage builds are kindly powered by DigitalOcean.</em>
</p>
# Features
With features like quick search, bookmarks, weather support, a wide range of integrations and widgets, an elegant and modern design, and a focus on performance, Homepage is your ideal start to the day and a handy companion throughout it.
- **Fast** - The site is statically generated at build time for instant load times.
- **Secure** - All API requests to backend services are proxied, keeping your API keys hidden. Constantly reviewed for security by the community.
- **For Everyone** - Images built for AMD64, ARM64, ARMv7, and ARMv6.
- **For Everyone** - Images built for AMD64, ARM64.
- **Full i18n** - Support for over 40 languages.
- **Service & Web Bookmarks** - Add custom links to the homepage.
- **Docker Integration** - Container status and stats. Automatic service discovery via labels.
@@ -41,37 +48,41 @@ With features like quick search, bookmarks, weather support, a wide range of int
## Docker Integration
Homepage has built-in support for Docker, and can automatically discover and add services to the homepage based on labels. See the [Docker Service Discovery](https://gethomepage.dev/latest/configs/docker/#automatic-service-discovery) page for more information.
Homepage has built-in support for Docker, and can automatically discover and add services to the homepage based on labels. See the [Docker Service Discovery](https://gethomepage.dev/configs/docker/#automatic-service-discovery) page for more information.
## Service Widgets
Homepage also has support for over 100 3rdparty services, including all popular starr apps, and most popular self-hosted apps. Some examples include: Radarr, Sonarr, Lidarr, Bazarr, Ombi, Tautulli, Plex, Jellyfin, Emby, Transmission, qBittorrent, Deluge, Jackett, NZBGet, SABnzbd, etc. As well as service integrations, Homepage also has a number of information providers, sourcing information from a variety of external 3rdparty APIs. See the [Service](https://gethomepage.dev/latest/widgets/) page for more information.
Homepage also has support for hundreds of 3rd-party services, including all popular \*arr apps, and most popular self-hosted apps. Some examples include: Radarr, Sonarr, Lidarr, Bazarr, Ombi, Tautulli, Plex, Jellyfin, Emby, Transmission, qBittorrent, Deluge, Jackett, NZBGet, SABnzbd, etc. As well as service integrations, Homepage also has a number of information providers, sourcing information from a variety of external 3rd-party APIs. See the [Service](https://gethomepage.dev/widgets/) page for more information.
## Information Widgets
Homepage has built-in support for a number of information providers, including weather, time, date, search, glances and more. System and status information presented at the top of the page. See the [Information Providers](https://gethomepage.dev/latest/widgets/) page for more information.
Homepage has built-in support for a number of information providers, including weather, time, date, search, glances and more. System and status information presented at the top of the page. See the [Information Providers](https://gethomepage.dev/widgets/) page for more information.
## Customization
Homepage is highly customizable, with support for custom themes, custom CSS & JS, custom layouts, formatting, localization and more. See the [Settings](https://gethomepage.dev/latest/configs/settings/) page for more information.
Homepage is highly customizable, with support for custom themes, custom CSS & JS, custom layouts, formatting, localization and more. See the [Settings](https://gethomepage.dev/configs/settings/) page for more information.
# Getting Started
For configuration options, examples and more, [please check out the homepage documentation](http://gethomepage.dev).
## Security Notice 🔒
Please note that when using features such as widgets, Homepage can access personal information (for example from your home automation system) and Homepage currently does not (and is not planned to) include any authentication layer itself. Thus, we recommend homepage be deployed behind a reverse proxy including authentication, SSL etc, and / or behind a VPN.
## With Docker
Using docker compose:
```yaml
version:"3.3"
services:
homepage:
image:ghcr.io/gethomepage/homepage:latest
container_name:homepage
environment:
PUID:1000-- optional, your user id
PGID:1000-- optional, your group id
HOMEPAGE_ALLOWED_HOSTS:gethomepage.dev# required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts
Then install dependencies and build the production bundle (I'm using pnpm here, you can use npm or yarn if you like):
Then install dependencies and build the production bundle:
```bash
pnpm install
@@ -116,15 +128,9 @@ Finally, run the server in production mode:
pnpm start
```
or development mode:
```bash
pnpm dev
```
# Configuration
Please refer to the [homepage documentation](https://gethomepage.dev/) website for more information. Everything you need to know about configuring Homepage is there. Please read everything carefully before asking for help, as most questions are answered there or are simple YAML configuration issues.
Please refer to the [homepage documentation website](https://gethomepage.dev/) for more information. Everything you need to know about configuring Homepage is there. Please read everything carefully before asking for help, as most questions are answered there or are simple YAML configuration issues.
# Development
@@ -164,6 +170,10 @@ mkdocs serve # or build, to build the static site
If you have any questions, suggestions, or general issues, please start a discussion on the [Discussions](https://github.com/gethomepage/homepage/discussions) page.
## Troubleshooting
In addition to the docs, the [troubleshooting guide](https://gethomepage.dev/troubleshooting/) can help reveal many basic config or network issues. If you're having a problem, it's a good place to start.
## Contributing & Contributors
Contributions are welcome! Please see the [CONTRIBUTING.md](CONTRIBUTING.md) file for more information.
@@ -20,7 +20,7 @@ Since Docker supports connecting with TLS and client certificate authentication,
```yaml
my-remote-docker:
host:192.168.0.101
port:275
port:2375
tls:
keyFile:tls/key.pem
caFile:tls/ca.pem
@@ -66,6 +66,30 @@ my-docker:
port:2375
```
Use `protocol: https` if you’re connecting through a reverse proxy (e.g., Traefik) that serves the Docker API over HTTPS:
```yaml
my-docker:
host:dockerproxy
port:443
protocol:https
```
!!! note
Note: This does not require TLS certificates if the proxy handles encryption. Do not use `protocol: https` unless you’re sure the target host supports HTTPS.
You can also include `headers` for the connection, for example, if you are using a reverse proxy that requires authentication:
```yaml
my-docker:
host:dockerproxy
port:443
protocol:https
headers:
Authorization:Basic <base64-encoded-credentials>
```
## Using Socket Directly
If you'd rather use the socket directly, first make sure that you're passing the local socket into the Docker container.
Multiple widgets can be specified by incrementing the index, e.g.
```yaml
labels:...
- homepage.widgets[0].type=emby
- homepage.widgets[0].url=http://emby.home
- homepage.widgets[0].key=yourembyapikeyhere
- homepage.widgets[1].type=uptimekuma
- homepage.widgets[1].url=http://uptimekuma.home
- homepage.widgets[1].slug=youreventslughere
```
You can add specify fields for e.g. the [CustomAPI](../widgets/services/customapi.md) widget by using array-style dot notation:
```yaml
@@ -203,7 +239,7 @@ In order to detect every service within the Docker swarm it is necessary that se
## Multiple Homepage Instances
The optional field `instanceName` can be configured in [settings.md](settings.md#instance-name) to differentiate between multiple homepage instances.
The optional field `instanceName` can be configured in [settings.yaml](settings.md#instance-name) to differentiate between multiple homepage instances.
To limit a label to an instance, insert `.instance.{{instanceName}}` after the `homepage` prefix.
@@ -235,4 +271,4 @@ You can show the docker stats by clicking the status indicator but this can also
showStats:true
```
Also see the settings for [show docker stats](docker.md#show-docker-stats).
Also see the settings for [show docker stats](settings.md#show-docker-stats).
Homepage uses YAML for configuration, YAML stands for "YAML Ain't Markup Language.". It's a human-readable data serialization format that's a superset of JSON. Great for config files, easy to read and write. Supports complex data types like lists and objects. **Indentation matters.** If you already use Docker Compose, you already use YAML.
Information widgets are widgets that provide information about your system or environment and are displayed at the top of the homepage. You can find a list of all available info widgets under the [Info Widgets](../widgets/info/index.md) section.
Info widgets are defined in the widgets.yaml
Each widget has its own configuration options, which are detailed in the widget's documentation.
## Layout
Info widgets are displayed in the order they are defined in the `widgets.yaml` file. You can change the order by moving the widgets around in the file. However, some widgets (weather, search and datetime) are aligned to the right side of the screen which can affect the layout of the widgets.
## Adding A Link
You can add a link to an info widget such as the logo or text widgets by adding an `href` option, for example:
@@ -8,6 +8,7 @@ The Kubernetes connectivity has the following requirements:
- Kubernetes 1.19+
- Metrics Service
- An Ingress controller
- Optionally: Gateway-API
The Kubernetes connection is configured in the `kubernetes.yaml` file. There are 3 modes to choose from:
@@ -19,6 +20,22 @@ The Kubernetes connection is configured in the `kubernetes.yaml` file. There are
mode:default
```
To configure Kubernetes gateway-api, ingress or ingressRoute service discovery, add one or multiple of the following settings.
Example settings:
```yaml
ingress:true# default, enable ingress only
```
or
```yaml
ingress:true# default, enable ingress
traefik:true# enable traefik ingressRoute
gateway:true# enable gateway-api
```
## Services
Once the Kubernetes connection is configured, individual services can be configured to pull statistics. Only CPU and Memory are currently supported.
@@ -36,7 +53,7 @@ Inside of the service you'd like to connect to a pod:
The `app` field is used to create a label selector, in this example case it would match pods with the label: `app.kubernetes.io/name=emby`.
Sometimes this is insufficient for complex or atypical application deployments. In these cases, the `pod-selector` field can be used. Any field selector can be used with it, so it allows for some very powerful selection capabilities.
Sometimes this is insufficient for complex or atypical application deployments. In these cases, the `podSelector` field can be used. Any field selector can be used with it, so it allows for some very powerful selection capabilities.
For instance, it can be utilized to roll multiple underlying deployments under one application to see a high-level aggregate:
@@ -47,7 +64,7 @@ For instance, it can be utilized to roll multiple underlying deployments under o
description:Matrix Synapse Powered Chat
app:matrix-element
namespace:comms
pod-selector:>-
podSelector:>-
app.kubernetes.io/instance in (
matrix-element,
matrix-media-repo,
@@ -58,7 +75,7 @@ For instance, it can be utilized to roll multiple underlying deployments under o
!!! note
A blank string as a pod-selector does not deactivate it, but will actually select all pods in the namespace. This is a useful way to capture the resource usage of a complex application siloed to a single namespace, like Longhorn.
A blank string as a podSelector does not deactivate it, but will actually select all pods in the namespace. This is a useful way to capture the resource usage of a complex application siloed to a single namespace, like Longhorn.
## Automatic Service Discovery
@@ -98,6 +115,10 @@ When the Kubernetes cluster connection has been properly configured, this servic
If you are using multiple instances of homepage, an `instance` annotation can be specified to limit services to a specific instance. If no instance is provided, the service will be visible on all instances.
If you have a single service that needs to be shown on multiple specific instances of homepage (but not on all of them), the service can be annotated by multiple `instance.name` annotations, where `name` can be the names of your specific multiple homepage instances. For example, a service that is annotated with `gethomepage.dev/instance.public: ""` and `gethomepage.dev/instance.internal: ""` will be shown on `public` and `internal` homepage instances.
Use the `gethomepage.dev/pod-selector` selector to specify the pod used for the health check. For example, a service that is annotated with `gethomepage.dev/pod-selector: app.kubernetes.io/name=deployment` would link to a pod with the label `app.kubernetes.io/name: deployment`.
### Traefik IngressRoute support
Homepage can also read ingresses defined using the Traefik IngressRoute custom resource definition. Due to the complex nature of Traefik routing rules, it is required for the `gethomepage.dev/href` annotation to be set:
@@ -138,6 +159,22 @@ spec:
If the `href` attribute is not present, Homepage will ignore the specific IngressRoute.
### Gateway API HttpRoute support
Homepage also features automatic service discovery for Gateway API. Service definitions are read by annotating the HttpRoute custom resource definition and are indentical to the Ingress example as defined in [Automatic Service Discovery](#automatic-service-discovery).
To enable Gateway API HttpRoute update `kubernetes.yaml` to include:
```
gateway: true # enable gateway-api
```
#### Using the unoffocial helm chart?
If you are using the unofficial helm chart ensure that the `ClusterRole` has required permissions for `gateway.networking.k8s.io`.
See [ClusterRole and ClusterRoleBinding](../installation/k8s.md#clusterrole-and-clusterrolebinding)
## Caveats
Similarly to Docker service discovery, there currently is no rigid ordering to discovered services and discovered services will be displayed above those specified in the `services.yaml`.
The Proxmox connection is configured in the `proxmox.yaml` file. See [Create token](#create-token) section below for details on how to generate the required API token.
```yaml
url:https://proxmox.host.or.ip:8006
token:username@pam!Token ID
secret:secret
```
## Services
Once the Proxmox connection is configured, individual services can be configured to pull statistics of VMs or LXCs. Only CPU and Memory are currently supported.
### Configuration Options
-`proxmoxNode`: The name of the Proxmox node where your VM/LXC is running
-`proxmoxVMID`: The ID of the Proxmox VM or LXC container
-`proxmoxType`: (Optional) The type of Proxmox virtual machine. Defaults to `qemu` for VMs, but can be set to `lxc` for LXC containers
#### Examples
For a QEMU VM (default):
```yaml
- HomeAssistant:
icon:home-assistant.png
href:http://homeassistant.local/
description:Home automation
proxmoxNode:pve
proxmoxVMID:101
# proxmoxType: qemu # This is the default, so it can be omitted
```
For an LXC container:
```yaml
- Nginx:
icon:nginx.png
href:http://nginx.local/
description:Web server
proxmoxNode:pve
proxmoxVMID:200
proxmoxType:lxc
```
## Create token
You will need to generate an API Token for new or an existing user. Here is an example of how to do this for a new user.
1. Navigate to the Proxmox portal, click on Datacenter
2. Expand Permissions, click on Groups
3. Click the Create button
4. Name the group something informative, like api-ro-users
5. Click on the Permissions "folder"
6. Click Add -> Group Permission
- Path: /
- Group: group from bullet 4 above
- Role: PVEAuditor
- Propagate: Checked
7. Expand Permissions, click on Users
8. Click the Add button
- User name: something informative like `api`
- Realm: Linux PAM standard authentication
- Group: group from bullet 4 above
9. Expand Permissions, click on API Tokens
10. Click the Add button
- User: user from bullet 8 above
- Token ID: something informative like the application or purpose like `homepage`
- Privilege Separation: Checked
11. Go back to the "Permissions" menu
12. Click Add -> API Token Permission
- Path: /
- API Token: select the Token ID created in Step 10
Unless otherwise noted, URLs should not end with a `/` or other API path. Each widget will handle the path on its own.
Each service can have one widget attached to it (often matching the service type, but that's not forced).
In addition to the href of the service, you can also specify the target location in which to open that link. See [Link Target](settings.md#link-target) for more details.
Using Emby as an example, this is how you would attach the Emby service widget.
```yaml
- Emby:
icon:emby.png
href:http://emby.host.or.ip/
description:Movies & TV Shows
widget:
type:emby
url:http://emby.host.or.ip
key:apikeyapikeyapikeyapikeyapikey
```
## Field Visibility
Each widget can optionally provide a list of which fields should be visible via the `fields` widget property. If no fields are specified, then all fields will be displayed. The `fields` property must be a valid YAML array of strings. As an example, here is the entry for Sonarr showing only a couple of fields.
**In all cases a widget will work and display all fields without specifying the `fields` property.**
Each service can have widgets attached to it (often matching the service type, but that's not forced).
In addition to the href of the service, you can also specify the target location in which to open that link. See [Link Target](settings.md#link-target) for more details.
Using Emby as an example, this is how you would attach the Emby service widget.
```yaml
- Emby:
icon:emby.png
href:http://emby.host.or.ip/
description:Movies & TV Shows
widget:
type:emby
url:http://emby.host.or.ip
key:apikeyapikeyapikeyapikeyapikey
```
#### Multiple Widgets
Each service can have multiple widgets attached to it, for example:
```yaml
- Emby:
icon:emby.png
href:http://emby.host.or.ip/
description:Movies & TV Shows
widgets:
- type:emby
url:http://emby.host.or.ip
key:apikeyapikeyapikeyapikeyapikey
- type:uptimekuma
url:http://uptimekuma.host.or.ip:port
slug:statuspageslug
```
!!! note
Multiple widgets per service are not yet supported with Kubernetes ingress annotations.
#### Field Visibility
Each widget can optionally provide a list of which fields should be visible via the `fields` widget property. If no fields are specified, then all fields will be displayed. The `fields` property must be a valid YAML array of strings. As an example, here is the entry for Sonarr showing only a couple of fields.
**In all cases a widget will work and display all fields without specifying the `fields` property.**
```yaml
- Sonarr:
icon:sonarr.png
href:http://sonarr.host.or.ip
widget:
type:sonarr
fields:["wanted","queued"]
url:http://sonarr.host.or.ip
key:apikeyapikeyapikeyapikeyapikey
```
## Descriptions
Services may have descriptions,
@@ -63,11 +138,15 @@ Services may have descriptions,
## Icons
Services may have an icon attached to them, you can use icons from [Dashboard Icons](https://github.com/walkxcode/dashboard-icons) automatically, by passing the name of the icon, with, or without `.png` or with `.svg` to use the svg version.
Services may have an icon attached to them, you can use icons from [Dashboard Icons](https://github.com/homarr-labs/dashboard-icons) automatically, by passing the name of the icon, with, or without `.png`, `.webp` or `.svg` to specify the desired version.
You can also specify prefixed icons from [Material Design Icons](https://materialdesignicons.com) with `mdi-XX` or [Simple Icons](https://simpleicons.org/) with `si-XX`.
You can also specify prefixed icons from:
You can specify a custom color by adding a hex color code as suffix e.g. `mdi-XX-#f0d453` or`si-XX-#a712a2`.
- [Simple Icons](https://simpleicons.org/) with `si-XX`
- [selfh.st/icons](https://selfh.st/icons/) with `sh-XX` to use the png version or `sh-XX.svg/png/webp` for a specific version
You can specify a custom color for `mdi` and `si` icons by adding a hex color code as a suffix e.g. `mdi-XX-#f0d453` or `si-XX-#a712a2`.
To use a remote icon, use the absolute URL (e.g. `https://...`).
@@ -103,6 +182,10 @@ To use a local icon, first create a Docker mount to `/app/public/icons` and then
Services may have an optional `ping` property that allows you to monitor the availability of an external host. As of v0.8.0, the ping feature attempts to use a true (ICMP) ping command on the underlying host. Currently, only IPv4 is supported.
!!! note
Because ping uses the ping command on the underlying host, in some cases you may need to install e.g. the `iputils-ping` package on the host system.
```yaml
- Group A:
- Sonarr:
@@ -171,7 +254,7 @@ Services may be connected to a Docker container, either running on the local mac
!!! note
This can also be controlled with `showStats`. See [show docker stats](docker.md#show-docker-stats) for more information
This can also be controlled with `showStats`. See [show docker stats](docker.md#show-stats) for more information
@@ -13,6 +13,14 @@ You can customize the title of the page if you'd like.
title:My Awesome Homepage
```
## Description
You can customize the description of the page if you'd like.
```yaml
description:A description of my awesome homepage
```
## Start URL
You can customize the start_url as required for installable apps. The default is "/".
@@ -70,7 +78,7 @@ background:
You can apply a blur filter to the service & bookmark cards. Note this option is incompatible with the background blur, saturate and brightness filters.
```yaml
cardBlur:sm# sm, "", md, etc... see https://tailwindcss.com/docs/backdrop-blur
cardBlur:xs# xs, md, etc... see https://tailwindcss.com/docs/backdrop-blur
```
## Favicon
@@ -93,7 +101,7 @@ theme: dark # or light
## Color Palette
You can configured a fixed color palette (and disable the palette switcher) by passing the `color` option, like so:
You can configure a fixed color palette (and disable the palette switcher) by passing the `color` option, like so:
```yaml
color:slate
@@ -118,6 +126,22 @@ As an example, this would produce the following layout:
<imgwidth="1260"alt="Screenshot 2022-09-15 at 8 03 57 PM"src="https://user-images.githubusercontent.com/82196/190466646-8ca94505-0fcf-4964-9687-3a6c7cd3144f.png">
### Icons-Only Layout
You can also specify the an icon-only layout for bookmarks, either like so:
```yaml
layout:
Media:
iconsOnly:true
```
or globally:
```yaml
bookmarksStyle:icons
```
### Sorting
Service groups and bookmark groups can be mixed in order, **but should use different group names**. If you do not specify any bookmark groups they will all show at the bottom of the page.
@@ -137,6 +161,27 @@ layout:
columns:3
```
### Nested Groups
If your services config has nested groups, you can apply settings to these groups by nesting them in the layout block
and using the same settings. For example
```yaml
layout:
Group A:
style:row
columns:4
Group C:
style:row
columns:2
Nested Group A:
style:row
columns:2
Nested Group B:
style:row
columns:2
```
### Headers
You can hide headers for each section in the layout as well by passing `header` as false, like so:
@@ -209,15 +254,29 @@ layout:
columns:4
```
### Five Columns
### Full Width
You can add a fifth column to services (when `style: columns` which is default) by adding:
You can make homepage take up the entire window width by adding:
```yaml
fiveColumns:true
fullWidth:true
```
By default homepage will max out at 4 columns for services with `columns` style
### Maximum Group Columns
You can set the maximum number of columns of groups on larger screen sizes (note this is only for groups with the default `style: columns`, not groups with `stle: row`) by adding:
```yaml
maxGroupColumns:8# default is 4 for services, 6 for bookmarks, max 8
```
By default homepage will max out at 4 columns for services and 6 for bookmarks, thus the minimum for this setting is _5_. Of course, if you're setting this to higher numbers, you may want to consider enabling the [fullWidth](#full-width) option as well.
If you want to set the maximum columns for bookmark groups separately, you can do so by adding:
```yaml
maxBookmarkGroupColumns:6# default is 6, max 8
```
### Collapsible sections
@@ -348,12 +407,12 @@ This can also be set for individual services. Note setting this at the service l
## Providers
The `providers` section allows you to define shared API provider options and secrets. Currently this allows you to define your weather API keys in secret and is also the location of the Longhorn URL and credentials.
The `providers` section allows you to define shared API provider options and secrets.
```yaml
providers:
openweathermap:openweathermapapikey
weatherapi:weatherapiapikey
finnhub:yourfinnhubapikeyhere
longhorn:
url:https://longhorn.example.com
username:admin
@@ -363,10 +422,10 @@ providers:
You can then pass `provider` instead of `apiKey` in your widget configuration.
```yaml
- weather:
- openweathermap:
latitude:50.449684
longitude:30.525026
provider:weatherapi
provider:openweathermap
```
## Quick Launch
@@ -377,9 +436,10 @@ You can use the 'Quick Launch' feature to search services, perform a web search
There are a few optional settings for the Quick Launch feature:
-`searchDescriptions`: which lets you control whether item descriptions are included in searches. This is off by default. When enabled, results that match the item name will be placed above those that only match the description.
-`searchDescriptions`: which lets you control whether item descriptions are included in searches. This is false by default. When enabled, results that match the item name will be placed above those that only match the description.
-`hideInternetSearch`: disable automatically including the currently-selected web search (e.g. from the widget) as a Quick Launch option. This is false by default, enabling the feature.
-`showSearchSuggestions`: shows search suggestions for the internet search. This value will be inherited from the search widget if it is not specified. If it is not specified there either, it will default to false.
-`showSearchSuggestions`: show search suggestions for the internet search. If this is not specified then the setting will be inherited from the search widget. If it is not specified there either, it will default to false. For custom providers the `suggestionUrl` needs to be set in order for this to work.
-`provider`: search engine provider. If none is specified it will try to use the provider set for the Search Widget, if neither are present then internet search will be disabled.
-`hideVisitURL`: disable detecting and offering an option to open URLs. This is false by default, enabling the feature.
```yaml
@@ -388,9 +448,20 @@ quicklaunch:
hideInternetSearch:true
showSearchSuggestions:true
hideVisitURL:true
provider:google# google, duckduckgo, bing, baidu, brave or custom
By default the release version is displayed at the bottom of the page. To hide this, use the `hideVersion` setting, like so:
@@ -398,6 +469,12 @@ By default the release version is displayed at the bottom of the page. To hide t
hideVersion:true
```
You can disable checking for new versions from GitHub (enabled by default) with:
```yaml
disableUpdateCheck:true
```
## Log Path
By default the homepage logfile is written to the a `logs` subdirectory of the `config` folder. In order to customize this path, you can set the `logpath` setting. A `logs` folder will be created in that location where the logfile will be written.
description: A modern, fully static, fast, secure, fully proxied, highly customizable application dashboard with integrations for over 100 services and translations into multiple languages.
A modern, <em>fully static, fast</em>, secure <em>fully proxied</em>, highly customizable application dashboard with integrations for over 100 services and translations into multiple languages. Easily configured via YAML files or through docker label discovery.
<pstyle="margin: 0 0 30px;">A modern, <em>fully static, fast</em>, secure <em>fully proxied</em>, highly customizable application dashboard with integrations for over 100 services and translations into multiple languages. Easily configured via YAML files or through docker label discovery.</p>
You have a few options for deploying homepage, depending on your needs. We offer docker images for a majority of platforms. You can also install and run homepage from source if Docker is not your thing. It can even be installed on Kubernetes with Helm.
</p>
!!! info
Please note that when using features such as widgets, Homepage can access personal information (for example from your home automation system) and Homepage currently does not (and is not planned to) include any authentication layer itself. Thus, we recommend homepage be deployed behind a reverse proxy including authentication, SSL etc, and / or behind a VPN.
:simple-docker: [ Install on Docker :octicons-arrow-right-24:](docker.md)
[:simple-docker: Install on Docker :octicons-arrow-right-24:](docker.md)
{ .card }
:simple-kubernetes: [ Install on Kubernetes :octicons-arrow-right-24:](k8s.md)
[:simple-kubernetes: Install on Kubernetes :octicons-arrow-right-24:](k8s.md)
{ .card }
:simple-unraid: [ Install on UNRAID :octicons-arrow-right-24:](unraid.md)
[:simple-unraid: Install on UNRAID :octicons-arrow-right-24:](unraid.md)
{ .card }
:simple-nextdotjs: [ Building from source :octicons-arrow-right-24:](source.md)
[:simple-nextdotjs: Building from source :octicons-arrow-right-24:](source.md)
{ .card }
</div>
### `HOMEPAGE_ALLOWED_HOSTS`
As of v1.0 there is one required environment variable to access homepage via a URL other than `localhost`, <code>HOMEPAGE_ALLOWED_HOSTS</code>. The setting helps prevent certain kinds of attacks when retrieving data from the homepage API proxy.
The value is a comma-separated (no spaces) list of allowed hosts (sometimes with the port) that can host your homepage install. See the [docker](docker.md), [kubernetes](k8s.md) and [source](source.md) installation pages for more information about where / how to set the variable.
`localhost:3000` and `127.0.0.1:3000` are always included, but you can add a domain or IP address to this list to allow that host such as `HOMEPAGE_ALLOWED_HOSTS=gethomepage.dev,192.168.1.2:1234`, etc.
If you are seeing errors about host validation, check the homepage logs and ensure that the host exactly as output in the logs is in the `HOMEPAGE_ALLOWED_HOSTS` list.
This can be disabled by setting `HOMEPAGE_ALLOWED_HOSTS` to `*` but this is not recommended.
There is an [unofficial helm chart](https://github.com/jameswynn/helm-charts/tree/main/charts/homepage) that creates all the necessary manifests, including the service account and RBAC entities necessary for service discovery.
If you don't want to use the unofficial Helm chart, you can also create your own Kubernetes manifest(s) and apply them with `kubectl apply -f filename.yaml`.
@@ -175,6 +96,7 @@ data:
expanded: true
cpu: true
memory: true
network: default
- search:
provider: duckduckgo
target: _blank
@@ -209,12 +131,20 @@ rules:
- get
- list
- apiGroups:
- traefik.containo.us
- traefik.io
resources:
- ingressroutes
verbs:
- get
- list
- apiGroups:
- gateway.networking.k8s.io
resources:
- httproutes
- gateways
verbs:
- get
- list
- apiGroups:
- metrics.k8s.io
resources:
@@ -293,6 +223,9 @@ spec:
- name:homepage
image:"ghcr.io/gethomepage/homepage:latest"
imagePullPolicy:Always
env:
- name:HOMEPAGE_ALLOWED_HOSTS
value:gethomepage.dev# required, may need port. See gethomepage.dev/installation/#homepage_allowed_hosts
ports:
- name:http
containerPort:3000
@@ -370,7 +303,7 @@ prevent unnecessary re-renders on page loads and window / tab focusing. The
procedure for enabling sticky sessions depends on your Ingress controller. Below
is an example using Traefik as the Ingress controller.
@@ -31,15 +31,15 @@ You may need to set the permissions of the folders to be able to edit the files.
- To use the [Docker integration](../configs/docker.md), you only need to use the `container:` parameter. There is no need to set the server.
!!! note
!!! note
To view detailed container statistics (CPU, RAM, etc.), or if you use a remote docker socket, `container:` will still need to be set. For example:
To view detailed container statistics (CPU, RAM, etc.), or if you use a remote docker socket, `container:` will still need to be set. For example:
```
- Plex:
icon: /icons/plex.png
href: https://app.plex.com
container: plex
```
```
- Plex:
icon: /icons/plex.png
href: https://app.plex.com
container: plex
```
- When you upload a new image into the **/images** folder, you will need to restart the container for it to show up in the WebUI. Please see the [service icons](../configs/services.md#icons) for more information.
description: Homepage is supported by these awesome people and companies.
---
If you would like to support the Homepage project, you can do so by becoming a sponsor. Your sponsorship helps to keep the project running and growing.
BuySellAds provides the project with the ability to monetize the website, with high quality ads from the CarbonAds network. All earnings are sent directly to the projects OpenCollective.
Thanks to the generous folks at [Glime](https://glimelab.ai), Homepage is now equipped with a pretty clever AI-powered bot. The bot has full knowledge of our docs, GitHub issues and discussions and is great at answering specific questions about setting up your Homepage. To use the bot, just hit the 'Ask AI' button on any page in our docs, [open a GitHub discussion](https://github.com/gethomepage/homepage/discussions) or check out the [#ai-support channel on Discord](https://discord.com/channels/1019316731635834932/1177885603552038993)!
## General Troubleshooting Tips
- For API errors, clicking the "API Error Information" button in the widget will usually show some helpful information as to whether the issue is reaching the service host, an authentication issue, etc.
- Check config/logs/homepage.log, on docker simply e.g. `docker logs homepage`. This may provide some insight into the reason for an error.
- Check the browser error console, this can also sometimes provide useful information.
- Consider setting the `ENV` variable `LOG_LEVEL` to `debug`.
- If certain widgets are failing when connecting to public APIs, consider [disabling IPv6](#disabling-ipv6).
## Service Widget Errors
All service widgets work essentially the same, that is, homepage makes a proxied call to an API made available by that service. The majority of the time widgets don't work it is a configuration issue. Of course, sometimes things do break. Some basic steps to try:
All service widgets work essentially the same, that is, homepage makes a proxied call to an API made available by that service. The majority of the time widgets don't work it is a configuration issue. Of course, sometimes things do break. Some basic steps to check:
1. Ensure that you follow the rule mentioned on https://gethomepage.dev/latest/configs/service-widgets/. **Unless otherwise noted, URLs should not end with a / or other API path. Each widget will handle the path on its own.**. This is very important as including a trailing slash can result in an error.
1. URLs should not end with a / or other API path. Each widget will handle the path on its own.
2. Verify the homepage installation can connect to the IP address or host you are using for the widget `url`. This is most simply achieved by pinging the server from the homepage machine, in Docker this means _from inside the container_ itself, e.g.:
2. All services with a widget require a unique name as well as a unique group (and all subgroups) name.
3. Verify the homepage installation can connect to the IP address or host you are using for the widget `url`. This is most simply achieved by pinging the server from the homepage machine, in Docker this means _from inside the container_ itself, e.g.:
```
docker exec homepage ping SERVICEIPORDOMAIN
@@ -31,7 +30,7 @@ All service widgets work essentially the same, that is, homepage makes a proxied
If your homepage install (container) cannot reach the service then you need to figure out why, for example in Docker this can mean putting the two containers on the same network, checking firewall issues, etc.
3. If you have verified that homepage can in fact reach the service then you can also check the API output using e.g. `curl`, which is often helpful if you do need to file a bug report. Again, depending on your networking setup this may need to be run from _inside the container_ as IP / hostname resolution can differ inside vs outside.
4. If you have verified that homepage can in fact reach the service then you can also check the API output using e.g. `curl`, which is often helpful if you do need to file a bug report. Again, depending on your networking setup this may need to be run from _inside the container_ as IP / hostname resolution can differ inside vs outside.
!!! note
@@ -68,3 +67,17 @@ All service widgets work essentially the same, that is, homepage makes a proxied
## Missing custom icons
If, after correctly adding and mapping your custom icons via the [Icons](../configs/services.md#icons) instructions, you are still unable to see your icons please try recreating your container.
## Disabling IPv6
If you are having issues with certain widgets that are unable to reach public APIs (e.g. weather), in certain setups you may need to disable IPv6. You can set the environment variable `HOMEPAGE_PROXY_DISABLE_IPV6` to `true` to disable IPv6 for the homepage proxy.
Alternatively, you can use the `sysctls` option in your docker-compose file to disable IPv6 for the homepage container completely:
description: Get comfortable with making API calls from inside your widget.
---
Homepage provides the `useWidgetAPI` hook to help you fetch data from an API. This hook insures that the data is fetched using a proxy, and is critical for security.
Here is an example of how the `useWidgetAPI` hook looks:
```js title="Fetch data from the stats endpoint"
import useWidgetAPI from "utils/proxy/use-widget-api";
- `endpoint`: The name of the endpoint to fetch data from.
- `params`: An optional object containing query parameters to pass to the API.
### `widget`
The `widget` argument is the metadata object for the widget. It contains information about the API endpoint, proxy handler, and mappings. This object is used by the `useWidgetAPI` hook to fetch data from the API. This is generally passed in as a prop from the parent component.
### `endpoint`
The `endpoint` argument is the name of the endpoint to fetch data from. This is [defined in the widget metadata object](metadata.md#endpoint). The `useWidgetAPI` hook uses this argument to determine which endpoint to fetch data from.
If no endpoint is provided, the `useWidgetAPI` hook will call the API endpoint defined in the widget metadata object directly.
### `params`
The `params` argument is an optional object containing query parameters to pass to the API. This is useful for filtering data or passing additional information to the API. This object is passed directly to the API endpoint as query parameters.
Here is an example of how to use the `params` argument:
```js title="Fetch data from the stats endpoint with query parameters"
import useWidgetAPI from "utils/proxy/use-widget-api";
The `params` must be [whitelisted in the widget metadata object](metadata.md#params). This is done to prevent arbitrary query parameters from being passed to the API.
description: Learn more about the widget component in Homepage, and how to build your widget UI.
---
Homepage widgets are built using React components. These components are responsible for fetching data from the API and rendering the widget UI. Homepage provides a set of hooks and utilities to help you build your widget component.
We'll cover two sections of the widget component: hooks and components.
#### Hooks
**`useTranslation`**
This hook is used to translate text and numerical content in widgets. Homepage provides a set of helpers to help you localize your widgets. You can learn more about translations in the [Translations Guide](translations.md).
**`useWidgetAPI`**
This hook is used to fetch data from the API. We cover this hook in more detail in the [API Guide](api.md).
#### Components
Homepage provides a set of components to help you build your widget UI. These components are designed to provide a consistent layout, and all widgets are expected to use these components.

**`<Container>`**
This component is a wrapper for the widget. It provides a consistent layout for all widgets.
```js
<Containerservice={service}></Container>
```
`service` is a prop that is passed to the widget component. It contains information about the service that the widget is displaying.
If there is an error fetching data from the API, the `error` prop can be passed to the `Container` component.
The `label` prop is used to look up the translation key in the translation files. The `value` prop is used to display the value of the block. To learn more about translations, please refer to the [Translations Guide](translations.md).
If there is no data available, the `Block` component can be used to display a placeholder layout.
We'll cover getting homepage up and running on your local machine for development, as well as some guidelines for developing new features and widgets.
## Development
First, clone the homepage repository.
@@ -44,17 +46,17 @@ See the [pre-commit documentation](https://pre-commit.com/#install) to get start
In general, homepage is meant to be a dashboard for 'self-hosted' services and we believe it is a small way we can help showcase this kind of software. While exceptions are made, mostly when there is no viable
self-hosted / open-source alternative, we ask that any widgets, etc. are developed primarily for a self-hosted tool.
## New Feature Guidelines
## New Feature or Enhancement Guidelines {#new-feature-guidelines}
- New features should be linked to an existing feature request with at least 10 'up-votes'. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users.
- If you have ideas for a larger feature, please open a discussion first.
- Please note that though it is a requirement, a discussion with 10 'up-votes' in no way guarantees that a PR will be merged.
- New features or enhancements, **no matter how small**, must be linked to an existing feature request with some comments or 'up-votes' that demonstrate community interest. The purpose of this requirement is to avoid the addition (and maintenance) of features that might only benefit a small number of users.
- If you have ideas for a larger feature you may want to open a discussion first.
## Service Widget Guidelines
To ensure cohesiveness of various widgets, the following should be used as a guide for developing new widgets:
- Please only submit widgets that have been requested and have at least 10 'up-votes'. The purpose of this requirement is to avoid the addition (and maintenance) of service widgets that might only benefit a small number of users.
- Please only submit widgets that target a feature request discussion with at least 20 'up-votes'. The purpose of this requirement is to avoid the addition (and maintenance) of service widgets that might only benefit a small number of users.
- Note that we reserve the right to decline widgets for projects that are very young (eg < ~1y) or those with a small reach (eg low GitHub stars). Again, this is in an effort to keep overall widget maintenance under control.
- Widgets should be only one row of blocks
- Widgets should be no more than 4 blocks wide and generally conform to the styling / design choices of other widgets
description: Learn how to create and customize widgets in Homepage. Explore translations, widget components, widget metadata, proxy handlers, and making API calls.
icon: fontawesome/solid/graduation-cap
---
Widgets are a core component of Homepage. They are used to display information about your system, services, and environment.
## Overview
If you are new to Homepage widgets, and are looking to create a new widget, please follow along with the guide here: [Widget Tutorial](tutorial.md).
### Translations
All text and numerical content in widgets should be translated and localized. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage).
To learn more about translations, please refer to the guide here: [Translations Guide](translations.md).
### Widget Component
The widget component is the core of the widget. It is responsible for [fetching data from the API](api.md) and rendering the widget UI. Homepage provides a set of hooks and utilities to help you build your widget component.
To learn more about widget components, please refer to the guide here: [Component Guide](component.md).
### Widget Metadata
Widget metadata defines the configuration of the widget. It defines the API endpoint to fetch data from, the proxy handler to use, and any data mappings.
To learn more about widget metadata, endpoint and data mapping, please refer to the guide here: [Metadata Guide](metadata.md).
To learn more about proxy handlers, please refer to the guide here: [Proxies Guide](proxies.md).
To learn more about making API calls from inside your widget, please refer to the guide here: [API Guide](api.md).
description: Explore all the metadata properties that can be used to configure a widget in Homepage.
---
Here, we will go over how to create and configure Homepage widget metadata. Metadata is a JS object that contains information about the widget, such as the API endpoint, proxy handler, and mappings. This metadata is used by Homepage to fetch data from the API and pass it to the widget.
## Widgets Configuration
Here are some examples of how to configure a widget's metadata object.
=== "Basic Example"
```js
import genericProxyHandler from "utils/proxy/handlers/generic";
const widgetExample = {
api: "{url}/api/{endpoint}",
proxyHandler: genericProxyHandler,
mappings: {
stats: { endpoint: "stats" }
},
};
```
=== "Advanced Example"
```js
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
import { asJson, jsonArrayFilter } from "utils/proxy/api-helpers";
A widget's metadata is quite powerful and can be configured in many different ways.
## Configuration Properties
### `api`
The `api` property is a string that represents the URL of the API endpoint that the widget will use to fetch data. The URL can contain placeholders that will be replaced with actual values at runtime. For example, the `{url}` placeholder will be replaced with the URL of the configured widget, and the `{endpoint}` placeholder will be replaced with the value of the `endpoint` property in the `mappings` object.
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
};
```
### `proxyHandler`
The `proxyHandler` property is a function that will be used to make the API request. Homepage includes some built-in proxy handlers that can be used out of the box:
Here is an example of the generic proxy handler that makes unauthenticated requests to the specified API endpoint.
=== "widget.js"
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
proxyHandler: genericProxyHandler,
};
```
=== "services.yaml"
```yaml
- Services:
- Your Widget:
icon: yourwidget.svg
href: https://example.com/
widget:
type: yourwidget
url: http://127.0.0.1:1337
```
If you are looking to learn more about proxy handlers, please refer to the guide here: [Proxies Guide](proxies.md).
### `mappings`
The `mappings` property is an object that contains information about the API endpoint, such as the endpoint name, validation rules, and parameter names. The `mappings` object can contain multiple endpoints, each with its own configuration.
!!! note "Security Note"
The `mappings` or `allowedEndpoints` property is required for the widget to fetch data from more than a static URL. Homepage uses a whitelist approach to ensure that widgets only access allowed endpoints.
```js
import { asJson } from "utils/proxy/api-helpers";
const widgetExample = {
api: "{url}/api/{endpoint}",
mappings: {
// `/api/stats?start=...&end=...`
stats: {
endpoint: "stats",
validate: ["total", "average"],
params: ["start", "end"],
},
// `/api/notices`
notices: {
endpoint: "notices",
map: (data) => {
total: asJson(data).length;
},
},
},
};
```
#### `endpoint`
The `endpoint` property is a string that represents the name of the API endpoint that the widget will use to fetch data. This value will be used to replace the `{endpoint}` placeholder in the `api` property.
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
mappings: {
// `/api/stats`
stats: {
endpoint: "stats",
},
},
};
```
#### `validate`
The `validate` property is an array of strings that represent the keys that should be validated in the API response. If the response does not contain all of the specified keys, the widget will not render.
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
mappings: {
// `/api/stats`
stats: {
endpoint: "stats",
validate: ["total", "average"],
},
},
};
```
This configuration will ensure that the API response contains the `total` and `average` keys before the widget is rendered.
#### `params`
The `params` property is an array of strings that represent the keys that should be passed as parameters to the API endpoint. These keys will be replaced with the actual values at runtime.
This configuration will pass the `start` and `end` keys as parameters to the API endpoint. The values are passed as an object to the `useWidgetAPI` hook.
#### `map`
The `map` property is a function that will be used to transform the API response before it is passed to the widget. This function is passed the raw API response and should return the transformed data.
The `method` represents the HTTP method that should be used to make the API request. The default value is `GET`. Note that `POST` requests are not allowed via the
widget API and require the use of a custom proxy.
#### `headers`
The `headers` property is an object that contains additional headers that should be included in the API request. If your endpoint requires specific headers, you can include them here.
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
mappings: {
// `/api/stats`
stats: {
endpoint: "stats",
headers: {
"Content-Type": "application/json",
},
},
},
};
```
#### `body`
The `body` property is an object that contains the data that should be sent in the request body. This property is only used when the `method` property is set to `POST` or `PUT`.
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
mappings: {
// `/api/graphql`
stats: {
endpoint: "graphql",
body: {
query: `
query {
stats {
total
average
}
}
`,
},
headers: {
"Content-Type": "application/json",
},
},
},
};
```
### `allowedEndpoints`
The `allowedEndpoints` property is a RegExp that represents the allowed endpoints that the widget can use. If the widget tries to access an endpoint that is not allowed, the request will be blocked.
`allowedEndpoints` can be used when endpoint validation is simple and can be done using a regular expression, and more control is not required.
!!! note "Security Note"
The `mappings` or `allowedEndpoints` property is required for the widget to fetch data from more than a static URL. Homepage uses a whitelist approach to ensure that widgets only access allowed endpoints.
```js
const widgetExample = {
api: "{url}/api/{endpoint}",
allowedEndpoints: /^stats|notices$/,
};
```
This configuration will only allow the widget to access the `stats` and `notices` endpoints.
description: Learn about proxy handlers in Homepage, and how to securely fetch data from an API.
---
Homepage includes a set of built-in proxy handlers that can be used to fetch data from an API. We will go over how to use these proxy handlers and briefly cover how to create your own.
## Available Proxy Handlers
Homepage comes with a few built-in proxy handlers that can be used to fetch data from an API. These handlers are located in the `utils/proxy/handlers` directory.
### `genericProxyHandler`
A proxy handler that makes generally unauthenticated requests to the specified API endpoint.
You can also pass API keys from the widget configuration to the proxy handler, for authenticated requests.
=== "widget.js"
```js
import genericProxyHandler from "utils/proxy/handlers/generic";
const widgetExample = {
api: "{url}/api/{endpoint}?key={key}",
proxyHandler: genericProxyHandler,
};
```
=== "services.yaml"
```yaml
# Widget Configuration
- Your Widget:
icon: yourwidget.svg
href: https://example.com/
widget:
type: yourwidget
url: http://example.com
key: your-api-key
```
### `credentialedProxyHandler`
A proxy handler that makes authenticated requests by setting request headers. Credentials are pulled from the widgets configuration.
By default the key is passed as an `X-API-Key` header. If you need to pass the key as something else, either add a case to the credentialedProxyHandler or create a new proxy handler.
=== "widget.js"
```js
import credentialedProxyHandler from "utils/proxy/handlers/credentialed";
const widgetExample = {
api: "{url}/api/{endpoint}?key={key}",
proxyHandler: credentialedProxyHandler,
};
```
=== "services.yaml"
```yaml
- Your Widget:
icon: yourwidget.svg
href: https://example.com/
widget:
type: yourwidget
url: http://127.0.0.1:1337
key: your-api-key
```
### `jsonrpcProxyHandler`
A proxy handler that makes authenticated JSON-RPC requests to the specified API endpoint, either using username + password or an API token.
The endpoint is the method to call and queryParams are used as the parameters.
=== "component.js"
```js
import Container from "components/services/widget/container";
import useWidgetAPI from "utils/proxy/use-widget-api";
You can create your own proxy handler to fetch data from an API. A proxy handler is a function that takes a configuration object and returns a function that makes the API request.
The proxy handler function takes three arguments:
- `req`: The request object.
- `res`: The response object.
- `map`: A function that maps the API response to the widget data.
The proxy handler function should return a promise that resolves to the API response.
Here is an example of a simple proxy handler that fetches data from an API and passes it to the widget:
Proxy handlers are a complex topic and require a good understanding of JavaScript and the Homepage codebase. If you are new to Homepage, we recommend using the built-in proxy handlers.
description: Tips and tricks for translating and localizing Homepage widgets.
---
All text and numerical content in widgets should be translated and localized. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage).
## Translations
Homepage uses the [next-i18next](https://github.com/i18next/next-i18next) library to handle translations. This library provides a set of hooks and utilities to help you localize your widgets, and Homepage has extended this library to support additional features.
=== "component.jsx"
```js
import { useTranslation } from "next-i18next";
import Container from "components/services/widget/container";
import Block from "components/services/widget/block";
export default function Component() {
const { t } = useTranslation();
return (
<Container service={service}>
<Block label="yourwidget.key1" />
<Block label="yourwidget.key2" />
<Block label="yourwidget.key3" />
</Container>
);
}
```
## Set up translation strings
Homepage uses translated and localized strings for **all text and numerical content** in widgets. English is the default language, and other languages can be added via [Crowdin](https://crowdin.com/project/gethomepage). To add the English translations for your widget, follow these steps:
Open the `public/locales/en/common.json` file.
Add a new object for your widget to the bottom of the list, like this:
```json
"yourwidget": {
"key1": "Value 1",
"key2": "Value 2",
"key3": "Value 3"
}
```
!!! note
Even if you natively speak another language, you should only add English translations. You can then add translations in your native language via [Crowdin](https://crowdin.com/project/gethomepage), once your widget is merged.
## Common Translations
Homepage provides a set of common translations that you can use in your widgets. These translations are used to format numerical content, dates, and other common elements.
description: Follow along with this guide to learn how to create a custom widget for Homepage. We'll cover the basic structure of a widget, how to use translations, and how to fetch data from an API.
---
In this guide, we'll walk through the process of creating a custom widget for Homepage. We'll cover the basic structure of a widget, how to use translations, and how to fetch data from an API. By the end of this guide, you'll have a solid understanding of how to build your own custom widget.
**Prerequisites:**
- Basic knowledge of React and JavaScript
- Familiarity with the Homepage platform
- Understanding of JSON and API interactions
Throughout this guide, we'll use `yourwidget` as a placeholder for the unique name of your custom widget. Replace `yourwidget` with the actual name of your widget. It should contain only lowercase letters and no spaces.
This guide makes use of a fake API, which would return a JSON response as such, when called with the `v1/info` endpoint:
```json
{"key1":123,"key2":456,"key3":789}
```
## Set up the widget definition
Create a new folder for your widget in the `src/widgets` directory. Name the folder `yourwidget`.
Inside the `yourwidget` folder, create a new file named `widget.js`. This file will contain the metadata for your widget.
Open the `widget.js` file and add the following code:
```js title="src/widgets/yourwidget/widget.js"
import genericProxyHandler from "utils/proxy/handlers/generic"; // (1)!
const widget = /* (2)! */ {
api: "{url}/{endpoint}" /* (3)! */,
proxyHandler: genericProxyHandler /* (1)! */,
mappings: /* (4)! */ {
info: /* (5)! */ {
endpoint: "v1/info" /* (6)! */,
},
},
};
export default widget;
```
1. We import the `genericProxyHandler` from the `utils/proxy/handlers/generic` module. The `genericProxyHandler` is a generic handler that can be used to fetch data from an API. We then assign the `genericProxyHandler` to the `proxyHandler` property of the `widget` object. There are other handlers available that you can use depending on your requirements. You can also create custom handlers if needed.
2. We define a `widget` object that contains the metadata for the widget.
3. The API endpoint to fetch data from. You can use placeholders like `{url}` and `{endpoint}` to dynamically generate the API endpoint based on the widget configuration.
4. An object that contains mappings for different endpoints. Each mapping should have an `endpoint` property that specifies the endpoint to fetch data from.
5. A mapping named `info` that specifies the `v1/info` endpoint to fetch data from. This would be called from the component as such: `#!js useWidgetAPI(widget, "info");`
6. The `endpoint` property of the `info` mapping specifies the endpoint to fetch data from. There are other properties you can pass to the mapping, such as `method`, `headers`, and `body`.
!!! warning "Important"
All widgets that fetch data from dynamic endpoints should have either `mappings` or an `allowedEndpoints` property.
## Including translation strings in your widget
Refer to the [translations guide](translations.md) for more details. The Homepage community prides itself on being multilingual, and we strongly encourage you to add translations for your widgets.
## Create the widget component
Create a new file for your widgets component, named `component.jsx`, in the `src/widgets/yourwidget` directory. We'll build the contents of the `component.jsx` file step by step.
We destructure the `widget` object from the `service` prop. The `widget` object contains the metadata for the widget, such as the API endpoint to fetch data from.
Now, the fun part! We use the `useWidgetAPI` hook to fetch data from an API. The `useWidgetAPI` hook takes two arguments: the `widget` object and the API endpoint to fetch data from. The `useWidgetAPI` hook returns an object with `data` and `error` properties.
You'll see here how part of the API url is built using the `url` and `endpoint` properties from the widget definition.
In this case, we're fetching data from the `info` endpoint. The `info` endpoint is defined in the `mappings` object. So the full API endpoint will be `"{url}/v1/info"`.
The mapping and endpoint are often the same, but must be defined regardless.
---
Next, we check if there's an error or no data.
If there's an error, we return a `Container` and pass it the `service` and `error` as props. The `Container` component will handle displaying the error message.
This will render the widget with placeholders for the data, i.e., a skeleton view.
!!! tip "Translation Tips"
The `label` prop in the `Block` component corresponds to the translation key we defined earlier in the `common.json` file. All text and numerical content should be translated.
---
If there is data, we return a `Container` component with three `Block` components, each with a `label` and a `value`.
Here we use the `t` function from the `useTranslation` hook to translate the data values. The `t` function takes the translation key and an object with variables to interpolate into the translation string.
We're using the `common.number` translation key to format the data values as numbers. This allows for easy localization of numbers, such as using commas or periods as decimal separators.
There are a large number of `common` numerical translation keys available, which you can learn more about in the [Translation Guide](translations.md).
You can now use your custom widget in your Homepage. Open your `services.yaml` file and add a new service with the `yourwidget` widget.
```yaml
- Services:
- Your Widget:
icon: yourwidget.svg
href: https://example.com/
widget:
type: yourwidget
url: http://127.0.0.1:1337
```
!!! tip "API Tips"
You'll see here how part of the API url is built using the `url` and `endpoint` properties from the widget definition.
We defined the api endpoint as `"{url}/{endpoint}"`. This is where the `url` is defined. So the full API endpoint will be `http://127.0.0.1:1337/{endpoint}`.
---
That's it! You've successfully created a custom widget for Homepage. If you have any questions or need help, feel free to reach out to the Homepage community for assistance. Happy coding!
description: Find information on how to configure specific widgets in Homepage.
icon: material/widgets
---
Homepage has two types of widgets: info and service. Below we'll cover each type and how to configure them.
The left navigation of this site contains links to all available widgets.
## Service Widgets
Service widgets are used to display the status of a service, often a web service or API. Services (and their widgets) are defined in your `services.yaml` file. Here's an example:
@@ -16,12 +19,17 @@ Service widgets are used to display the status of a service, often a web service
description:Watch movies and TV shows.
server:localhost
container:plex
widget:
type:tautulli
url:http://172.16.1.1:8181
key:aabbccddeeffgghhiijjkkllmmnnoo
widgets:
- type:tautulli
url:http://172.16.1.1:8181
key:aabbccddeeffgghhiijjkkllmmnnoo
- type:uptimekuma
url:http://172.16.1.2:8080
slug:aaaaaaabbbbb
```
More detail on configuring service widgets can be found in the [Service Widgets Config](../configs/services.md) section.
## Info Widgets
Info widgets are used to display information in the header, often about your system or environment. Info widgets are defined your `widgets.yaml` file. Here's an example:
@@ -33,3 +41,5 @@ Info widgets are used to display information in the header, often about your sys
longitude:-117.51
cache:5
```
More detail on configuring info widgets can be found in the [Info Widgets Config](../configs/info-widgets.md) section.
@@ -9,6 +9,8 @@ The disk path is the path reported by `df` (Mounted On), or the mount point of t
The cpu and memory resource information are the container's usage while [glances](glances.md) displays statistics for the host machine on which it is installed.
The resources widget primarily relies on a popular tool called [systeminformation](https://systeminformation.io). Thus, any limitiations of that software apply, for example, BRTFS RAID is not supported for the disk usage. In this case users may want to use the [glances widget](glances.md) instead.
_Note: unfortunately, the package used for getting CPU temp ([systeminformation](https://systeminformation.io)) is not compatible with some setups and will not report any value(s) for CPU temp._
**Any disk you wish to access must be mounted to your container as a volume.**
@@ -19,10 +21,13 @@ _Note: unfortunately, the package used for getting CPU temp ([systeminformation]
memory:true
disk:/disk/mount/path
cputemp:true
tempmin:0# optional, minimum cpu temp
tempmax:100# optional, maximum cpu temp
uptime:true
units:imperial# only used by cpu temp
units: imperial# only used by cpu temp, options:'imperial'or 'metric'
refresh:3000# optional, in ms
diskUnits:bytes# optional, bytes (default) or bbytes. Only applies to disk
network:true# optional, uses 'default' if true or specify a network interface name
```
You can also pass a `label` option, which allows you to group resources under named sections,
@@ -5,20 +5,25 @@ description: Unifi Controller Information Widget Configuration
_(Find the Unifi Controller service widget [here](../services/unifi-controller.md))_
You can display general connectivity status from your Unifi (Network) Controller. When authenticating you will want to use a local account that has at least read privileges.
You can display general connectivity status from your Unifi (Network) Controller.
!!! warning
When authenticating you will want to use a local account that has at least read privileges.
An optional 'site' parameter can be supplied, if it is not the widget will use the default site for the controller.
_Note: If you enter e.g. incorrect credentials and receive an "API Error", you may need to recreate the container to clear the cache._
!!! hint
If you enter e.g. incorrect credentials and receive an "API Error", you may need to recreate the container to clear the cache.
description: Weather API Information Widget Configuration
---
**Note: this widget is considered 'deprecated' since there is no longer a free Weather API tier for new members. See the openmeteo or openweathermap widgets for alternatives.**
The free tier is all that's required, you will need to [register](https://www.weatherapi.com/signup.aspx) and grab your API key.
```yaml
- weatherapi:
label:Kyiv# optional
latitude:50.449684
longitude:30.525026
units:metric# or imperial
apiKey:yourweatherapikey
cache:5# Time in minutes to cache API responses, to stay within limits
format:# optional, Intl.NumberFormat options
maximumFractionDigits:1
```
You can optionally not pass a `latitude` and `longitude` and the widget will use your current location (requires a secure context, eg. HTTPS).
description: Lightweight monitoring widget for APC UPSs using apcupsd daemon
---
This widget extracts UPS information from an apcupsd daemon.
Only works for [APC/Schneider](https://www.se.com/us/en/product-range/61915-smartups/#products) UPS products.
[!NOTE]
By default apcupsd daemon is bound to 127.0.0.1. Edit `/etc/apcupsd.conf` and change `NISIP` to an IP accessible from your homepage docker (usually your internal LAN interface).
Learn more about [ArgoCD](https://argo-cd.readthedocs.io/en/stable/).
Allowed fields (limited to a max of 4): `["apps", "synced", "outOfSync", "healthy", "progressing", "degraded", "suspended", "missing"]`
```yaml
widget:
type:argocd
url:http://argocd.host.or.ip:port
key:argocdapikey
```
You can generate an API key either by creating a bearer token for an existing account, see [Authorization](https://argo-cd.readthedocs.io/en/latest/developer-guide/api-docs/#authorization) (not recommended) or create a new local user account with limited privileges and generate an authentication token for this account. To do this the steps are:
- [Create a new local user](https://argo-cd.readthedocs.io/en/stable/operator-manual/user-management/#create-new-user) and give it the `apiKey` capability
- Setup [RBAC configuration](https://argo-cd.readthedocs.io/en/stable/operator-manual/rbac/#rbac-configuration) for your the user and give it readonly access to your ArgoCD resources, e.g. by giving it the `role:readonly` role.
- In your ArgoCD project under _Settings / Accounts_ open the newly created account and in the _Tokens_ section click on _Generate New_ to generate an access token, optionally specifying an expiry date.
If you installed ArgoCD via the official Helm chart, the account creation and rbac config can be achived by overriding these helm values:
```yaml
configs:
cm:
accounts.readonly:apiKey
rbac:
policy.csv:"g, readonly, role:readonly"
```
This creates a new account called `readonly` and attaches the `role:readonly` role to it.
Learn more about [Beszel](https://github.com/henrygd/beszel)
The widget has two modes, a single system with detailed info if `systemId` is provided, or an overview of all systems if `systemId` is not provided.
The `systemID` is the `id` field on the collections page of Beszel under the PocketBase admin panel. You can also use the 'nice name' from the Beszel UI.
A "superuser" is currently required to access the data from the Beszel API.
Allowed fields for 'overview' mode: `["systems", "up"]`
Allowed fields for a single system: `["name", "status", "updated", "cpu", "memory", "disk", "network"]`
# This (no field) will take the root of the API response, e.g. when APIs return an array:
- label:Number of items
format:size
```
Supported formats for the values are `text`, `number`, `float`, `percent`, `bytes`, `bitrate`, `date` and `relativeDate`.
Supported formats for the values are `text`, `number`, `float`, `percent`,`duration`,`bytes`, `bitrate`,`size`,`date` and `relativeDate`.
The `dateStyle` and `timeStyle` options of the `date` format are passed directly to [Intl.DateTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/DateTimeFormat/DateTimeFormat) and the `style` and `numeric` options of `relativeDate` are passed to [Intl.RelativeTimeFormat](https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Intl/RelativeTimeFormat/RelativeTimeFormat).
The `duration` format expects the duration to be specified in seconds. The `scale` transformation tool can be used if a conversion is required.
The `size` format will return the length of the array or string, or the number of keys in an object. This is then formatted as `number`.
## Example
For the following JSON object from the API:
@@ -93,9 +96,16 @@ mappings:
label:Name
- field:status# Alive
label:Status
- field:
origin:name# Earth (C-137)
- field:origin.name# Earth (C-137)
label:Origin
- field:locations.1.name# Citadel of Ricks
label:Location
```
Note that older versions of the widget accepted fields as a yaml object, which is still supported. E.g.:
```yaml
mappings:
- field:
locations:
1:name# Citadel of Ricks
@@ -128,7 +138,15 @@ You can manipulate data with the following tools `remap`, `scale`, `prefix` and
prefix:"$"
```
## List View
## Display Options
The widget supports different display modes that can be set using the `display` property.
### Block View (Default)
The default display mode is `block`, which shows fields in a block format.
### List View
You can change the default block view to a list view by setting the `display` option to `list`.
@@ -152,13 +170,54 @@ The list view can optionally display an additional field next to the primary fie
- any:true# will map all other values
to:Unknown
additionalField:
field:
hourly:
time:key
field:hourly.time.key
color:theme
format:date
```
### Dynamic List View
To display a list of items from an array in the API response, set the `display` property to `dynamic-list` and configure the `mappings` object with the following properties:
```yaml
widget:
type:customapi
url:https://example.com/api/servers
display:dynamic-list
mappings:
items:data# optional, the path to the array in the API response. Omit this option if the array is at the root level
name:id# required, field in each item to use as the item name (left side)
label:ip_address# required, field in each item to use as the item label (right side)
limit:5# optional, limit the number of items to display
format:text# optional - format of the label field
target:https://example.com/server/{id}# optional, makes items clickable with template support
```
This configuration would work with an API that returns a response like:
Learn more about [Filebrowser](https://filebrowser.org).
If you are using [Proxy header authentication](https://filebrowser.org/configuration/authentication-method#proxy-header) you have to set `authHeader` and `username`.
Allowed fields: `["available", "used", "total"]`.
```yaml
widget:
type:filebrowser
url:http://filebrowserhostorip:port
username:username
password:password
authHeader:X-My-Header# If using Proxy header authentication
@@ -13,7 +13,7 @@ Home Network > Network > Network Settings > Access Settings in the Home Network
Credentials are not needed and, as such, you may want to consider using `http` instead of `https` as those requests are significantly faster.
Allowed fields (limited to a max of 4): `["connectionStatus", "uptime", "maxDown", "maxUp", "down", "up", "received", "sent", "externalIPAddress"]`.
Allowed fields (limited to a max of 4): `["connectionStatus", "uptime", "maxDown", "maxUp", "down", "up", "received", "sent", "externalIPAddress", "externalIPv6Address", "externalIPv6Prefix"]`.
@@ -7,7 +7,7 @@ Learn more about [Gitea](https://gitea.com).
API token requires `notifications`, `repository` and `issue` permissions. See the [gitea documentation](https://docs.gitea.com/development/api-usage#generating-and-listing-api-tokens) for details on generating tokens.
API requires a personal access token with either `read_api` or `api` permission. See the [gitlab documentation](https://docs.gitlab.com/ee/user/profile/personal_access_tokens.html#create-a-personal-access-token) for details on generating one.
Your Gitlab user ID can be found on [your profile page](https://support.circleci.com/hc/en-us/articles/20761157174043-How-to-find-your-GitLab-User-ID).
@@ -51,6 +51,8 @@ The metric field in the configuration determines the type of system monitoring d
`process`: Top 5 processes based on CPU usage. Gives an overview of which processes are consuming the most resources.
`containers`: Docker or Kubernetes containers list. Shows up to 5 containers running on the system and their resource usage.
`network:<interface_name>`: Network data usage for the specified interface. Replace `<interface_name>` with the name of your network interface, e.g., `network:enp0s25`, as specified in glances.
`sensor:<sensor_id>`: Temperature of the specified sensor, typically used to monitor CPU temperature. Replace `<sensor_id>` with the name of your sensor, e.g., `sensor:Package id 0` as specified in glances.
@@ -9,10 +9,14 @@ Learn more about [Gluetun](https://github.com/qdm12/gluetun).
Requires [HTTP control server options](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md) to be enabled. By default this runs on port `8000`.
To setup authentication, follow [the official Gluetun documentation](https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md#authentication). Note that to use the api key method, you must add the route `GET /v1/publicip/ip` to the `routes` array in your Gluetun config.toml. Similarly, if you want to include the `port_forwarded` field, you must add the route `GET /v1/openvpn/portforwarded` to your Gluetun config.toml.
```yaml
widget:
type:gluetun
url:http://gluetun.host.or.ip:port
key:gluetunkey# Not required if /v1/publicip/ip endpoint is configured with `auth = none`
Learn more about [Headscale](https://headscale.net/).
You will need to generate an API access token from the [command line](https://headscale.net/ref/remote-cli/#create-an-api-key) using `headscale apikeys create` command.
To find your node ID, you can use `headscale nodes list` command.
Some files were not shown because too many files have changed in this diff
Show More
Reference in New Issue
Block a user
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.