inspired by the web server in Samba 4

Andrew Tridgell tridge at
Sat Jun 4 03:02:50 GMT 2005


 > Rather than enmbedding the web server, i'm curious
 > what we could do with an  Samba/Apache/mod_python
 > open framework for managing Samba.

yes, if we didn't have any concerns about installation difficulties,
and were not converned about platforms where python isn't available
(or just isn't installed), then I would agree that embedded python
would arguably be a better technical solution than embedded js. Python
is just a better language.

I think though that the fact that by using something like ejs we can
for the first time completely rely on the presence of a scripting
language in every install of Samba makes up for its less powerful
language features. I think we will end up using the scripting language
not just in the web server, but also in command line tools.

If you are concerned about the power of the ejs language, then an
intermediate solution would be to embed spidermonkey (the mozilla
javascript engine). Unlike ejs, spidermonkey is ECMA standards
compliant, and has many more powerful language features. The reason I
chose ejs and not spidermonkey is it is much easier to embed.

Note that we can make this change later if we find the limitations of
ejs too restrictive, as spidermonkey is a superset of ejs.

Using mod_python+apache would also present a considerable license
problem. Our web management interface needs deep access to smbd
structures, and that means linking to a lot of Samba code.

Finally, I think it would be quite tricky to get the same ease of use
features in a apache+python+smbd setup. The current web server
auto-detects https versus http on the same port, auto-creates TLS
certificates, and works with no config file at all and no sam database
at all. So installation is:

  make install
  start smbd
  connect to http://localhost:901/

and that is it as the user is thrown into a install wizard. Complex
instructions about setting up apache with a modified mod_python to
talk to smbd internals, plus setting up apache https would increase
the barrier to entry a lot.

Cheers, Tridge

More information about the samba-technical mailing list