diff options
author | 2022-03-27 03:31:32 +0200 | |
---|---|---|
committer | 2022-04-16 15:45:00 +0200 | |
commit | 3e3e91f811c2f74ee5ef2acf2ab9333b2c9927f6 (patch) | |
tree | 8e5994e6ee117d971338b18a32235b64e00a6678 /net-ftp/pure-ftpd/files | |
parent | app-office/lyx: Keyword 2.3.6.1-r1 riscv, #838088 (diff) | |
download | gentoo-3e3e91f811c2f74ee5ef2acf2ab9333b2c9927f6.tar.gz gentoo-3e3e91f811c2f74ee5ef2acf2ab9333b2c9927f6.tar.bz2 gentoo-3e3e91f811c2f74ee5ef2acf2ab9333b2c9927f6.zip |
net-ftp/pure-ftpd: migrate to stand-alone configuration
This bump changed at lot of things:
* Deprecating configuration via 'conf.d', since not all option are
available via command line. User will be informed about this.
* Using '/etc/pure-ftpd.conf' as main configuration file, since more
option are available here.
* Adding pure-certd init script and config script for using SNI via FTP
* Splitting Uploadscript into it's own init script
* Simplified init script by removing much old stuff, which it seems,
that it's not needed any more today. At least in my tests.
* Adding SVCNAME support.
* Removed sed for MAX_USER_LENGTH, as it's already default
* Removed DOCS for default docs
* Removed keepdir, since it looks like it's not needed anymore
* Overhauled eBuild
Signed-off-by: Conrad Kostecki <conikost@gentoo.org>
Closes: https://github.com/gentoo/gentoo/pull/24592
Signed-off-by: Lars Wendler <polynomial-c@gentoo.org>
Diffstat (limited to 'net-ftp/pure-ftpd/files')
-rw-r--r-- | net-ftp/pure-ftpd/files/pure-certd.initd | 19 | ||||
-rw-r--r-- | net-ftp/pure-ftpd/files/pure-certd.script | 27 | ||||
-rw-r--r-- | net-ftp/pure-ftpd/files/pure-ftpd.confd-r4 | 5 | ||||
-rw-r--r-- | net-ftp/pure-ftpd/files/pure-ftpd.initd-r12 | 23 | ||||
-rw-r--r-- | net-ftp/pure-ftpd/files/pure-uploadscript.confd | 8 | ||||
-rw-r--r-- | net-ftp/pure-ftpd/files/pure-uploadscript.initd | 30 |
6 files changed, 112 insertions, 0 deletions
diff --git a/net-ftp/pure-ftpd/files/pure-certd.initd b/net-ftp/pure-ftpd/files/pure-certd.initd new file mode 100644 index 000000000000..1d254e5274a9 --- /dev/null +++ b/net-ftp/pure-ftpd/files/pure-certd.initd @@ -0,0 +1,19 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +certd_scriptfile="/etc/${SVCNAME}.sh" +certd_socketfile="/run/${SVCNAME}.sock" +pidfile="/run/pure-certd.pid" + +command="/usr/sbin/pure-certd" +command_args="--pidfile ${pidfile} --run ${certd_scriptfile} --socket ${certd_socketfile}" +command_background="true" + +start_pre() { + if [ ! -f "${certd_scriptfile}" ] ; then + eerror "The file ${certd_scriptfile} does not exist!" + eerror "Please create and configure the script." + return 1 + fi +} diff --git a/net-ftp/pure-ftpd/files/pure-certd.script b/net-ftp/pure-ftpd/files/pure-certd.script new file mode 100644 index 000000000000..77aa1bf9f702 --- /dev/null +++ b/net-ftp/pure-ftpd/files/pure-certd.script @@ -0,0 +1,27 @@ +#!/bin/sh +# Copyright 1999-2022 Gentoo Foundation +# Distributed under the terms of the GNU General Public License v2 + +# Set default ssl directory +SSL_DIR="/etc/ssl/pure-ftpd" + +# Check SNI and select certificate +case "${CERTD_SNI_NAME}" in + domain1.tld) + FILE_CERT="${SSL_DIR}/domain1.tld.crt" + FILE_KEY="${SSL_DIR}/domain1.tld.key" + ;; + + domain2.tld) + FILE_CERT="${SSL_DIR}/domain2.tld.crt" + FILE_KEY="${SSL_DIR}/domain2.tld.key" + ;; +esac + +# Print selected certificate for 'pure-certd'. +# You can modify 'action' for your needs. +# See man page of 'pure-certd' for more information. +echo "action:fallback" +echo "cert_file:${FILE_CERT}" +echo "key_file:${FILE_KEY}" +echo "end" diff --git a/net-ftp/pure-ftpd/files/pure-ftpd.confd-r4 b/net-ftp/pure-ftpd/files/pure-ftpd.confd-r4 new file mode 100644 index 000000000000..d49b6c509c58 --- /dev/null +++ b/net-ftp/pure-ftpd/files/pure-ftpd.confd-r4 @@ -0,0 +1,5 @@ +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# Optionally depend on started Pure-Certd +# RC_NEED="pure-certd" diff --git a/net-ftp/pure-ftpd/files/pure-ftpd.initd-r12 b/net-ftp/pure-ftpd/files/pure-ftpd.initd-r12 new file mode 100644 index 000000000000..c971125784b7 --- /dev/null +++ b/net-ftp/pure-ftpd/files/pure-ftpd.initd-r12 @@ -0,0 +1,23 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +ftpd_configfile="/etc/${SVCNAME}.conf" +pidfile="/run/pure-ftpd.pid" + +command="/usr/sbin/pure-ftpd" +command_args="${ftpd_configfile}" +command_background="true" + +depend() { + need localmount + use netmount +} + +start_pre() { + if [ ! -f "${ftpd_configfile}" ] ; then + eerror "The file ${ftpd_configfile} does not exist!" + eerror "Please create and configure the configuration file." + return 1 + fi +} diff --git a/net-ftp/pure-ftpd/files/pure-uploadscript.confd b/net-ftp/pure-ftpd/files/pure-uploadscript.confd new file mode 100644 index 000000000000..4b8fca0deb8f --- /dev/null +++ b/net-ftp/pure-ftpd/files/pure-uploadscript.confd @@ -0,0 +1,8 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +# If you want to process each file uploaded through Pure-FTPd, enter the name +# of the script that should process the files below. +# Use man pure-uploadscript to learn more about how to write this script. +# UPLOADSCRIPT="/path/to/uploadscript" diff --git a/net-ftp/pure-ftpd/files/pure-uploadscript.initd b/net-ftp/pure-ftpd/files/pure-uploadscript.initd new file mode 100644 index 000000000000..f0c57742e749 --- /dev/null +++ b/net-ftp/pure-ftpd/files/pure-uploadscript.initd @@ -0,0 +1,30 @@ +#!/sbin/openrc-run +# Copyright 1999-2022 Gentoo Authors +# Distributed under the terms of the GNU General Public License v2 + +ftpd_configfile="/etc/${SVCNAME/uploadscript/ftpd}.conf" +pidfile="/run/pure-uploadscript.pid" + +command="/usr/sbin/pure-uploadscript" +command_args="${UPLOADSCRIPT}" +command_background="true" + +depend() { + need localmount + use netmount +} + +start_pre() { + if [ -n "${UPLOADSCRIPT}" ] ; then + eerror "The file ${ftpd_configfile} does not exist!" + eerror "Please create and configure the uploadscript file." + return 1 + fi + + if ! grep "^CallUploadScript" "${ftpd_configfile}" ; then + eerror "You cannot start this uploadscript," + eerror "unless you enable the option CallUploadScript" + eerror "in your main Pure-FTPd configuration file ${ftpd_configfile}" + return 1 + fi +} |