Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DietPi-Software | Web Dashboard for DietPi #448

Closed
Fourdee opened this issue Jul 27, 2016 · 93 comments · Fixed by #4918
Closed

DietPi-Software | Web Dashboard for DietPi #448

Fourdee opened this issue Jul 27, 2016 · 93 comments · Fixed by #4918
Assignees
Labels
Milestone

Comments

@Fourdee
Copy link
Collaborator

Fourdee commented Jul 27, 2016

ADMIN EDIT

Dashboard is available for testing, see https://github.com/ravenclaw900/DietPi-Dashboard#installation for instructions.

Base:

  • Must not require a webserver stack (implies self contained website). eg: Websockets and Bootstrap/JS
  • Lightweight (minimal cpu and memory usage)

Main DietPi programs for web implementation:

  • DietPi-Software
  • DietPi-Config

Additional features:

  • Terminal window
@rhkean
Copy link
Contributor

rhkean commented Jul 27, 2016

brainstorming..... this can probably be done with python. Couchpotato and NzbHydra use python and have decent simple web interfaces. But, so does netdata and it's written in C.

@tr0yspradling
Copy link

I plan on taking a stab at this with Python/Flask.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jul 28, 2016

@tr0yspradling

I plan on taking a stab at this with Python/Flask.

Excellent 👍

We will need to change alot of the DietPi code to truly accommodate the web dashboard, but either myself or @rhkean can do this alongside @tr0yspradling's work.
If you have any progress, let us know.

@Fourdee Fourdee added this to the Prototyping milestone Jul 28, 2016
@Fourdee
Copy link
Collaborator Author

Fourdee commented Jul 28, 2016

@rhkean

But, so does netdata and it's written in C.

YMPD is also written in C: https://github.com/notandy/ympd

Standalone MPD Web GUI written in C, utilizing Websockets and Bootstrap/JS http://www.ympd.org

@WolfganP
Copy link

Great idea. I think that the system will benefit more if it's designed extensible from the start, so it can be tailored for custom system commands or headless operation (ie one button remote system shutdown/restart, modules commands -ie minidlna db rescan-, etc)

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jul 28, 2016

@WolfganP

Yep, ideally i'd like a system where users can either use the web dash, or, terminal for all DietPi features.
So for example, we could have a DietPi-Software page where the user can install software from a list, then follow a link to the docs. Basically a duplicate of the whiltail menu, but in a better web format. Possibilities are endless.

I recently added code that allows for automated command line installations:

/DietPi/dietpi/dietpi-software install KODI HIFI

But I/we will need help with this, I can do the bash/unix side, but i lack the skills for the web side.

@rhkean
Copy link
Contributor

rhkean commented Jul 28, 2016

@WolfganP
Yep, ideally i'd like a system where users can either use the web dash, or, terminal for all DietPi features.

terrific idea. The trick, I think, will come in finding a way to do this that maintains the small footprint that is at the heart of DietPi

@WolfganP
Copy link

Ideally it should just be a different UI for using the existing installation / config scripts, with the ability to add user scripts / commands / recipes somehow (to avoid reinventing the wheel and having to reimplement the current / tuned dietpi-* specific scripts).

@tr0yspradling
Copy link

tr0yspradling commented Jul 29, 2016

I've created DietPi-Dashboard. It's a skeleton project at the moment, but I'll have some progress up soon.

I've decided to use CherryPy instead of Flask, but I'm curious, should we reverse proxy through NGINX or use the standalone server with CherryPy?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jul 29, 2016

@tr0yspradling

That was quick, looking forward to seeing it progress 👍

I've decided to use CherryPy instead of Flask, but I'm curious, should we reverse proxy through NGINX or use the standalone server with CherryPy?

I would prefer it didn't required a webserver, self contained in a standalone server would be ideal.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Jul 29, 2016

@WolfganP

Ideally it should just be a different UI for using the existing installation / config scripts, with the ability to add user scripts / commands / recipes somehow (to avoid reinventing the wheel and having to reimplement the current / tuned dietpi-* specific scripts).

