NethServer::Database implementation

I’m working on an important feature for esmith::DB module on ns7 (but the patch should work on ns6, too).

The git branch name is dbus, because I’m trying to display on the server-manager some values available on the system DBus. It is an improvement of esmith::DB to allow accessing other sources of informations through our legacy DB API (used by the db command, templates, UI and so on…). Frankly this first implementation is not for DBus at all :smile:

Actually I’ve implemented two glibc/NSS-based backend: Passwd and Group. On a ns7 joined with Active Directory using realmd I can run the following command:


# db ‘NethServer::Database::Passwd’ show administrator@adnethesis.it
administrator@adnethesis.it=passwd
comment=
dir=/home/administrator@adnethesis.it
gecos=Administrator
gid=1541400513
name=administrator@adnethesis.it
passwd=*
quota=
shell=/bin/bash
uid=1541400500

The Passwd class is another brick for our Samba4/AD integration.

The code is on

https://github.com/NethServer/nethserver-lib/compare/v7...DavidePrincipi:dbus

Please let me know your impressions!

2 Likes

Could you please explain the goal of this effort? What are you trying to accomplish? Which are the benefits for the 7 infrastructure?

The goal is the so-called “multi-site”, the ability to share and consume users and groups accounts between multiple NethServer installations.

Today on ns6, we have NethServer joined to an Active Directory domain in Samba ADS mode. We have some limitations: only some services are configured to work with it. Moreover the web UI does not show AD accounts at all. The underlying architecture suffers of years of adjustments and there are 3 user databases to keep aligned. The implementation and the configuration is very complex, I was saying at least 4K lines of code…

Tomorrow on ns7 the users and groups will be provided by an Active Directory infrastructure (“native” by MS, or implemented by the nsdc container). We could also support OpenLDAP or any other backend (FreeIPA) allowed by the sssd infrastructure.

Going further, we could also allow multiple account backends at the same time. We can even suppose a single mail server for multiple organizations!

4 Likes

I’m so so happy to hear that! :rainbow:

I’m pretty sure it’s going to be the best NethServer ever :heart_eyes:

1 Like

The interface to timedated on DBus, from our db command. The command below change the symlink /etc/localtime.


[root@davidep5]# db ‘NethServer::Database::Timedate’ set Timezone ‘America/New_York’
[root@davidep5]# db ‘NethServer::Database::Timedate’ show
Timezone=America/New_York
[root@davidep5]# date
Mon Mar 7 11:54:48 EST 2016
[root@davidep5]# db ‘NethServer::Database::Timedate’ set Timezone ‘Europe/Rome’
[root@davidep5]# db ‘NethServer::Database::Timedate’ show
Timezone=Europe/Rome
[root@davidep5]# date
Mon Mar 7 17:55:17 CET 2016

We can now play with hostnamed too!

    # db 'NethServer::Database::Hostname' show
Chassis=vm
Deployment=
Hostname=davidep5.nethesis.it
IconName=computer-vm
KernelName=Linux
KernelRelease=3.10.0-327.10.1.el7.x86_64
KernelVersion=#1 SMP Tue Feb 16 17:03:50 UTC 2016
Location=Libvirt davidep1
OperatingSystemCPEName=cpe:/o:centos:centos:7
OperatingSystemPrettyName=CentOS Linux 7 (Core)
PrettyHostname=Davide Principi's computer
StaticHostname=davidep5.nethesis.it
2 Likes