Update acme.sh & fix duckdns (#4560)

* fix dialog info
* acme.sh 3.0.7
* use fake email if none given
* format email correct
* adressing #2255
This commit is contained in:
/rootzoll 2024-05-29 13:49:16 +02:00 committed by GitHub
parent 4932495daa
commit c0d07013fc
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
5 changed files with 41 additions and 44 deletions

View file

@ -2,6 +2,7 @@
- New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540) - New: config.scripts/lnd.signaddress.sh to easy sign messages on addresses on LND [details](https://github.com/raspiblitz/raspiblitz/issues/4540)
- Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4) - Update: Specter Desktop 2.0.4 with reactivated UPDATE option [details](https://github.com/cryptoadvance/specter-desktop/releases/tag/v2.0.4)
- Update: acme.sh 3.0.7 (repair duckdns.org dyndns)
- Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082) - Remove: Tallycoin-Connect [see service shutdown](https://x.com/djbooth007/status/1784409117563720082)
- Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589) - Remove: IP2Tor Shoplist [details](https://github.com/raspiblitz/raspiblitz/issues/4589)

View file

@ -622,9 +622,9 @@ def menuMakeSubscription(blitzServiceName, torAddress, torPort):
if lastusedShop == choice_url_ip2torcom: lastusedShop="" if lastusedShop == choice_url_ip2torcom: lastusedShop=""
# FULMO Shop # FULMO Shop
choice_url_fulmo="fulmo7x6yvgz6zs2b2ptduvzwevxmizhq23klkenslt5drxx2physlqd.onion" #choice_url_fulmo="fulmo7x6yvgz6zs2b2ptduvzwevxmizhq23klkenslt5drxx2physlqd.onion"
choices.append(("B", "Fulmo Shop")) #choices.append(("B", "Fulmo Shop"))
if lastusedShop == choice_url_fulmo: lastusedShop="" #if lastusedShop == choice_url_fulmo: lastusedShop=""
# add before option if different from static options # add before option if different from static options
if len(lastusedShop) > 0: choices.append(("Y", lastusedShop)) if len(lastusedShop) > 0: choices.append(("Y", lastusedShop))

View file

@ -334,8 +334,10 @@ def subscriptions_cancel(s_id):
print(json.dumps(subs, indent=2)) print(json.dumps(subs, indent=2))
# todo: deinstall letsencrypt if this was last subscription # deinstall letsencrypt/dyndns if this was last subscription
if len(subs['subscriptions_letsencrypt']) == 0:
os.system("/home/admin/config.scripts/bonus.letsencrypt.sh off")
os.system("/home/admin/config.scripts/internet.dyndomain.sh off")
def get_subscription(subscription_id): def get_subscription(subscription_id):
try: try:

View file

@ -268,8 +268,8 @@ def main():
cfg.reload() cfg.reload()
if not cfg.run_behind_tor.value: if not cfg.run_behind_tor.value:
Dialog(dialog="dialog", autowidgetsize=True).msgbox(''' Dialog(dialog="dialog", autowidgetsize=True).msgbox('''
The IP2TOR service just makes sense if you run The IP2TOR service just makes sense if you
your RaspiBlitz behind TOR. run your RaspiBlitz behind TOR.
''', title="Info") ''', title="Info")
sys.exit(0) sys.exit(0)

View file

@ -12,8 +12,9 @@ fi
source /mnt/hdd/raspiblitz.conf source /mnt/hdd/raspiblitz.conf
ACME_LOAD_BASE_URL="https://codeload.github.com/acmesh-official/acme.sh/tar.gz" # https://github.com/acmesh-official/acme.sh/releases
ACME_VERSION="2.8.6" ACME_LOAD_BASE_URL="https://github.com/acmesh-official/acme.sh/archive/refs/tags/3.0.7.tar.gz"
ACME_VERSION="3.0.7"
ACME_INSTALL_HOME="/home/admin/.acme.sh" ACME_INSTALL_HOME="/home/admin/.acme.sh"
ACME_CONFIG_HOME="/mnt/hdd/app-data/letsencrypt" ACME_CONFIG_HOME="/mnt/hdd/app-data/letsencrypt"
@ -21,19 +22,6 @@ ACME_CERT_HOME="${ACME_CONFIG_HOME}/certs"
ACME_IS_INSTALLED=0 ACME_IS_INSTALLED=0
# if Tor is on test that CURL is by default running over Tor
# TODO: issue https://github.com/rootzoll/raspiblitz/issues/1341
#if [ "${runBehindTor}" == "on" ]; then
# echo "# checking if Tor proxy for CURL is working ..."
# checkTor=$(curl -s https://check.torproject.org | grep -c "Congratulations")
# if [ ${checkTor} -eq 0 ]; then
# echo "err='curl tor proxy not working'"
# exit 1
# else
# echo "# OK Tor proxy for CURL"
# fi
#fi
################### ###################
# FUNCTIONS # FUNCTIONS
################### ###################
@ -70,7 +58,15 @@ function acme_status() {
} }
function acme_install() { function acme_install() {
email="${1}" email="${1}"
# create a dummy email if none is provided
if [ -z "${email}" ]; then
random_number=$(shuf -i 100-999 -n 1)
random_word=$(shuf -n 1 /usr/share/dict/words)
ending="x.com"
email="${random_word}${random_number}@gm${ending}"
fi
# ensure socat # ensure socat
if ! command -v socat >/dev/null; then if ! command -v socat >/dev/null; then
@ -79,41 +75,38 @@ function acme_install() {
sudo apt-get install -y socat >/dev/null 2>&1 sudo apt-get install -y socat >/dev/null 2>&1
fi fi
# make sure config directory exists
if ! [ -d $ACME_CONFIG_HOME ]; then if ! [ -d $ACME_CONFIG_HOME ]; then
sudo mkdir -p $ACME_CONFIG_HOME sudo mkdir -p $ACME_CONFIG_HOME
fi fi
sudo chown admin:admin $ACME_CONFIG_HOME sudo chown admin:admin $ACME_CONFIG_HOME
rm -f "/tmp/acme.sh_${ACME_VERSION}.tar.gz" # download and install acme.sh
if ! curl --silent --fail -o "/tmp/acme.sh_${ACME_VERSION}.tar.gz" "${ACME_LOAD_BASE_URL}/${ACME_VERSION}" 2>&1; then echo "# download acme.sh release ${ACME_VERSION} from ${ACME_LOAD_BASE_URL}"
echo "Error ($?): Download failed from: ${ACME_LOAD_BASE_URL}/${ACME_VERSION}" rm -r /tmp/acme.sh* 2>/dev/null
rm -f "/tmp/acme.sh_${ACME_VERSION}.tar.gz" if ! curl -L --silent --fail -o "/tmp/acme.sh.tar.gz" "${ACME_LOAD_BASE_URL}" 2>&1; then
echo "Error ($?): Download failed from: ${ACME_LOAD_BASE_URL}"
rm -r /tmp/acme.sh*
exit 1 exit 1
fi fi
if tar xzf "/tmp/acme.sh_${ACME_VERSION}.tar.gz" -C /tmp/; then if tar xzf "/tmp/acme.sh.tar.gz" -C /tmp/; then
cd "/tmp/acme.sh-${ACME_VERSION}" || exit cd "/tmp/acme.sh-${ACME_VERSION}" || exit
if [ -n "${email}" ]; then echo "# installing acme.sh with email(${email})"
./acme.sh --install \ ./acme.sh --install \
--noprofile \ --noprofile \
--home "${ACME_INSTALL_HOME}" \ --home "${ACME_INSTALL_HOME}" \
--config-home "${ACME_CONFIG_HOME}" \ --config-home "${ACME_CONFIG_HOME}" \
--cert-home "${ACME_CERT_HOME}" \ --cert-home "${ACME_CERT_HOME}" \
--accountemail "${email}" --accountemail "${email}"
else
./acme.sh --install \
--noprofile \
--home "${ACME_INSTALL_HOME}" \
--config-home "${ACME_CONFIG_HOME}" \
--cert-home "${ACME_CERT_HOME}"
fi
else
echo "# Error ($?): Extracting failed"
exit 1
fi fi
rm -f "/tmp/acme.sh_${ACME_VERSION}.tar.gz" rm -r /tmp/acme.sh*
rm -Rf "/tmp/acme.sh_${ACME_VERSION}"
} }
function refresh_certs_with_nginx() { function refresh_certs_with_nginx() {
@ -219,6 +212,7 @@ if [ "$1" = "1" ] || [ "$1" = "on" ]; then
sudo chmod -R 733 $ACME_CONFIG_HOME sudo chmod -R 733 $ACME_CONFIG_HOME
# install the acme script # install the acme script
echo "# acme_install"
acme_install "${address}" acme_install "${address}"
echo "" echo ""