Autmatically keep Vaultwarden users in sync with your LDAP instance
Find a file
Tobias Bossert ae661f5df1
Merge pull request #16 from sirtoobii/fix/user_not_adopted
Added option to dump emails from the email source.
2025-06-18 14:56:48 +02:00
.docker feature complete 2023-06-13 15:14:28 +02:00
data feature complete 2023-06-13 15:14:28 +02:00
tests Big refactoring, bug fixes, and new features: 2025-02-09 22:57:29 +01:00
vaultwarden_user_sync Added option to dump emails from the email source. 2025-05-25 17:34:39 +02:00
.env.dist Added option to dump emails from the email source. 2025-05-25 17:34:39 +02:00
.gitignore Purpose and scope of this library should be more clear now 2023-12-25 10:55:43 +01:00
docker-compose.yaml Remove deprecated version reference, thanks @kaindlnetwork, fix printing of detected changes 2025-02-11 14:14:47 +01:00
Dockerfile Big refactoring, bug fixes, and new features: 2025-02-09 22:57:29 +01:00
LICENCE.md feature complete 2023-06-13 15:14:28 +02:00
Readme.md Big refactoring, bug fixes, and new features: 2025-02-09 22:57:29 +01:00
requirements.txt initial version 2023-06-09 17:48:19 +02:00

Vaultwarden LDAP sync adapter

This python library is a lightweight alternative to the official Bitwarden Directory Connector aiming to be less "clunkly" than the vaultwarden_ldap (written in Rust) implementation.

Specifically, it invites unseen LDAP users (according to filter) and disables users which vanished from LDAP while even surviving a user initiated change of the email address in Vaultwarden. Furthermore, its simple architecture should allow for easy integration of other email sources.

Configuration

In general, this libray is configured using environment variables and supports .env files. See .env.dist for a comprehensive list of configuration options.

Usage

Configure the .env file according your needs and run docker compose up -d.

Development

  • Install os requirements: apt install libldap2-dev libsasl2-dev python3-dev python3-venv
  • Then, after repo checkout:
cd vaultwarden_ldap_sync

# Create venv
python3 -m venv venv

# Activate venv
source venv/bin/activate

# Install requirements
pip install -r requirements.txt

# Run tests
python3 -m unittest discover -s tests/

# Run main script locally
python3 -m vaultwarden_user_sync.sync --help

Adding another email source

Adding another email source is as simple as subclassing EmailSource and implementing the get_email_list() method

Contributions and feedback welcome