|
1 | | -# docker-phpLDAPadmin |
| 1 | +# osixia/phpldapadmin |
| 2 | + |
| 3 | +A docker image to run phpLDAPadmin. |
| 4 | +> [phpldapadmin.sourceforge.net](http://phpldapadmin.sourceforge.net) |
2 | 5 |
|
3 | | -A docker image to run phpLDAPadmin |
4 | 6 |
|
5 | 7 | ## Quick start |
6 | 8 |
|
7 | | -### Get phpLDAPadmin in 1'' |
8 | | -Run docker container with your custom environment variables : |
| 9 | +Run a phpLDAPadmin docker image by replacing `ldap.example.com` with your ldap host or IP : |
9 | 10 |
|
10 | 11 | sudo docker run -p 443:443 \ |
11 | | - -e LDAP_HOST=ldap.example.com \ |
12 | | - -e LDAP_BASE_DN=dc=example,dc=com \ |
13 | | - -e LDAP_LOGIN_DN=cn=admin,dc=example,dc=com \ |
| 12 | + -e LDAP_HOSTS=ldap.example.com \ |
14 | 13 | -d osixia/phpldapadmin |
15 | 14 |
|
16 | | -phpLDAPadmin should be running on https://localhost |
| 15 | +That's it :) you can access phpLDAPadmin on **https://localhost** |
| 16 | + |
17 | 17 |
|
| 18 | +## Examples |
18 | 19 |
|
19 | | -### Whant more ? Openldap & phpLDAPadmin in 2'' |
| 20 | +### OpenLDAP & phpLDAPadmin in 1'' |
20 | 21 |
|
21 | | -to be completed :) |
| 22 | +### HTTPS |
22 | 23 |
|
| 24 | +#### Use autogenerated certificate |
| 25 | +By default HTTPS is enable, a certificate is created for the CN (common name) example.org. To work properly on your server adjust SERVER_NAME environment variable to match the phpLDAPadmin server CN. |
23 | 26 |
|
24 | | -## Available Configuration Parameters |
| 27 | + docker run -e SERVER_NAME=phpldapadmin.my-compagny.com -d osixia/phpldapadmin |
25 | 28 |
|
26 | | -## Examples |
| 29 | +#### Use your own certificate |
| 30 | + |
| 31 | +Add your custom certificate, private key and CA certificate in the directory **image/service/phpldapadmin/assets/apache2/ssl** adjust filename in **image/env.yml** and rebuild the image ([see manual build](#manual-build)). |
| 32 | + |
| 33 | +Or you can set your custom certificate at run time, by mouting your a directory containing thoses files to **/osixia/phpldapadmin/apache2/ssl** and adjust there name with the following environment variables : |
| 34 | + |
| 35 | + docker run -v /path/to/certifates:/osixia/phpldapadmin/apache2/ssl \ |
| 36 | + -e SSL_CRT_FILENAME=my-phpldapadmin.crt \ |
| 37 | + -e SSL_KEY_FILENAME=my-phpldapadmin.key \ |
| 38 | + -e SSL_CA_CRT_FILENAME=the-ca.crt \ |
| 39 | + -d osixia/phpldapadmin |
| 40 | + |
| 41 | +Ommit the -e SSL_CA_CRT_FILENAME variable for self signed certificates |
| 42 | + |
| 43 | +#### Disable HTTPS |
| 44 | +Add -e HTTPS=false to the run command : |
| 45 | + |
| 46 | + docker run -e HTTPS=false -d osixia/phpldapadmin |
| 47 | + |
| 48 | +## Environment Variables |
| 49 | + |
| 50 | +## Manual build |
| 51 | + |
| 52 | +Clone this project : |
| 53 | + |
| 54 | + git clone https://github.com/osixia/docker-phpLDAPadmin |
| 55 | + cd docker-mariadb |
27 | 56 |
|
28 | | -### Customise self signed certificat |
| 57 | +Adapt Makefile, set your image NAME and VERSION, for example : |
29 | 58 |
|
30 | | -### Use your own ssl certificat |
| 59 | + NAME = osixia/phpldapadmin |
| 60 | + VERSION = 0.5.0 |
| 61 | + |
| 62 | + becomes : |
| 63 | + NAME = billy-the-king/phpldapadmin |
| 64 | + VERSION = 0.1.0 |
31 | 65 |
|
32 | | -### Get phpLDAPadmin using TLS |
| 66 | +Build your image : |
| 67 | + |
| 68 | + make build |
| 69 | + |
| 70 | +Run your image : |
33 | 71 |
|
| 72 | + docker run -d billy-the-king/phpldapadmin:0.1.0 |
34 | 73 |
|
35 | | -## Do it yourself |
| 74 | +## Tests |
36 | 75 |
|
37 | | -### Build image |
| 76 | +We use **Bats** (Bash Automated Testing System) to test this image: |
38 | 77 |
|
39 | | -Clone the repository |
| 78 | +> [https://github.com/sstephenson/bats](https://github.com/sstephenson/bats) |
40 | 79 |
|
41 | | - git clone https://github.com/osixia/docker-phpLDAPadmin |
42 | | - cd docker-phpLDAPadmin |
| 80 | +Install Bats, and in this project directory run : |
43 | 81 |
|
44 | | -Build image |
| 82 | + make test |
45 | 83 |
|
46 | | - sudo docker build -t phpldapadmin . |
| 84 | + |
47 | 85 |
|
0 commit comments