Skip to content

Latest commit

 

History

History
70 lines (53 loc) · 2.53 KB

README.md

File metadata and controls

70 lines (53 loc) · 2.53 KB

LLDAP-Discord

A Discord bot that integrates with GraphQL and LDAP to manage monthly subscribers by adding and removing their access to an LDAP group. Designed for and tested using the Lightweight LDAP Project

Features

  • Automated Subscription Management: Grants and revokes access based on the subscriber role.
  • Self-Service Account Creation: Users can register their own LLDAP accounts via a simple Discord command.
  • Admin Controls: Sync subscribers manually when needed.
  • Designed for Media Servers: Compatible with Emby and Jellyfin authentication via LDAP.

Environment Configuration

To configure the bot, create a .env file with the following variables:

DISCORD_BOT_TOKEN=DISCORDTOKEN
LDAP_SERVER_URL=ldap://yoursite.com:3890
LDAP_BIND_DN=uid=admin,ou=people,dc=example,dc=com
LDAP_BIND_PASSWORD=PASSWORD
LDAP_BASE_DN=dc=example,dc=com
LLDAP_LOGIN_URL=https://YourLLDAPWebPage.com
SUBSCRIBER_ROLE_NAME=Subscriber
SUBSCRIBERS_GROUP_ID=4
SERVICE_NAME=YourServiceName

Important Notes

This bot does not handle role subscription management. You must use a separate subscription/payment service such as Upgrade.Chat. The bot operates on the assumption that users are already assigned the subscriber role.

Once assigned, users can register an LLDAP account using the /register command. They will receive a temporary password and a link to update it via a private message:

Reply Example

Available Commands

User Commands

Register as a Subscriber

/register <email>

Allows users with the subscriber role to create an LLDAP account.

Admin Commands

Manually Sync Subscribers

/sync_subscribers

Forces a synchronization process in case of any discrepancies.

Integration with Media Servers

This bot was developed to enable subscription-based access to Emby and Jellyfin. Below are the required LDAP search filters:

Jellyfin LDAP Search Filter

(|(memberof=cn=lifetime,ou=groups,dc=example,dc=com)(memberof=cn=subscribers,ou=groups,dc=example,dc=com))

Emby User Search Filter

(&(uid={0})(|(memberof=cn=lifetime,ou=groups,dc=example,dc=com)(memberof=cn=subscribers,ou=groups,dc=example,dc=com)))

Future Updates

Planned features include:

  • Lifetime Subscriber Role Support: Grant permanent access to specific users.

Support

If this project has helped you, consider supporting me by buying me a coffee. 🚀