Yep.
To start off with, we'll start small and see what the dash can do. In time, we can always add more to it. I have this vision of making DietPi completely web interfaced, but at this time, its just an idea. We'll see how it goes :)

@tr0yspradling
Copy link

Right now I'm working on syncing live system information with python-socketio and displaying it with Chart.js. Once I finish that, I'm going to add process & software package management.

@k-plan
Copy link
Contributor

k-plan commented Aug 23, 2016

Hi,

are where any news? Thanks.

@tr0yspradling
Copy link

I'll be updating the repository tonight. I'll post back here when I do.

@tr0yspradling
Copy link

@Fourdee I considered using Crow.

@tr0yspradling
Copy link

I haven't been able to get as much done as I hoped, I had another project taking up most of my time.

Check out DietPi-Dashboard to see what's there. It needs cleaned up and reorganized a little, some of the major features aren't implemented yet.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Aug 25, 2016

@tr0yspradling

time

No worries 👍

Check out DietPi-Dashboard to see what's there. It needs cleaned up and reorganized a little, some of the major features aren't implemented yet.

I'am a bit of a Python "n00b" (Its like reading an Alien language for me, with a few English letters and numbers in-between lol) , but i'll give it a whirl, run.py to launch?

@Fourdee
Copy link
Collaborator Author

Fourdee commented Aug 25, 2016

Notes: Quick install deps and run:

apt-get install -y python python3 python-pip python-dev #build-essential
wget https://github.com/tr0yspradling/DietPi-Dashboard/archive/master.zip -O package.zip
unzip package.zip
rm package.zip
chmod +x -R DietPi-Dashboard-master
cd DietPi-Dashboard-master
pip install -r requirements.txt
./start

@tr0yspradling Expected?

root@DietPi:~# DietPi-Dashboard-master/run.py
from: can't read /var/mail/flask
from: can't read /var/mail/werkzeug.debug
from: can't read /var/mail/flask_socketio
DietPi-Dashboard-master/run.py: line 5: import: command not found
DietPi-Dashboard-master/run.py: line 6: import: command not found
DietPi-Dashboard-master/run.py: line 7: import: command not found
from: can't read /var/mail/project.server
from: can't read /var/mail/project.server
DietPi-Dashboard-master/run.py: line 12: syntax error near unexpected token `('
DietPi-Dashboard-master/run.py: line 12: `application = create_application(debug=True)'

@tr0yspradling
Copy link

The application depends on several python packages. The python package index can be installed with
sudo apt install python-pip
and the dependencies can be installed by running
sudo pip install -r requirements.txt

I'm creating a virtualenv and startup script for it now. I'll update when I've finished my modifications.

@tr0yspradling
Copy link

Check DietPi-Dashboard. Executing ./start should work.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Aug 26, 2016

@tr0yspradling

Tried on my test rig (Odroid C2, ARM64):

root@DietPi:~/DietPi-Dashboard-master# ./start
/usr/local/lib/python2.7/dist-packages/flask/exthook.py:71: ExtDeprecationWarning: Importing flask.ext.socketio is deprecated, use flask_socketio instead.
  .format(x=modname), ExtDeprecationWarning
Traceback (most recent call last):
  File "run.py", line 10, in <module>
    from project.server import sioServer
  File "/root/DietPi-Dashboard-master/project/server/__init__.py", line 3, in <module>
    from dashboard.views import dashboard_routes
  File "/root/DietPi-Dashboard-master/project/server/dashboard/views.py", line 9, in <module>
    from diagnosticsReport import DiagnosticsReport
  File "/root/DietPi-Dashboard-master/project/server/dashboard/diagnosticsReport.py", line 2, in <module>
    import cpuinfo
  File "/usr/local/lib/python2.7/dist-packages/cpuinfo/__init__.py", line 5, in <module>
    from cpuinfo import *
  File "/usr/local/lib/python2.7/dist-packages/cpuinfo/cpuinfo.py", line 1553, in <module>
    _check_arch()
  File "/usr/local/lib/python2.7/dist-packages/cpuinfo/cpuinfo.py", line 1510, in _check_arch
    raise Exception("py-cpuinfo currently only works on X86 and some ARM CPUs.")
