├── lemonldap.dpkg.cfg ├── lemonldap-ng.list ├── old ├── lemonldap-ng-oldstable.list └── Dockerfile-oldstable ├── kubernetes ├── deploy │ ├── k8s-llng-configmap.yaml │ ├── k8s-llng-namespace.yaml │ ├── k8s-llng-svc.yaml │ ├── k8s-llng-ingress.yaml │ ├── k8s-llng-apache2.yaml │ └── k8s-llng-nginx.yaml ├── docker │ ├── k8s-llng-apache2 │ │ ├── etc.apt.sources.d.lemonldap-ng.list │ │ └── Dockerfile │ ├── k8s-llng-fastcgi │ │ ├── etc.apt.sources.d.lemonldap-ng.list │ │ ├── entrypoint.sh │ │ └── Dockerfile │ └── k8s-llng-nginx │ │ └── Dockerfile └── README.md ├── docker-trunk ├── debian │ ├── 8 │ │ ├── apache2 │ │ │ ├── Dockerfile_spec.rb │ │ │ └── Dockerfile │ │ └── nginx │ │ │ ├── etc.supervisor.conf.d.supervisord.conf │ │ │ └── Dockerfile │ ├── 9 │ │ └── apache2 │ │ │ ├── Dockerfile_spec.rb │ │ │ └── Dockerfile │ └── 10 │ │ ├── README.md │ │ └── Dockerfile └── centos │ └── 7 │ └── apache2 │ ├── docker-entrypoint.sh │ └── Dockerfile ├── docker-compose ├── README.md └── docker-compose.yaml ├── docker-compose.yaml ├── docker-compose-selinux.yaml ├── Dockerfile ├── docker-entrypoint.sh ├── README.md └── LICENSE /lemonldap.dpkg.cfg: -------------------------------------------------------------------------------- 1 | path-include /usr/share/doc/lemonldap-ng-doc/* 2 | -------------------------------------------------------------------------------- /lemonldap-ng.list: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG repository 2 | deb https://lemonldap-ng.org/deb 1.9 main 3 | deb-src https://lemonldap-ng.org/deb 1.9 main 4 | -------------------------------------------------------------------------------- /old/lemonldap-ng-oldstable.list: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG repository 2 | deb http://lemonldap-ng.org/deb oldstable main 3 | deb-src http://lemonldap-ng.org/deb oldstable main 4 | -------------------------------------------------------------------------------- /kubernetes/deploy/k8s-llng-configmap.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: ConfigMap 4 | metadata: 5 | name: domain 6 | namespace: auth 7 | data: 8 | domain: 'example.com' 9 | -------------------------------------------------------------------------------- /kubernetes/docker/k8s-llng-apache2/etc.apt.sources.d.lemonldap-ng.list: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG repository 2 | deb https://lemonldap-ng.org/deb stable main 3 | deb-src https://lemonldap-ng.org/deb stable main 4 | -------------------------------------------------------------------------------- /kubernetes/docker/k8s-llng-fastcgi/etc.apt.sources.d.lemonldap-ng.list: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG repository 2 | deb https://lemonldap-ng.org/deb stable main 3 | deb-src https://lemonldap-ng.org/deb stable main 4 | -------------------------------------------------------------------------------- /docker-trunk/debian/10/README.md: -------------------------------------------------------------------------------- 1 | # 2.0 image 2 | 3 | # Launch with: 4 | export PORTAL=http://auth.example.com:8080/ 5 | export PORT=:8080 6 | docker run -p 8080:80 --env=PORTAL --env=PORT 7 | -------------------------------------------------------------------------------- /kubernetes/deploy/k8s-llng-namespace.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Namespace 4 | metadata: 5 | name: auth 6 | spec: 7 | finalizers: 8 | - kubernetes 9 | status: 10 | phase: Active 11 | -------------------------------------------------------------------------------- /kubernetes/deploy/k8s-llng-svc.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: v1 3 | kind: Service 4 | metadata: 5 | name: llng 6 | namespace: auth 7 | labels: 8 | app: llng 9 | spec: 10 | ports: 11 | - name: "http" 12 | port: 80 13 | protocol: TCP 14 | targetPort: 80 15 | 16 | -------------------------------------------------------------------------------- /docker-compose/README.md: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG in docker-compose 2 | 3 | ## Build your docker 4 | It is the same with classic build : 5 | docker build --rm -t yourname/lemonldap-ng:version . 6 | 7 | ## Verify your docker-compose 8 | To check your docker-compose : 9 | docker-composer config --service 10 | 11 | ## Deploy with docker-compose 12 | Start your docker-compose : 13 | docker-compose start # or docker-compose up 14 | 15 | Stop your docker-compose : 16 | docker-compose stop 17 | -------------------------------------------------------------------------------- /docker-trunk/debian/8/apache2/Dockerfile_spec.rb: -------------------------------------------------------------------------------- 1 | # spec/Dockerfile_spec.rb 2 | 3 | require "serverspec" 4 | require "docker" 5 | 6 | describe "Dockerfile" do 7 | before(:all) do 8 | image = Docker::Image.build_from_dir('.') 9 | 10 | set :os, family: :debian 11 | set :backend, :docker 12 | set :docker_image, image.id 13 | end 14 | 15 | it "installs the right version of Debian" do 16 | expect(os_version).to include("Debian") 17 | end 18 | 19 | def os_version 20 | command("cat /etc/issue").stdout 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /docker-trunk/debian/9/apache2/Dockerfile_spec.rb: -------------------------------------------------------------------------------- 1 | # spec/Dockerfile_spec.rb 2 | 3 | require "serverspec" 4 | require "docker" 5 | 6 | describe "Dockerfile" do 7 | before(:all) do 8 | image = Docker::Image.build_from_dir('.') 9 | 10 | set :os, family: :debian 11 | set :backend, :docker 12 | set :docker_image, image.id 13 | end 14 | 15 | it "installs the right version of Debian" do 16 | expect(os_version).to include("Debian") 17 | end 18 | 19 | def os_version 20 | command("cat /etc/issue").stdout 21 | end 22 | end 23 | -------------------------------------------------------------------------------- /docker-trunk/centos/7/apache2/docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | if [ "$SSODOMAIN" != 'example.com' ]; then 4 | HTTPCONF=/etc/httpd/conf.d/httpd.conf 5 | if ! grep "ServerName $SSODOMAIN" "$HTTPCONF" >/dev/null; then 6 | echo "Configuring LLNG for $SSODOMAIN" 7 | echo "ServerName $SSODOMAIN" >>"$HTTPCONF" 8 | sed -i "s/example\.com/$SSODOMAIN/g" /etc/lemonldap-ng/* \ 9 | /var/lib/lemonldap-ng/conf/lmConf-1.js* /var/lib/lemonldap-ng/test/index.pl 10 | else 11 | echo "Re-using LLNG existing configuration for $SSODOMAIN" 12 | fi 13 | fi 14 | 15 | rm -rf /run/httpd/* /tmp/httpd* 16 | exec /usr/sbin/apachectl -DFOREGROUND 17 | -------------------------------------------------------------------------------- /docker-compose/docker-compose.yaml: -------------------------------------------------------------------------------- 1 | version: '2' 2 | services: 3 | fastcgi: 4 | image: k8s-llng-fastcgi 5 | volumes: 6 | - dataavailable:/etc/nginx/sites-available 7 | - dataenabled:/etc/nginx/sites-enabled 8 | - fastcgisocket:/var/run/llng-fastcgi-server/llng-fastcgi.sock 9 | nginx: 10 | image: k8s-llng-nginx 11 | ports: 12 | - "80:8080" 13 | volumes: 14 | - dataavailable:/etc/nginx/sites-available 15 | - dataenabled:/etc/nginx/sites-enabled 16 | - fastcgisocket:/var/run/llng-fastcgi-server/llng-fastcgi.sock 17 | volumes: 18 | dataenabled: {} 19 | dataavailable: {} 20 | fastcgisocket: {} 21 | -------------------------------------------------------------------------------- /kubernetes/deploy/k8s-llng-ingress.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | kind: Ingress 3 | apiVersion: extensions/v1beta1 4 | metadata: 5 | name: llng 6 | namespace: auth 7 | labels: 8 | app: llng 9 | spec: 10 | rules: 11 | - host: auth.example.com 12 | http: 13 | paths: 14 | - backend: 15 | serviceName: llng 16 | servicePort: 80 17 | - host: reload.example.com 18 | http: 19 | paths: 20 | - backend: 21 | serviceName: llng 22 | servicePort: 80 23 | - host: manager.example.com 24 | http: 25 | paths: 26 | - backend: 27 | serviceName: llng 28 | servicePort: 80 29 | 30 | -------------------------------------------------------------------------------- /kubernetes/docker/k8s-llng-fastcgi/entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | set -x 3 | set -e 4 | 5 | ln -s /etc/lemonldap-ng/handler-nginx.conf /etc/nginx/sites-available/ 6 | ln -s /etc/lemonldap-ng/manager-nginx.conf /etc/nginx/sites-available/ 7 | ln -s /etc/lemonldap-ng/portal-nginx.conf /etc/nginx/sites-available/ 8 | ln -s /etc/lemonldap-ng/test-nginx.conf /etc/nginx/sites-available/ 9 | ln -s /etc/nginx/sites-available/handler-nginx.conf /etc/nginx/sites-enabled/ 10 | ln -s /etc/nginx/sites-available/manager-nginx.conf /etc/nginx/sites-enabled/ 11 | ln -s /etc/nginx/sites-available/portal-nginx.conf /etc/nginx/sites-enabled/ 12 | ln -s /etc/nginx/sites-available/test-nginx.conf /etc/nginx/sites-enabled/ 13 | 14 | exec /usr/sbin/llng-fastcgi-server -F -u www-data -g www-data 15 | -------------------------------------------------------------------------------- /kubernetes/deploy/k8s-llng-apache2.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: llng 6 | namespace: auth 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | labels: 12 | app: llng 13 | spec: 14 | containers: 15 | - name: k8s-llng-apache2 16 | imagePullPolicy: "Always" 17 | env: 18 | - name: SSODOMAIN 19 | valueFrom: 20 | configMapKeyRef: 21 | name: llng 22 | key: domain 23 | image: /k8s-llng-apache2:v0.0.1 24 | ports: 25 | - name: "http" 26 | containerPort: 80 27 | 28 | -------------------------------------------------------------------------------- /kubernetes/docker/k8s-llng-nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Use debian repo of LemonLDAP::NG project 3 | 4 | # Start from Debian Jessie 5 | FROM debian:jessie 6 | MAINTAINER Clément OUDOT 7 | LABEL name="llng-apache2" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com \ 12 | DUMBINITVERSION 1.2.0 13 | 14 | COPY lemonldap-ng.list / 15 | 16 | # Update system 17 | RUN apt -y update \ 18 | && apt -y install wget apt-transport-https \ 19 | && apt -y dist-upgrade \ 20 | && echo "# Install Dumb-init" \ 21 | && wget https://github.com/Yelp/dumb-init/releases/download/v${DUMBINITVERSION}/dumb-init_${DUMBINITVERSION}_amd64.deb \ 22 | && dpkg -i dumb-init_${DUMBINITVERSION}_amd64.deb \ 23 | && apt install -f -y \ 24 | && echo "# Install LemonLDAP::NG package" \ 25 | && apt -y install \ 26 | && apt clean \ 27 | && rm -fr /var/lib/apt/lists/* 28 | 29 | EXPOSE 80 443 30 | ENTRYPOINT ["dumb-init","--","/usr/sbin/nginx"] 31 | -------------------------------------------------------------------------------- /kubernetes/README.md: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG in Kubernetes 2 | 3 | ## Build your docker 4 | It is the same with classic build : 5 | docker build --rm -t yourname/lemonldap-ng:version . 6 | 7 | ## Customize your deployment 8 | 9 | To deploy your ll::ng on kubernetes, you can modify the namespace(in all yaml) and SSODOMAIN(in k8s-llng-configmap.yaml and k8s-llng-ingress.yaml). 10 | 11 | ## Choose your container image 12 | 13 | You must edit k8s-llng-nginx.yaml or k8s-llng-apache2.yaml with a correct image registry. 14 | 15 | ## Deploy on kubernetes 16 | You need to create your namespace first and make choice between nginx and apache2 : 17 | kubectl create -f k8s-llng-namespace.yaml 18 | kubectl create -f k8s-llng-configmap.yaml 19 | kubectl create -f k8s-llng-svc.yaml 20 | kubectl create -f k8s-llng-nginx.yaml # or kubectl create -f k8s-llng-apache2.yaml 21 | kubectl create -f k8s-llng-ingress.yaml 22 | 23 | If you want to execute with only one command : 24 | kubectl create -f k8s-llng-namespace.yaml -f k8s-llng-configmap.yaml -f k8s-llng-svc.yaml f k8s-llng-{nginx|apache2}.yaml -f k8s-llng-ingress.yaml 25 | 26 | Now you can connect on the url, you have in k8s-llng-ingress.yaml. 27 | 28 | -------------------------------------------------------------------------------- /old/Dockerfile-oldstable: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Use debian repo of LemonLDAP::NG project 3 | 4 | # Start from Debian Jessie 5 | FROM debian:jessie 6 | MAINTAINER Clément OUDOT 7 | 8 | # Change SSO DOMAIN here 9 | ENV SSODOMAIN example.com 10 | 11 | # Update system 12 | RUN apt-get -y update && apt-get -y dist-upgrade 13 | 14 | # Install LemonLDAP::NG repo 15 | RUN apt-get -y install wget 16 | RUN wget -O - http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | apt-key add - 17 | COPY lemonldap-ng-oldstable.list /etc/apt/sources.list.d/ 18 | 19 | # Install LemonLDAP::NG packages 20 | RUN apt-get -y update && apt-get -y install apache2 libapache2-mod-perl2 lemonldap-ng lemonldap-ng-fr-doc 21 | 22 | # Change SSO Domain 23 | RUN sed -i "s/example\.com/${SSODOMAIN}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1 /var/lib/lemonldap-ng/test/index.pl 24 | 25 | # Enable sites 26 | RUN a2ensite handler-apache2.conf 27 | RUN a2ensite portal-apache2.conf 28 | RUN a2ensite manager-apache2.conf 29 | RUN a2ensite test-apache2.conf 30 | 31 | RUN a2enmod cgid perl alias rewrite 32 | 33 | # Remove cached configuration 34 | RUN rm -rf /tmp/lemonldap-ng-config 35 | 36 | EXPOSE 80 443 37 | VOLUME ["/var/log/apache2", "/etc/apache2", "/etc/lemonldap-ng", "/var/lib/lemonldap-ng/conf", "/var/lib/lemonldap-ng/sessions", "/var/lib/lemonldap-ng/psessions"] 38 | ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] 39 | -------------------------------------------------------------------------------- /kubernetes/docker/k8s-llng-fastcgi/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Use debian repo of LemonLDAP::NG project 3 | 4 | # Start from Debian Jessie 5 | FROM debian:jessie 6 | MAINTAINER Clément OUDOT 7 | LABEL name="k8s-llng-fastcgi" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com 12 | ENV DUMBINITVERSION 1.2.0 13 | 14 | COPY etc.apt.sources.d.lemonldap-ng.list / 15 | COPY entrypoint.sh / 16 | 17 | # Update system 18 | RUN apt -y update \ 19 | && apt -y install wget apt-transport-https \ 20 | && apt -y dist-upgrade \ 21 | && echo "# Install Dumb-init" \ 22 | && wget https://github.com/Yelp/dumb-init/releases/download/v${DUMBINITVERSION}/dumb-init_${DUMBINITVERSION}_amd64.deb \ 23 | && dpkg -i dumb-init_${DUMBINITVERSION}_amd64.deb \ 24 | && apt install -f -y \ 25 | && rm -f dumb-init_${DUMBINITVERSION}_amd64.deb \ 26 | && echo "# Install LemonLDAP::NG repo" \ 27 | && mv etc.apt.sources.d.lemonldap-ng.list /etc/apt/sources.list.d/lemonldap-ng.list \ 28 | && wget -O - http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | apt-key add - \ 29 | && apt update \ 30 | && echo "# Install LemonLDAP::NG package" \ 31 | && apt -y install lemonldap-ng lemonldap-ng-fr-doc lemonldap-ng-fastcgi-server \ 32 | && echo "# Change SSO Domain" \ 33 | && sed -i "s/example\.com/${SSODOMAIN}/g" /etc/lemonldap-ng/* \ 34 | && echo "# Remove cached configuration" \ 35 | && rm -rf /tmp/lemonldap-ng-config \ 36 | && rm -fr /var/lib/apt/lists/* 37 | 38 | ENTRYPOINT ["dumb-init","--","/bin/sh","/entrypoint.sh"] 39 | 40 | -------------------------------------------------------------------------------- /docker-trunk/debian/9/apache2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Installation of trunk version of LL::NG 3 | 4 | # Start from Debian Jessie 5 | FROM debian:stretch 6 | MAINTAINER Clément OUDOT 7 | LABEL name="llng-apache2-trunk" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com 12 | 13 | RUN apt -y update \ 14 | && apt -y upgrade \ 15 | && apt-get -y install gnupg2 curl 16 | RUN apt -y update \ 17 | && apt -y upgrade \ 18 | && apt-get -y install gnupg2 curl \ 19 | && curl http://lemonldap-ng.ow2.io/lemonldap-ng/GPG_PUBLIC_KEY | apt-key add - \ 20 | && echo 'deb [arch=amd64,trusted=yes] http://lemonldap-ng.ow2.io/lemonldap-ng/debian stretch main' > /etc/apt/sources.list.d/llng.list \ 21 | && apt -y update \ 22 | && apt-get -y install apache2 libapache2-mod-perl2 libapache2-mod-fcgid lemonldap-ng libgd-securityimage-perl \ 23 | && sed -i "s/example\.com/${SSODOMAIN}/g" /etc/lemonldap-ng/* \ 24 | && echo "/var/lib/lemonldap-ng/conf/lmConf-1.js" \ 25 | && sed -i "s/logLevel\s*=\s*warn/logLevel = debug/" /etc/lemonldap-ng/lemonldap-ng.ini \ 26 | && sed -i "s/LogLevel warn/LogLevel debug/" /etc/apache2/apache2.conf \ 27 | && a2ensite handler-apache2.conf portal-apache2.conf manager-apache2.conf test-apache2.conf \ 28 | && a2enmod fcgid perl alias rewrite headers \ 29 | && rm -rf /tmp/lemonldap-ng-config \ 30 | && rm -fr /var/lib/apt/lists/* 31 | 32 | EXPOSE 80 443 33 | VOLUME ["/var/log/apache2", "/etc/apache2", "/etc/lemonldap-ng", "/var/lib/lemonldap-ng/conf", "/var/lib/lemonldap-ng/sessions", "/var/lib/lemonldap-ng/psessions"] 34 | ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] 35 | -------------------------------------------------------------------------------- /docker-trunk/centos/7/apache2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Installation of trunk version of LL::NG 3 | 4 | # Start from CentOS 7 5 | FROM centos:7 6 | MAINTAINER Clément OUDOT 7 | LABEL name="llng-centos7-apache2-trunk" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com 12 | 13 | EXPOSE 80 443 14 | 15 | COPY docker-entrypoint.sh / 16 | 17 | # Update and install 18 | RUN yum -y update \ 19 | && yum clean all \ 20 | && curl -fLsS -o /usr/local/bin/dumb-init https://github.com/Yelp/dumb-init/releases/download/v1.2.0/dumb-init_1.2.0_amd64 \ 21 | && chmod +x /usr/local/bin/dumb-init \ 22 | && yum -y install epel-release \ 23 | && yum -y install perl-Apache-Session perl-Authen-Captcha perl-Cache-Cache perl-Clone perl-Config-IniFiles perl-Convert-PEM perl-Crypt-OpenSSL-RSA perl-Crypt-OpenSSL-X509 perl-Crypt-Rijndael perl-Digest-HMAC perl-Digest-SHA perl-Email-Sender perl-GD-SecurityImage perl-HTML-Template perl-IO-String perl-JSON perl-LDAP perl-Mouse perl-Plack perl-Regexp-Assemble perl-Regexp-Common perl-SOAP-Lite perl-String-Random perl-Unicode-String perl-version perl-XML-Simple --enablerepo=epel-testing \ 24 | && yum -y install perl-Test-Pod perl-Class-Inspector perl-Test-MockObject perl-Env perl-XML-LibXSLT \ 25 | && yum -y install git rpm-build tar which 26 | 27 | # Get trunk version of LL::NG 28 | WORKDIR root 29 | RUN git clone https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng.git \ 30 | && cd lemonldap-ng \ 31 | && make rpm-dist \ 32 | && rpmbuild -ta lemonldap*tar.gz 33 | 34 | # Install packages 35 | RUN yum localinstall -y /root/rpmbuild/RPMS/noarch/*.rpm \ 36 | && yum clean all \ 37 | && rpm -Uvh --force /root/rpmbuild/RPMS/noarch/lemonldap-ng-doc*rpm 38 | 39 | ENTRYPOINT ["/usr/local/bin/dumb-init","--","/docker-entrypoint.sh"] 40 | -------------------------------------------------------------------------------- /docker-trunk/debian/8/nginx/etc.supervisor.conf.d.supervisord.conf: -------------------------------------------------------------------------------- 1 | [unix_http_server] 2 | file=/tmp/supervisor.sock ; (the path to the socket file) 3 | 4 | [supervisord] 5 | logfile=/tmp/supervisord.log ; (main log file;default $CWD/supervisord.log) 6 | logfile_maxbytes=50MB ; (max main logfile bytes b4 rotation;default 50MB) 7 | logfile_backups=10 ; (num of main logfile rotation backups;default 10) 8 | loglevel=info ; (log level;default info; others: debug,warn,trace) 9 | pidfile=/tmp/supervisord.pid ; (supervisord pidfile;default supervisord.pid) 10 | nodaemon=true ; (start in foreground if true;default false) 11 | minfds=1024 ; (min. avail startup file descriptors;default 1024) 12 | minprocs=200 ; (min. avail process descriptors;default 200) 13 | user=root ; 14 | 15 | ; the below section must remain in the config file for RPC 16 | ; (supervisorctl/web interface) to work, additional interfaces may be 17 | ; added by defining them in separate rpcinterface: sections 18 | [rpcinterface:supervisor] 19 | supervisor.rpcinterface_factory = supervisor.rpcinterface:make_main_rpcinterface 20 | 21 | [supervisorctl] 22 | serverurl=unix:///tmp/supervisor.sock ; use a unix:// URL for a unix socket 23 | 24 | [program:llng-fastcgi-server] 25 | command=/usr/sbin/llng-fastcgi-server --foreground -u www-data -g www-data 26 | autostart=true 27 | autorestart=true 28 | priority=5 29 | stdout_logfile=/dev/stdout 30 | stdout_logfile_maxbytes=0 31 | stderr_logfile=/dev/stderr 32 | stderr_logfile_maxbytes=0 33 | 34 | [program:nginx] 35 | command=/usr/sbin/nginx 36 | autostart=true 37 | autorestart=true 38 | priority=10 39 | stdout_logfile=/dev/stdout 40 | stdout_logfile_maxbytes=0 41 | stderr_logfile=/dev/stderr 42 | stderr_logfile_maxbytes=0 43 | stdout_events_enabled=true 44 | stderr_events_enabled=true 45 | -------------------------------------------------------------------------------- /docker-compose.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | lemonldap-ng: 3 | container_name: lemonldap-ng 4 | image: lemonldapng/lemonldap-ng:latest 5 | environment: 6 | PUID: 1000 7 | PGID: 1000 8 | TZ: Europe/Paris 9 | SSODOMAIN: example.com 10 | PORTAL_HOSTNAME: auth.example.com 11 | MANAGER_HOSTNAME: manager.example.com 12 | HANDLER_HOSTNAME: reload.example.com 13 | TEST1_HOSTNAME: test1.example.com 14 | TEST2_HOSTNAME: test2.example.com 15 | LOGLEVEL: debug 16 | # Starts fast-cgi-server with a port rather than socket 17 | #FASTCGI_LISTEN_PORT: 9000 18 | PORT: 80 19 | IPV4_ONLY: true 20 | PRESERVEFILES: /etc/lemonldap-ng /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/psessions /etc/nginx/sites-enabled 21 | ports: 22 | # Needed only when using fast-cgi-server via port access 23 | #- 9000:9000 24 | - 80:80 25 | volumes: 26 | - ./llng/etc:/etc/lemonldap-ng 27 | - ./llng/var-conf:/var/lib/lemonldap-ng/conf 28 | - ./llng/var-sessions:/var/lib/lemonldap-ng/sessions 29 | - ./llng/var-psessions:/var/lib/lemonldap-ng/psessions 30 | - ./llng/theme:/usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme 31 | - ./llng/template:/usr/share/lemonldap-ng/portal/templates/CustomTheme 32 | - ./llng/plugins:/usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin 33 | - ./llng/register:/usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister 34 | - ./llng/userdb:/usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb 35 | - ./llng/auth:/usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth 36 | - ./llng/captcha:/usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha 37 | - ./llng/menutab:/usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab 38 | - ./llng/nginx:/etc/nginx/sites-enabled 39 | restart: unless-stopped 40 | -------------------------------------------------------------------------------- /docker-compose-selinux.yaml: -------------------------------------------------------------------------------- 1 | services: 2 | lemonldap-ng: 3 | container_name: lemonldap-ng 4 | image: lemonldapng/lemonldap-ng:latest 5 | environment: 6 | PUID: 1000 7 | PGID: 1000 8 | TZ: Europe/Paris 9 | SSODOMAIN: example.com 10 | PORTAL_HOSTNAME: auth.example.com 11 | MANAGER_HOSTNAME: manager.example.com 12 | HANDLER_HOSTNAME: reload.example.com 13 | TEST1_HOSTNAME: test1.example.com 14 | TEST2_HOSTNAME: test2.example.com 15 | LOGLEVEL: debug 16 | # Starts fast-cgi-server with a port rather than socket 17 | #FASTCGI_LISTEN_PORT: 9000 18 | PORT: 8080 19 | IPV4_ONLY: true 20 | PRESERVEFILES: /etc/lemonldap-ng /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/psessions /etc/nginx/sites-enabled 21 | ports: 22 | # Needed only when using fast-cgi-server via port access 23 | #- 9000:9000 24 | - 8080:8080 25 | volumes: 26 | - ./llng/etc:/etc/lemonldap-ng:Z 27 | - ./llng/var-conf:/var/lib/lemonldap-ng/conf:Z 28 | - ./llng/var-sessions:/var/lib/lemonldap-ng/sessions:Z 29 | - ./llng/var-psessions:/var/lib/lemonldap-ng/psessions:Z 30 | - ./llng/theme:/usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme:Z 31 | - ./llng/template:/usr/share/lemonldap-ng/portal/templates/CustomTheme:Z 32 | - ./llng/plugins:/usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin:Z 33 | - ./llng/register:/usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister:Z 34 | - ./llng/userdb:/usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb:Z 35 | - ./llng/auth:/usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth:Z 36 | - ./llng/captcha:/usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha:Z 37 | - ./llng/menutab:/usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab:Z 38 | - ./llng/nginx:/etc/nginx/sites-enabled:Z 39 | restart: unless-stopped 40 | -------------------------------------------------------------------------------- /kubernetes/docker/k8s-llng-apache2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Use debian repo of LemonLDAP::NG project 3 | 4 | # Start from Debian Jessie 5 | FROM debian:jessie 6 | MAINTAINER Clément OUDOT 7 | LABEL name="k8s-llng-apache2" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com 12 | ENV DUMBINITVERSION 1.2.0 13 | 14 | EXPOSE 80 443 15 | COPY etc.apt.sources.d.lemonldap-ng.list / 16 | 17 | # Update system 18 | RUN apt -y update \ 19 | && apt -y install wget apt-transport-https \ 20 | && apt -y dist-upgrade \ 21 | && echo "# Install Dumb-init" \ 22 | && wget https://github.com/Yelp/dumb-init/releases/download/v${DUMBINITVERSION}/dumb-init_${DUMBINITVERSION}_amd64.deb \ 23 | && dpkg -i dumb-init_${DUMBINITVERSION}_amd64.deb \ 24 | && apt install -f -y \ 25 | && echo "# Install LemonLDAP::NG repo" \ 26 | && mv etc.apt.sources.d.lemonldap-ng.list /etc/apt/sources.list.d/lemonldap-ng.list \ 27 | && wget -O - http://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | apt-key add - \ 28 | && apt update \ 29 | && echo "# Install LemonLDAP::NG package" \ 30 | && apt -y install apache2 libapache2-mod-perl2 libapache2-mod-fcgid lemonldap-ng lemonldap-ng-fr-doc \ 31 | && echo "# Change SSO Domain" \ 32 | && sed -i "s/example\.com/${SSODOMAIN}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.js /var/lib/lemonldap-ng/test/index.pl \ 33 | && echo "# Comment CGIPassAuth directive" \ 34 | && sed -i 's/CGIPassAuth on/#CGIPassAuth on/g' /etc/lemonldap-ng/portal-apache2.conf \ 35 | && echo "# Enable sites" \ 36 | && a2ensite handler-apache2.conf \ 37 | && a2ensite portal-apache2.conf \ 38 | && a2ensite manager-apache2.conf \ 39 | && a2ensite test-apache2.conf \ 40 | && a2enmod fcgid perl alias rewrite \ 41 | && echo "# Remove cached configuration" \ 42 | && rm -rf /tmp/lemonldap-ng-config \ 43 | && rm -fr /var/lib/apt/lists/* 44 | 45 | VOLUME ["/var/log/apache2", "/etc/apache2", "/etc/lemonldap-ng", "/var/lib/lemonldap-ng/conf", "/var/lib/lemonldap-ng/sessions", "/var/lib/lemonldap-ng/psessions"] 46 | ENTRYPOINT ["dumb-init","--","/usr/sbin/apache2ctl", "-D", "FOREGROUND"] 47 | -------------------------------------------------------------------------------- /docker-trunk/debian/10/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:buster 2 | MAINTAINER Xavier (Yadd) Guimard 3 | LABEL name="lemonldap-ng-nginx" \ 4 | version="v2.0.0~a1" 5 | 6 | ENV SSODOMAIN=example.com \ 7 | PORTAL=http://auth.example.com \ 8 | PORT= \ 9 | DUMBINITVERSION=1.2.0 \ 10 | DEBIAN_FRONTEND=noninteractive 11 | 12 | EXPOSE 80 443 13 | RUN apt-get -y update \ 14 | && apt-get -y dist-upgrade 15 | 16 | RUN echo "# Install LemonLDAP::NG source repo" && \ 17 | apt-get -y install wget apt-transport-https gnupg liblasso-perl && \ 18 | wget -O - https://lemonldap-ng.org/_media/rpm-gpg-key-ow2 | apt-key add - && \ 19 | echo "deb https://lemonldap-ng.org/deb 2.0 main" >/etc/apt/sources.list.d/lemonldap-ng.list 20 | 21 | RUN echo "# Install Dumb-init" \ 22 | && wget https://github.com/Yelp/dumb-init/releases/download/v${DUMBINITVERSION}/dumb-init_${DUMBINITVERSION}_amd64.deb \ 23 | && dpkg -i dumb-init_${DUMBINITVERSION}_amd64.deb \ 24 | && apt-get install -f -y \ 25 | && apt-get -y update \ 26 | && echo "# Install LemonLDAP::NG package" \ 27 | && apt-get -y install nginx lemonldap-ng cron anacron \ 28 | && echo "LLNG installed" 29 | 30 | RUN echo "#!/bin/sh" > /usr/bin/start.sh && \ 31 | echo "service cron start" >> /usr/bin/start.sh && \ 32 | echo "service anacron start" >> /usr/bin/start.sh && \ 33 | echo 'perl -i -pe '"'"'s@http://auth.example.com/@$ENV{PORTAL}@g'"' /var/lib/lemonldap-ng/conf/lmConf-1.json" >> /usr/bin/start.sh && \ 34 | echo 'perl -i -pe '"'"'s@example.com/@$ENV{SSODOMAIN}$ENV{PORT}/@g'"' /var/lib/lemonldap-ng/conf/lmConf-1.json" >> /usr/bin/start.sh && \ 35 | echo 'sed -i "s/example\.com/${SSODOMAIN}/" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json' >> /usr/bin/start.sh && \ 36 | echo "service lemonldap-ng-fastcgi-server start" >> /usr/bin/start.sh && \ 37 | echo "nginx" >> /usr/bin/start.sh && \ 38 | echo "\ndaemon off;" >> /etc/nginx/nginx.conf && \ 39 | chmod +x /usr/bin/start.sh && \ 40 | echo "start script created" 41 | 42 | RUN cd /etc/nginx/sites-enabled/ && \ 43 | ln -s ../../lemonldap-ng/handler-nginx.conf && \ 44 | ln -s ../../lemonldap-ng/portal-nginx.conf && \ 45 | ln -s ../../lemonldap-ng/manager-nginx.conf && \ 46 | ln -s ../../lemonldap-ng/test-nginx.conf && \ 47 | echo "LLNG conf files installed" 48 | 49 | CMD [ "start.sh" ] 50 | -------------------------------------------------------------------------------- /docker-trunk/debian/8/apache2/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Installation of trunk version of LL::NG 3 | 4 | # Start from Debian Jessie 5 | FROM debian:jessie 6 | MAINTAINER Clément OUDOT 7 | LABEL name="llng-apache2-trunk" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com 12 | 13 | # Update system 14 | RUN apt -y update \ 15 | && apt -y upgrade \ 16 | && apt -y install apache2 libapache2-mod-perl2 libapache2-mod-fcgid \ 17 | libapache-session-perl libnet-ldap-perl libcache-cache-perl \ 18 | libdbi-perl perl-modules libwww-perl libcache-cache-perl \ 19 | libxml-simple-perl libsoap-lite-perl libhtml-template-perl \ 20 | libregexp-assemble-perl libjs-jquery libxml-libxml-perl \ 21 | libcrypt-rijndael-perl libio-string-perl libxml-libxslt-perl \ 22 | libconfig-inifiles-perl libjson-perl libstring-random-perl \ 23 | libemail-date-format-perl libmime-lite-perl libcrypt-openssl-rsa-perl \ 24 | libdigest-hmac-perl libclone-perl libauthen-sasl-perl \ 25 | libnet-cidr-lite-perl libcrypt-openssl-x509-perl libauthcas-perl \ 26 | libtest-pod-perl libtest-mockobject-perl libauthen-captcha-perl \ 27 | libnet-openid-consumer-perl libnet-openid-server-perl \ 28 | libunicode-string-perl libconvert-pem-perl libmouse-perl libplack-perl \ 29 | libglib-perl liblasso-perl yui-compressor dh-systemd libdbd-sqlite3-perl \ 30 | libemail-sender-perl libgd-securityimage-perl libimage-magick-perl \ 31 | && apt-get -y install vim \ 32 | && apt-get -y install git make devscripts \ 33 | && cd /root \ 34 | && git clone https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng.git \ 35 | && cd lemonldap-ng \ 36 | && make debian-install-for-apache \ 37 | && sed -i "s/example\.com/${SSODOMAIN}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/test/index.pl \ 38 | && echo "/var/lib/lemonldap-ng/conf/lmConf-1.js" \ 39 | && sed -i "s/logLevel\s*=\s*warn/logLevel = debug/" /etc/lemonldap-ng/lemonldap-ng.ini \ 40 | && sed -i "s/LogLevel warn/LogLevel debug/" /etc/apache2/apache2.conf \ 41 | && a2ensite handler-apache2.conf portal-apache2.conf manager-apache2.conf test-apache2.conf \ 42 | && a2enmod fcgid perl alias rewrite \ 43 | && rm -rf /tmp/lemonldap-ng-config \ 44 | && rm -fr /var/lib/apt/lists/* 45 | 46 | EXPOSE 80 443 47 | VOLUME ["/var/log/apache2", "/etc/apache2", "/etc/lemonldap-ng", "/var/lib/lemonldap-ng/conf", "/var/lib/lemonldap-ng/sessions", "/var/lib/lemonldap-ng/psessions"] 48 | ENTRYPOINT ["/usr/sbin/apache2ctl", "-D", "FOREGROUND"] 49 | -------------------------------------------------------------------------------- /kubernetes/deploy/k8s-llng-nginx.yaml: -------------------------------------------------------------------------------- 1 | --- 2 | apiVersion: extensions/v1beta1 3 | kind: Deployment 4 | metadata: 5 | name: llng 6 | namespace: auth 7 | spec: 8 | replicas: 1 9 | template: 10 | metadata: 11 | labels: 12 | app: llng 13 | spec: 14 | containers: 15 | - name: k8s-lln-nginx 16 | imagePullPolicy: "Always" 17 | env: 18 | - name: SSODOMAIN 19 | valueFrom: 20 | configMapKeyRef: 21 | name: llng 22 | key: domain 23 | image: /k8s-llng-nginx:v0.0.1 24 | ports: 25 | - name: "http" 26 | containerPort: 80 27 | volumeMounts: 28 | - mountPath: /etc/nginx/sites-available 29 | name: nginxconfavailable 30 | readOnly: false 31 | - mountPath: /etc/nginx/sites-enabled 32 | name: nginxconfenabled 33 | readOnly: false 34 | - mountPath: /var/run/llng-fastcgi-server/llng-fastcgi.sock 35 | name: fastcgisocket 36 | readOnly: false 37 | - name: k8s-lln-fastcgi 38 | imagePullPolicy: "Always" 39 | env: 40 | - name: SSODOMAIN 41 | valueFrom: 42 | configMapKeyRef: 43 | name: llng 44 | key: domain 45 | image: /k8s-llng-fastcgi:v0.0.1 46 | ports: 47 | - name: "http" 48 | containerPort: 80 49 | volumeMounts: 50 | - mountPath: /etc/nginx/sites-available 51 | name: nginxconfavailable 52 | readOnly: false 53 | - mountPath: /etc/nginx/sites-enabled 54 | name: nginxconfenabled 55 | readOnly: false 56 | - mountPath: /var/run/llng-fastcgi-server/llng-fastcgi.sock 57 | name: fastcgisocket 58 | readOnly: false 59 | volumes: 60 | - name: nginxconfavailable 61 | emptyDir: 62 | medium: Memory 63 | - name: fastcgisocket 64 | emptyDir: 65 | medium: Memory 66 | - name: nginxconfenabled 67 | emptyDir: 68 | medium: Memory 69 | -------------------------------------------------------------------------------- /Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:trixie-slim 2 | LABEL org.opencontainers.image.authors="Clément OUDOT" \ 3 | name="lemonldap-ng-nginx" \ 4 | version="v2.0" 5 | 6 | ENV SSODOMAIN=example.com \ 7 | LOGLEVEL=info \ 8 | DEBIAN_FRONTEND=noninteractive 9 | 10 | # Keep documentation files for Lemonldap that are normally removed by the 11 | # debian-slim image 12 | COPY lemonldap.dpkg.cfg /etc/dpkg/dpkg.cfg.d/lemonldap 13 | 14 | RUN echo "# Install LemonLDAP::NG source repo" && \ 15 | apt -y update && \ 16 | apt -y install wget apt-transport-https gnupg dumb-init curl && \ 17 | curl https://lemonldap-ng.org/lemonldap-debian-packages-pub.gpg | gpg --dearmor > /usr/share/keyrings/lemonldap-debian-packages-pub.gpg && \ 18 | echo "deb [arch=amd64 signed-by=/usr/share/keyrings/lemonldap-debian-packages-pub.gpg] https://lemonldap-ng.org/deb 2.0 main" >/etc/apt/sources.list.d/lemonldap-ng.list 19 | 20 | RUN apt -y update && \ 21 | echo "# Install LemonLDAP::NG packages" && \ 22 | apt -y install nginx lemonldap-ng cron anacron liblasso-perl libio-string-perl && \ 23 | echo "# Install LemonLDAP::NG TOTP requirements" && \ 24 | apt -y install libconvert-base32-perl libdigest-hmac-perl && \ 25 | echo "# Install LemonLDAP::NG WebAuthn requirements" && \ 26 | apt -y install libauthen-webauthn-perl && \ 27 | echo "# Install some DB drivers" && \ 28 | apt -y install libdbd-mysql-perl libdbd-pg-perl && \ 29 | echo "# Install vim required for lmConfigEditor" && \ 30 | apt -y install vim && \ 31 | echo "\ndaemon off;" >> /etc/nginx/nginx.conf 32 | 33 | RUN echo "# Clean up image" && \ 34 | apt clean && \ 35 | apt autoremove --yes && \ 36 | rm -rf /var/lib/{apt,dpkg,cache,log}/ 37 | 38 | COPY docker-entrypoint.sh / 39 | 40 | RUN echo '# Copy orignal configuration' && \ 41 | cp -a /etc/lemonldap-ng /etc/lemonldap-ng-orig && \ 42 | cp -a /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/conf-orig && \ 43 | cp -a /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/sessions-orig && \ 44 | cp -a /var/lib/lemonldap-ng/psessions /var/lib/lemonldap-ng/psessions-orig 45 | 46 | RUN echo "# Reverse proxy clean up" && \ 47 | rm /etc/lemonldap-ng-orig/*-apache2.conf && \ 48 | rm /etc/nginx/sites-enabled/default && \ 49 | mkdir /etc/nginx/sites-enabled-orig && \ 50 | mv /etc/lemonldap-ng-orig/*-nginx.conf /etc/nginx/sites-enabled-orig/ && \ 51 | cp /etc/nginx/sites-enabled-orig/* /etc/nginx/sites-enabled/ 52 | 53 | RUN echo "# Configure nginx to log to standard streams" && \ 54 | ln -sf /dev/stdout /var/log/nginx/access.log && \ 55 | ln -sf /dev/stderr /var/log/nginx/error.log 56 | 57 | VOLUME ["/etc/lemonldap-ng","/var/lib/lemonldap-ng/conf", "/var/lib/lemonldap-ng/sessions", "/var/lib/lemonldap-ng/psessions", "/etc/nginx/sites-enabled/"] 58 | 59 | ENTRYPOINT ["dumb-init","--","/bin/sh", "/docker-entrypoint.sh"] 60 | -------------------------------------------------------------------------------- /docker-trunk/debian/8/nginx/Dockerfile: -------------------------------------------------------------------------------- 1 | # Dockerfile for LemonLDAP::NG 2 | # Installation of trunk version of LL::NG 3 | 4 | # Start from Debian Jessie 5 | FROM debian:jessie 6 | MAINTAINER Xavier Guimard 7 | LABEL name="llng-nginx-trunk" \ 8 | version="v0.0.1" 9 | 10 | # Change SSO DOMAIN here 11 | ENV SSODOMAIN example.com 12 | ENV DUMBINITVERSION 1.2.0 13 | 14 | COPY etc.supervisor.conf.d.supervisord.conf / 15 | 16 | # Update system and install LL::NG dependencies 17 | RUN echo "deb http://ftp.debian.org/debian jessie-backports main" > /etc/apt/sources.list.d/jessie-backports.list \ 18 | && apt-get -y update \ 19 | && apt -y install wget apt-transport-https \ 20 | && apt -y dist-upgrade \ 21 | && echo "# Install Dumb-init" \ 22 | && wget https://github.com/Yelp/dumb-init/releases/download/v${DUMBINITVERSION}/dumb-init_${DUMBINITVERSION}_amd64.deb \ 23 | && dpkg -i dumb-init_${DUMBINITVERSION}_amd64.deb \ 24 | && apt install -f -y \ 25 | && apt-get -y install nginx-extras supervisor libapache-session-perl libnet-ldap-perl \ 26 | libcache-cache-perl libdbi-perl perl-modules libwww-perl libcache-cache-perl \ 27 | libxml-simple-perl libsoap-lite-perl libhtml-template-perl \ 28 | libregexp-assemble-perl libjs-jquery libxml-libxml-perl libcrypt-rijndael-perl \ 29 | libio-string-perl libxml-libxslt-perl libconfig-inifiles-perl libjson-perl \ 30 | libstring-random-perl libemail-date-format-perl libmime-lite-perl \ 31 | libcrypt-openssl-rsa-perl libdigest-hmac-perl libclone-perl libauthen-sasl-perl \ 32 | libnet-cidr-lite-perl libcrypt-openssl-x509-perl libauthcas-perl libtest-pod-perl \ 33 | libtest-mockobject-perl libauthen-captcha-perl libnet-openid-consumer-perl \ 34 | libnet-openid-server-perl libunicode-string-perl libconvert-pem-perl \ 35 | libmouse-perl libplack-perl libglib-perl liblasso-perl yui-compressor dh-systemd \ 36 | vim git make devscripts libdbd-sqlite3-perl libemail-sender-perl \ 37 | libgd-securityimage-perl libimage-magick-perl libconvert-base32-perl \ 38 | && apt-get install -y -t jessie-backports debhelper \ 39 | && rm -rf /var/lib/apt/lists/* \ 40 | && echo "# Get trunk version of LL::NG" \ 41 | && cd /root \ 42 | && git clone https://gitlab.ow2.org/lemonldap-ng/lemonldap-ng.git \ 43 | && echo "# Install LL::NG" \ 44 | && cd lemonldap-ng \ 45 | && make debian-install-for-nginx \ 46 | && rm -rf /tmp/*lemonldap* /root/lemonldap/* \ 47 | && mv /etc.supervisor.conf.d.supervisord.conf /etc/supervisor/conf.d/supervisord.conf \ 48 | && echo "# Change SSO Domain" \ 49 | && sed -i "s/example\.com/${SSODOMAIN}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/test/index.pl \ 50 | && echo "#/var/lib/lemonldap-ng/conf/lmConf-1.js" \ 51 | && echo "# Set debug mode" \ 52 | && sed -i "s/logLevel\s*=\s*warn/logLevel = debug/" /etc/lemonldap-ng/lemonldap-ng.ini \ 53 | && echo "# Enable sites" \ 54 | && cd /etc/nginx/sites-enabled \ 55 | && ln -s ../sites-available/portal-nginx.conf \ 56 | && ln -s ../sites-available/manager-nginx.conf \ 57 | && ln -s ../sites-available/handler-nginx.conf \ 58 | && ln -s ../sites-available/test-nginx.conf \ 59 | && echo "# Enable headers and custom logs" \ 60 | && perl -i -pe 's/#// if(/nginx-lua-headers/)' /etc/lemonldap-ng/test-nginx.conf \ 61 | && perl -i -pe 's/#// if(/access\.log/)' /etc/lemonldap-ng/handler-nginx.conf \ 62 | && echo "# No daemon" \ 63 | && echo "\ndaemon off;" >> /etc/nginx/nginx.conf \ 64 | && echo "# Create run directory for llng-fastcgi-server" \ 65 | && mkdir -p /var/run/llng-fastcgi-server/ \ 66 | && chown www-data:www-data /var/run/llng-fastcgi-server/ 67 | 68 | EXPOSE 80 443 69 | VOLUME ["/var/log/nginx", "/etc/lemonldap-ng", "/var/lib/lemonldap-ng/conf", "/var/lib/lemonldap-ng/sessions", "/var/lib/lemonldap-ng/psessions"] 70 | ENTRYPOINT ["dumb-init","--","/usr/bin/supervisord", "-c", "/etc/supervisor/conf.d/supervisord.conf"] 71 | -------------------------------------------------------------------------------- /docker-entrypoint.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | service cron start 3 | service anacron start 4 | 5 | if [ ! -z ${PORT} ]; then 6 | echo "# Changing nginx port to ${PORT}" 7 | sed -i -e "s/listen 80;/listen ${PORT};/g" /etc/nginx/sites-enabled-orig/* 8 | fi 9 | 10 | if [ "${IPV4_ONLY}" = true ]; then 11 | echo "# Disabling IPV6 in nginx" 12 | sed -i -e "/listen \[::\]:80;/d" /etc/nginx/sites-enabled-orig/* 13 | fi 14 | 15 | for PRESERVEFILE in ${PRESERVEFILES} ; 16 | do 17 | if [ ! "$(ls -A ${PRESERVEFILE} &>/dev/null)" ]; then 18 | echo "# Restore ${PRESERVEFILE} directory" 19 | chown -R www-data:www-data ${PRESERVEFILE} 20 | cp -a ${PRESERVEFILE}-orig/* ${PRESERVEFILE}/ 21 | fi 22 | done 23 | 24 | if [ ! -z ${PORTAL_HOSTNAME+x} ]; then 25 | sed -i -e "s/auth.example.com/${PORTAL_HOSTNAME}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json /etc/nginx/sites-enabled/* 26 | fi 27 | if [ ! -z ${MANAGER_HOSTNAME+x} ]; then 28 | sed -i -e "s/manager.example.com/${MANAGER_HOSTNAME}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json /etc/nginx/sites-enabled/* 29 | fi 30 | if [ ! -z ${HANDLER_HOSTNAME+x} ]; then 31 | sed -i -e "s/reload.example.com/${HANDLER_HOSTNAME}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json /etc/nginx/sites-enabled/* 32 | fi 33 | if [ ! -z ${TEST1_HOSTNAME+x} ]; then 34 | sed -i -e "s/test1.example.com/${TEST1_HOSTNAME}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json /etc/nginx/sites-enabled/* 35 | fi 36 | if [ ! -z ${TEST2_HOSTNAME+x} ]; then 37 | sed -i -e "s/test2.example.com/${TEST2_HOSTNAME}/g" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json /etc/nginx/sites-enabled/* 38 | fi 39 | 40 | if [ ! -z ${PROXY_RANGE+x} ]; then 41 | sed -i -e "s#.*set_real_ip_from.*# set_real_ip_from ${PROXY_RANGE};#g" /etc/nginx/sites-enabled/* 42 | sed -i -e "s#.*real_ip_header.*# real_ip_header X-Forwarded-For;#g" /etc/nginx/sites-enabled/* 43 | fi 44 | 45 | sed -i "s/\.example\.com/\.${SSODOMAIN}/" /etc/lemonldap-ng/* /var/lib/lemonldap-ng/conf/lmConf-1.json /etc/nginx/sites-enabled/* 46 | 47 | # Logging options 48 | sed -i -e "s/^logLevel.*/logLevel=${LOGLEVEL}/" /etc/lemonldap-ng/lemonldap-ng.ini 49 | if ! grep -q '^logger' /etc/lemonldap-ng/lemonldap-ng.ini ; then 50 | sed -i -e '/^logLevel/alogger = Lemonldap::NG::Common::Logger::Std' /etc/lemonldap-ng/lemonldap-ng.ini 51 | fi 52 | 53 | sed -i -e 's/^;checkTime.*/checkTime = 1/' /etc/lemonldap-ng/lemonldap-ng.ini 54 | 55 | if [ ! -z ${FASTCGI_LISTEN_PORT+x} ]; then 56 | echo "Remove the SOCKET variable" 57 | sed -i -e "s|^SOCKET=/run/llng-fastcgi-server/llng-fastcgi.sock|#SOCKET=/run/llng-fastcgi-server/llng-fastcgi.sock|" /etc/default/lemonldap-ng-fastcgi-server 58 | 59 | echo "Add LISTEN variable" 60 | echo "# Listen" >> /etc/default/lemonldap-ng-fastcgi-server 61 | echo "LISTEN=0.0.0.0:$FASTCGI_LISTEN_PORT" >> /etc/default/lemonldap-ng-fastcgi-server 62 | 63 | echo "Update NGinx configuration from UNIX socket to TCP socket" 64 | sed -i -e "s|fastcgi_pass unix:/var/run/llng-fastcgi-server/llng-fastcgi.sock|fastcgi_pass 0.0.0.0:$FASTCGI_LISTEN_PORT|" /etc/nginx/sites-enabled/*-nginx.conf 65 | 66 | echo "Update upstream llng fastcgi to tcpsocket" 67 | sed -i -e "s|unix:/var/run/llng-fastcgi-server/llng-fastcgi.sock|0.0.0.0:$FASTCGI_LISTEN_PORT|" /etc/nginx/sites-enabled/portal-nginx.conf 68 | 69 | echo "Exporting environment variables" 70 | . /etc/default/lemonldap-ng-fastcgi-server 71 | export SOCKET LISTEN PID USER GROUP 72 | 73 | echo "Starting fast-cgi-server" 74 | /etc/init.d/lemonldap-ng-fastcgi-server start 75 | else 76 | echo "Exporting environment variables" 77 | . /etc/default/lemonldap-ng-fastcgi-server 78 | export SOCKET LISTEN PID USER GROUP 79 | 80 | echo "Creating directory for socket" 81 | if [ ! -z ${SOCKET+x} ]; then 82 | mkdir -p "$(dirname $SOCKET)" 83 | chown www-data "$(dirname $SOCKET)" 84 | fi 85 | 86 | echo "Starting fast-cgi-server" 87 | /usr/sbin/llng-fastcgi-server --foreground& 88 | fi 89 | 90 | echo "Starting nginx" 91 | nginx 92 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # LemonLDAP::NG in Docker 2 | 3 | ![LL::NG+Docker](http://lemonldap-ng.org/_media/documentation/lemonldap-ng-docker.png) 4 | 5 | ## Build the image 6 | 7 | Use the docker build command: 8 | 9 | ``` 10 | sudo docker buildx build -t lemonldap-ng:latest . 11 | ``` 12 | 13 | > [!NOTE] 14 | > If you would like to deploy the container on port `:80` you will need to use `sudo` to build and deploy the image. 15 | > Building and deploying without `sudo` can be used to deploy containers on port > 1024. 16 | 17 | ## Run the image 18 | 19 | The image will run LemonLDAP::NG in demo mode (see http://lemonldap-ng.org/documentation/latest/authdemo). 20 | 21 | Add auth.example.com/manager.example.com/test1.example.com/test2.example.com to /etc/hosts on the host 22 | ``` 23 | echo "127.0.0.1 auth.example.com manager.example.com reload.example.com test1.example.com test2.example.com" | sudo tee -a /etc/hosts 24 | ``` 25 | Map the container port 80 to host port 80 (option -p) when you run the container to be able to access it 26 | ``` 27 | sudo docker run -d -p 80:80 lemonldapng/lemonldap-ng:latest 28 | ``` 29 | Then connect to http://auth.example.com with your browser and log in with dwho/dwho. 30 | 31 | ## Configuration 32 | 33 | You may use the following environment variables to configure the container 34 | 35 | * `SSODOMAIN`: change the default `example.com` domain with something else 36 | * `LOGLEVEL`: Set LLNG verbosity (for `docker logs`). Possible values: `error`, `warn`, `notice`, `info`, `debug` 37 | * `FASTCGI_LISTEN_PORT`: Listen on a port instead of using a UNIX socket. If you use this variable, you will probably want to map this port on your host. 38 | * `PROXY_RANGE`: if LLNG is running behind a reverse proxy, change the nginx configurations for `set_real_ip_from`. `PROXY_RANGE` will be the IP range of your proxy. ex: `172.0.0.0/8` 39 | * `PRESERVEFILES`: define folders for llng configuration that would need to be preserved, if empty folders are mounted they will be populated with original default configurations 40 | 41 | You can also finely set the hostnames for each site 42 | 43 | * `PORTAL_HOSTNAME`: change the default `auth.example.com` domain with something else 44 | * `MANAGER_HOSTNAME`: change the default `manager.example.com` domain with something else 45 | * `HANDLER_HOSTNAME`: change the default `reload.example.com` domain with something else 46 | * `TEST1_HOSTNAME`: change the default `test1.example.com` domain with something else 47 | * `TEST2_HOSTNAME`: change the default `test2.example.com` domain with something else 48 | 49 | Customisations to the themes such as logos, templates etc. can be listed in the following folders. The name of the custom theme folder in `htdocs/static` or `templates` are shared. You can use the following command to configure the variable `portalSkin` or modify `lmConfX.json`: `/usr/share/lemonldap-ng/bin/lemonldap-ng-cli set portalSkin CustomTheme` 50 | 51 | * /usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme 52 | * /usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme/css 53 | * /usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme/js 54 | * /usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme/images 55 | * /usr/share/lemonldap-ng/portal/templates/CustomTheme 56 | 57 | The custom Perl plugins can be provided in the following locations with the code inserting the following `Package Lemonldap::NG::Portal:Plugins:CustomFolder` for plugins for examples: 58 | 59 | * /usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin 60 | * /usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister 61 | * /usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb 62 | * /usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth 63 | * /usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha 64 | * /usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab 65 | 66 | Example: 67 | 68 | ``` 69 | sudo docker run -d --name lemonldap-ng -e SSODOMAIN=example.com -e LOGLEVEL=debug -p 80:80 lemonldapng/lemonldap-ng:latest 70 | ``` 71 | 72 | Command to deploy fast-cgi-server and nginx connecting via port 9000: 73 | 74 | ``` 75 | sudo docker run -d \ 76 | --name lemonldap-ng \ 77 | -e SSODOMAIN=example.com \ 78 | -e PORTAL_HOSTNAME=auth.example.com \ 79 | -e MANAGER_HOSTNAME=manager.example.com \ 80 | -e HANDLER_HOSTNAME=reload.example.com \ 81 | -e TEST1_HOSTNAME=test1.example.com \ 82 | -e TEST2_HOSTNAME=test2.example.com \ 83 | -e PRESERVEFILES="/etc/lemonldap-ng /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/psessions /etc/nginx/sites-enabled" \ 84 | -e LOGLEVEL=debug \ 85 | -e FASTCGI_LISTEN_PORT=9000 \ 86 | -e PORT=80 \ 87 | -e IPV4_ONLY=true \ 88 | -p 80:80 \ 89 | -p 9000:9000 \ 90 | -v ./llng/etc:/etc/lemonldap-ng \ 91 | -v ./llng/var-conf:/var/lib/lemonldap-ng/conf \ 92 | -v ./llng/var-sessions:/var/lib/lemonldap-ng/sessions \ 93 | -v ./llng/var-psessions:/var/lib/lemonldap-ng/psessions \ 94 | -v ./llng/theme:/usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme \ 95 | -v ./llng/template:/usr/share/lemonldap-ng/portal/templates/CustomTheme \ 96 | -v ./llng/plugins:/usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin \ 97 | -v ./llng/register:/usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister \ 98 | -v ./llng/userdb:/usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb \ 99 | -v ./llng/auth:/usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth \ 100 | -v ./llng/captcha:/usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha \ 101 | -v ./llng/menutab:/usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab \ 102 | -v ./llng/nginx:/etc/nginx/sites-enabled \ 103 | lemonldapng/lemonldap-ng:latest 104 | ``` 105 | 106 | Command to deploy fast-cgi-server and nginx with socket: 107 | 108 | ``` 109 | sudo docker run -d \ 110 | --name lemonldap-ng \ 111 | -e SSODOMAIN=example.com \ 112 | -e PORTAL_HOSTNAME=auth.example.com \ 113 | -e MANAGER_HOSTNAME=manager.example.com \ 114 | -e HANDLER_HOSTNAME=reload.example.com \ 115 | -e TEST1_HOSTNAME=test1.example.com \ 116 | -e TEST2_HOSTNAME=test2.example.com \ 117 | -e PRESERVEFILES="/etc/lemonldap-ng /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/psessions /etc/nginx/sites-enabled" \ 118 | -e LOGLEVEL=debug \ 119 | -e PORT=80 \ 120 | -e IPV4_ONLY=true \ 121 | -p 80:80 \ 122 | -v ./llng/etc:/etc/lemonldap-ng \ 123 | -v ./llng/var-conf:/var/lib/lemonldap-ng/conf \ 124 | -v ./llng/var-sessions:/var/lib/lemonldap-ng/sessions \ 125 | -v ./llng/var-psessions:/var/lib/lemonldap-ng/psessions \ 126 | -v ./llng/theme:/usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme \ 127 | -v ./llng/template:/usr/share/lemonldap-ng/portal/templates/CustomTheme \ 128 | -v ./llng/plugins:/usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin \ 129 | -v ./llng/register:/usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister \ 130 | -v ./llng/userdb:/usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb \ 131 | -v ./llng/auth:/usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth \ 132 | -v ./llng/captcha:/usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha \ 133 | -v ./llng/menutab:/usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab \ 134 | -v ./llng/nginx:/etc/nginx/sites-enabled \ 135 | lemonldapng/lemonldap-ng:latest 136 | ``` 137 | Don't forget to modify your `/etc/hosts` accordingly 138 | 139 | ### SELinux 140 | 141 | To deploy containers on SELinux distributions you can use the following: 142 | 143 | ``` 144 | docker compose -f docker-compose-selinux.yaml up -d 145 | ``` 146 | 147 | or run the following command(port deployment): 148 | 149 | ``` 150 | docker run -d \ 151 | --name lemonldap-ng 152 | -e SSODOMAIN=example.com \ 153 | -e PORTAL_HOSTNAME=auth.example.com \ 154 | -e MANAGER_HOSTNAME=manager.example.com \ 155 | -e HANDLER_HOSTNAME=reload.example.com \ 156 | -e TEST1_HOSTNAME=test1.example.com \ 157 | -e TEST2_HOSTNAME=test2.example.com \ 158 | -e PRESERVEFILES="/etc/lemonldap-ng /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/psessions /etc/nginx/sites-enabled" \ 159 | -e LOGLEVEL=debug \ 160 | -e FASTCGI_LISTEN_PORT=9000 \ 161 | -e PORT=8080 \ 162 | -e IPV4_ONLY=true \ 163 | -p 8080:8080 \ 164 | -p 9000:9000 \ 165 | -v ./llng/etc:/etc/lemonldap-ng:Z \ 166 | -v ./llng/var-conf:/var/lib/lemonldap-ng/conf:Z \ 167 | -v ./llng/var-sessions:/var/lib/lemonldap-ng/sessions:Z \ 168 | -v ./llng/var-psessions:/var/lib/lemonldap-ng/psessions:Z \ 169 | -v ./llng/theme:/usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme:Z \ 170 | -v ./llng/template:/usr/share/lemonldap-ng/portal/templates/CustomTheme:Z \ 171 | -v ./llng/plugins:/usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin:Z \ 172 | -v ./llng/register:/usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister:Z \ 173 | -v ./llng/userdb:/usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb:Z \ 174 | -v ./llng/auth:/usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth:Z \ 175 | -v ./llng/captcha:/usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha:Z \ 176 | -v ./llng/menutab:/usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab:Z \ 177 | -v ./llng/nginx:/etc/nginx/sites-enabled:Z \ 178 | lemonldapng/lemonldap-ng:latest 179 | ``` 180 | 181 | or run the following command(socket deployment): 182 | 183 | ``` 184 | docker run -d \ 185 | --name lemonldap-ng 186 | -e SSODOMAIN=example.com \ 187 | -e PORTAL_HOSTNAME=auth.example.com \ 188 | -e MANAGER_HOSTNAME=manager.example.com \ 189 | -e HANDLER_HOSTNAME=reload.example.com \ 190 | -e TEST1_HOSTNAME=test1.example.com \ 191 | -e TEST2_HOSTNAME=test2.example.com \ 192 | -e PRESERVEFILES="/etc/lemonldap-ng /var/lib/lemonldap-ng/conf /var/lib/lemonldap-ng/sessions /var/lib/lemonldap-ng/psessions /etc/nginx/sites-enabled" \ 193 | -e LOGLEVEL=debug \ 194 | -e PORT=8080 \ 195 | -e IPV4_ONLY=true \ 196 | -p 8080:8080 \ 197 | -v ./llng/etc:/etc/lemonldap-ng:Z \ 198 | -v ./llng/var-conf:/var/lib/lemonldap-ng/conf:Z \ 199 | -v ./llng/var-sessions:/var/lib/lemonldap-ng/sessions:Z \ 200 | -v ./llng/var-psessions:/var/lib/lemonldap-ng/psessions:Z \ 201 | -v ./llng/theme:/usr/share/lemonldap-ng/portal/htdocs/static/CustomTheme:Z \ 202 | -v ./llng/template:/usr/share/lemonldap-ng/portal/templates/CustomTheme:Z \ 203 | -v ./llng/plugins:/usr/share/perl5/Lemonldap/NG/Portal/Plugins/CustomPlugin:Z \ 204 | -v ./llng/register:/usr/share/perl5/Lemonldap/NG/Portal/Register/CustomRegister:Z \ 205 | -v ./llng/userdb:/usr/share/perl5/Lemonldap/NG/Portal/UserDB/CustomUserdb:Z \ 206 | -v ./llng/auth:/usr/share/perl5/Lemonldap/NG/Portal/Auth/CustomAuth:Z \ 207 | -v ./llng/captcha:/usr/share/perl5/Lemonldap/NG/Portal/Captcha/CustomCaptcha:Z \ 208 | -v ./llng/menutab:/usr/share/perl5/Lemonldap/NG/Portal/MenuTab/CustomMenuTab:Z \ 209 | -v ./llng/nginx:/etc/nginx/sites-enabled:Z \ 210 | lemonldapng/lemonldap-ng:latest 211 | ``` 212 | 213 | ## Reverse proxy configuration 214 | 215 | You can use proxy pass functionality in httpd(Apache2) to redirect traffic to lemonldap-ng with the following configuration: 216 | 217 | HTTP: 218 | ``` 219 | 220 | ProxyPreserveHost On 221 | ProxyRequests Off 222 | CustomLog /var/log/httpd/llng.log combined 223 | ServerName example.com 224 | ServerAlias auth.example.com manager.example.com reload.example.com test1.example.com test2.example.com 225 | ProxyPass / http://127.0.0.1:8080/ 226 | ProxyPassReverse / http://127.0.0.1:8080/ 227 | 228 | ``` 229 | 230 | HTTPS: 231 | ``` 232 | 233 | ServerName example.com 234 | ServerAlias auth.example.com manager.example.com reload.example.com test1.example.com test2.example.com 235 | 236 | RewriteEngine On 237 | RewriteCond %{HTTPS} off 238 | RewriteRule ^(.*)$ https://%{HTTP_HOST}%{REQUEST_URI} [L,R=301] 239 | 240 | 241 | 242 | ServerName example.com 243 | CustomLog /var/log/httpd/llng.log combined 244 | 245 | SSLEngine on 246 | SSLCertificateChainFile "/path/to/example.com.cacert.cert" 247 | SSLCertificateFile "/path/to/example.com.cert" 248 | SSLCertificateKeyFile "/path/to/example.com.key" 249 | 250 | ProxyPreserveHost On 251 | ProxyRequests Off 252 | ProxyPass / http://127.0.0.1:8080/ 253 | ProxyPassReverse / http://127.0.0.1:8080/ 254 | 255 | ``` 256 | 257 | For SELinux we will need to allow the redirect of httpd traffic to the lemonldap-ng docker container (:80->:8080) 258 | 259 | ``` 260 | sudo setsebool -P httpd_can_network_relay on 261 | ``` 262 | 263 | ### Using LLNG Handler 264 | 265 | LLNG provides functionality to redirect authentication via the Handler before redirecting the user to the application being protected. We provide the ability to mount nginx configuration by mounting a volume to the `/etc/nginx/sites-enabled/` folder and restarting the container. Example nginx configuration can be found [here](https://lemonldap-ng.org/documentation/latest/configvhost.html#reverse-proxy-1). 266 | 267 | ## Cron session purge 268 | 269 | The sessions in lemonldap-ng need to be purged on a regular basis, we will need to add the cronjobs using the command `crontab -e` for the following jobs. 270 | 271 | ``` 272 | # Lemonldap::NG::Handler Session Purge 273 | 1 * * * * docker exec -it llng bash -c "[ -x /usr/share/lemonldap-ng/bin/purgeLocalCache ] && if [ ! -d /run/systemd/system ]; then /usr/share/lemonldap-ng/bin/purgeLocalCache; fi" 274 | # Lemonldap::NG::Portal Session Purge 275 | 7 * * * * docker exec -it llng bash -c "[ -x /usr/share/lemonldap-ng/bin/purgeCentralCache ] && if [ ! -d /run/systemd/system ]; then /usr/share/lemonldap-ng/bin/purgeCentralCache; fi" 276 | ``` 277 | 278 | > [!NOTE] 279 | > If the build and deployment were conducted using `sudo` make sure to do the same for the `crontab` command. 280 | 281 | ## Podman 282 | 283 | Simply swapping out `docker` with `podman` on the all the commands listed in this README. However you will be required to create volumes manually before executing the command or the compose file. 284 | 285 | ``` 286 | mkdir -p ./llng 287 | mkdir -p ./llng/etc 288 | mkdir -p ./llng/var-conf 289 | mkdir -p ./llng/var-sessions 290 | mkdir -p ./llng/var-psessions 291 | mkdir -p ./llng/theme 292 | mkdir -p ./llng/template 293 | mkdir -p ./llng/plugins 294 | mkdir -p ./llng/register 295 | mkdir -p ./llng/userdb 296 | mkdir -p ./llng/auth 297 | mkdir -p ./llng/captcha 298 | mkdir -p ./llng/menutab 299 | mkdir -p ./llng/nginx 300 | ``` 301 | 302 | ## Docker hub 303 | 304 | See also https://hub.docker.com/r/lemonldapng/lemonldap-ng/ 305 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | GNU GENERAL PUBLIC LICENSE 2 | Version 2, June 1991 3 | 4 | Copyright (C) 1989, 1991 Free Software Foundation, Inc., 5 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA 6 | Everyone is permitted to copy and distribute verbatim copies 7 | of this license document, but changing it is not allowed. 8 | 9 | Preamble 10 | 11 | The licenses for most software are designed to take away your 12 | freedom to share and change it. By contrast, the GNU General Public 13 | License is intended to guarantee your freedom to share and change free 14 | software--to make sure the software is free for all its users. This 15 | General Public License applies to most of the Free Software 16 | Foundation's software and to any other program whose authors commit to 17 | using it. (Some other Free Software Foundation software is covered by 18 | the GNU Lesser General Public License instead.) You can apply it to 19 | your programs, too. 20 | 21 | When we speak of free software, we are referring to freedom, not 22 | price. Our General Public Licenses are designed to make sure that you 23 | have the freedom to distribute copies of free software (and charge for 24 | this service if you wish), that you receive source code or can get it 25 | if you want it, that you can change the software or use pieces of it 26 | in new free programs; and that you know you can do these things. 27 | 28 | To protect your rights, we need to make restrictions that forbid 29 | anyone to deny you these rights or to ask you to surrender the rights. 30 | These restrictions translate to certain responsibilities for you if you 31 | distribute copies of the software, or if you modify it. 32 | 33 | For example, if you distribute copies of such a program, whether 34 | gratis or for a fee, you must give the recipients all the rights that 35 | you have. You must make sure that they, too, receive or can get the 36 | source code. And you must show them these terms so they know their 37 | rights. 38 | 39 | We protect your rights with two steps: (1) copyright the software, and 40 | (2) offer you this license which gives you legal permission to copy, 41 | distribute and/or modify the software. 42 | 43 | Also, for each author's protection and ours, we want to make certain 44 | that everyone understands that there is no warranty for this free 45 | software. If the software is modified by someone else and passed on, we 46 | want its recipients to know that what they have is not the original, so 47 | that any problems introduced by others will not reflect on the original 48 | authors' reputations. 49 | 50 | Finally, any free program is threatened constantly by software 51 | patents. We wish to avoid the danger that redistributors of a free 52 | program will individually obtain patent licenses, in effect making the 53 | program proprietary. To prevent this, we have made it clear that any 54 | patent must be licensed for everyone's free use or not licensed at all. 55 | 56 | The precise terms and conditions for copying, distribution and 57 | modification follow. 58 | 59 | GNU GENERAL PUBLIC LICENSE 60 | TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION 61 | 62 | 0. This License applies to any program or other work which contains 63 | a notice placed by the copyright holder saying it may be distributed 64 | under the terms of this General Public License. The "Program", below, 65 | refers to any such program or work, and a "work based on the Program" 66 | means either the Program or any derivative work under copyright law: 67 | that is to say, a work containing the Program or a portion of it, 68 | either verbatim or with modifications and/or translated into another 69 | language. (Hereinafter, translation is included without limitation in 70 | the term "modification".) Each licensee is addressed as "you". 71 | 72 | Activities other than copying, distribution and modification are not 73 | covered by this License; they are outside its scope. The act of 74 | running the Program is not restricted, and the output from the Program 75 | is covered only if its contents constitute a work based on the 76 | Program (independent of having been made by running the Program). 77 | Whether that is true depends on what the Program does. 78 | 79 | 1. You may copy and distribute verbatim copies of the Program's 80 | source code as you receive it, in any medium, provided that you 81 | conspicuously and appropriately publish on each copy an appropriate 82 | copyright notice and disclaimer of warranty; keep intact all the 83 | notices that refer to this License and to the absence of any warranty; 84 | and give any other recipients of the Program a copy of this License 85 | along with the Program. 86 | 87 | You may charge a fee for the physical act of transferring a copy, and 88 | you may at your option offer warranty protection in exchange for a fee. 89 | 90 | 2. You may modify your copy or copies of the Program or any portion 91 | of it, thus forming a work based on the Program, and copy and 92 | distribute such modifications or work under the terms of Section 1 93 | above, provided that you also meet all of these conditions: 94 | 95 | a) You must cause the modified files to carry prominent notices 96 | stating that you changed the files and the date of any change. 97 | 98 | b) You must cause any work that you distribute or publish, that in 99 | whole or in part contains or is derived from the Program or any 100 | part thereof, to be licensed as a whole at no charge to all third 101 | parties under the terms of this License. 102 | 103 | c) If the modified program normally reads commands interactively 104 | when run, you must cause it, when started running for such 105 | interactive use in the most ordinary way, to print or display an 106 | announcement including an appropriate copyright notice and a 107 | notice that there is no warranty (or else, saying that you provide 108 | a warranty) and that users may redistribute the program under 109 | these conditions, and telling the user how to view a copy of this 110 | License. (Exception: if the Program itself is interactive but 111 | does not normally print such an announcement, your work based on 112 | the Program is not required to print an announcement.) 113 | 114 | These requirements apply to the modified work as a whole. If 115 | identifiable sections of that work are not derived from the Program, 116 | and can be reasonably considered independent and separate works in 117 | themselves, then this License, and its terms, do not apply to those 118 | sections when you distribute them as separate works. But when you 119 | distribute the same sections as part of a whole which is a work based 120 | on the Program, the distribution of the whole must be on the terms of 121 | this License, whose permissions for other licensees extend to the 122 | entire whole, and thus to each and every part regardless of who wrote it. 123 | 124 | Thus, it is not the intent of this section to claim rights or contest 125 | your rights to work written entirely by you; rather, the intent is to 126 | exercise the right to control the distribution of derivative or 127 | collective works based on the Program. 128 | 129 | In addition, mere aggregation of another work not based on the Program 130 | with the Program (or with a work based on the Program) on a volume of 131 | a storage or distribution medium does not bring the other work under 132 | the scope of this License. 133 | 134 | 3. You may copy and distribute the Program (or a work based on it, 135 | under Section 2) in object code or executable form under the terms of 136 | Sections 1 and 2 above provided that you also do one of the following: 137 | 138 | a) Accompany it with the complete corresponding machine-readable 139 | source code, which must be distributed under the terms of Sections 140 | 1 and 2 above on a medium customarily used for software interchange; or, 141 | 142 | b) Accompany it with a written offer, valid for at least three 143 | years, to give any third party, for a charge no more than your 144 | cost of physically performing source distribution, a complete 145 | machine-readable copy of the corresponding source code, to be 146 | distributed under the terms of Sections 1 and 2 above on a medium 147 | customarily used for software interchange; or, 148 | 149 | c) Accompany it with the information you received as to the offer 150 | to distribute corresponding source code. (This alternative is 151 | allowed only for noncommercial distribution and only if you 152 | received the program in object code or executable form with such 153 | an offer, in accord with Subsection b above.) 154 | 155 | The source code for a work means the preferred form of the work for 156 | making modifications to it. For an executable work, complete source 157 | code means all the source code for all modules it contains, plus any 158 | associated interface definition files, plus the scripts used to 159 | control compilation and installation of the executable. However, as a 160 | special exception, the source code distributed need not include 161 | anything that is normally distributed (in either source or binary 162 | form) with the major components (compiler, kernel, and so on) of the 163 | operating system on which the executable runs, unless that component 164 | itself accompanies the executable. 165 | 166 | If distribution of executable or object code is made by offering 167 | access to copy from a designated place, then offering equivalent 168 | access to copy the source code from the same place counts as 169 | distribution of the source code, even though third parties are not 170 | compelled to copy the source along with the object code. 171 | 172 | 4. You may not copy, modify, sublicense, or distribute the Program 173 | except as expressly provided under this License. Any attempt 174 | otherwise to copy, modify, sublicense or distribute the Program is 175 | void, and will automatically terminate your rights under this License. 176 | However, parties who have received copies, or rights, from you under 177 | this License will not have their licenses terminated so long as such 178 | parties remain in full compliance. 179 | 180 | 5. You are not required to accept this License, since you have not 181 | signed it. However, nothing else grants you permission to modify or 182 | distribute the Program or its derivative works. These actions are 183 | prohibited by law if you do not accept this License. Therefore, by 184 | modifying or distributing the Program (or any work based on the 185 | Program), you indicate your acceptance of this License to do so, and 186 | all its terms and conditions for copying, distributing or modifying 187 | the Program or works based on it. 188 | 189 | 6. Each time you redistribute the Program (or any work based on the 190 | Program), the recipient automatically receives a license from the 191 | original licensor to copy, distribute or modify the Program subject to 192 | these terms and conditions. You may not impose any further 193 | restrictions on the recipients' exercise of the rights granted herein. 194 | You are not responsible for enforcing compliance by third parties to 195 | this License. 196 | 197 | 7. If, as a consequence of a court judgment or allegation of patent 198 | infringement or for any other reason (not limited to patent issues), 199 | conditions are imposed on you (whether by court order, agreement or 200 | otherwise) that contradict the conditions of this License, they do not 201 | excuse you from the conditions of this License. If you cannot 202 | distribute so as to satisfy simultaneously your obligations under this 203 | License and any other pertinent obligations, then as a consequence you 204 | may not distribute the Program at all. For example, if a patent 205 | license would not permit royalty-free redistribution of the Program by 206 | all those who receive copies directly or indirectly through you, then 207 | the only way you could satisfy both it and this License would be to 208 | refrain entirely from distribution of the Program. 209 | 210 | If any portion of this section is held invalid or unenforceable under 211 | any particular circumstance, the balance of the section is intended to 212 | apply and the section as a whole is intended to apply in other 213 | circumstances. 214 | 215 | It is not the purpose of this section to induce you to infringe any 216 | patents or other property right claims or to contest validity of any 217 | such claims; this section has the sole purpose of protecting the 218 | integrity of the free software distribution system, which is 219 | implemented by public license practices. Many people have made 220 | generous contributions to the wide range of software distributed 221 | through that system in reliance on consistent application of that 222 | system; it is up to the author/donor to decide if he or she is willing 223 | to distribute software through any other system and a licensee cannot 224 | impose that choice. 225 | 226 | This section is intended to make thoroughly clear what is believed to 227 | be a consequence of the rest of this License. 228 | 229 | 8. If the distribution and/or use of the Program is restricted in 230 | certain countries either by patents or by copyrighted interfaces, the 231 | original copyright holder who places the Program under this License 232 | may add an explicit geographical distribution limitation excluding 233 | those countries, so that distribution is permitted only in or among 234 | countries not thus excluded. In such case, this License incorporates 235 | the limitation as if written in the body of this License. 236 | 237 | 9. The Free Software Foundation may publish revised and/or new versions 238 | of the General Public License from time to time. Such new versions will 239 | be similar in spirit to the present version, but may differ in detail to 240 | address new problems or concerns. 241 | 242 | Each version is given a distinguishing version number. If the Program 243 | specifies a version number of this License which applies to it and "any 244 | later version", you have the option of following the terms and conditions 245 | either of that version or of any later version published by the Free 246 | Software Foundation. If the Program does not specify a version number of 247 | this License, you may choose any version ever published by the Free Software 248 | Foundation. 249 | 250 | 10. If you wish to incorporate parts of the Program into other free 251 | programs whose distribution conditions are different, write to the author 252 | to ask for permission. For software which is copyrighted by the Free 253 | Software Foundation, write to the Free Software Foundation; we sometimes 254 | make exceptions for this. Our decision will be guided by the two goals 255 | of preserving the free status of all derivatives of our free software and 256 | of promoting the sharing and reuse of software generally. 257 | 258 | NO WARRANTY 259 | 260 | 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY 261 | FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN 262 | OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES 263 | PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED 264 | OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF 265 | MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS 266 | TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE 267 | PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, 268 | REPAIR OR CORRECTION. 269 | 270 | 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING 271 | WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR 272 | REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES, 273 | INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING 274 | OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED 275 | TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY 276 | YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER 277 | PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE 278 | POSSIBILITY OF SUCH DAMAGES. 279 | 280 | END OF TERMS AND CONDITIONS 281 | 282 | How to Apply These Terms to Your New Programs 283 | 284 | If you develop a new program, and you want it to be of the greatest 285 | possible use to the public, the best way to achieve this is to make it 286 | free software which everyone can redistribute and change under these terms. 287 | 288 | To do so, attach the following notices to the program. It is safest 289 | to attach them to the start of each source file to most effectively 290 | convey the exclusion of warranty; and each file should have at least 291 | the "copyright" line and a pointer to where the full notice is found. 292 | 293 | {description} 294 | Copyright (C) {year} {fullname} 295 | 296 | This program is free software; you can redistribute it and/or modify 297 | it under the terms of the GNU General Public License as published by 298 | the Free Software Foundation; either version 2 of the License, or 299 | (at your option) any later version. 300 | 301 | This program is distributed in the hope that it will be useful, 302 | but WITHOUT ANY WARRANTY; without even the implied warranty of 303 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 304 | GNU General Public License for more details. 305 | 306 | You should have received a copy of the GNU General Public License along 307 | with this program; if not, write to the Free Software Foundation, Inc., 308 | 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. 309 | 310 | Also add information on how to contact you by electronic and paper mail. 311 | 312 | If the program is interactive, make it output a short notice like this 313 | when it starts in an interactive mode: 314 | 315 | Gnomovision version 69, Copyright (C) year name of author 316 | Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'. 317 | This is free software, and you are welcome to redistribute it 318 | under certain conditions; type `show c' for details. 319 | 320 | The hypothetical commands `show w' and `show c' should show the appropriate 321 | parts of the General Public License. Of course, the commands you use may 322 | be called something other than `show w' and `show c'; they could even be 323 | mouse-clicks or menu items--whatever suits your program. 324 | 325 | You should also get your employer (if you work as a programmer) or your 326 | school, if any, to sign a "copyright disclaimer" for the program, if 327 | necessary. Here is a sample; alter the names: 328 | 329 | Yoyodyne, Inc., hereby disclaims all copyright interest in the program 330 | `Gnomovision' (which makes passes at compilers) written by James Hacker. 331 | 332 | {signature of Ty Coon}, 1 April 1989 333 | Ty Coon, President of Vice 334 | 335 | This General Public License does not permit incorporating your program into 336 | proprietary programs. If your program is a subroutine library, you may 337 | consider it more useful to permit linking proprietary applications with the 338 | library. If this is what you want to do, use the GNU Lesser General 339 | Public License instead of this License. 340 | 341 | --------------------------------------------------------------------------------