DietPi-Dashboard icon indicating copy to clipboard operation
DietPi-Dashboard copied to clipboard

Spring board for known (+ custom) web applications

Open MichaIng opened this issue 2 years ago • 14 comments

Since we have some users who want to use something like Heimdall, to have a page with tiles/links to various web applications, but Heimdall is difficult to implement into dietpi-software in a compatible way, probably we can implement it into DietPi-Dashboard:

  • We could scan for installed (dietpi-)software titles where we know the subpath or the port, and show a related tile with link (using the dashboard access host + known default port and/or subpath) and a hardcoded logo.
  • We could allow to edit the link, probably even the logo.
  • We could allow to add custom tiles with link and logo.
  • We could allow to reorder the tiles.

The last three parts would require a server-side storing of the info, so something which DietPi-Dashboard does not do at all. Of course it could be also done just via config.toml for now, so that it is possible to override the default link of a defined web application.

MichaIng avatar Feb 24 '22 20:02 MichaIng

I look forward to this functionality :-)

TommySharpNZ avatar Feb 27 '22 20:02 TommySharpNZ

Personally, I still think it would be better to have a dedicated bookmarks dashboard application, however this detecting installed software from DietPi-Software would be nice. It would probably require putting the ports and web addresses of software in a more standardized place, though. Not sure about how to do server-side storage, a full database seems like too much, and I like the no dependencies. Maybe storing it in a JSON file, similar to Python's pickledb. It would also allow graph data to be saved, like in #153.

ravenclaw900 avatar Feb 28 '22 16:02 ravenclaw900

Earlier or later, adding the ability to change config.toml settings via web interface would be great anyway. It could then also hold overrides for the known/default software ports and/or URLs (when running on a different machine or requiring a different host than the dashboard). Of course it would be also a dedicated config file if all in one is seen as an issue, not sure which format is best then, I personally don't like JSON because it is hard to edit manually and hard to grep/sed/awk. But of course there are processing libraries and tools available. For custom entries I however agree that TOML is not great either, requiring either custom sections or variable names with incrementing suffix or such, like spring_url_0, spring_url_1, spring_label_0, spring_color_0 or so (just examples of possibly interesting customisations).

MichaIng avatar Feb 28 '22 16:02 MichaIng

A vote for this from the forum: https://dietpi.com/phpbb/viewtopic.php?t=10366

MichaIng avatar May 13 '22 14:05 MichaIng

Before any work can be done on this, it would be great to have some kind of port database for DietPi-Software. Otherwise, users would need to add the software themselves (it seems like automatically getting the ports would be a big advantage over Heimdall). Pickledb now has feature flags to remove unneeded dependencies, so customizing and storing on the server could be done.

ravenclaw900 avatar May 13 '22 15:05 ravenclaw900

ss -tlpn could be used to get process names which listen on specific TCP ports. Probably there is a Rust crate as well. Otherwise, I agree, a port database makes much sense, also to see port conflicts reliably when impending software. However, reasonably ports can always be changed, so probably it is even best to derive available software and related ports directly from ss, so we only need a list of known process names, and probably associated logos?

Ah, and then there are the port 80/443 webserver applications and their sub path. Okay probably better to parse /boot/dietpi/.installed then, as those cannot be detected in a generic way otherwise.

MichaIng avatar May 13 '22 15:05 MichaIng

There are some great long-term solutions being proposed above. In the interim, I was wondering if we could perhaps consider at a simpler solution.

Would it be possible to create a new tab called "Links" that allows users to add and edit any title/link combination to their DietPi Dashboard. For example if a user wanted to access Aria2, they would just add a link with the title "Aria2" and the URL "http://system_ip/aria2/docs/". This would allow any URLs to be added which could either point to services on the DietPi or items on the Internet. If we wanted to make this slightly more sophisticated, we could allow for icons to be set, but even just the addition of title/name link functionality would be a great addition IMHO.

To keep things simple we could have a single editable file, perhaps a simple markdown file with a format such as [Title](URL) or using the Aria2 example, [Aria2](http://system_ip/aria2/docs/).

What do people think?

robinkleem avatar May 20 '22 03:05 robinkleem

Currently that sounds like a good plan. It would probably not be stored as a markdown file, perhaps as JSON or YAML, which makes it easiest to write from the frontend.

ravenclaw900 avatar May 20 '22 13:05 ravenclaw900

Keeping the final implementation in mind, at least I wouldn't implement something "smaller" now which needs to be completely rewritten later, but only if the code can be easily extended for the final implementation. Just my 2 cents, to reduce coding overhead 😉.

MichaIng avatar May 20 '22 13:05 MichaIng

This should be extendable, it would probably be how you would manually add software that's not automatically detected, and how it would be stored in the backend anyway.

ravenclaw900 avatar May 20 '22 13:05 ravenclaw900

@ravenclaw900 whatever solution you decide on for application links, I think it will add substantial value to the current DietPi Dashboard. As it is currently, the homepage for all my DietPi servers is straight to http://server:5252/ :wink:

robinkleem avatar May 26 '22 11:05 robinkleem

I'll begin work on this as soon as I get #232 and #236 merged.

ravenclaw900 avatar May 27 '22 15:05 ravenclaw900

Hi Team, any updates on this? I'd love to get rid of my docker setup that just hosts Heimdall... :-)

TommySharpNZ avatar Oct 12 '22 22:10 TommySharpNZ

I found another similar app that could be used for inspiration or even added to the installable software list? https://github.com/benphelps/homepage

TommySharpNZ avatar Oct 24 '22 09:10 TommySharpNZ