Exception: py-cpuinfo currently only works on X86 and some ARM CPUs.

I'll power up a RPi and try it.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Aug 26, 2016

@tr0yspradling

I love where this is going. This is exactly what DietPi needs. Great work 👍
image

Ps. you should put "DietPi-Dashboard created by tr0yspradling/realname" in the footer ;)

@tr0yspradling
Copy link

I'll have to go through and check the supported architectures for each supported platform. I didn't think of that.

I should have done this from the start, but I'll go through and pull the data from the special file: /proc/cpuinfo

@tr0yspradling
Copy link

We should start reporting issues to the dashboard repository so it's more organized.

@Fourdee
Copy link
Collaborator Author

Fourdee commented Aug 26, 2016

@tr0yspradling

We should start reporting issues to the dashboard repository so it's more organized.

Good call 👍
I'd like to add a few tickets with features I'd like to see, and discuss their implementation if thats ok?

@tr0yspradling
Copy link

Absolutely. Check your email!

@ravenclaw900
Copy link
Collaborator

I just recently noticed that happening a couple times as well. I'll try to pin it down.

@ravenclaw900
Copy link
Collaborator

ravenclaw900 commented Oct 26, 2021

@Joulinar, just pushed a change that, for me, fixes that problem. It also brings CPU usage on most pages from ~100% (spinning loop), to 0%!

@ravenclaw900
Copy link
Collaborator

This should make testing a bit easier, CI will now build binaries after every commit. See the updated README for downloading instructions.

@Joulinar
Copy link
Collaborator

ahh cool. Quite easy to install the nightly. Looks good.

@MichaIng MichaIng linked a pull request Nov 1, 2021 that will close this issue
@MichaIng MichaIng changed the title Web Dashboard for DietPi DietPi-Software | Web Dashboard for DietPi Nov 1, 2021
@ravenclaw900
Copy link
Collaborator

@MichaIng, just added config file with port and TLS support.

@MichaIng MichaIng added the Solution available 🥂 Definite solution has been done label Nov 4, 2021
MichaIng added a commit that referenced this issue Nov 5, 2021
+ CHANGELOG | Thanks to @ravenclaw900, we are priod to announce our own official DietPi web interface for monitoring and managing your DietPi system. It is still in beta phase, as we are testing and implementing more features gradually, but we are happy if you would give it a try, "dietpi-software install 200", and give us feedback: #448
@ravenclaw900
Copy link
Collaborator

Could you test the binaries linked against the musl libc library? They seem to have lower memory usage in general. https://github.com/ravenclaw900/DietPi-Dashboard/actions/runs/1427621051

@MichaIng
Copy link
Owner

MichaIng commented Nov 6, 2021

Hmm, when downloading these artifacts via curl, I get a 404, when using wget, a 400, same when I use the final URL that is redirected to. Via browser it works well, but I'm too lazy to install desktop + browser on all test systems. Any idea how those can be downloaded from command line? 🤔

@ravenclaw900
Copy link
Collaborator

ravenclaw900 commented Nov 6, 2021

It requires you to be logged in with a GitHub account. You could use the nightly.link: https://nightly.link/ravenclaw900/DietPi-Dashboard/actions/runs/1427621051. (https://nightly.link/ravenclaw900/DietPi-Dashboard/actions/runs/1427621051/dietpi-dashboard-amd64.zip for amd64 direct download).

@MichaIng
Copy link
Owner

MichaIng commented Nov 6, 2021

These work, thanks. Indeed these use only about 60% of memory 👍. They do not seem to cause any issues. Everything that works with the main nightly builds, works with the musl builds as well.

MichaIng pushed a commit that referenced this issue Nov 6, 2021
+ DietPi-Software | DietPi-Dashboard: Thanks to the great work of @ravenclaw900, we are proud to announce our own official DietPi web interface for monitoring and managing your DietPi system using your web browser. It is still in beta phase as we test and gradually implement more features. We would be happy if you would try it out via "dietpi-software install 200" and give us feedback: #448
+ DietPi-Services | When printing the status, instead of removing a hardcoded number of 11 characters from the start of the line, remove the first field and delimiter. The number of leading spaces has changed with Bullseye, so that the colon of "Active:" was shown unintentionally.
@GvY85
Copy link

