From dc8f49de548e2c2e2aa321841585153a99cd3858 Mon Sep 17 00:00:00 2001 From: Georg Lauterbach <44545919+aendeavor@users.noreply.github.com> Date: Mon, 31 May 2021 09:12:28 +0200 Subject: [PATCH] corrected linting and removed generate ssl bin --- .../config/advanced/optional-config.md | 1 - docs/content/config/setup.sh.md | 1 - setup.sh | 38 +++++++++---------- target/bin/generate-ssl-certificate | 32 ---------------- 4 files changed, 19 insertions(+), 53 deletions(-) delete mode 100755 target/bin/generate-ssl-certificate diff --git a/docs/content/config/advanced/optional-config.md b/docs/content/config/advanced/optional-config.md index 7ad053a2..ccc48001 100644 --- a/docs/content/config/advanced/optional-config.md +++ b/docs/content/config/advanced/optional-config.md @@ -11,7 +11,6 @@ This is a list of all configuration files and directories which are optional or - **sieve-filter:** directory for sieve filter scripts. (Docs: [Sieve][docs-sieve]) - **sieve-pipe:** directory for sieve pipe scripts. (Docs: [Sieve][docs-sieve]) - **opendkim:** DKIM directory. Auto-configurable via [`setup.sh config dkim`][docs-setupsh]. (Docs: [DKIM][docs-dkim]) -- **ssl:** SSL Certificate directory. Auto-configurable via [`setup.sh config ssl`][docs-setupsh]. (Docs: [SSL][docs-ssl]) ## Files diff --git a/docs/content/config/setup.sh.md b/docs/content/config/setup.sh.md index db91a373..7427fffa 100644 --- a/docs/content/config/setup.sh.md +++ b/docs/content/config/setup.sh.md @@ -96,7 +96,6 @@ OPTIONS COMMAND config := ./setup.sh config dkim [ ARGUMENTS... ] - ./setup.sh config ssl (ATTENTION: This is deprecated and will be removed soon.) COMMAND relay := ./setup.sh relay add-domain [] diff --git a/setup.sh b/setup.sh index f988032a..6410ab91 100755 --- a/setup.sh +++ b/setup.sh @@ -163,35 +163,35 @@ ${ORANGE}OPTIONS${RESET} ${RED}[${ORANGE}SUB${RED}]${ORANGE}COMMANDS${RESET} ${LBLUE}COMMAND${RESET} email ${RED}:=${RESET} - ${0} email add [] - ${0} email update [] - ${0} email del [ OPTIONS${RED}...${RESET} ] [ ${RED}...${RESET} ] - ${0} email restrict [] - ${0} email list + ${0} email ${CYAN}add${RESET} [] + ${0} email ${CYAN}update${RESET} [] + ${0} email ${CYAN}del${RESET} [ OPTIONS${RED}...${RESET} ] [ ${RED}...${RESET} ] + ${0} email ${CYAN}restrict${RESET} [] + ${0} email ${CYAN}list${RESET} ${LBLUE}COMMAND${RESET} alias ${RED}:=${RESET} - ${0} alias add - ${0} alias del - ${0} alias list + ${0} alias ${CYAN}add${RESET} + ${0} alias ${CYAN}del${RESET} + ${0} alias ${CYAN}list${RESET} ${LBLUE}COMMAND${RESET} quota ${RED}:=${RESET} - ${0} quota set [] - ${0} quota del + ${0} quota ${CYAN}set${RESET} [] + ${0} quota ${CYAN}del${RESET} ${LBLUE}COMMAND${RESET} config ${RED}:=${RESET} - ${0} config dkim [ ARGUMENTS${RED}...${RESET} ] + ${0} config ${CYAN}dkim${RESET} [ ARGUMENTS${RED}...${RESET} ] ${LBLUE}COMMAND${RESET} relay ${RED}:=${RESET} - ${0} relay add-domain [] - ${0} relay add-auth [] - ${0} relay exclude-domain + ${0} relay ${CYAN}add-domain${RESET} [] + ${0} relay ${CYAN}add-auth${RESET} [] + ${0} relay ${CYAN}exclude-domain${RESET} ${LBLUE}COMMAND${RESET} debug ${RED}:=${RESET} - ${0} debug fetchmail - ${0} debug fail2ban [unban ] - ${0} debug show-mail-logs - ${0} debug inspect - ${0} debug login + ${0} debug ${CYAN}fetchmail${RESET} + ${0} debug ${CYAN}fail2ban${RESET} [unban ] + ${0} debug ${CYAN}show-mail-logs${RESET} + ${0} debug ${CYAN}inspect${RESET} + ${0} debug ${CYAN}login${RESET} ${ORANGE}EXAMPLES${RESET} ${WHITE}./setup.sh email add test@domain.tld${RESET} diff --git a/target/bin/generate-ssl-certificate b/target/bin/generate-ssl-certificate deleted file mode 100755 index 221309b1..00000000 --- a/target/bin/generate-ssl-certificate +++ /dev/null @@ -1,32 +0,0 @@ -#! /bin/bash - -set -e - -# check if FQDN was passed as arguement in setup.sh -if [[ -z ${1} ]] -then - FQDN="$(hostname --fqdn)" -else - FQDN="${1}" -fi - -SSL_CFG_PATH="/tmp/docker-mailserver/ssl" - -if [[ ! -d ${SSL_CFG_PATH} ]] -then - mkdir --parents "${SSL_CFG_PATH}" -fi - -cd "${SSL_CFG_PATH}" || { echo "cd ${SSL_CFG_PATH} error" ; exit ; } - -# Create CA certificate -/usr/lib/ssl/misc/CA.pl -newca - -# Create an unpassworded private key and create an unsigned public key certificate -openssl req -new -nodes -keyout "${SSL_CFG_PATH}"/"${FQDN}"-key.pem -out "${SSL_CFG_PATH}"/"${FQDN}"-req.pem -days 3652 - -# Sign the public key certificate with CA certificate -openssl ca -out "${SSL_CFG_PATH}"/"${FQDN}"-cert.pem -infiles "${SSL_CFG_PATH}"/"${FQDN}"-req.pem - -# Combine certificates for courier -cat "${SSL_CFG_PATH}"/"${FQDN}"-key.pem "${SSL_CFG_PATH}"/"${FQDN}"-cert.pem > "${SSL_CFG_PATH}"/"${FQDN}"-combined.pem