summaryrefslogtreecommitdiffstats
path: root/roles/common/files/usr/local/bin
diff options
context:
space:
mode:
authorGuilhem Moulin <guilhem@fripost.org>2025-09-10 15:14:45 +0200
committerGuilhem Moulin <guilhem@fripost.org>2025-09-10 15:14:45 +0200
commit4b48f1b6dd799d1a69f0c9e2a157a007fcdcbe25 (patch)
tree98a20332171ab0a568945f9ef5b32d63b9f8c0df /roles/common/files/usr/local/bin
parent983981b8546d9ef847cfef7711c35c6e06549f43 (diff)
Send internal system mails to root@f.o.
Instead of admin@f.o. Per msgid=<ad724342-b3bb-48d9-9984-6d277714910d@fripost.org>.
Diffstat (limited to 'roles/common/files/usr/local/bin')
-rwxr-xr-xroles/common/files/usr/local/bin/genkeypair.sh2
1 files changed, 1 insertions, 1 deletions
diff --git a/roles/common/files/usr/local/bin/genkeypair.sh b/roles/common/files/usr/local/bin/genkeypair.sh
index 72102f4..aecdaaf 100755
--- a/roles/common/files/usr/local/bin/genkeypair.sh
+++ b/roles/common/files/usr/local/bin/genkeypair.sh
@@ -145,41 +145,41 @@ fi
if [ -z "$config" -a \( "$cmd" = x509 -o "$cmd" = csr \) ]; then
config=$(mktemp) || exit 2
trap 'rm -f "$config"' EXIT
# see /usr/share/ssl-cert/ssleay.cnf
cat >"$config" <<- EOF
[ req ]
distinguished_name = req_distinguished_name
prompt = no
policy = policy_anything
req_extensions = v3_req
x509_extensions = v3_req
[ req_distinguished_name ]
organizationName = Fripost
organizationalUnitName = SSLcerts
$(echo "$ou")
commonName = ${cn:-/}
[ v3_req ]
- subjectAltName = email:admin@fripost.org${dns:+, $dns}
+ subjectAltName = email:root@fripost.org${dns:+, $dns}
basicConstraints = critical, CA:FALSE
# https://security.stackexchange.com/questions/24106/which-key-usages-are-required-by-each-key-exchange-method
keyUsage = critical, ${usage:-digitalSignature, keyEncipherment, keyCertSign}
subjectKeyIdentifier = hash
EOF
fi
if [ -s "$privkey" -a $force -eq 0 ]; then
echo "Error: private key exists: $privkey" >&2
exit 1
elif [ ! -s "$privkey" -o $force -ge 2 ]; then
install --mode="${mode:-0600}" ${owner:+--owner="$owner"} ${group:+--group="$group"} /dev/null "$privkey" || exit 2
openssl $genkey $genkeyargs >"$privkey" || exit 2
[ "$cmd" = dkim ] && exit
fi
if [ "$cmd" = x509 -a "$pubkey" = "$privkey" ]; then
pubkey=$(mktemp)
openssl req -config "$config" -new -x509 ${hash:+-$hash} -days 3650 -key "$privkey" >"$pubkey" || exit 2
cat "$pubkey" >>"$privkey" || exit 2