GvY85 commented Nov 9, 2021

Tried out the Stable release in 7.8 Beta and this is really great!

Some remarks:
-I could not get the terminal working. There seems to be a completely black window and a cursor when clicking the window but nothing happens when typing.
-When switching 'tabs' a few times it seemed to get stuck on "loading" after a while.
-Is it possible to add a login screen? Now everyone with local network access can mess with the system.
-The installation and updating process needs some tweaking/more info I think. I had to systemstl status dietpi-webdashboard to find out the port it was using. Perhaps make that also configurable? Also some info on the port it uses and how to update/update it? Perhaps make it updatable with dietpi-update?.
-Layout and graphics are really nice but perhaps an option to change the default colors?I know everyone loves the DietPi theme but for those that love other colors just a bit more that would be great ;) .

Just had about 15min to look at it so could not deep dive into it.

@MichaIng
Copy link
Owner

MichaIng commented Nov 9, 2021

I could not get the terminal working. There seems to be a cursor when clicking but nothing happens when typing.

Known issue and fixed with next beta, which I will push in 1-2 hours: ravenclaw900/DietPi-Dashboard#19

When switching 'tabs' a few times it seemed to get stuck on "loading" after a while.

I suppose this is as navigating to Terminal currently stops the service. Here a manual fix btw:

cat << '_EOF_' > /etc/systemd/system/dietpi-dashboard.service
[Unit]
Description=Web Dashboard (DietPi)
Wants=network-online.target
After=network-online.target

[Service]
ExecStart=/opt/dietpi-dashboard/dietpi-dashboard
StandardInput=tty
TTYPath=/dev/tty42
StandardOutput=journal

[Install]
WantedBy=multi-user.target
_EOF_
systemctl daemon-reload
systemctl restart dietpi-dashboard

Is it possible to add a login screen?

Indeed needed IMO. My idea was to keep it simple and use password protection only (no user management): ravenclaw900/DietPi-Dashboard#11
The only question is whether regular HTTP authentication with user + password is much simpler to implement with existing Rust crates. Feel free to contribute to the linked request/discussion.

The installation and updating process needs some tweaking/more info I think

Jep, a documentation is required: MichaIng/DietPi-Docs#610

Update should be done via dietpi-software reinstall 200, but we may consider to do this automatically as part of dietpi-update, at least definitely if changes in DietPi require a related update of the dashboard.

Layout and graphics are really nice but perhaps an option to change the default colors?

Good idea. As of my preference for dark modes, @ravenclaw900 was so kind to make realise this: #448 (comment)
However, would be great to have at least a dark/bright mode switch, or even switching the accent colour from green to something else. But I'd consider this a minor long term request and focus on stability and a reasonable set of core features first. I opened a request where further ideas/discussion can be done: ravenclaw900/DietPi-Dashboard#29

Since this issue will be closed with the release, it would be great if you guys could check for requests/issues on the actual dashboard repository, and if not existing yet, report it there: https://github.com/ravenclaw900/DietPi-Dashboard/issues

@tandy-1000
Copy link

image

I installed the dashboard, but I much prefer these colors to the current "dietpi"-esque theme, . I imagine ravenclaw900/DietPi-Dashboard#29 is fixing that?

Another idea that may be out of scope to this project is doing regular SMART checking of hard drives. Could require an extension to dietpi_drive-manager.
I use scrutiny for that purpose at the moment.

@MichaIng
Copy link
Owner

Jep, the linked request is about this at least. Though no ETA when we will address it.

SMART data is indeed an interesting idea, probably to show on the Management page. Since not all drives support SMART, I'd implement it as optional, e.g. using smartmontools, if installed, and skip it, if not installed.

@MichaIng
Copy link
Owner

I'll mark this issue as closed now. Please do reports/requests at the dedicated repository from now on: https://github.com/ravenclaw900/DietPi-Dashboard/issues

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging a pull request may close this issue.