will-moss / isaiah

Self-hostable clone of lazydocker for the web. Manage your Docker fleet with ease
MIT License
86 stars 3 forks source link

Multi host mode feature request #2

Closed vutsalsinghal closed 1 month ago

vutsalsinghal commented 5 months ago

Hi @will-moss

I wanted to throw out some ideas for multi-host (and maybe multi-node) mode. Not sure if these are necessary or are an overkill for this project 😄


  1. Could there be stats on the home page with basic details about different hosts? Something like this

    Screenshot 2024-02-06 at 1 19 13 PM
  2. Ability to search container globally (across hosts) and navigate to it

  3. Confirmation before container restart/stop.

  4. Sort containers by either - last_created,name, etc can be set via config/env

vutsalsinghal commented 5 months ago

On a side note -

  1. there doesn't seem to be a way to switch host (when using multi-host mode) when using isaiah on mobile.
  2. custom.css isn't working. I copied the sample.custom.css and just modified the background but it didn't do anything

My docker-compose.yaml

isaiah:
    image: mosswill/isaiah:latest
    container_name: isaiah_container
    ports:
      - 3000:3000
    env_file: ./isaiah/.env
    environment:
      - MULTI_HOST_ENABLED=true
    volumes:
      - /var/run/docker.sock:/var/run/docker.sock:ro
      - ./isaiah/docker_hosts:/docker_hosts
      - ./isaiah/custom-theme.css:/custom.css
    restart: unless-stopped
will-moss commented 5 months ago

Hi,

Thanks for opening the issue, and for the awesome ideas!

For starters, you are absolutely correct about the missing mobile control for switching hosts on mobile. I immediately fixed it, and published a new release. You can pull the latest image, and you'll have a dedicated mobile control for switching hosts on your mobile device.

Regarding the custom.css issue, I tried to reproduce it on my end, but couldn't. I could succesfully change any color, and add my custom styles. That said, this is what I would suggest to help you troubleshoot on your end :

For the confirmation prompt before a container stop / restart, no problem. It's now added to my list, and I'll implement it soon (this week I believe).

For the sorting by configurable field, I believe it's trickier, but it's added to my list for sure.

For the global container search across hosts, I love the feature. It makes me think about Spotlight on Mac. Added to my list, and thanks a lot for the idea.

Ultimately, for the home page dashboard in multi-host setups, I'll try to implement it after I'm done with the previous features. I think it might take a bit longer as I, supposedly, must implement it for multi-agent setups as well to preserve feature-equivalence.

vutsalsinghal commented 5 months ago

Thanks for the prompt reply.

You're correct, theh custom.css was browser cache issue. Since the css filename hasnt changed, browser will use the cached version. Would it be possible to look for something like custom-<random-numbers>.css instead of custom.css so that just changing the random numbers at the end would prevent browser from spitting stale copy?

vutsalsinghal commented 5 months ago

How does the mobile host switcher works? I've pulled the latest image (1.61) but cant figure out how to change the host?

EDIT: ok I can see the globe icon to switch host in landscape mode of my mobile (the extra icons do not show up in portrait mode)

Another enhancement -

  1. Password should be provided as hash (maybe sha256, etc)
will-moss commented 5 months ago

I'm glad the issue with custom.css was fixed on your end. I'm definitely looking into a way to keep it from being cached by the browser, with a random string certainly.

For the mobile host switcher, you have to scroll horizontally on the bottom controls. Let me know if the scroll doesn't work (shouldn't be the case, but I'm unaware of the device / browser you're using). Even in portrait mode, you should be able to scroll to reveal it.

Excellent idea for the hashed password ! Added to my growing list of features to implement!!

vutsalsinghal commented 5 months ago

Yes indeed! Didnt realize there is small horizontal scroll bar in portrait mode as well! 😄 Awesome!

vutsalsinghal commented 4 months ago
  1. When the menu for container is opened, the container_name should also be displayed in the pop-up box header (cause sometime you might accidently open menu for another container)
vutsalsinghal commented 4 months ago
  1. Striped background for each new line of output for better readability and toggle timestamp (below is a screen shot from Dozzle) image
will-moss commented 4 months ago

Alright alright !

I've just published a new release, and it includes :

