Setting up a LLDAP server: Difference between revisions

From Alpine Linux
Line 14: Line 14:
= Configure =
= Configure =
To configure LLDAP we have to create a config file, and an rc file to start it automaticly upon boot:
To configure LLDAP we have to create a config file, and an rc file to start it automaticly upon boot:
{{Code|cat <<EOF > /opt/lldap/lldap_config.toml
<code>
cat <<EOF > /opt/lldap/lldap_config.toml
ldap_port = 3890
ldap_port = 3890
http_port = 17170
http_port = 17170
Line 44: Line 45:
#key_file="/data/key.pem"
#key_file="/data/key.pem"
EOF
EOF
}}
</code>
Replace domain.tld with your chose domain name.
Replace domain.tld with your chose domain name.
Next we need to create an openrc file so we can automaticly start lldap:
Next we need to create an openrc file so we can automaticly start lldap:

Revision as of 16:11, 1 October 2024

General

LLDAP is a small LDAP server designed for directory services without the overhead of a full blown OpenLDAP server. LLDAP server is designed for easy management using a simple web gui. It lacks some of the features found in other directory servers, because its specificly designed for home use.

Install

Installing LLDAP is fairly simple and can be done in less then 5 minutes. start by logging in as root:

doas su -

Then we make sure the system is up to date and install wget:

apk update && apk upgrade && apk add wget

Then we make the directory for LLDAP to live in and install the software:

mkdir /opt/lldap && cd /opt/lldap

wget https://github.com/lldap/lldap/releases/download/v0.5.0/amd64-lldap.tar.gz && tar xzf amd64-lldap.tar.gz && mv amd64-lldap/* . && rn -rf amd64-lldap


Configure

To configure LLDAP we have to create a config file, and an rc file to start it automaticly upon boot: cat <<EOF > /opt/lldap/lldap_config.toml ldap_port = 3890 http_port = 17170 http_url = "https://domain.tld" jwt_secret = "very-long-string" ldap_base_dn = "dc=domain,dc=tld" ldap_user_dn = "admin" ldap_user_email = "admin@domain.tld" ldap_user_pass = "very-strong-password" database_url = "sqlite:///opt/lldap/users.db?mode=rwc" key_seed = "random-string-again"

[smtp_options]

  1. enable_password_reset=true
  2. server="smtp.gmail.com"
  3. port=587
  4. smtp_encryption = "TLS"
  5. user="sender@gmail.com"
  6. password="password"
  7. from="LLDAP Admin <sender@gmail.com>"
  8. reply_to="Do not reply <noreply@localhost>"

[ldaps_options]

  1. enabled=true
  2. port=6360
    1. Certificate file.
  3. cert_file="/data/cert.pem"
    1. Certificate key file.
  4. key_file="/data/key.pem"

EOF Replace domain.tld with your chose domain name. Next we need to create an openrc file so we can automaticly start lldap:

Template:Code This is not an extensive file, but it gets you running and ensures lldap starts and works correctly. Now we need to add it to the default runlevel and start the service

chmod +x /etc/init.d/lldap && rc-update add lldap

Use

To use LLDAP we can browse to http://<ip>:17170 and login with the credentials we specified in the config file.


This is a basic configuration. You can now connect other services that support ldap logins to LLDAP.

Troubleshooting

  • Some troubleshooting information


Resources