Skip to content
This repository was archived by the owner on Jun 7, 2023. It is now read-only.

Commit ab848ba

Browse files
authored
Merge pull request #4 from Diesel-Net/development
Add user and group templates for diesel-net domain
2 parents 1c4c5a9 + c876361 commit ab848ba

7 files changed

Lines changed: 195 additions & 2 deletions

File tree

.ansible/templates/docker-compose.yaml.j2

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ version: '3.8'
44
services:
55

66
main:
7-
image: osixia/phpldapadmin:0.9.0
7+
image: {{ docker_image }}
88
volumes:
99
- /etc/localtime:/etc/localtime
1010
- {{ ssl_cert_dir }}:/container/service/ldap-client/assets/certs

.drone.yaml

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,27 @@ clone:
77
depth: 1
88

99
steps:
10+
11+
- name: docker build & push
12+
image: plugins/docker
13+
settings:
14+
mirror: dockerhub.nexus.diesel.net
15+
registry: docker.nexus.diesel.net
16+
username:
17+
from_secret: nexus_user
18+
password:
19+
from_secret: nexus_pass
20+
repo: docker.nexus.diesel.net/${DRONE_REPO_NAME}
21+
tags:
22+
- ${DRONE_BRANCH}-latest
23+
when:
24+
branch:
25+
- development
26+
- stable
27+
event:
28+
- push
29+
30+
1031
- name: configure & deploy (development)
1132
image: plugins/ansible:3
1233
environment:

Dockerfile

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
FROM osixia/phpldapadmin:0.9.0
2+
3+
COPY customUser.xml /
4+
COPY customGroup.xml /
5+
6+
COPY startup.sh /container/service/phpldapadmin-additional-templates/
7+
RUN chmod +x /container/service/phpldapadmin-additional-templates/startup.sh

README.md

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,5 @@
11
# phpldapadmin
2-
phpLDAPadmin
2+
phpLDAPadmin on docker swarm
3+
4+
## custom templates
5+
https://github.com/osixia/docker-phpLDAPadmin/issues/30#issuecomment-689564451

customGroup.xml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!DOCTYPE template SYSTEM "template.dtd">
3+
4+
<template>
5+
<askcontainer>1</askcontainer>
6+
<description>New Diesel-Net Group</description>
7+
<icon>ldap-ou.png</icon>
8+
<invalid>0</invalid>
9+
<rdn>cn</rdn>
10+
<!-- <regexp>^ou=.*,</regexp> -->
11+
<title>Diesel-Net: Group</title>
12+
<visible>1</visible>
13+
14+
<objectClasses>
15+
<!-- <objectClass id="posixGroup"></objectClass> -->
16+
<objectClass id="groupOfUniqueNames"></objectClass>
17+
</objectClasses>
18+
19+
<attributes>
20+
<attribute id="cn">
21+
<display>Group Name</display>
22+
<order>1</order>
23+
<page>1</page>
24+
</attribute>
25+
<attribute id="description">
26+
<display>Description</display>
27+
<order>2</order>
28+
<page>1</page>
29+
</attribute>
30+
<attribute id="owner">
31+
<display>Owner</display>
32+
<order>3</order>
33+
<page>1</page>
34+
<value><![CDATA[=php.MultiList(/;(&(objectClass=posixAccount));dn;%cn% (%uid|-12%))]]></value>
35+
</attribute>
36+
<attribute id="uniqueMember">
37+
<display>Members</display>
38+
<order>4</order>
39+
<page>1</page>
40+
<value><![CDATA[=php.MultiList(/;(&(objectClass=posixAccount));dn;%cn% (%uid|-12%))]]></value>
41+
</attribute>
42+
</attributes>
43+
44+
</template>

customUser.xml

