From ab23368b8879e2bcd9836f9ce151e3bd36fef45d Mon Sep 17 00:00:00 2001 From: Jason Date: Mon, 14 Feb 2022 16:46:31 -0500 Subject: [PATCH] =?UTF-8?q?=20=F0=9F=A6=88=F0=9F=8F=A0=F0=9F=90=9C?= =?UTF-8?q?=E2=9D=97=20Initial=20Commit=20=E2=9D=97=F0=9F=90=9C?= =?UTF-8?q?=F0=9F=A6=88=F0=9F=8F=A0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 19 ++++++++++ Dockerfile | 77 +++++++++++++++++++++++++++++++++++++++ LICENSE.md | 13 +++++++ README.md | 10 +++++ bin/entrypoint-proftpd.sh | 51 ++++++++++++++++++++++++++ config/proftpd.conf | 43 ++++++++++++++++++++++ 6 files changed, 213 insertions(+) create mode 100644 .gitignore create mode 100644 Dockerfile create mode 100644 LICENSE.md create mode 100644 README.md create mode 100644 bin/entrypoint-proftpd.sh create mode 100644 config/proftpd.conf diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..c0035ea --- /dev/null +++ b/.gitignore @@ -0,0 +1,19 @@ +# gitignore created on 02/09/22 at 12:17 +# Disable reminder in prompt +ignoredirmessage + +# OS generated files +.DS_Store +.DS_Store? +._* +.Spotlight-V100 +.Trashes +ehthumbs.db +Thumbs.db + +# Other +.installed + + +# ignore commit message +.gitcommit diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..125e548 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,77 @@ +FROM casjaysdev/alpine:latest AS stage + +RUN apk -U upgrade && \ + apk add \ + proftpd-mod_auth_otp \ + proftpd-mod_ban \ + proftpd-mod_copy \ + proftpd-mod_ctrls_admin \ + proftpd-mod_deflate \ + proftpd-mod_dynmasq \ + proftpd-mod_exec \ + proftpd-mod_facl \ + proftpd-mod_geoip \ + proftpd-mod_ifsession \ + proftpd-mod_ifversion \ + proftpd-mod_ldap \ + proftpd-mod_load \ + proftpd-mod_memcache \ + proftpd-mod_quotatab \ + proftpd-mod_quotatab_file \ + proftpd-mod_quotatab_ldap \ + proftpd-mod_quotatab_radius \ + proftpd-mod_quotatab_sql \ + proftpd-mod_radius \ + proftpd-mod_ratio \ + proftpd-mod_readme \ + proftpd-mod_redis \ + proftpd-mod_rewrite \ + proftpd-mod_sftp \ + proftpd-mod_sftp_sql \ + proftpd-mod_shaper \ + proftpd-mod_site_misc \ + proftpd-mod_snmp \ + proftpd-mod_sql \ + proftpd-mod_sql_mysql \ + proftpd-mod_sql_odbc \ + proftpd-mod_sql_passwd \ + proftpd-mod_sql_postgres \ + proftpd-mod_sql_sqlite \ + proftpd-mod_tls \ + proftpd-mod_tls_memcache \ + proftpd-mod_tls_redis \ + proftpd-mod_tls_shmcache \ + proftpd-mod_unique_id \ + proftpd-mod_wrap2 \ + proftpd-mod_wrap2_file \ + proftpd-mod_wrap2_redis \ + proftpd-mod_wrap2_sql \ + proftpd-utils + +COPY ./config/. /etc/ +COPY ./bin/. /usr/local/bin/ + +FROM stage +ARG BUILD_DATE="$(date +'%Y-%m-%d %H:%M')" + +LABEL \ + org.label-schema.name="proftpd" \ + org.label-schema.description="proftpd server based on Alpine Linux" \ + org.label-schema.url="https://github.com/casjaysdev/jekyll" \ + org.label-schema.vcs-url="https://github.com/casjaysdev/jekyll" \ + org.label-schema.build-date=$BUILD_DATE \ + org.label-schema.version=$BUILD_DATE \ + org.label-schema.vcs-ref=$BUILD_DATE \ + org.label-schema.license="MIT" \ + org.label-schema.vcs-type="Git" \ + org.label-schema.schema-version="latest" \ + org.label-schema.vendor="CasjaysDev" \ + maintainer="CasjaysDev " + +EXPOSE 21 + +WORKDIR /data +VOLUME [ "/data" ] [ "/data", "/config" ] + +HEALTHCHECK CMD [ "/usr/local/bin/entrypoint-proftpd.sh" "healthcheck" ] +ENTRYPOINT [ "/usr/local/bin/entrypoint-proftpd.sh" ] diff --git a/LICENSE.md b/LICENSE.md new file mode 100644 index 0000000..86d4345 --- /dev/null +++ b/LICENSE.md @@ -0,0 +1,13 @@ + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + Version 2, December 2004 + + Copyright (C) 2022 Jason Hempstead + + Everyone is permitted to copy and distribute verbatim or modified + copies of this license document, and changing it is allowed as long + as the name is changed. + + DO WHAT THE FUCK YOU WANT TO PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 1. You just DO WHAT THE FUCK YOU WANT TO. diff --git a/README.md b/README.md new file mode 100644 index 0000000..8b88cbf --- /dev/null +++ b/README.md @@ -0,0 +1,10 @@ +

+👋 Welcome to proftpd 👋 +

+

+StartDocumentationHere +

+ +## Author + +👤 **Jason Hempstead** diff --git a/bin/entrypoint-proftpd.sh b/bin/entrypoint-proftpd.sh new file mode 100644 index 0000000..6c184aa --- /dev/null +++ b/bin/entrypoint-proftpd.sh @@ -0,0 +1,51 @@ +#!/usr/bin/env bash +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +##@Version : 202202021753-git +# @Author : Jason Hempstead +# @Contact : jason@casjaysdev.com +# @License : WTFPL +# @ReadME : entrypoint.sh --help +# @Copyright : Copyright: (c) 2022 Jason Hempstead, Casjays Developments +# @Created : Wednesday, Feb 02, 2022 17:53 EST +# @File : entrypoint.sh +# @Description : +# @TODO : +# @Other : +# @Resource : +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +APPNAME="$(basename "$0")" +VERSION="202202021753-git" +USER="${SUDO_USER:-${USER}}" +HOME="${USER_HOME:-${HOME}}" +SRC_DIR="${BASH_SOURCE%/*}" +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +# Set bash options +if [[ "$1" == "--debug" ]]; then shift 1 && set -xo pipefail && export SCRIPT_OPTS="--debug" && export _DEBUG="on"; fi +trap 'exitCode=${exitCode:-$?};[ -n "$ENTRYPOINT_SH_TEMP_FILE" ] && [ -f "$ENTRYPOINT_SH_TEMP_FILE" ] && rm -Rf "$ENTRYPOINT_SH_TEMP_FILE" &>/dev/null' EXIT + +# - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - +export TZ="${TZ:-America/New_York}" +export HOSTNAME="${HOSTNAME:-casjaysdev-proftpd}" + +[ -n "${TZ}" ] && echo "${TZ}" >/etc/timezone +[ -n "${HOSTNAME}" ] && echo "${HOSTNAME}" >/etc/hostname +[ -n "${HOSTNAME}" ] && echo "127.0.0.1 $HOSTNAME localhost" >/etc/hosts +[ -f "/usr/share/zoneinfo/${TZ}" ] && ln -sf "/usr/share/zoneinfo/${TZ}" "/etc/localtime" + +[ -f "/config/ssl/ca.crt" ] || create-ssl-cert +[ -f "/config/proftpd.conf" ] && + cp -Rf /config/proftpd.conf /etc/proftpd/proftpd.conf || + cp -Rf /etc/proftpd/proftpd.conf /config/proftpd.conf + +case $1 in +healthcheck) + echo 'OK' + ;; +bash | shell | sh) + shift 1 + exec /bin/bash -l "$@" + ;; +*) + exec proftpd --nodaemon -c /etc/proftpd/proftpd.conf || bash -l + ;; +esac diff --git a/config/proftpd.conf b/config/proftpd.conf new file mode 100644 index 0000000..f62ee02 --- /dev/null +++ b/config/proftpd.conf @@ -0,0 +1,43 @@ +# proftpd config + +Umask 022 +AllowOverwrite yes +TransferLog /dev/stdout +ExtendedLog /dev/stdout +DefaultRoot /data +DisplayConnect "/etc/motd" + + + +User root +Group root +AccessGrantMsg "Anonymous login ok, restrictions apply." +UserAlias anonymous ftp +MaxClients 2000 "Sorry, max %m users -- try again later" +DisplayLogin /data/welcome.msg +DisplayChdir .message +DisplayReadme README* +DirFakeUser on ftp +DirFakeGroup on ftp +WtmpLog off +ExtendedLog /dev/stdout WRITE,READ default +ExtendedLog /dev/stdout AUTH auth +AllowRetrieveRestart on +AnonRequirePassword off + + DenyAll + + + +PassivePorts 49152 65534 +TLSEngine on +TLSRequired off +TLSProtocol TLSv1 TLSv1.1 TLSv1.2 +TLSOptions NoSessionReuseRequired +TLSVerifyClient off +TLSRenegotiate none +TLSLog /dev/stdout + +TLSCACertificateFile /config/ssl/ca.crt +TLSRSACertificateFile /config/ssl/localhost.crt +TLSRSACertificateKeyFile /config/ssl/localhost.key