Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add to README.md insturctions for adding custom schema #177

Open
mzayikin opened this issue Dec 15, 2017 · 3 comments
Open

Add to README.md insturctions for adding custom schema #177

mzayikin opened this issue Dec 15, 2017 · 3 comments

Comments

@mzayikin
Copy link

mzayikin commented Dec 15, 2017

I have mySchema.schema which has this definition

attributetype ( 2.16.840.1.113734.3.1.1
	NAME 'spid'
	DESC 'Service provider ID'
	EQUALITY caseIgnoreMatch
	SUBSTR caseIgnoreSubstringsMatch
	SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

so on container start

docker run --env LDAP_ADMIN_PASSWORD="mypass" --env LDAP_DOMAIN="example.com" --env LDAP_TLS=false --name=my-ldap --volume /Users/me/LDAP/data:/container/service/slapd/assets/config/bootstrap/ldif/custom osixia/openldap:1.1.10 --copy-service --loglevel debug

I get this error

ldap_add: Undefined attribute type (17)
	additional info: spid: attribute type undefined

my data folder /Users/me/LDAP/data does have schema definition and yes, I have tried to mount it to different places. Could you please add more information about mounting schema file to container?

Thanks in advance,
Michael

@giafar
Copy link

giafar commented Dec 30, 2017

Hi Michael,
create a .schema file and put in then /container/service/slapd/assets/config/bootstrap/schema. The startup script will create the ldif for you and add to the server schema files.

This is my working schema file (spid.schema).

attributetype ( 2.25.1 NAME 'spidCode' DESC 'SPID - Spid Code' EQUALITY caseIgnoreMatch SUBSTR caseIgnoreSubstringsMatch SYNTAX 1.3.6.1.4.1.1466.115.121.1.15{256} ) objectclass ( 2.25 NAME 'spidPerson' DESC '' SUP inetOrgPerson STRUCTURAL MUST ( spidCode ) )

Please reneame the file in my.schema because the Schema name part is offending some startup script.

Regards Gianluca.

@secsea
Copy link

secsea commented Jan 17, 2018

hello,
i have a .schema file named my.schema in docker host /mnt/ldap-docker/schema/

`
attributetype ( 2.16.840.1.113730.3.1.901
NAME 'userType'
DESC 'type of user'
EQUALITY caseIgnoreMatch
SUBSTR caseIgnoreSubstringsMatch
SYNTAX 1.3.6.1.4.1.1466.115.121.1.15 )

objectclass ( 2.16.840.1.113730.3.2.2
NAME 'inetOrgPerson'
DESC 'RFC2798: Internet Organizational Person'
SUP organizationalPerson
STRUCTURAL
MAY ( userType )
)
`

i run ldap with

docker run --env LDAP_ORGANISATION="myconpany" --env LDAP_DOMAIN="myconpany.com" \ --env LDAP_ADMIN_PASSWORD="admin321" \ -p 389:389 -p 636:636 \ --volume /mnt/ldap-docker/database:/var/lib/ldap \ --volume /mnt/ldap-docker/config:/etc/ldap/slapd.d \ --volume /mnt/ldap-docker/schema/my.schema:/container/service/slapd/assets/config/bootstrap/schema/my.schema \ --detach osixia/openldap:1.1.11 --copy-service

i still cannot add attribute userType for a user
Undefined attribute type (17) userType attribute type undefined

Is there anything wrong with me?

@hpwxf
Copy link

hpwxf commented Sep 8, 2018

As written in image/service/slapd/startup.sh (follow $BOOTSTRAP variable), *.schema files from /container/service/slapd/assets/config/bootstrap/schema directory are loaded (after a schema-to-ldif.sh conversion) only if database and config directories are empty.

As I had to start a new ldap service, I have restarted the container from a fresh clean data/config volumes and thus my schema has been loaded.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants