diff --git a/.github/workflows/package-phpldapadmin.yml b/.github/workflows/package-phpldapadmin.yml new file mode 100644 index 0000000..da6a40e --- /dev/null +++ b/.github/workflows/package-phpldapadmin.yml @@ -0,0 +1,18 @@ +--- +name: "Package phpldapadmin" +on: + push: + branches: + - main + - test + - dev + paths: + - 'phpldapadmin/**' + workflow_dispatch: {} + +jobs: + package-phpldapadmin: + uses: "./.github/workflows/package.yml" + with: + name: phpldapadmin + path: phpldapadmin diff --git a/phpldapadmin/APP_VERSION b/phpldapadmin/APP_VERSION new file mode 100644 index 0000000..0f26f76 --- /dev/null +++ b/phpldapadmin/APP_VERSION @@ -0,0 +1 @@ +1.2.6.7 diff --git a/phpldapadmin/Containerfile b/phpldapadmin/Containerfile new file mode 100644 index 0000000..435ba07 --- /dev/null +++ b/phpldapadmin/Containerfile @@ -0,0 +1,43 @@ +FROM alpine:3.19 + +ARG APP_VERSION + +RUN set -ex; \ + apk add --no-cache \ + apache2 \ + curl \ + shadow \ + util-linux \ + php82 \ + php82-apache2 \ + php82-ldap \ + php82-gettext \ + php82-mbstring \ + php82-opcache \ + php82-openssl \ + php82-session \ + php82-xml \ + php82-pecl-apcu \ + rm -f /etc/apache2/conf.d/info.conf; \ + rm -f /etc/apache2/conf.d/userdir.conf; \ + ln -sf /usr/bin/php82 /usr/bin/php; + +COPY php.conf.d/ /etc/php82/conf.d/ +COPY apache2.conf.d/ /etc/apache2/conf.d/ + +RUN set -ex; \ + sed -i -e 's|^#\(LoadModule remoteip_module.*\)|\1|' /etc/apache2/httpd.conf + +RUN set -ex; \ + curl -fsSL -o "phpLDAPadmin-${APP_VERSION}.tar.gz" \ + "https://github.com/leenooks/phpLDAPadmin/archive/${APP_VERSION}.tar.gz"; \ + mkdir -p /var/www/phpldapadmin; \ + tar -xzf "phpLDAPadmin-${APP_VERSION}.tar.gz" --strip-components=1 -C /var/www/phpldapadmin; \ + rm "phpLDAPadmin-${APP_VERSION}.tar.gz"; + +COPY entrypoint.sh / + +STOPSIGNAL SIGWINCH + +ENTRYPOINT ["/entrypoint.sh"] +CMD ["httpd", "-DFOREGROUND"] diff --git a/phpldapadmin/apache2.conf.d/basic.conf b/phpldapadmin/apache2.conf.d/basic.conf new file mode 100644 index 0000000..5341569 --- /dev/null +++ b/phpldapadmin/apache2.conf.d/basic.conf @@ -0,0 +1,5 @@ +ServerTokens Prod +ServerSignature Off + +EnableMMAP Off +EnableSendfile On diff --git a/phpldapadmin/apache2.conf.d/phpldapadmin.conf b/phpldapadmin/apache2.conf.d/phpldapadmin.conf new file mode 100644 index 0000000..aa4b576 --- /dev/null +++ b/phpldapadmin/apache2.conf.d/phpldapadmin.conf @@ -0,0 +1,7 @@ +DocumentRoot "/var/www/phpldapadmin" + + DirectoryIndex index.php + AllowOverride All + Options FollowSymlinks + Require all granted + diff --git a/phpldapadmin/apache2.conf.d/remoteip.conf b/phpldapadmin/apache2.conf.d/remoteip.conf new file mode 100644 index 0000000..fff4a8d --- /dev/null +++ b/phpldapadmin/apache2.conf.d/remoteip.conf @@ -0,0 +1,6 @@ + + RemoteIPHeader X-Real-IP + RemoteIPInternalProxy 10.0.0.0/8 + RemoteIPInternalProxy 172.16.0.0/12 + RemoteIPInternalProxy 192.168.0.0/16 + diff --git a/phpldapadmin/entrypoint.sh b/phpldapadmin/entrypoint.sh new file mode 100755 index 0000000..8a98f94 --- /dev/null +++ b/phpldapadmin/entrypoint.sh @@ -0,0 +1,4 @@ +#!/bin/sh +set -eu + +exec "$@" diff --git a/phpldapadmin/php.conf.d/90_apcu.ini b/phpldapadmin/php.conf.d/90_apcu.ini new file mode 100644 index 0000000..008bcab --- /dev/null +++ b/phpldapadmin/php.conf.d/90_apcu.ini @@ -0,0 +1 @@ +apc.enable_cli=1 diff --git a/phpldapadmin/php.conf.d/90_opcache.ini b/phpldapadmin/php.conf.d/90_opcache.ini new file mode 100644 index 0000000..fb8579e --- /dev/null +++ b/phpldapadmin/php.conf.d/90_opcache.ini @@ -0,0 +1,8 @@ +opcache.enable=1 +opcache.interned_strings_buffer=32 +opcache.max_accelerated_files=16229 +opcache.memory_consumption=256 +opcache.save_comments=1 +opcache.revalidate_freq=60 +opcache.jit=1255 +opcache.jit_buffer_size=256M