Skip to content

Commit 8116e63

Browse files
author
Kristan Kenney
committed
Merge branch 'fix/856_rework_le_renew' into staging/fixes
2 parents 7a9d41f + 3f31eed commit 8116e63

File tree

2 files changed

+25
-3
lines changed

2 files changed

+25
-3
lines changed

CHANGELOG.md

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,9 @@ All notable changes to this project will be documented in this file.
1616
- Fixed an error that would occur when running `v-change-user-php-cli` for the first time if .bash_aliases did not exist. (#960)
1717
- Corrected an issue where tooltips were not displayed when hovering over the top level menu items.
1818
- Improved handling of APT repository keys during installation.
19-
20-
## [1.2.1] - Service Release 1
19+
- Reworked the Let's Encrypt renew functionality to skip removed aliases.
20+
21+
## [1.2.1] - Service Release
2122
### Features
2223
- Consolidated First and Last Name fields to a singular name field to simply input.
2324
- v-change-user-name will now accept both "First Last" (single argument) and First Last (two arguments) for backward compatibility.

bin/v-update-letsencrypt-ssl

Lines changed: 22 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -58,6 +58,27 @@ for user in $($HESTIA/bin/v-list-sys-users plain); do
5858
aliases=$(echo "$aliases" |tr ' ' '\n' |sed "/^$/d")
5959
aliases=$(echo "$aliases" |egrep -v "^$domain,?$")
6060
aliases=$(echo "$aliases" |sed -e ':a;N;$!ba;s/\n/,/g')
61+
62+
# Source domain.conf
63+
source <(cat $HESTIA/data/users/$user/web.conf | grep "DOMAIN='$domain'")
64+
65+
# Split aliases into array
66+
IFS=',' read -r -a ALIASES <<< "$ALIAS"
67+
68+
# Loop through all crt aliases
69+
for alias in ${aliases//,/ } ; do
70+
# Validate if the alias still exists in web.conf
71+
if [[ " ${ALIASES[@]} " =~ " ${alias} " ]]; then
72+
f_aliases+="$alias,"
73+
fi
74+
done
75+
76+
# Remove leading comma
77+
if [[ ${f_aliases: -1} = ',' ]] ; then f_aliases=${f_aliases::-1}; fi
78+
79+
# Write the filtered alias list to the default var
80+
aliases=$f_aliases
81+
6182
msg=$($BIN/v-add-letsencrypt-domain $user $domain $aliases)
6283
if [ $? -ne 0 ]; then
6384
log_event $E_INVALID "$domain $msg"
@@ -114,4 +135,4 @@ done
114135
# No Logging
115136
#log_event "$OK" "$EVENT"
116137

117-
exit
138+
exit

0 commit comments

Comments
 (0)