Code Monkey home page Code Monkey logo

samba4-manager's Introduction

Introduction

This project is a web interface for Samba4 made using Flask and python-ldap.

It's using the connecting user's own credentials to connect to the directory and allow a variety of operations.

The goal is to be able to do most common directory operations directly through this web interface rather than have to rely on command tools or Windows interfaces.

History

Around 3 years ago, the Ubuntu flavor for education, Edubuntu, started working on a server edition, using containers for the various services commonly used by school districts and using Samba4 as the directory.

Due to limited spare time by the main developers, this project slowly died but the web inteface developped to manage the Samba4 server still evolved and over the years, got a bunch of bugfixes and improvements.

As a result, it was decided that this should be turned into its own project, outside of the scope of the Edubuntu project and be made widely available.

Dependencies

  • python
  • python-dnspython
  • python-flask
  • python-flaskext.wtf,
  • python-ldap
  • python-wtforms

Using

  • Copy manager.cfg.example to manager.cfg
  • Put a random string in SECRET_KEY
  • Set LDAP_DOMAIN to your Samba4 domain
  • Start the server with:
./samba4-manager

You may then connect through: http://localhost:8080

Contributing

Contributions are always appreciated!

The project is licensed under the GNU GPL version 2 (and any later version). Contributors must sign-off on their commits, indicating that they agree with the Developer Certificate of Ownership (developercertificate.org).

samba4-manager's People

Contributors

dmitry-sinina avatar jkellerer avatar stgraber avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

samba4-manager's Issues

Tree - Users - 500 Internal Server Error

Hi,

Try to use this with number of users is around 1500.
The error appear when I click the Users tree.
The error message on the web:
"The server encountered an internal error and was unable to complete your request. Either the server is overloaded or there is an error in the application."

::ffff:172.17.1.1 - - [04/Jun/2016 02:10:41] "GET /tree/CN=Users,DC=example,DC=com HTTP/1.1" 500 -
Any suggestion on this?

Best,

Convert to python-ldap3

Replace current usage of python-ldap by the more modern and python3-compatible python-ldap3.

Configuring samba4-manager from snapd installation

Hi Devs,
I would like to install samba4-manager into Ubuntu 20.04 from snapd,
I've put my own "manager.cfg" into "~/snap/samba4-manager/current/" but samba4-manager seems doesn't seen it.

2022-07-14T22:34:59+02:00 samba4-manager.daemon[5137]: samba4-manager hasn't been configured yet, stopping.
2022-07-14T22:34:59+02:00 systemd[1]: Stopping Service for snap application samba4-manager.daemon...
2022-07-14T22:34:59+02:00 systemd[1]: snap.samba4-manager.daemon.service: Succeeded.
2022-07-14T22:34:59+02:00 systemd[1]: Stopped Service for snap application samba4-manager.daemon.

Enabling debug and running

snap run samba4-manager.daemon

Obtain:


samba4-manager hasn't been configured yet, stopping.
Traceback (most recent call last):
  File "./samba4-manager", line 100, in <module>
    raise Exception("No LDAP server in domain '%s'." %
Exception: No LDAP server in domain ''.

This is the content of my "manager.cfg" ->

SECRET_KEY = "123456789"
LDAP_DOMAIN = "foo-book"
#LDAP_SERVER = "some-specific-server.example"
#LDAP_DN = "DC=mydomain,DC=example"
#DEBUG = True
#URL_PREFIX = "/domain"

Where I'm wrong?

Many thanks!!

david

Convert to python3

This is blocked on #1 but once we're using python-ldap3, the rest of the codebase should be fixed where needed to work properly on python3.

ImportError: cannot import name 'TextField' from 'wtforms'

I'm trying to run samba4-manager under debian 11 and samba4, and it throws a really weird error.


root@srv-dc01:~/samba4-manager-master# ./samba4-manager --config manager.cfg
Traceback (most recent call last):
  File "/root/samba4-manager-master/./samba4-manager", line 114, in <module>
    plugin = importlib.import_module("plugins.%s" % plugin_name)
  File "/usr/lib/python3.9/importlib/__init__.py", line 127, in import_module
    return _bootstrap._gcd_import(name[level:], package, level)
  File "<frozen importlib._bootstrap>", line 1030, in _gcd_import
  File "<frozen importlib._bootstrap>", line 1007, in _find_and_load
  File "<frozen importlib._bootstrap>", line 986, in _find_and_load_unlocked
  File "<frozen importlib._bootstrap>", line 680, in _load_unlocked
  File "<frozen importlib._bootstrap_external>", line 790, in exec_module
  File "<frozen importlib._bootstrap>", line 228, in _call_with_frames_removed
  File "/root/samba4-manager-master/plugins/user.py", line 22, in <module>
    from wtforms import PasswordField, SelectMultipleField, TextAreaField, \
ImportError: cannot import name 'TextField' from 'wtforms' (/usr/local/lib/python3.9/dist-packages/wtforms/__init__.py)

All dependencies and requirements were installed from pip without errors.

How to resolve this error.
Thanks.

Exception: Unknown multiple value field: managedObjects

Cheers,

I got the above error for the following fields:

  • managedObjects
  • proxyAddresses

These may have come from installation of SOGo or OpenChange, one of which requires changes to Samba4's AD schema.

The fix is similar to the one mentioned in #5:

diff --git a/libs/ldap_func.py b/libs/ldap_func.py
index 04d5605..b1c84e0 100644
--- a/libs/ldap_func.py
+++ b/libs/ldap_func.py
@@ -44,7 +44,8 @@ LDAP_AD_USERACCOUNTCONTROL_VALUES = {2: ("Account is disabled", True),
 LDAP_AD_BOOL_ATTRIBUTES = ['showInAdvancedViewOnly']
 LDAP_AD_GUID_ATTRIBUTES = ['objectGUID']
 LDAP_AD_MULTIVALUE_ATTRIBUTES = ['member', 'memberOf', 'objectClass', 'repsTo',
-                                 'servicePrincipalName', 'sshPublicKey']
+                                 'servicePrincipalName', 'sshPublicKey',
+                                 'managedObjects', 'proxyAddresses']
 LDAP_AD_SID_ATTRIBUTES = ['objectSid']
 LDAP_AD_UINT_ATTRIBUTES = ['userAccountControl', 'groupType']

Support TLSv1.2

The web server should support TLS and ideally, default to it.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.