Browse Source

Use docker image for ldap

Simplify the development of lowry by using the docker image for testing
communities
meskio 9 months ago
parent
commit
f7cb59d4bd
Signed by: meskio GPG Key ID: 52B8F5AC97A2DA86
  1. 10
      Makefile
  2. 7
      README.md
  3. 8
      examples/data.ldif
  4. 2
      examples/lowry.conf
  5. 9
      examples/sindominio.ldif
  6. 13
      examples/sindominio.schema

10
Makefile

@ -17,12 +17,12 @@ clean:
rm -rf node_modules dist lowry
deps:
sudo apt install slapd ldap-utils golang npm
sudo apt install ldap-utils golang npm
fixtures:
sudo cp examples/sindominio.* /etc/ldap/schema/
sudo ldapadd -Y EXTERNAL -H ldapi:// -f /etc/ldap/schema/sindominio.ldif
sudo slapadd -n 1 -l examples/data.ldif
run_ldap:
docker run --rm -d -p 389:3389 --name ldap registry.sindominio.net/ldap
sleep 1
ldapadd -x -w password -H ldap://localhost:389/ -f examples/data.ldif -D "cn=admin,dc=nodomain"
demo:
./lowry -noLockUsers -config examples/lowry.conf

7
README.md

@ -1,9 +1,14 @@
Set up a testing environment:
```
make deps
make fixtures
```
Launch ldap in a docker container:
```
make ldap
```
For more info on how to keep persistant storage for the ldap server check the [docker-compose.yml](https://git.sindominio.net/estibadores/ldap/src/branch/master/docker-compose.yml).
Build lowry and run it with the demo data:
```
make all

8
examples/data.ldif

@ -12,7 +12,9 @@ objectClass: shadowAccount
objectClass: sdPerson
objectClass: top
sdRole: amiga
userPassword: {SSHA}FHqod3gytvH9MDGhpMV1DKjyU7eO1EDG
userPassword:: e0NSWVBUfSQ2JFIvbjJ6WHlKTG1wSUJCclUkWWd4ajBKcE9IdktoWFpEcE11TVp
PQXVIRmp0VTl6ekc1WGZXejI0cElyblpzN3oyeU5hcDFjU0NydEhtS0RLOVhjR2dWN3RuZVpjaHo2
MEdPMkNtWTE=
loginShell: /bin/bash
uidNumber: 1000
gidNumber: 1000
@ -29,7 +31,9 @@ objectClass: shadowAccount
objectClass: sdPerson
objectClass: top
sdRole: sindominante
userPassword: {SSHA}FHqod3gytvH9MDGhpMV1DKjyU7eO1EDG
userPassword:: e0NSWVBUfSQ2JDhpZ3pEZmgwdWZjVEt1c0okOEtPMUVuM3hrU005M2lrYXJQR0c
xMWRtREdqTUVqRHZaazZCMEs5NEY0aGF6aEJLc1p2MW5sUWI5d052ZDk1d0FaWkxnVkZhYlkzb0wv
VzZZeDJIdzA=
loginShell: /bin/bash
uidNumber: 1001
gidNumber: 1001

2
examples/lowry.conf

@ -1,5 +1,5 @@
ldapaddr=localhost:389
ldappass=foobar
ldappass=password
domain=nodomain
httpaddr=:8080
giteaURL=

9
examples/sindominio.ldif

@ -1,9 +0,0 @@
dn: cn=sindominio,cn=schema,cn=config
objectClass: olcSchemaConfig
cn: sindominio
olcAttributeTypes: ( 1.3.6.1.4.1.42023.11 NAME 'sdRole' DESC 'Rol en SinDominio'
SUP name SINGLE-VALUE )
olcAttributeTypes: ( 1.3.6.1.4.1.42023.12 NAME 'sdLocked'
DESC 'Cuenta de SinDominio bloqueada' SUP name )
olcObjectClasses: ( 1.3.6.1.4.1.42023.10 NAME 'sdPerson'
DESC 'Personas de SinDominio' SUP top AUXILIARY MUST sdRole MAY sdLocked )

13
examples/sindominio.schema

@ -1,13 +0,0 @@
attributetype ( 1.3.6.1.4.1.42023.11 NAME 'sdRole'
DESC 'Rol en SinDominio'
SUP name SINGLE-VALUE)
attributetype ( 1.3.6.1.4.1.42023.12 NAME 'sdLocked'
DESC 'Cuenta de SinDominio bloqueada'
SUP name)
objectclass ( 1.3.6.1.4.1.42023.10 NAME 'sdPerson'
DESC 'Personas de SinDominio'
SUP top AUXILIARY
MUST sdRole
MAY sdLocked)
Loading…
Cancel
Save