Giter Club home page Giter Club logo

ldap-for-plex's Introduction

LDAP-for-Plex dependencies Status License: MIT

An LDAP server that uses Plex as the provider.

If the project gets some traction more features could be added. Due to the way ldapjs works it should be possible to add support for changing passwords, usernames and various other things too.

Warning

This LDAP server does not currently require authentication to perform queries so I suggest you don't expose the server externally.

Installation

These steps assume you have NodeJS and Yarn installed.

  1. Clone this GitHub project.
  2. Run yarn install

Once you've finished the above steps, run yarn start and wait for the config to generate, edit the config/options.json file and add your plexToken, plexMachineId and plexServerName, you can change the rest if you want.

Now you should be able to run yarn start and your server will start.

Docker

Run using automated build:

docker run -d \
  -n ldapforplex \
  -p 389:389 \
  -v /path/to/config:/usr/src/LDAP-For-Plex/config \
  thebaconguy/ldap-for-plex

Run with docker-compose:

---
version: '3.4'

services:

  ldapforplex:
      image: thebaconguy/ldap-for-plex
      container_name: ldapforplex
      restart: unless-stopped
      ports:
        - 389:389
      volumes:
        - /path/to/config:/usr/src/LDAP-For-Plex/config

Change the path to config and the port depending on your configuration.

Build yourself:

  1. docker build -t your-image-name .
  2. Run like the automated build except with your image name.

Configuration

Create/edit the /path/to/config/options.json file and add your plexToken, plexMachineId and plexServerName, similar to:

{
  "debug": true,
  "port": 389,
  "host": "0.0.0.0",
  "rootDN": "ou=users,o=plex.tv",
  "plexToken": "ABCDEFGHIJKLM",
  "plexMachineID": "123abc456def",
  "plexServerName": "My Plex Server"
}

LDAP Search

A quick way to know it's working is to use curl (reference):

  • curl ldap://ldapforplex/ou=users,o=plex.tv?*?sub?(objectClass=*)

TODO

  1. Figure out how to use password authentication (PlexAuth?)
  2. Persist the uid generated for each record so that it can be used as a consistent identifier since username and user email can change. (Use a db a store the user list? Make sure to reconcile the differences by username or user email)

ldap-for-plex's People

Contributors

drobson03 avatar hjone72 avatar thebaconguy avatar

Stargazers

 avatar

Watchers

 avatar  avatar

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.