Adaugă codul complet al proiectului underchat-ircd
This commit is contained in:
1 parent
caba5224bf
commit
5fdc1cc27c
462 files changed
+164488
No files matched your search
@@ -0,0 +1,11 @@
|
||||
CA="https://acme-v02.api.letsencrypt.org/directory"
|
||||
OLDCA="https://acme-v01.api.letsencrypt.org/directory"
|
||||
CHALLENGETYPE="dns-01"
|
||||
BASEDIR=$SCRIPTDIR
|
||||
DOMAINS_TXT="${BASEDIR}/domains.txt"
|
||||
CERTDIR="${BASEDIR}/certs"
|
||||
ACCOUNTDIR="${BASEDIR}/accounts"
|
||||
HOOK="${BASEDIR}/hook.sh"
|
||||
HOOK_CHAIN="yes"
|
||||
PRIVATE_KEY_RENEW="no"
|
||||
CONTACT_EMAIL="your-le-email@example.net"
|
||||
@@ -0,0 +1 @@
|
||||
yourmainserver.afternet.org irc.afternet.org
|
||||
@@ -0,0 +1,58 @@
|
||||
#!/usr/bin/env bash
|
||||
|
||||
NSUPDATE="nsupdate -k /home/alpha/dehydrated/nsupdate.key"
|
||||
NSSERVER="127.0.0.1"
|
||||
ZONE="le.example.net"
|
||||
IRCDPEM="/home/alpha/ircd/lib/ircd.pem"
|
||||
IRCDPID="/home/alpha/ircd/lib/ircd.pid"
|
||||
|
||||
deploy_challenge() {
|
||||
local nsudttxt="server ${DNSSERVER}\nzone ${ZONE}.\n"
|
||||
|
||||
declare -a args=("$@")
|
||||
|
||||
for i in `seq 0 3 $(($#-1))`;
|
||||
do
|
||||
local DOMAIN="${args[$i]}" TOKEN_FILENAME="${args[$(($i+1))]}" TOKEN_VALUE="${args[$(($i+2))]}"
|
||||
nsudttxt="${nsudttxt}update add _acme-challenge.${DOMAIN}.${ZONE}. 300 IN TXT \"${TOKEN_VALUE}\"\n"
|
||||
printf "ADD: _acme-challenge.%s.%s. 300 IN TXT \"%s\"\n" "${DOMAIN}" "${ZONE}" "${TOKEN_VALUE}"
|
||||
done
|
||||
|
||||
nsudttxt="${nsudttxt}send\n"
|
||||
|
||||
echo -e "${nsudttxt}" | $NSUPDATE
|
||||
|
||||
/bin/sleep 0.5
|
||||
}
|
||||
|
||||
clean_challenge() {
|
||||
local nsudttxt="server ${DNSSERVER}\nzone ${ZONE}.\n"
|
||||
|
||||
declare -a args=("$@")
|
||||
|
||||
for i in `seq 0 3 $(($#-1))`;
|
||||
do
|
||||
local DOMAIN="${args[$i]}" TOKEN_FILENAME="${args[$(($i+1))]}" TOKEN_VALUE="${args[$(($i+2))]}"
|
||||
nsudttxt="${nsudttxt}update del _acme-challenge.${DOMAIN}.${ZONE}. 300 IN TXT \"${TOKEN_VALUE}\"\n"
|
||||
printf "DEL: _acme-challenge.%s.%s. 300 IN TXT \"%s\"\n" "${DOMAIN}" "${ZONE}" "${TOKEN_VALUE}"
|
||||
done
|
||||
|
||||
nsudttxt="${nsudttxt}send\n"
|
||||
|
||||
echo -e "${nsudttxt}" | $NSUPDATE
|
||||
|
||||
/bin/sleep 0.5
|
||||
}
|
||||
|
||||
deploy_cert() {
|
||||
local DOMAIN="${1}" KEYFILE="${2}" CERTFILE="${3}" FULLCHAINFILE="${4}" CHAINFILE="${5}" TIMESTAMP="${6}"
|
||||
|
||||
cat $KEYFILE > $IRCDPEM
|
||||
cat $FULLCHAINFILE >> $IRCDPEM
|
||||
kill -USR1 `cat $IRCDPID`
|
||||
}
|
||||
|
||||
HANDLER="$1"; shift
|
||||
if [[ "${HANDLER}" =~ ^(deploy_challenge|clean_challenge|deploy_cert)$ ]]; then
|
||||
"$HANDLER" "$@"
|
||||
fi
|
||||
@@ -0,0 +1,9 @@
|
||||
# This is used by nsupdate -k thisfile
|
||||
# it is generated by:
|
||||
#
|
||||
# ddns-confgen -q -k some-key-name
|
||||
#
|
||||
key "some-key-name" {
|
||||
algorithm hmac-sha256;
|
||||
secret "CzSBCDAx5lvn+XuSr79bsB35v2JfAWPogK18mKhf1hw=";
|
||||
};
|
||||
@@ -0,0 +1,48 @@
|
||||
==== Lets Encrypt ircd Certificates ====
|
||||
|
||||
This directory contains files and notes (in this file) about a proposed
|
||||
way to use lets-encript ssl certificates. The trouble with LE certificates
|
||||
that needs to be solved is thus:
|
||||
|
||||
* irc.network.org needs to point (via Route53 or similar) to any
|
||||
particular server, and be valid
|
||||
* servername.network.org needs to also point to that one server
|
||||
and be valid
|
||||
* Servers are run by different admins and those admins don't have
|
||||
full trust to dns or website
|
||||
|
||||
Jobe has worked out a solution to this, and I am attempting to document
|
||||
it for others to impliment easier.
|
||||
|
||||
The solution is to run an instance of the BIND dns server and
|
||||
alias the acme lets-encript name to it from the primary domain.
|
||||
Then in BIND, we setup access to each ircd server to add/remove TXT
|
||||
entries to it. Each ircd server has its own key with privs that can
|
||||
be revoked.
|
||||
|
||||
In our example we will use network.org as the primary network name
|
||||
and lechallange.network.org as the subdomain used by BIND
|
||||
|
||||
First thing is to setup BIND somewhere. We make bind in charge of
|
||||
the sub-domain le.network.org, specifically we are interested in adding
|
||||
and removing TXT records as: _acme-challenge.le.network.org
|
||||
|
||||
Next setup the real network.org dns server. We add a CNAME from
|
||||
_acme-challenge.network.org to _acme-challenge.le.network.org and an
|
||||
NS record to le.network.org to our BIND server.
|
||||
|
||||
Finally, we set up dehydrated, and feed it in the required domain
|
||||
consisting of: someserver.network.org with SAN of irc.network.org
|
||||
|
||||
dehydrated will add a TXT record called _acme-challenge.le.network.org
|
||||
to BIND. Lets-encrypt will check _acme-challenge.network.org but will find
|
||||
the CNAME to _acme-challenge.le.network.org and will follow it. When
|
||||
complete, dehydrated will remove it again (And anyway, multiple TXT records
|
||||
can exist and lets-encrypt will find the one it wants)
|
||||
|
||||
Finally, dehydrated will copy the files together as needed to create ircd.pem
|
||||
and send a SIGUSR1 to ircd to reload.
|
||||
|
||||
This is a work in progress...
|
||||
|
||||
|
||||
Reference in new issue
Block a user