Lines changed: 104 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,104 @@
1+
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
2+
<!DOCTYPE template SYSTEM "../template.dtd">
3+
4+
<template>
5+
<askcontainer>1</askcontainer>
6+
<description>New Diesel-Net User Account</description>
7+
<icon>ldap-user.png</icon>
8+
<invalid>0</invalid>
9+
<rdn>uid</rdn>
10+
<!--<regexp>^ou=People,o=.*,</regexp>-->
11+
<title>Diesel-Net: User Account</title>
12+
<visible>1</visible>
13+
14+
<objectClasses>
15+
<objectClass id="inetOrgPerson"></objectClass>
16+
<objectClass id="posixAccount"></objectClass>
17+
</objectClasses>
18+
19+
<attributes>
20+
<attribute id="mail">
21+
<display>Email</display>
22+
<order>1</order>
23+
<page>1</page>
24+
</attribute>
25+
<attribute id="givenName">
26+
<display>First name</display>
27+
<icon>ldap-uid.png</icon>
28+
<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
29+
<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>
30+
<order>2</order>
31+
<page>1</page>
32+
</attribute>
33+
<attribute id="sn">
34+
<display>Last name</display>
35+
<onchange>=autoFill(cn;%givenName% %sn%)</onchange>
36+
<onchange>=autoFill(uid;%givenName|0-1/l%%sn/l%)</onchange>
37+
<!-- <onchange>=autoFill(homeDirectory;/home/users/%uid|0-1/l%/%uid%)</onchange> -->
38+
<order>3</order>
39+
<page>1</page>
40+
</attribute>
41+
<attribute id="cn">
42+
<display>Common Name</display>
43+
<order>4</order>
44+
<page>1</page>
45+
</attribute>
46+
<attribute id="uid">
47+
<display>User ID</display>
48+
<onchange>=autoFill(homeDirectory;/home/users/%uid%)</onchange>
49+
<order>5</order>
50+
<page>1</page>
51+
<spacer>1</spacer>
52+
</attribute>
53+
<attribute id="homeDirectory">
54+
<display>Home directory</display>
55+
<!-- <onchange>=autoFill(homeDirectory;/home/users/%gidNumber|0-0/T%/%uid|3-%)</onchange> -->
56+
<order>9</order>
57+
<page>1</page>
58+
</attribute>
59+
<attribute id="uidNumber">
60+
<display>UID Number</display>
61+
<icon>terminal.png</icon>
62+
<order>7</order>
63+
<page>1</page>
64+
<readonly>1</readonly>
65+
<value>=php.GetNextNumber(/;uidNumber)</value>
66+
</attribute>
67+
<attribute id="gidNumber">
68+
<display>GID Number</display>
69+
<!-- <onchange>=autoFill(homeDirectory;/home/users/%gidNumber|0-0/T%/%uid|3-%)</onchange> -->
70+
<order>8</order>
71+
<page>1</page>
72+
<value><![CDATA[=php.PickList(/;(&(objectClass=posixGroup));gidNumber;%cn%;;;;cn)]]></value>
73+
</attribute>
74+
<attribute id="loginShell">
75+
<display>Login shell</display>
76+
<order>10</order>
77+
<page>1</page>
78+
<!-- <value><![CDATA[=php.PickList(/;(&(objectClass=posixAccount));loginShell;%loginShell%;;;;loginShell)]]></value> -->
79+
<type>select</type>
80+
<value id="/bin/bash">Bash</value>
81+
<value id="/bin/csh">C Shell</value>
82+
<value id="/bin/dash">Dash</value>
83+
<value id="/bin/sh">Shell</value>
84+
<value id="/bin/tsh">Turbo C Shell</value>
85+
<value id="/bin/false">False</value>
86+
<value id="/usr/sbin/nologin">No Login</value>
87+
</attribute>
88+
<attribute id="userPassword">
89+
<display>Password</display>
90+
<!-- <helper>
91+
<display>Encryption</display>
92+
<id>enc</id>
93+
<value>=php.PasswordEncryptionTypes()</value>
94+
</helper> -->
95+
<icon>lock.png</icon>
96+
<order>6</order>
97+
<page>1</page>
98+
<post>=php.PasswordEncrypt(%enc%;%userPassword%)</post>
99+
<spacer>1</spacer>
100+
<verify>1</verify>
101+
</attribute>
102+
</attributes>
103+
104+
</template>

startup.sh

Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
#!/bin/bash -e
2+
3+
USER_TEMPLATE_PATH=/customUser.xml
4+
GROUP_TEMPLATE_PATH=/customGroup.xml
5+
6+
if [ -f $USER_TEMPLATE_PATH ]; then
7+
mv $USER_TEMPLATE_PATH /var/www/phpldapadmin/templates/creation/
8+
fi
9+
10+
if [ -f $GROUP_TEMPLATE_PATH ]; then
11+
mv $GROUP_TEMPLATE_PATH /var/www/phpldapadmin/templates/creation/
12+
fi
13+
14+
exit 0

0 commit comments

Comments
 (0)