Messed around and made a GUI for container logs and configs reddit / selfhosted ---------------------------------------------------------------------- ToddGergey · 2023-10-13 12:02 We were kind of annoyed by how we weren't able to access our containers to see logs in an instant. Docker commands are fine, but you need to SSH into the server to be able to do it, and manually specify which container you'd like to check out. To save some time, we made a tool and we named it darklens. You can use it to check your containers without using SSH keys, entering Docker commands ("oh, shoot, the container I was curious about had - and not \_ in it, let's fix that typo and waste 4 more seconds") in the terminal, and trying to figure out container configs in unreadable JSON data. Thought we'd like to show you this tool because it can be helpful for self-hosters and you can give valuable feedback on how we can improve it. You can check it out on GitHub here: \- darklens on GitHub: [https://github.com/dyrector- io/darklens](https://github.com/dyrector-io/darklens) Have a nice weekend yall! ---------------------------------------------------------------------- ElevenNotes · 2023-10-13 12:22 Redis and logstash plugin for container log exists. What makes yours better/different? What's the USP? ---------------------------------------------------------------------- thekrautboy · 2023-10-13 12:23 Nice! Going to try it out. Can you compare it to [Dozzle](https://dozzle.dev/) which also is essentially a quick web-based container logviewer with some extras? ---------------------------------------------------------------------- Open-Inflation-1671 · 2023-10-13 15:08 Take a look: https://github.com/slavaGanzin/rconf Tool for remote configuring/running services. Which I use to live configure my docker containers from the inside. You may draw an inspiration on how server-agent connection os done for dark lens or directorio. Will try darklens on the next docker swarm ;) ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-13 15:24 Not sure why you're downvoted. I had this exact same thought. Even wrote a docker-compose.yml myself to try and run but same error as your point number 4. ---------------------------------------------------------------------- Mafyuh · 2023-10-13 15:57 Portainer does exactly this ---------------------------------------------------------------------- thekrautboy · 2023-10-13 16:30 Yeah, 4.5 hours later and no response from OP *shrug* ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-13 17:50 Haha, give him some time. Might be a timezone issue. I do this too. Work into late in the night. Forget some things, release item, then go to sleep. ---------------------------------------------------------------------- thekrautboy · 2023-10-13 17:52 Oh for sure, its not a problem. But i dont know, when i advertise the release of a new project, i stick around for a few minutes atleast to get immediate feedback, and i would make sure its actually downloadable before i make posts :) ---------------------------------------------------------------------- thekrautboy · 2023-10-14 08:34 Pinging /u/ToddGergey any updates? ---------------------------------------------------------------------- ToddGergey · 2023-10-14 14:05 Sorry for the late response, you're definitely right, we messed up about that big time. By next week it'll be fixed by us Also thank you for a great feedback! We need to make some updates about the readme as some of the things you mentioned were already addressed (this is my personal mistake as I manage the readme in the project), and yeah, we definitely can turn agent setup into a one liner, sounds a lot better tbh ---------------------------------------------------------------------- thekrautboy · 2023-10-14 14:09 Thats okay, i will try it out next week then :) ---------------------------------------------------------------------- ToddGergey · 2023-10-14 14:12 Will check that out, thank you for the suggestion! ---------------------------------------------------------------------- ToddGergey · 2023-10-14 14:24 We can't really tell how our solution is different compared to those because this is the first time we heard about this. Will give it a look, though, so thank you! ---------------------------------------------------------------------- ToddGergey · 2023-10-14 14:25 Thanks, I'll let you know :D ---------------------------------------------------------------------- ElevenNotes · 2023-10-14 14:28 Maybe next time check what already exists and improve upon that rather than inventing something on your own. ---------------------------------------------------------------------- ToddGergey · 2023-10-16 08:36 Hey! We fixed the issue, you should be able to give darklens a try now :) Sorry for the mistake, and thanks for your patience! Let me know if you bump into issues ---------------------------------------------------------------------- thekrautboy · 2023-10-16 10:32 Thanks for fixing that! Some quick notes, [in addition to the ones from my previous comment](h ttps://www.reddit.com/r/selfhosted/comments/176x544/messed_around_and_ made_a_gui_for_container_logs/k4p3l0s/): The image that the generated agent script tries to pull `ghcr.io/dyrector-io/darklens/agent:0.1` cannot be pulled ("manifest unknown"). * Looking at the Github packages list, there is now `ghcr.io/dyrector- io/darklens/agent:0.1.0` public, so probably a typo in the version tag. Pulling the 0.1.0 tag manually works. * The environment variable `PUBLIC_URL` should be required, not optional. If its empty, the "generate agent script" option does ask for it, but it doesnt update the "one liner curl download" command that is generated, making it unusable. So either require it or just fix the generated output. * Why does the darklens host container have a `AGENT_ADDRESS` env variable? What is it supposed to be used for? Isnt the agent supposed to have the information about the host and connect to the host? If the setup is meant to be that the host connects to the agent using this var, then how are users supposed to add multiple agents? * The generated agent script is broken. I dont see any way how the agent is informed of a way to actually connect to the darklens host. The only two env vars that are passed to the generated agent container are `GRPC_TOKEN` and `HOST_DOCKER_SOCK_PATH` for the socket access. How is the agent supposed to connect to the host? * **Generating a one-liner that pipes into sh/bash for people to copy&paste** into their system is very bad etiquette imo. Its a bad practice to teach beginners and casual user (who a app like this is aimed at mostly). * I dont see why the generated script does even bother to do things like checking if Docker or Podman is installed and which OS is used etc. Imo its fine to leave that to the user, either they have a working Docker installation on that system, or not. The entire script makes the deployment of the agent needlessly bloated. I would instead just generate a single `docker run` line with just the exact parameters that the agent requires, so people can copy&paste that into their system and directly deploy the agent. As it is right now, it is still unusable, even when trying to fix many things manually. The UI loads up but when the agent cannot connect there isnt much to do at all. ---------------------------------------------------------------------- thekrautboy · 2023-10-16 10:33 Ping /u/omfgitsasalmon in case you are interested. ---------------------------------------------------------------------- ToddGergey · 2023-10-16 13:51 Thanks for the comment! We fixed the version tag issue, and we took a different approach with the agent. We're experimenting with the project now, so now the tool gives a docker run command, a simple one- liner instead of a script. In the meantime, we added a new section to the readme about how the agent works and how it can be installed ---------------------------------------------------------------------- thekrautboy · 2023-10-16 14:00 Nice! Still a lot of things unclear. I will check back with this in a few weeks and see how it has progressed by then. ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-22 06:14 Thanks for the holler! I'll check it out today :) ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-22 11:06 I just successfully tested this out. And unfortunately, sad to say, Portainer does the same thing as a higher level too. I absolutely see no purpose in using this app vs Portainer (which is also free). ---------------------------------------------------------------------- ToddGergey · 2023-10-23 06:56 Thanks for the feedback! What do you think we can improve about darklens? ---------------------------------------------------------------------- omfgitsasalmon · 2023-10-23 09:18 Hmm, the only thing I found lacking from Portainer is probably the way logs are presented. It's all clumped together, although having lines is helpful, but sometimes it's still very messy. Perhaps syntax highlighting for logs, and probably alternating background colors would have helped a lot. But to be very honest, even if Darklens has that feature, I'd still prefer to use Portainer because I can spin up instances, manage and even execute directly into the docker container shell right from Portainer. Doesn't make sense to have another overhead on top of Portainer just for pretty logging. Unless somehow Darklens is an app that does that one thing only. View logs in a pretty environment. Keeps the overhead small enough to actually make it worth it. And also, allow viewing the logs of the host machine, not just docker applications.