Definitely my aim just trying to find the time is the main challenge at the moment
Update: I’ve managed to get scratchpad working (I think I’m still testing but I think it’s persistent) if my tests work it will mean a working rootless persistent container of LemonLDAP-NG (manual config of course if it works we can automate the rest)
Update 2.
I’ve fixed it and updated the details below all files are accessible via /opt/lemonldap/ (your can add any files but make sure you chown them correctly) thus step one is finished (the manual setup and persistence of data)
Update 3.
Added instructions for enabling restart via systemctl
Update 4.
I’ve changed the instructions to have the folders created directly under the scratchpad location for backup purposes and to remove the step for needing to chown the folders in the initial stage.
- First set the http route
api-cli run set-route --agent module/traefik1 --data - <<EOF
{
"instance": "myportal",
"url": "http://127.0.0.1:<port>",
"host": "myportal.$(hostname -d)",
"lets_encrypt": true,
"http2https": true,
"skip_cert_verify": false
}
EOF
wait
api-cli run set-route --agent module/traefik1 --data - <<EOF
{
"instance": "mymanager",
"url": "http://127.0.0.1:<port>",
"host": "mymanager.$(hostname -d)",
"lets_encrypt": true,
"http2https": true,
"skip_cert_verify": false
}
EOF
- Install scratchpad module.
add-module ghcr.io/davideprincipi/scratchpad:latest
- Login to container.
runagent -m scratchpad<number_of_scratchpad_instance> bash -l
-
Create the Folders.
mkdir -p backgrounds apps logos logs cache conf etc
-
Create the volumes in scratchpad.
podman volume create \
-o device=backgrounds \
-o=o=bind \
backgrounds
podman volume create \
-o device=conf \
-o=o=bind \
conf
podman volume create \
-o device=logos \
-o=o=bind \
logos
podman volume create \
-o device=apps \
-o=o=bind \
apps
podman volume create \
-o device=logs \
-o=o=bind \
logs
podman volume create \
-o device=cache \
-o=o=bind \
cache
podman volume create \
-o device=etc \
-o=o=bind \
etc
- Run the lemonldap Podman script.
podman run --detach --name lemonldap \
--volume=apps:/usr/share/lemonldap-ng/portal/htdocs/static/common/apps:rw,Z \
--volume=backgrounds:/usr/share/lemonldap-ng/portal/htdocs/static/common/backgrounds:rw,Z \
--volume=logos:/usr/share/lemonldap-ng/portal/htdocs/static/common/logos:rw,Z \
--volume=conf:/var/lib/lemonldap-ng/conf:rw,Z \
--volume=logs:/www/logs:rw,Z \
--volume=etc:/etc/lemonldap-ng:rw,Z \
--volume=cache:/var/cache/lemonldap-ng:rw,Z \
-e SSODOMAIN=$(hostname -d) \
-e PORTAL_HOSTNAME=myportal.$(hostname -d) \
-e MANAGER_HOSTNAME=mymanager.$(hostname -d) \
-e HANDLER_HOSTNAME=myhandler.$(hostname -d) \
-e TEST1_HOSTNAME=test1.$(hostname -d) \
-e TEST2_HOSTNAME=test2.$(hostname -d) \
-e LOGLEVEL=debug \
-e TZ="<country/city>" \
-e FASTCGI_LISTEN_PORT=9000 \
-p <port>:80 \
docker.io/coudot/lemonldap-ng:latest
- make the service file to be able to restart service using systemd
(i.e., systemctl --user (re)start/stop lemonldap
).
podman generate systemd -f \
--no-header \
--container-prefix '' \
lemonldap
mv -vf \
<long .service file name from previous command>.service \
../systemd/user/lemonldap.service
- Stop the service in Podman.
podman stop lemonldap
- Reload system daemons and enable the service.
systemctl --user daemon-reload
systemctl --user enable lemonldap
- Start LemonLDAP.
systemctl --user start lemonldap
– need to update the instructions to include option for favicon (maybe even have just common folder instead of apps, backgrounds etc)
just need to add your favicon to logos folder and change favicon path in manager to common/logos/favicon.ico
– add steps to auto add ldap/ad via instructions from stephdl
I will have to work out the backup process as I think backing up the scratchpad module only backups up the initial install of scratchpad