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

Dashy #421

Open
wants to merge 4 commits into
base: master
Choose a base branch
from
Open

Dashy #421

wants to merge 4 commits into from

Conversation

BrokenOnedroid
Copy link
Contributor

@BrokenOnedroid BrokenOnedroid commented Jan 15, 2025

To ease and accelerate the PR submission, please use the template below to provide all requested information.
You can find guidelines on which docker image to use in the Rockstor's documentation,
as well as examples of proper formatting in other rock-ons (here
and here)

Fixes # .

General information on project

This pull request proposes to add a new rock-on for the following project:

  • name: dashy
  • website: https://dashy.to/
  • description: A dashboard application. Can be used as a collection, e.g. of installed Rockons. Or widgets can be added for additional information.

It can look something like this:
dashy

Information on docker image

Checklist

  • Passes JSONlint validation
  • Entry added to root.json in alphabetical order (for new rock-on only)
  • "description" object lists and links to the docker image used
  • "description" object provides information on the image's particularities (advantage over another existing rock-on for the same project, for instance)
  • "website" object links to project's main website

@Hooverdan96
Copy link
Member

@BrokenOnedroid thanks for submitting the Rockon. I did a test install, which went almost fine ...

image
the share configured to use 1001/1001 for UID/GID with full access to the share

image

image
Maintaining corresponding UID/GID

image

it seems that passing in a different UID/GID is not working. The configuration failed during the preparation phase when I first went to the UI page. After some time compiling/preparing/checking it threw this error message at the end:

image

The docker log showed the errors for the /app/user-data not existing. When entering the container, I noticed that the user running it was still root:

image

Since I had set up the config share with UID/GID 1001/1001 it couldn't save the configuration to the share, I believe.

After adjusting the permissions back to root/root the configuration save worked fine and thus the dashy app as well.

I followed the instruction to save the configuration to disk, which worked and I then configured a Rockstor entry (very simple):

image

That all worked fine

Am I doing something incorrectly w.r.t UID/GID?

@BrokenOnedroid
Copy link
Contributor Author

@Hooverdan96

I tried it like the original config after: https://dashy.to/docs/deployment/

... volumes: /root/my-config.yml:/app/user-data/conf.yml ...

That did not work since a volume is expected for an Rock-on.
=> Changed it to a Volume
=> that should be the reasons for the Configuration Load Error

I did not have a Problem with skipping the Error and then saving the config to disk.
I'm using 1000/100 as UID/GID.
Is this information helpful to you?

@Hooverdan96
Copy link
Member

Hooverdan96 commented Jan 20, 2025

Yeah, I skipped the error, too. However, I then still couldn't save the config to disk. Only when I changed the authorizations on the config share to match the root user running inside the container, it would save the file.

when you go inside your running container:

docker exec -it dashy /bin/sh

and do the id or whoami, what does it show for you?

Also, when you set up the config share for dashy, what's the authorization set to?

@Hooverdan96
Copy link
Member

Hooverdan96 commented Jan 21, 2025

ok, very strange. when I initially tried to save the configuration from here:

image

It gives me the error that I can't save (as I highlighted earlier):
image

At the same time, it looks like it actually does create the conf.yml file. Only fails to create the backup file.

And when I go back into the configuration and select save again, then the backup creation works fine:

image

However, both the config file, the backup directory, and the actual backup is created using the root user:

image

I guess, it then means that it does work for me, as it does for you.

I'm not sure what's going on there, but that seems to be a "feature" within dashy. This is when I have both the UID/GID and the share ownership set to 1001/1001.

Interestingly, also, when looking inside the container, the UID/GID for the user-data folder is set to the 1001/1001 that I passed into the Rockon:
image

But ... this seems like a bug of Dashy and not related to the Rockon itself. And once, the file has been created there doesn't seem to be an issue to change and save the initially file from there on out. But, it also seems to make the the whole UID/GID useless at this point, since root is running (and saving) the show anyway.
I think, unless its use is clarified or (if it's a bug) fixed by the dashy owner, you can probably even drop the UID/GID as environment variables, since it doesn't make a difference.

@BrokenOnedroid
Copy link
Contributor Author

@Hooverdan96 I'm going to remove the UID/GID and try an install with an new share.
Maybe dashy wants to backup every change before saving.
Then removing the env vars would change nothing.
This is because the first time it is saved, the expected `config.yaml' is missing and can't be saved into a backup.

@BrokenOnedroid
Copy link
Contributor Author

@Hooverdan96 I can replicate your findings. Additionally there was no difference not using the UID/GID.
Setting wo UIG/GID:
Settings_wo_GID_UID
Same Error:
error_on_start
Docker log:
error_on_start_docker log

Using the Configurator and saving twice removed the errors for me:
saving_twice

@Hooverdan96
Copy link
Member

@BrokenOnedroid do you then want to push a change, removing the UID/GID? Then we can review once more and hopefully it can be merged in as a new Rockon.

@Hooverdan96
Copy link
Member

Thanks for the additional update. So, testing installation again:

image

adding config share:
image

define port:
image

Installation is successful:
image

In the log:

[29/Jan/2025 11:16:40] INFO [storageadmin.views.rockon:504] Rock-on definitions retrieved in: 14.17 seconds.
[29/Jan/2025 11:18:43] INFO [storageadmin.tasks:55] Now executing Huey task [install], id: c23d9190-e904-4dea-880b-5f4667092b33.
[29/Jan/2025 11:18:43] ERROR [system.osi:287] non-zero code(1) returned by command: ['/usr/bin/docker', 'stop', 'dashy_new']. output: [''] error: ['Error response from daemon: No such container: dashy_new', '']
[29/Jan/2025 11:18:43] ERROR [system.osi:287] non-zero code(1) returned by command: ['/usr/bin/docker', 'rm', 'dashy_new']. output: [''] error: ['Error response from daemon: No such container: dashy_new', '']
[29/Jan/2025 11:18:46] INFO [storageadmin.views.rockon:106] Rockon (Dashy_New) state pending and no pending task: assuming task is mid execution.
[29/Jan/2025 11:19:02] INFO [storageadmin.views.rockon:106] Rockon (Dashy_New) state pending and no pending task: assuming task is mid execution.
[29/Jan/2025 11:19:08] INFO [storageadmin.views.rockon:106] Rockon (Dashy_New) state pending and no pending task: assuming task is mid execution.
[29/Jan/2025 11:19:23] INFO [storageadmin.views.rockon:106] Rockon (Dashy_New) state pending and no pending task: assuming task is mid execution.
[29/Jan/2025 11:19:38] INFO [storageadmin.views.rockon:106] Rockon (Dashy_New) state pending and no pending task: assuming task is mid execution.
[29/Jan/2025 11:19:38] INFO [storageadmin.tasks:63] Task [install], id: c23d9190-e904-4dea-880b-5f4667092b33 completed OK

Connecting to WebUI:
image

Config Load error is expected during initial install, as no configuration file exists, yet. To remedy that situation, go to Interactive Editor:
image

Save to Disk:
image

Throws error (because of backup attempt of a non-existing config file at the first start) – so as expected.
Entering the configuration again, updating the configuration and saving proceeds as expected.

From my perspective this Rockon is ready for merge. @phillxnet please take a look when you have a chance.

@Hooverdan96 Hooverdan96 requested a review from phillxnet January 29, 2025 20:02
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants