Add config and documentation for running dirsrv with Docker
This commit is contained in:
parent
1a30345f46
commit
93d56f79d5
@ -1,4 +1,11 @@
|
|||||||
|
LDAP_HOST=localhost
|
||||||
|
LDAP_PORT=389
|
||||||
|
LDAP_ADMIN_PASSWORD=passthebutter
|
||||||
|
LDAP_SUFFIX="dc=kosmos,dc=org"
|
||||||
|
|
||||||
EJABBERD_API_URL='https://xmpp.kosmos.org/api'
|
EJABBERD_API_URL='https://xmpp.kosmos.org/api'
|
||||||
|
|
||||||
BTCPAY_API_URL='http://localhost:23001/api/v1'
|
BTCPAY_API_URL='http://localhost:23001/api/v1'
|
||||||
|
|
||||||
LNDHUB_API_URL='http://localhost:3023'
|
LNDHUB_API_URL='http://localhost:3023'
|
||||||
LNDHUB_PUBLIC_URL='https://lndhub.kosmos.org'
|
LNDHUB_PUBLIC_URL='https://lndhub.kosmos.org'
|
||||||
|
18
README.md
18
README.md
@ -31,10 +31,24 @@ Running all specs:
|
|||||||
|
|
||||||
bundle exec rspec
|
bundle exec rspec
|
||||||
|
|
||||||
|
### Docker (Compose)
|
||||||
|
|
||||||
|
There is a working Dockr Compose config file, which allows you to spin up both
|
||||||
|
an app server for Rails as well as a local 389ds (LDAP) server.
|
||||||
|
|
||||||
|
By default, `docker-compose up` will only start the LDAP server, listening on
|
||||||
|
port 389 on your machine. Uncomment other services in `docker-compose.yml`.
|
||||||
|
|
||||||
### LDAP server
|
### LDAP server
|
||||||
|
|
||||||
TODO make it easy to run a local Kosmos LDAP server for development, without
|
See the previous section for quickly spinning up an LDAP server with Docker (or
|
||||||
manual LDIF imports etc. (or provide a staging instance)
|
edit your environment configuration to use an existing one).
|
||||||
|
|
||||||
|
After creating the Docker container for the first time (or after deleting it),
|
||||||
|
you need to run the following command once, in order to create the dirsrv
|
||||||
|
back-end:
|
||||||
|
|
||||||
|
docker-compose exec ldap dsconf localhost backend create --suffix="dc=kosmos,dc=org" --be-name="dev"
|
||||||
|
|
||||||
## Documentation
|
## Documentation
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ class CreateLdapUserJob < ApplicationJob
|
|||||||
def ldap_client
|
def ldap_client
|
||||||
ldap_client ||= Net::LDAP.new host: ldap_config['host'],
|
ldap_client ||= Net::LDAP.new host: ldap_config['host'],
|
||||||
port: ldap_config['port'],
|
port: ldap_config['port'],
|
||||||
encryption: ldap_config['ssl'],
|
# encryption: ldap_config['ssl'],
|
||||||
auth: {
|
auth: {
|
||||||
method: :simple,
|
method: :simple,
|
||||||
username: ldap_config['admin_user'],
|
username: ldap_config['admin_user'],
|
||||||
|
@ -29,7 +29,7 @@ development:
|
|||||||
host: <%= ENV["LDAP_HOST"] || "localhost" %>
|
host: <%= ENV["LDAP_HOST"] || "localhost" %>
|
||||||
port: <%= ENV["LDAP_PORT"] || "389" %>
|
port: <%= ENV["LDAP_PORT"] || "389" %>
|
||||||
attribute: cn
|
attribute: cn
|
||||||
base: ou=kosmos.org,cn=users,dc=kosmos,dc=org
|
base: <%= ENV["LDAP_BASE"] || "ou=kosmos.org,cn=users,dc=kosmos,dc=org" %>
|
||||||
admin_user: "cn=Directory Manager"
|
admin_user: "cn=Directory Manager"
|
||||||
admin_password: <%= ENV["LDAP_ADMIN_PASSWORD"] %>
|
admin_password: <%= ENV["LDAP_ADMIN_PASSWORD"] %>
|
||||||
ssl: <%= ENV["LDAP_USE_TLS"] || "false" %>
|
ssl: <%= ENV["LDAP_USE_TLS"] || "false" %>
|
||||||
|
@ -3,22 +3,32 @@ services:
|
|||||||
image: 4teamwork/389ds:latest
|
image: 4teamwork/389ds:latest
|
||||||
volumes:
|
volumes:
|
||||||
- ./tmp/389ds:/data
|
- ./tmp/389ds:/data
|
||||||
|
ports:
|
||||||
|
- "389:3389"
|
||||||
environment:
|
environment:
|
||||||
DS_DM_PASSWORD: passthebutter
|
DS_DM_PASSWORD: passthebutter
|
||||||
SUFFIX_NAME: "dc=kosmos,dc=org"
|
SUFFIX_NAME: "dc=kosmos,dc=org"
|
||||||
web:
|
# phpldapadmin:
|
||||||
build: .
|
# image: osixia/phpldapadmin:0.9.0
|
||||||
tty: true
|
# ports:
|
||||||
command: bash -c "rm -f tmp/pids/server.pid && bin/dev"
|
# - "8389:80"
|
||||||
volumes:
|
# environment:
|
||||||
- .:/akkounts
|
# PHPLDAPADMIN_HTTPS: false
|
||||||
ports:
|
# PHPLDAPADMIN_LDAP_HOSTS: "#PYTHON2BASH:[{'ldap': [{'server': [{'tls': False}, {'port': 3389}]}, {'login': [{'bind_id': 'cn=Directory Manager'}, {'bind_pass': 'passthebutter'}]}]}]"
|
||||||
- "3000:3000"
|
# PHPLDAPADMIN_LDAP_CLIENT_TLS: false
|
||||||
environment:
|
# web:
|
||||||
RAILS_ENV: development
|
# build: .
|
||||||
LDAP_HOST: ldap
|
# tty: true
|
||||||
LDAP_PORT: 3389
|
# command: bash -c "sleep 5 && rm -f tmp/pids/server.pid && bin/dev"
|
||||||
LDAP_ADMIN_PASSWORD: passthebutter
|
# volumes:
|
||||||
LDAP_USE_TLS: "false"
|
# - .:/akkounts
|
||||||
depends_on:
|
# ports:
|
||||||
- ldap
|
# - "3000:3000"
|
||||||
|
# environment:
|
||||||
|
# RAILS_ENV: development
|
||||||
|
# LDAP_HOST: ldap
|
||||||
|
# LDAP_PORT: 3389
|
||||||
|
# LDAP_ADMIN_PASSWORD: passthebutter
|
||||||
|
# LDAP_USE_TLS: "false"
|
||||||
|
# depends_on:
|
||||||
|
# - ldap
|
||||||
|
Loading…
x
Reference in New Issue
Block a user