diogovalentte / homarr-iframes

iFrames of many selfhosted services to use in ANY dashboard.
https://ko-fi.com/diogovalentte
MIT License
63 stars 0 forks source link

Homarr iFrames

image

This project connects to multiple self-hosted applications (called sources here) and creates an iFrame to be used in any dashboard (not only Homarr, despite the project's name).

The iFrames will be available under the project's API routes, like /v1/iframe/linkwarden. These routes accept query parameters to change the iFrame, like limiting the number of items or specifying whether you want the iFrames to check for updates automatically (the iframe reloads if the source contents change (like adding new bookmarks on Linkwarden)).

Sources

The API can create iFrames for multiple sources, like the Vikunja source that creates an iFrame with your tasks, or the Linkwarden source that creates an iFrame with your bookmarks.

The sources may require environment variables with specific information like the application address or credentials. The way you provide these environment variables depends on how you run the API.

API docs

The API docs are under the path /v1/swagger/index.html, like http://192.168.1.44/v1/swagger/index.html or https://sub.domain.com/v1/swagger/index.html, depending on how you access the API.

Notes

How to add the iframe to your dashboard

  1. In your Homarr dashboard, click on Enter edit mode -> Add a tile -> Widgets -> iFrame.
  2. Click to edit the new iFrame widget.
  3. Add the API URL (http://192.168.1.15:8080) + the source path (/v1/iframe/linkwarden) + query parameters, like http://192.168.1.15:8080/v1/iframe/linkwarden?collectionId=1&limit=3&theme=dark.

How accessing the iframes works

When you add an iFrame to your dashboard, it's >your< web browser that fetches the iFrame from the API and shows it to you, not your dashboard application running on your server. So your browser needs to be able to access the API, that's how an iFrame works.

No built-in authentication system

This project doesn't have any built-in authentication system, so anyone who can access the API will be able to get all information from the API routes, like your Vikunja tasks, Linkwarden bookmarks, etc. You can add an authentication portal like Authelia or Authentik in front of the project to secure it, that's how I do it.

How to run:

Using Docker:

  1. Run the latest version:
docker run --name homarr-iframes -p 8080:8080 -e VARIABLE_NAME=VARIABLE_VALUE -e VARIABLE_NAME=VARIABLE_VALUE ghcr.io/diogovalentte/homarr-iframes:latest

Using Docker Compose:

  1. There is a docker-compose.yml file in this repository. You can clone this repository to use this file or create one yourself.
  2. Create a .env file with the environment variables you want to provide to the API. It should be like the .env.example file and be in the same directory as the docker-compose.yml file.
  3. Start the container by running:
docker compose up

Manually:

  1. Install the dependencies:
go mod download
  1. Export the environment variables.
  2. Run:
go run main.go