Is the e-smith layer is a pain?


#1

Hello,

I see various discussions about one subject( or type of subject): How to improve Nethserver? What to do to the comunity grow? And so on…
Personnally, I’ve submit ideas that could be a way to improve the distro or help the community…

But another way to improve all the existent stuff is to analise what is not gone well or what is slows down, what is against productive…

And I think that this e-smith layer, this template system is really a pain.

Even our documentation start like this: ( it’s a copy paste…except the smiley )

Every piece of software has its own configuration format, and writing
parsers for each one is a complex, time-consuming and error-prone
process. :cold_sweat:

When Unix was design in the 70’s, all think was done to make things easy: All configuration files was in the /etc
When I was student at the end of the the 80’s, I learn Unix with OS/9, and all was easy, the configuration files was in /etc
Nowaday, Unix, Linux, Solaris, BSD continue o use /etc for configuration files.

When a developper, or a group of developper, or a project made a software… they design the software to put the configuration files in /etc

So this e-smith system is a pain cause of all things are more complex, when a dev team design a software the other Nethserver dev team is redoing the job with the e-smith layer…

Without the e-smith layer all could be easier to devellope, easier to maintain fully functional, and the Dev Team could/would focus on others tasks.

Even every existing software documentation, site, book not apply with the e-smith layer cause of this template system…

Why continuing complicating things? Is better to make things simplest?
What do you think ?


(Alessio Fattorini) #2

I think that @filippo_carletti might be the best man :smiley: for giving you a full explanation


#3

Alessio… Don’t pull out ! :smile:
And tell us what do you think?


(Filippo Carletti) #4

I like simple things a lot. My job is to remove code.
The documentation excerpt quoted by @Jim proposes the e-smith layer as a way to lower complexity in the code.
I still believe it fulfills the original purpose, but I’m really open to suggestions on improving it (or use something far better).

The e-smith system is formed by templates, events and actions. There’s certainly room for improving parts of them (we have open issues already filed), but I don’t see a new better architecture.

@Jim, would you like to share your ideas (or code)?


(Davide Principi) #5

How would you ease the things? How improve/replace the e-smith layer?


#6

I don’t know how to improve the e-smith layer :laughing:
But we can ask us: Is the E-smith layer is necessary to Nethserver?
Is Nethserver will be better without the e-smith layer?


(Davide Principi) #7

The answer is: yes

NethServer is built on it!

Maybe we can enhance it and find new implementations, but I think the original idea is still valid!


(Stefano) #8

the first answer that come to my mind was “ROTFL, are you kidding?”

Filippo, Me and other dev guys know very well the db/template/events paradigm

once you understand how it works, you’ll see that it makes thing easier to maintain, integrate, replicate things…

NS took this paradigm from Koozali SME server, formerly E-smith, a rh/centos based distro that exists since early 2000 years (I started playing with it in 2002, Filippo maybe before…)

Jim, you’d really re-read the documentation and give a look to this page:
http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual

there are may advantage in such an implementation, I’m sure you’ll realize once you read all the docs.


(Alessio Fattorini) #9

I don’t want to pull out anyone :smile: I’m not an expert but I know the expertise of many members here - not of all you, just someone - then I try to ask around the best insights.

About the question also worth noting that NethServer has a WebUI, modifying the configuration file is easy but for example how do you enable the WebUI to change/read such files and maintain the system in a valid state? It’s not an easy challenge, at all :smile:


(Bogdan Costin) #10

Maybe it is so Fillippo and I agree with you,
But, the main issue is that, despite the fact that the purpose was to remove complexity It added another level on top of the existing one +1 complexity.

The documentation for development is not very helpful and it presents incomplete stuff.
The e-smith system may be good, i could not say yes or no. But the framework is too complex.

The PHP UI with MCV framework is added to the esmith as another component! so +1 in complexity.
And maybe all this could be ok if we could learn or see exactly what does what.

