Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 8 additions & 6 deletions test_server_installer_rocky_9.sh
Original file line number Diff line number Diff line change
Expand Up @@ -86,6 +86,7 @@ NGINX_CONTENTS='map $http_upgrade $connection_upgrade {
}

add_header Access-Control-Allow-Origin "*";
# Samknows SSL configuration add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; ";

server {
listen 80 default_server;
Expand Down Expand Up @@ -168,9 +169,9 @@ if $MANUAL_INSTALL
echo yum install $PACKAGES_SUGGEST
echo
echo "This will also install the latest available mainline kernel from EL Repo"
echo
echo
echo "dnf --enablerepo=elrepo-kernel install kernel-ml && grubby --default-kernel"
echo
echo
echo "Would you like these packages installed now?"
select yn in "Yes" "No"; do
case $yn in
Expand Down Expand Up @@ -450,17 +451,18 @@ install_samknows_firewallrules () {
}

install_samknows_certbot () {
certbot --agree-tos -n --nginx -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL > /dev/null 2>&1
certbot --agree-tos --hsts -n --nginx -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL > /dev/null 2>&1
if [[ $? -ne 0 ]]
then
echo "Error: certbot exited with an error when running:"
echo "certbot --agree-tos -n --nginx --no-redirect -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL"
echo "certbot --agree-tos --hsts -n --nginx --no-redirect -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL"
echo "Please run certbot to manually generate a SSL certificate."
exit 1;
fi
sed -i '36,39s/# Samknows SSL configuration listen/ listen/g' $NGINX_FILENAME
sed -i '30,30s/# Samknows SSL configuration listen/ listen/g' $NGINX_FILENAME
sed -i '37,40s/# Samknows SSL configuration add_header/ add_header/g' $NGINX_FILENAME
sed -i '/^#/d' $NGINX_FILENAME
sed -i '63,$ d' $NGINX_FILENAME
sed -i '64,$ d' $NGINX_FILENAME
awk -v n=3 '/^server/{n--}; n > 0' $NGINX_FILENAME > $NGINX_FILENAME.new && mv $NGINX_FILENAME.new $NGINX_FILENAME
}

Expand Down
10 changes: 6 additions & 4 deletions test_server_installer_ubuntu.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,7 @@ NGINX_COFIG='map $http_upgrade $connection_upgrade {
}

add_header Access-Control-Allow-Origin "*";
# Samknows SSL configuration add_header Strict-Transport-Security "max-age=15552000; includeSubdomains; ";

server {
listen 80 default_server;
Expand Down Expand Up @@ -439,17 +440,18 @@ install_samknows_firewallrules () {
}

install_samknows_certbot () {
certbot --agree-tos -n --nginx -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL > /dev/null 2>&1
certbot --agree-tos --hsts -n --nginx -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL > /dev/null 2>&1
if [[ $? -ne 0 ]]
then
echo "Error: certbot exited with an error doing:"
echo "certbot --agree-tos -n --nginx --no-redirect -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL"
echo "certbot --agree-tos --hsts -n --nginx --no-redirect -d $FQDN_HOSTNAME -m $CERTBOT_EMAIL"
echo "Please run certbot to manually generate a SSL certificate."
exit 1;
fi
sed -i '36,39s/# Samknows SSL configuration listen/ listen/g' $NGINX_FILENAME
sed -i '30,30s/# Samknows SSL configuration listen/ listen/g' $NGINX_FILENAME
sed -i '37,40s/# Samknows SSL configuration add_header/ add_header/g' $NGINX_FILENAME
sed -i '/^#/d' $NGINX_FILENAME
sed -i '63,$ d' $NGINX_FILENAME
sed -i '64,$ d' $NGINX_FILENAME
awk -v n=3 '/^server/{n--}; n > 0' $NGINX_FILENAME > $NGINX_FILENAME.new && mv $NGINX_FILENAME.new $NGINX_FILENAME
}

Expand Down