Compare commits
7 Commits
a3f3105081
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
| 2fabe99d72 | |||
| 67a78649ba | |||
| ccba3f5b06 | |||
| bf35cced8c | |||
| fab0f268d3 | |||
| 754504ff68 | |||
| 1c9ba9e92c |
12
.gitignore
vendored
Normal file
12
.gitignore
vendored
Normal file
@@ -0,0 +1,12 @@
|
||||
*.pwd
|
||||
*.env
|
||||
*.bak
|
||||
*.key
|
||||
*.crt
|
||||
*.pem
|
||||
# MacOS system files
|
||||
**/.DS_Store
|
||||
tmp
|
||||
**/__pycache__/
|
||||
**/*.pyc
|
||||
**/*.pyo
|
||||
@@ -14,8 +14,8 @@ INITIALIZED_FLAG = Path("/var/lib/ldap/.initialized")
|
||||
SLAPD_D = Path("/etc/ldap/slapd.d")
|
||||
|
||||
|
||||
base_dn = os.environ["LDAP_BASE_DN"]
|
||||
password = os.environ["LDAP_PASSWORD"]
|
||||
base_dn = os.environ.get("LDAP_BASE_DN") or "dc=example,dc=org"
|
||||
password = os.environ.get("LDAP_PASSWORD") or "changeit"
|
||||
tls_enabled = os.environ.get("TLS_ENABLED") == "1"
|
||||
admin_dn = f"cn=admin,{base_dn}"
|
||||
|
||||
|
||||
5
docker-bake.hcl
Normal file
5
docker-bake.hcl
Normal file
@@ -0,0 +1,5 @@
|
||||
target "default" {
|
||||
context = "."
|
||||
dockerfile = "Dockerfile"
|
||||
tags = ["registry.koszewscy.waw.pl/openldap:latest"]
|
||||
}
|
||||
@@ -1,5 +1,5 @@
|
||||
LDAP_DOMAIN=example.com
|
||||
LDAP_BASE_DN=dc=example,dc=com
|
||||
LDAP_DOMAIN=example.org
|
||||
LDAP_BASE_DN=dc=example,dc=org
|
||||
LDAP_ORG=Example Organization
|
||||
LDAP_PASSWORD=ChangeMe123!
|
||||
LDAP_ADMIN_PASSWORD=ChangeMe123!
|
||||
LDAP_PASSWORD=changeit
|
||||
LDAP_ADMIN_PASSWORD=changeit
|
||||
|
||||
14
scripts/build.sh
Normal file
14
scripts/build.sh
Normal file
@@ -0,0 +1,14 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
REPO_DIR="$(git rev-parse --show-toplevel)"
|
||||
|
||||
if command -v container 2>/dev/null; then
|
||||
container build -t "registry.koszewscy.waw.pl/openldap:latest" "$REPO_DIR"
|
||||
elif command -v docker 2>/dev/null; then
|
||||
docker buildx bake --file "$REPO_DIR"/scripts/docker-bake.hcl
|
||||
else
|
||||
echo "No supported container tool found."
|
||||
exit 1
|
||||
fi
|
||||
20
scripts/run-container.sh
Executable file
20
scripts/run-container.sh
Executable file
@@ -0,0 +1,20 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
set -e
|
||||
|
||||
SCRIPT_DIR="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)"
|
||||
|
||||
if command -v container >/dev/null 2>&1; then
|
||||
container run -d --name ldap \
|
||||
--env-file ~/app-data/openldap/openldap.env \
|
||||
-v openldap_data:/var/lib/ldap \
|
||||
-v openldap_slapd:/etc/ldap/slapd.d \
|
||||
-v ~/app-data/openldap/certs:/etc/ldap/certs:ro \
|
||||
-v ~/app-data/openldap/accounts:/bootstrap/accounts:ro \
|
||||
-v ~/app-data/openldap/backups:/var/backups:rw \
|
||||
-p 389:389 -p 636:636 \
|
||||
openldap:latest
|
||||
else
|
||||
echo "Error: 'container' command not found. Please install the 'container' CLI tool." >&2
|
||||
exit 1
|
||||
fi
|
||||
Reference in New Issue
Block a user