Skip to content

Commit 47f2d37

Browse files
authored
Fix/slapd bugs (#7)
1 parent 3d2ab75 commit 47f2d37

5 files changed

Lines changed: 67 additions & 46 deletions

File tree

.github/workflows/build-image.yml

Lines changed: 0 additions & 42 deletions
This file was deleted.

.github/workflows/docker-push.yml

Lines changed: 52 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
name: Build and Push Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
workflow_dispatch:
8+
9+
env:
10+
REGISTRY: ghcr.io
11+
IMAGE_NAME: ${{ github.repository }}
12+
13+
jobs:
14+
build-and-push:
15+
runs-on: ubuntu-latest
16+
permissions:
17+
contents: read
18+
packages: write
19+
20+
steps:
21+
- name: Checkout repository
22+
uses: actions/checkout@v4
23+
24+
- name: Set up Docker Buildx
25+
uses: docker/setup-buildx-action@v3
26+
27+
- name: Log in to GitHub Container Registry
28+
uses: docker/login-action@v3
29+
with:
30+
registry: ${{ env.REGISTRY }}
31+
username: ${{ github.actor }}
32+
password: ${{ secrets.GITHUB_TOKEN }}
33+
34+
- name: Extract metadata
35+
id: meta
36+
uses: docker/metadata-action@v5
37+
with:
38+
images: ${{ env.REGISTRY }}/${{ env.IMAGE_NAME }}
39+
tags: |
40+
type=ref,event=branch
41+
type=semver,pattern={{version}}
42+
type=semver,pattern={{major}}.{{minor}}
43+
type=sha
44+
type=raw,value=latest,enable={{is_default_branch}}
45+
46+
- name: Build and push Docker image
47+
uses: docker/build-push-action@v5
48+
with:
49+
context: .
50+
push: true
51+
tags: ${{ steps.meta.outputs.tags }}
52+
labels: ${{ steps.meta.outputs.labels }}

image/docker-entrypoint.sh

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ create_global_var()
2626
export KRB_ADMIN_PASSWORD=${KRB_ADMIN_PASSWORD:-admin}
2727

2828
export KRB_REALM=${KRB_REALM:-EXAMPLE.COM}
29-
export DOMAIN_NAME=$(to_lower "$KRB_REALM")
29+
export DOMAIN_NAME=${DOMAIN_NAME:-$(to_lower "$KRB_REALM")}
3030
export LDAP_DN=$(create_dn "$KRB_REALM")
3131
export LDAP_ORGANISATION=${LDAP_ORGANISATION:-EXAMPLE.COM}
3232

@@ -79,6 +79,7 @@ configuration() {
7979
replace_file "/container/config-slapd.sh";
8080
debug_echo "Launching configuration";
8181
/container/config-slapd.sh;
82+
mkdir -p /var/run/slapd && chown openldap:openldap /var/run/slapd;
8283
/usr/sbin/slapd -h "ldapi:// ldap://" -u openldap -g openldap;
8384
sleep 10;
8485
/container/config-openldap.sh

image/schemas/add/06-ldap_groups.ldif

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,8 @@ dn: ou=Groups,{{ LDAP_DN }}
66
objectClass: organizationalUnit
77
ou: Groups
88

9-
dn: cn=storers,ou=Groups,{{ LDAP_DN }}
9+
dn: cn=Employees,ou=Groups,{{ LDAP_DN }}
10+
objectClass: top
1011
objectClass: posixGroup
11-
cn: storers
12-
gidNumber: 10001
12+
cn: Employees
13+
gidNumber: 100
Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
dn: cn=microsoft,cn=schema,cn=config
2+
objectClass: olcSchemaConfig
3+
cn: microsoft
4+
olcAttributeTypes: ( 1.2.840.113556.1.4.656
5+
NAME 'userPrincipalName'
6+
EQUALITY caseIgnoreMatch
7+
SUBSTR caseIgnoreSubstringsMatch
8+
SYNTAX '1.3.6.1.4.1.1466.115.121.1.15'
9+
SINGLE-VALUE )

0 commit comments

Comments
 (0)