Skip to content

Commit

Permalink
Merge pull request #6444 from ant-media/add_ssl_for_docker
Browse files Browse the repository at this point in the history
Add SSL configuration for Docker container
  • Loading branch information
mekya committed Jul 2, 2024
2 parents 0faecc7 + a46c821 commit f66392a
Showing 1 changed file with 23 additions and 3 deletions.
26 changes: 23 additions & 3 deletions src/main/server/enable_ssl.sh
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,27 @@ get_password() {
done
}

# Check if there is a Container and install necessary packages
is_docker_container() {
if [ -f /.dockerenv ]; then
apt-get install iptables dnsutils -y
return 0
fi

return 1
}


SUDO="sudo"
if ! [ -x "$(command -v sudo)" ]; then
SUDO=""
fi

if is_docker_container; then
SUDO=""
fi


output() {
OUT=$?
if [ $OUT -ne 0 ]; then
Expand Down Expand Up @@ -138,8 +154,8 @@ wait_for_dns_validation() {
# Install jq
install_jq() {
if ! [ command -v jq &> /dev/null ]; then
sudo apt update -qq
sudo apt install -y jq
$SUDO apt update -qq
$SUDO apt install -y jq
fi
}

Expand Down Expand Up @@ -469,7 +485,11 @@ ipt_restore

echo ""

$SUDO service antmedia restart
if is_docker_container; then
kill -HUP 1
else
$SUDO service antmedia restart
fi

output

Expand Down

0 comments on commit f66392a

Please sign in to comment.