Cockpit information on NS

development
module
cockpit

(Bogdan Costin) #1

I want to start a discussion regarding the new UI for NS.
Cockpit seems to be the next stage regarding the UI of NS and as such I want to ask if the community will find a interesting topic to have the Cockpit UI presented by the devs.

Also to see if there is interest in the community to have a live session from one of the devs doing actual work in creating a new module in the cockpit UI.

Something like the coders do on Twitch, live interactive coding sessions.

What are your thoughts on this?

  • Do you think it will help the communiti to see live how to develop a NS module on Cockpit?
  • Do you have interest in a developer presenting the Cockpit UI integration in NS?

0 voters


(Rob Bosch) #2

I think this would be a great boost to attract new members that can help with integrating services in NethServer. Either be it for cockpit or for netgui.
However, my personal opinion is that cockpit has a lot more potential. Besides hosting services, it also is quite a nice platform to manage LXC containers.


(Bogdan Costin) #3

In my opinion having a coding session for Cockpit will be good for the community.
Since this is where we are heading with NS UI, it will be a good start to have it explained in a interactive mode. (Q&A)

And if people see that it is not so complicated, then they will build the confidence to start playing with the code and the modules.


(Stefano Zamboni) #4

my 2c

I took a look at the code
First of all: there’s a massive use of cockpit.spawn method to call a real command on the server… remember cockpit runs with the privileges of the logged user… so, a WAN exposed UI which runs with root privileges must not be able to run an arbitrary command. IOW, ATM the UI could run a

rm -rf /

then… I read somewhere that the aim for Nethserver 8 is to move away from e-smith layer to use something like ansible… if so, the approach used to create NS’ cockpit modules is wrong 'cause it heavily relies on CLI commands (specific of NS) and so it must be likey rewritten moving to another “engine”

IMO, the right approach is to have a complete API to interact with the server and a front end that “simply” uses those APIs… this is the way cockpit works… the engine can be changed but, as long as API don’t change, the UI will keep on working as usual.


(Bogdan Costin) #5

Hi Stefano,
The first part of your comment is valid no matter if it is Cockpit or any other UI.
Even with Nethgui this is valid.
As a general rule. Exposing the adm interface to WAN side of the server is not a smart move.

Regarding the second part of your comment. I suppose that Cockpit will have native support for management and not depend on the e-smith layer.

But also for specific parts you should use / develop your own modules, since Cockpit is not going to interact universaly with the system.

For this part of development, it will be great to have a “insider” view of how it can be done by users willing to start playing with the code.

So i guess it is a good starting point for the new UI to have it “presented” alongside with the actual implementation in the NS environment.


(Stefano Zamboni) #6

I’ll try to explain myself better…

cockpit is not to be used as is for server management in NS way… that’s because it doesn’t store any value, it’s “just” a web interface, replicating a CLI (this can be read in cockpit’s description)

BTW, you can create your custom modules BUT you must write your “custom” engine behind them… and the best way is to create some standard API and let your modules use them… IOW, use cockpit for all the features that don’t need any interaction with e-smith layer (raid, monitoring ecc) and use it as a framework for all the other functions


(Bogdan Costin) #7

That is correct, in the way that Cockpit does not store any data. It is a UI and as such it will reflect information to the user about the system and will allow you to interact with the engine or sub-system.

In this regards we need to see how it is possible for a normal user to dip his fingers into code as easily as possible.
Working on-top of e-smith or any other layer for management.

But as you can see, also from this discussion :slight_smile: A better presentation is needed :slight_smile:


(Stefano Zamboni) #8

if you have an API layer, an user that wants to create a module just to know about UI fronted side development (html, css, js ecc) and which API to call

no more knowledge is needed


(Bogdan Costin) #9

I think that you are assuming too much knowledge the user must have, to begin with.
In my case I’m assuming a user from the community that has no knowledge at all.

And this is the intended audience. Zero or almost no knowledge at all.
Basically to be a point of origin for who is interested but does not know what is is about.

Think of it as a Learning class for first time users of NethServer.


(Alessio Fattorini) #10

I like this proposal, it would be like a short webinar really focused on how to getting started with cockpit.
I don’t know if it’s doable and what it involves, maybe some of the cockpit experts may shed a light on that @edoardo_spadoni @davidep