I'm jumping on the next features now!

Thanks again so much for raising all these points, and feel free to keep doing so !

vutsalsinghal commented 4 months ago

Love the new changes! ❤️ 🙏🏼

Really appreciate the sha256 change and the corresponding documentation.

2 things though:

will-moss commented 4 months ago

Thanks for your feedback!

For the keyboard shortcuts not displaying a pop-up confirmation, it is the expected behavior so far. It assumes the user knowing the keyboard shortcuts is well aware of what they're doing, hence the interface doesn't ask for confirmation. Do you think it should be changed or turned into an option?

For the stripped background color for logs, the problem is known already. I am looking into a better way to implement it so as to circumvent the issue you're mentioning (a.k.a, the background isn't as long as the entire overflow width).

vutsalsinghal commented 4 months ago

I would argue the opposite actually - if someone is using the menu to stop/restart then confirmation is less productive 😄 But jokes aside, both approaches should have confirmation imo. The default response can be 'y/yes' so ppl on keyboard can just use the shortcut and press enter at the pop-up confirmation.

It could be parameterized, but too many parameters could be confusing - your call on that. There could also be a simple settings menu (to toggle line_wrap, timestamp, etc) that can be saved in browser's local storage!

vutsalsinghal commented 4 months ago
  1. Copy log lines (right now I'm not able to copy at all).
  2. Search container logs (also keyboard shortcut to start searching).
  3. Timestamp (can be toggled on/off) with the log line would be very helpful.
vutsalsinghal commented 3 months ago
  1. Proxy header authentication (ex - https://www.authelia.com/integration/trusted-header-sso/introduction/)
will-moss commented 3 months ago

Alright alright alright!

Work has been pretty rough these days, but I'm back.

Thank you so much once again for spending the time to share your feature ideas and observations.

The more I'm implementing all your features and ideas, the happier I get 👍 👍 👍

I've just released a new version a few minutes ago, that includes :

Planned for the next releases (I'm on it) :

Ultimately, do you mind explaining how the Proxy Header Authentication would work? I ain't so familiar with Authelia, and even after reading their docs, I'm not sure that I've got it right. From what I understand, if Proxy Header Authentication was implemented in isaiah, it would look like below, right?

User ---LOGIN-----> Authelia User <--OK--------- Authelia User ------REQUEST----> Authelia ----REQUEST+HEADER---> Isaiah User <-----RESPONSE--- Authelia <---RESPONSE------------- Isaiah

In other words, the User logs in with Authelia, then sends all their requests to Authelia, who will forward them to Isaiah and back, without needing to authenticate with Isaiah.

If my representation is correct, don't bother explaining. Else, please feel free to correct me and explain what I couldn't get!

Thanks again for the amazing features and observations 💯 🎊

will-moss commented 3 months ago

Just released the "Search container logs" feature 👍

will-moss commented 3 months ago

Just released the "Sort" feature, and added support for the "Created At" field to be shown / used for sorting containers 👍

vutsalsinghal commented 3 months ago

Dude absolutely love the features! Thanks a ton... Appreciate it a lot ❤️ ❤️ 🖖🏼

Your understanding is kind of correct (even I have some holes in my understanding from a implementation point).

Basically the auth gateway (authelia/authentik) forwards the trusted headers and value (like "X-Remote-User sampleUser", etc) and Isaiah based on that will allow access. If the headers are missing or value is empty then --> permission denied.

Maybe the following implementation by Dozzle might help - link

vutsalsinghal commented 3 months ago

Also I dont think sort is working. This is my config and it doesnt seem to be doing anything.

  isaiah:
    image: mosswill/isaiah:latest
    container_name: isaiah_container
    ports:
      - 3000:3000
    env_file: ./isaiah/.env
    environment:
      - MULTI_HOST_ENABLED=true
      - CONTAINER_LOGS_TAIL=100
      - CONTAINER_LOGS_SINCE=168h #7days
      - "TTY_SERVER_COMMAND=/bin/sh -i"
      - COLUMNS_CONTAINERS=State,Name,Created
      - COLUMNS_IMAGES=Name,Version,Size
      - COLUMNS_VOLUMES=Driver,Name,MountPoint
      - COLUMNS_NETWORKS=Name,Driver
      - SORTBY_CONTAINERS=-Created
    volumes:
      - ./isaiah/docker_hosts:/docker_hosts
    restart: unless-stopped
will-moss commented 3 months ago

Thank you for the link to the Proxy Header Auth implementation. I will definitely use it as an inspiration.

For the sorting, I may be wrong, but I think you may not be on the latest version? Or potentially, your container wasn't restarted? I just tried your parameter (SORTBY_CONTAINERS=-Created) and it worked in my setup.

Otherwise, are you able to see if sorting works with other fields? For instance with "Name" or "-Name" or else?

Edit : The sorting happens client-side. Now I believe you'll have it fixed if you delete your cache or try a hard refresh in your browser or try in a private incognito tab. The point is to have the main JS file reloaded

vutsalsinghal commented 3 months ago

yes sir! you're right. Deleting cache worked! thank you

will-moss commented 3 months ago

Just released the Dashboard feature, hoping that it meets your needs! It is toggled on by default, and can be triggered by pressing "O" as in "Overview". It will display a menu where you can pick any of your server, agents, and hosts.

vutsalsinghal commented 3 months ago

Love the overview feature! Ofc a lot can be added to it but I like the simplicity :)

will-moss commented 2 months ago

Just added the Jump feature. You can now type J, start typing, and either click on a resource, or navigate with the arrow keys and press enter to pick one. For now, it only works for the current host / agent as I found it would be a little more complex to make the app search through remote resources. Hoping that it's a first step in the right direction! I will definitely try to find the time to make it work globally, and not forget about Authelia.

vutsalsinghal commented 2 months ago

jump feature is working as expected on the current host for me!

will-moss commented 2 months ago

Thanks for the feedback!

I'm glad to inform you that I managed to implement the search and jump across all hosts, and released it a few minutes ago!

vutsalsinghal commented 2 months ago

jump is not working perfectly for multi host. It works, but not always. I'm able to short list by partial name but when I press enter, sometimes it takes me to a random resource on that host and other times it takes me to the expected one (could be because another issue described below).

Also, when I type to search for a resource, it blocks my typing - I'm unable to type smoothly. I know it searches on every keystroke but I think since there is a delay in that search, it blocks the cursor from typing the next character.

Another suggestion if I could give about search is to use fuzzy search instead of substring based.

will-moss commented 2 months ago

Alright, thank you very much for your tests and feedback. It's very much appreciated.

I have just published a new release, that includes :

Regarding the Jump feature, you were absolutely correct about the issue. I rewrote a few parts of the feature, and I believe that it should work better from now on.

For context, the main issue was that, on every single keystroke (even arrows, ctrl, shift, etc.), the Jump popup (containing the input and results) was erased, and regenerated. Hence, if one typed faster than the browser was able to regenerate the input and focus it, keystrokes would be lost or inserted randomly within the input. However, as of now, the Jump popup is only partially regenerated, keeping the input intact as you're typing, but regenerating the results on the fly. It should have been implemented that way from the beginning, it's my mistake (read, laziness!).

I hope it works better now, and of course, please feel free to let me know if there's still something missing or to be fixed.

PS : I will look into the fuzzy search improvement asap.

vutsalsinghal commented 2 months ago

I can attest that there is typing/searching improvement in the jump feature... but jumping to random resource still remains.

And I think i know why that is happening! You're not taking into account the sort user is using. I think you're using ascending alphabetical naming sort to jump to a certain resource at that index.

For example - I've a container yamtrack_container and isaiah env has SORTBY_CONTAINERS=-Created so the yamtrack_container is the 1st one for me (since I recently created it) BUT the jump feature is jumping to the last container (cause based on ascending alphabetical sort yamtrack_container should have been at the end)


I'm yet to test the forward proxy auth.

vutsalsinghal commented 2 months ago

I just tested the forward auth - it works 🥳

Like that password based auth is there as fallback option!

will-moss commented 2 months ago

Alright! Thank you a thousand times.

You were absolutely correct for what had been causing the random jumps, and I have just released a fix for it. Kudos for finding it.

vutsalsinghal commented 2 months ago

I tested the latest image (sha256:a8529509b72e06078c00d8f97868a8efb9d2b137fc1d66d1a3788d1e3cb1bdca) but there is no change in behaviour. No change while testing in incognito as well.

will-moss commented 2 months ago

Can I ask you to check the following ?

If there is one match, it means that you are indeed using the latest version, and the fix I released works in my environment, but not in yours, and that would require a deeper analysis of what's causing the problem for your environment. However, if there is no match for "toSorted", it means that your browser is still loading the previous version of "isaiah.js".

All in all, this makes me think that I should include the version of the project somewhere on the UI, to make these checks easier, and also force the browser to load the new "isaiah.js" file when a new version is released (as has been the case for the custom CSS theme file).

Let me know!

vutsalsinghal commented 2 months ago

Hmm Weird... I had to restart my VM for an unrelated reason and I can see the fix now! Thank you.

(it might have been cached somewhere 🤦🏼 )

will-moss commented 2 months ago

I'm glad the issue is resolved on your end 👍 Thanks for letting me know.

I'm happy to inform you that I've just published two releases, including :

You will be responsible for telling me whether this issue can be closed 🎉 🎉 🎉

vutsalsinghal commented 2 months ago

I can see the version using v 💯

Love the fuzzy search but sometimes I see some inconsistencies with it.

for example:

No. 1 image Its not showing the image resource "ghcr.io/fuzzygrim/yamtrack" on the same VM

No. 2 image Its showing the Image on other 2 VMs (3rd and 4th) as well where it doesnt actually exists.

vutsalsinghal commented 1 month ago

this is extension of point no. 11

  1. Copy log lines (right now I'm not able to copy at all).

Ability to copy highlighted portion of the logs would be very helpful. Sometime there is an error in the logs and I just want to highlight and google search... I dont want to copy the entire container logs to clipboard.

will-moss commented 1 month ago

I have just published a new release regarding the logs. You should now be able to select any text, and copy-paste it without fearing to lose your selection as new logs are received. (In the background, what happens is : the rendering loop is blocked as long as you hover the Logs tab).

Regarding the Jump feature, thank you very much for the screenshots and explanation. I'm still on it!

vutsalsinghal commented 1 month ago

copy-paste is working 🥳

Quick question - "rendering loop is blocked" does that mean as long I'm hovering over the logs tab, it won't be refreshed?

will-moss commented 1 month ago

Thanks for the feedback! I'm happy it works.

Regarding your question, indeed, you are completely right. However, let me make sure we are on the same page.

When you are hovering over the Logs tab, the rendering loop is disabled. When you leave the Logs tab with your mouse, the rendering loop is enabled again. Also, if you perform an action with your keyboard, the rendering loop is enabled again even if you hover the Logs tab (if you press 'x' for the menu, for example).

However, and this is the most important thing I believe, when the rendering loop is disabled, you still receive logs in the background. It's just that they are not shown until you leave the Logs tab with your mouse. So, when you say "it won't be refreshed" that is true in terms of immediate rendering. But in the background, the logs are received, and as soon as you leave the zone with your mouse, all the accumulated logs in the background will be shown.

will-moss commented 1 month ago

Hi again,

Regarding the bug you encountered with the fuzzy-search feature in Jump mode, is there any chance that the bug has disappeared in the meantime?

I tried many things, but couldn't reproduce your issue on my end.

Here's an attempt at typing with typos : https://ibb.co/DQZPhK4 Here's an attempt at typing the proper name : https://ibb.co/QNG27x0

(I pulled yamtrack and created a container with it, to try to reproduce your environment.)

Not being able to reproduce the issue, I thought maybe this had something to do with a lost-then-resumed connection?When the connection between the browser and isaiah is lost, the browser automatically reconnects to isaiah, and tries to reset itself. I'm thinking, maybe the "reset itself" was imperfect, and refreshing the page with F5 / Ctrl + R would have solved your issue?

Crossing my fingers here 🤞

vutsalsinghal commented 1 month ago

Hey Will,

sorry for delay in response. I was sick last week.


The bug in the fuzzy search still exists. It's not super annoying... I'll close this PR (can keep the discussion open). Thanks a lot for this amazing tool and implementing all the feature like a ninja! 🥷 🥳