Skip to content

Commit

Permalink
add cration of .well-known folder
Browse files Browse the repository at this point in the history
  • Loading branch information
Hystepik committed Feb 9, 2024
1 parent dfe668b commit b20d10c
Showing 1 changed file with 18 additions and 4 deletions.
22 changes: 18 additions & 4 deletions scripts/action_suspend_unsuspend.sh
Original file line number Diff line number Diff line change
Expand Up @@ -353,11 +353,25 @@ if [[ "$mode" == "rename" ]]; then
# We must create it using letsencrypt if not yet created
if [[ ! -e /home/admin/wwwroot/dolibarr_documents/sellyoursaas_local/crt/$fqn-custom.crt ]]; then
# When we rename, it may be because we change abc.with... into def.with..., or
# because we added a custom url

# because we added a custom url

if [[ ! -d $instancedir/htdocs/.well-known ]]; then
echo "mkdir $instancedir/htdocs/.well-known"
mkdir $instancedir/htdocs/.well-known
echo "chown $osusername:$osusername $instancedir/htdocs/.well-known"
chown $osusername:$osusername $instancedir/htdocs/.well-known
fi

if [[ ! -d $instancedir/htdocs/.well-known/acme-challenge ]]; then
echo "mkdir $instancedir/htdocs/.well-known/acme-challenge"
mkdir $instancedir/htdocs/.well-known/acme-challenge
echo "chown $osusername:$osusername $instancedir/htdocs/.well-known/acme-challenge"
chown $osusername:$osusername $instancedir/htdocs/.well-known/acme-challenge
fi

# Generate the letsencrypt certificate
echo "certbot certonly --webroot -w $instancedir -d $customurl"
certbot certonly --webroot -w $instancedir -d $customurl
echo "certbot certonly --webroot -w $instancedir/htdocs -d $customurl"
certbot certonly --webroot -w $instancedir/htdocs -d $customurl

# create links
if [[ -e /etc/letsencrypt/live/$customurl/cert.pem ]]; then
Expand Down

0 comments on commit b20d10c

Please sign in to comment.