Remember that anyone outside the NS dev team has little or no clue about how stuff works inside. So this will be a deterrent for developers. It will keep most people out because it will be to difficult to create modules or improve in the current ones

As a solution, I propose that a better documentation for development be added. and clear examples.
An index of functions with explication on what they do and where… something to have a better idea on how we can actually use what is inside NS and not try to learn it by reverse engineering :smile:

This is from my own point of view struggling with the bkpconf module :smile:


(Stefano) #11

not strictly related to NS but…


(JamesMillar) #12

It’s one of the reasons I haven’t dug into developing or improving modules. For instance, the suggestion to auto delete files in the recycle bin. If there was a simpler system for the “semi-dev’s” I’d be looking at ways and begin improving on the samba module to include auto delete. --just an opinion of course. I’m not that well verse into e-smith and if I had time to understand it… well, you know.


(Davide Principi) #13

Think about the e-smith layer as the business rules level. It knows how to configure the system.

The web interface layer knows only what configurations are available and presents them to the admin.

The two levels of abstraction are both necessary to a coherent and easy to develop/administer system


(Davide Principi) #14

For instance, in 7 we’ll have systemd and dbus interfaces. They are new concepts and components that could simplify the e-smith layer if we find a smart way to use them…


(Bogdan Costin) #15

Hi Davide,
I know what they suppose to be as abstraction layers and how they should work. The main issue I think is the lack okf documentation/examples that will make the semi-dev’s aproach the system.

Without those it will be very difficult to begin work on something.

So the main issue is not the concept itself but the opacity of it.
Maybe we should find a way to work on this direction more (documentations and how-to’s for devs)

BR
Bogdan


(Stefano) #16

just to get more confident with the e-smith layer, try to think things WITHOUT a web gui

I mean… if you need a new variable/flag to enable/disable a feature, think about the logic itself and don’t deal with the UI…

let’s say you need to enable on per user basis the automatic recycle bin deletion after XX days…

you need:

  • a global variable to store XX value (in days)
  • a variable on user db entry
  • a script that, IF recycle bin is enabled and IF the user has the “enable deletion” flag set to true, runs…

[note]
I’m just “playing”, so my entries here are not really workable…
[/note]

db configuration set recyclebin configuration RetentionTime 30 (30 days)

db accounts setprop username EmptyRecycle true

the cron script has to get values (in primis if recyclebin is enabled and the retention time), then loot into all the user’s account, check if the EmptyRecicle flag is true and do some homework

this will work even if no UI is present… obviously, while someone else creates the UI, you have to set via the cli the parameters…


(Bogdan Costin) #17

Hi Stefano,
It looks “dooable” and i think you can come up with some concept because you have more knowledge about the db, the variables used by NS, how to read/write/edit/delete a db entry, the e-smith layer etc

But try to think of a solution whithout this knowledge and you will first try to create a cron that will run a simple script…

Or I’m wrong ?


(Filippo Carletti) #18

@Ctek, you’re right and a cron job will work out of the box.
If you want to adjust the cron job behaviour you may think about adding some variables to it. Those vars will go to the configuration db. Then you may want to add a web interface to set those vars.
It’s logical, no? :smile:


(Stefano) #19

Ctek: please re-read NS developer docs and, again, take a look here:

http://wiki.contribs.org/SME_Server:Documentation:Developers_Manual

this is not 100% NS compliant, because NS has some differences, but it will enlight you on the basics concepts…

think about nethserver-password package… it was born in an afternoon, may years ago, for SME server… I did it because of italian laws… I read the manual, take a look at other scripts (actions) and I simply adapt some code… once you know how db/fragmens/events/actions thing works, if you have a small programming experience, you’re done

but the first thing to do is to forget about the web UI


(Bogdan Costin) #20

Ok ok ok… , it seems that i’ve turned into a little

I did not want to turn this into a flame topic :smile:
Just to make a point that a better documentation and more explanations will be better for future dev’s
Not to change anything in the framework just to better know it will be better.

Best regards
Bogdan