From 0d746bc19ea64da04447ccdb4a6274a5d614d9d3 Mon Sep 17 00:00:00 2001 From: Sebastian Hugentobler Date: Thu, 13 Oct 2016 13:52:14 +0200 Subject: [PATCH] initial commit --- .gitignore | 2 ++ Dockerfile | 26 ++++++++++++++++++ rootfs/etc/confd/conf.d/proftpd.conf.toml | 3 +++ rootfs/etc/confd/templates/proftpd.conf.tmpl | 28 ++++++++++++++++++++ rootfs/etc/services.d/proftpd/run | 3 +++ rootfs/musl_mempcpy.patch | 11 ++++++++ 6 files changed, 73 insertions(+) create mode 100755 .gitignore create mode 100644 Dockerfile create mode 100644 rootfs/etc/confd/conf.d/proftpd.conf.toml create mode 100644 rootfs/etc/confd/templates/proftpd.conf.tmpl create mode 100644 rootfs/etc/services.d/proftpd/run create mode 100644 rootfs/musl_mempcpy.patch diff --git a/.gitignore b/.gitignore new file mode 100755 index 0000000..93bfd12 --- /dev/null +++ b/.gitignore @@ -0,0 +1,2 @@ +*~ +.DS_Store diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..67255e6 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,26 @@ +FROM thallian/confd-env:latest + +ENV PROFTP_VERSION v1.3.5b + +RUN addgroup -g 2222 proftp +RUN adduser -h /var/lib/proftp -u 2222 -D -G proftp proftp + +ADD /rootfs / + +RUN apk add --no-cache openssl openldap tar gcc make g++ openldap-dev + +RUN mkdir /tmp/proftpd +RUN wget -qO- https://github.com/proftpd/proftpd/archive/$PROFTP_VERSION.tar.gz | tar -xz -C /tmp/proftpd --strip 1 + +WORKDIR /tmp/proftpd +RUN ./configure --with-modules=mod_ldap +RUN patch -p1 -i /musl_mempcpy.patch +RUN make && make install + +RUN rm -r /tmp/proftpd +RUN rm /musl_mempcpy.patch +WORKDIR / + +RUN apk del tar gcc make g++ openldap-dev + +EXPOSE 2121 diff --git a/rootfs/etc/confd/conf.d/proftpd.conf.toml b/rootfs/etc/confd/conf.d/proftpd.conf.toml new file mode 100644 index 0000000..e9ac655 --- /dev/null +++ b/rootfs/etc/confd/conf.d/proftpd.conf.toml @@ -0,0 +1,3 @@ +[template] +src = "proftpd.conf.tmpl" +dest = "/usr/local/etc/proftpd.conf" diff --git a/rootfs/etc/confd/templates/proftpd.conf.tmpl b/rootfs/etc/confd/templates/proftpd.conf.tmpl new file mode 100644 index 0000000..ba2f7fb --- /dev/null +++ b/rootfs/etc/confd/templates/proftpd.conf.tmpl @@ -0,0 +1,28 @@ +ServerName "{{getenv "SERVER_NAME"}}" +ServerType standalone +DefaultServer on +Port 2121 +UseIPv6 off +Umask 022 +MaxInstances 30 +User proftp +Group proftp +DefaultRoot /var/lib/proftp/data +AllowOverwrite on + + + DenyAll + + + + LDAPServer {{getenv "LDAP_URI"}} + LDAPUseTLS {{getenv "LDAP_USE_TLS"}} + LDAPAuthBinds {{getenv "LDAP_USE_AUTH_BIND"}} + LDAPBindDN "{{getenv "LDAP_BIND_DN"}}" {{getenv "LDAP_BIND_PASSWORD"}} + + LDAPUsers {{getenv "LDAP_BASE"}} "{{getenv "LDAP_FILTER"}}" + LDAPSearchScope subtree + LDAPDefaultUID 2222 + LDAPDefaultGID 2222 + LDAPGenerateHomedir off + \ No newline at end of file diff --git a/rootfs/etc/services.d/proftpd/run b/rootfs/etc/services.d/proftpd/run new file mode 100644 index 0000000..e89b766 --- /dev/null +++ b/rootfs/etc/services.d/proftpd/run @@ -0,0 +1,3 @@ +#!/usr/bin/with-contenv sh + +exec s6-setuidgid proftp proftpd --nodaemon diff --git a/rootfs/musl_mempcpy.patch b/rootfs/musl_mempcpy.patch new file mode 100644 index 0000000..8376029 --- /dev/null +++ b/rootfs/musl_mempcpy.patch @@ -0,0 +1,11 @@ +--- a/lib/pr_fnmatch.c ++++ b/lib/pr_fnmatch.c +@@ -250,7 +250,7 @@ + # endif + # define STRLEN(S) strlen (S) + # define STRCAT(D, S) strcat (D, S) +-# define MEMPCPY(D, S, N) __mempcpy (D, S, N) ++# define MEMPCPY(D, S, N) mempcpy (D, S, N) + # define MEMCHR(S, C, N) memchr (S, C, N) + # define STRCOLL(S1, S2) strcoll (S1, S2) + # include "pr_fnmatch_loop.c"