-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdeploy.sh
More file actions
57 lines (43 loc) · 1.61 KB
/
deploy.sh
File metadata and controls
57 lines (43 loc) · 1.61 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
#!/bin/bash
set -e
echo "🛠️ Zenth Cloud Directory - Install Script"
INSTALL_DIR="/opt/zenth-ldap"
SLAPD_CONF="$INSTALL_DIR/etc/openldap/slapd.conf"
# Step 1: Update and install dependencies
echo "🔧 Installing dependencies..."
sudo apt update
sudo apt install -y build-essential libtool libssl-dev libsasl2-dev \
libdb-dev libwrap0-dev libreadline-dev libargon2-dev \
libsystemd-dev libperl-dev libslp-dev git
# Step 2: Clone the repository if needed
if [ ! -d "zenth-directory" ]; then
echo "📥 Cloning repository..."
git clone https://github.com/zenthcloud/zenth-directory.git
fi
cd zenth-directory
# Step 3: Build
echo "⚙️ Building Zenth Cloud Directory..."
./configure --prefix=$INSTALL_DIR --enable-slapd --enable-modules --with-tls=openssl
make -j$(nproc)
sudo make install
# Step 4: Configuration
echo "🗂️ Setting up configuration..."
sudo mkdir -p $INSTALL_DIR/var/openldap-data
sudo tee $SLAPD_CONF > /dev/null <<EOF
include $INSTALL_DIR/etc/openldap/schema/core.schema
pidfile $INSTALL_DIR/var/run/slapd.pid
argsfile $INSTALL_DIR/var/run/slapd.args
database mdb
maxsize 1073741824
suffix "dc=zenthcloud,dc=local"
rootdn "cn=admin,dc=zenthcloud,dc=local"
rootpw secretpassword
directory $INSTALL_DIR/var/openldap-data
index objectClass eq
EOF
# Step 5: Start slapd
echo "🚀 Launching LDAP server..."
sudo $INSTALL_DIR/libexec/slapd -f $SLAPD_CONF -h "ldap://0.0.0.0:389"
echo "✅ Zenth Directory is now running on ldap://localhost:389"
echo "ℹ️ Login DN: cn=admin,dc=zenthcloud,dc=local"
echo "🔑 Password: secretpassword"