From 3a4f8cb6eb2b7f267cc9bd40ba9356580cf480b9 Mon Sep 17 00:00:00 2001 From: JRoberts <8711996+jr-simplex@users.noreply.github.com> Date: Mon, 11 Jul 2022 16:39:27 +0400 Subject: [PATCH] corrections to ntf server linode script (#469) --- scripts/ntf-server-linode.sh | 13 +++++-------- scripts/smp-server-linode.sh | 4 ---- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/scripts/ntf-server-linode.sh b/scripts/ntf-server-linode.sh index ca7415007..e682c2122 100644 --- a/scripts/ntf-server-linode.sh +++ b/scripts/ntf-server-linode.sh @@ -1,8 +1,8 @@ #!/bin/bash +# # -# TODO review -# +# # # Log all stdout output to stackscript.log @@ -74,6 +74,8 @@ ntf-server --version # Initialize server init_opts=() +[[ $ENABLE_STORE_LOG == "on" ]] && init_opts+=(-l) + ip_address=$(curl ifconfig.me) init_opts+=(--ip $ip_address) @@ -85,10 +87,6 @@ ntf-server init "${init_opts[@]}" fingerprint=$(cat /etc/opt/simplex-notifications/fingerprint) # Determine server address to specify in welcome script and Linode tag -# ! If FQDN was provided and used as part of server initialization, server's certificate will not pass validation at client -# ! if client tries to connect by server's IP address, so we have to specify FQDN as server address in Linode tag and -# ! in welcome script regardless of creation of A record in Linode -# ! https://hackage.haskell.org/package/x509-validation-1.6.10/docs/src/Data-X509-Validation.html#validateCertificateName if [[ -n "$FQDN" ]]; then server_address=$FQDN else @@ -98,7 +96,6 @@ fi # Set up welcome script on_login_script="/opt/simplex-notifications/on_login.sh" -# TODO fix address # / Welcome script cat > $on_login_script << EOF #!/bin/bash @@ -109,7 +106,7 @@ server_address=\$2 cat << EOF2 ******************************************************************************** -SimpleX notifications server address: smp://\$fingerprint@\$server_address +SimpleX notifications server address: ntf://\$fingerprint@\$server_address Check server status with: systemctl status ntf-server To keep this server secure, the UFW firewall is enabled. diff --git a/scripts/smp-server-linode.sh b/scripts/smp-server-linode.sh index ba26a6a0d..2f57479c3 100644 --- a/scripts/smp-server-linode.sh +++ b/scripts/smp-server-linode.sh @@ -86,10 +86,6 @@ smp-server init "${init_opts[@]}" fingerprint=$(cat /etc/opt/simplex/fingerprint) # Determine server address to specify in welcome script and Linode tag -# ! If FQDN was provided and used as part of server initialization, server's certificate will not pass validation at client -# ! if client tries to connect by server's IP address, so we have to specify FQDN as server address in Linode tag and -# ! in welcome script regardless of creation of A record in Linode -# ! https://hackage.haskell.org/package/x509-validation-1.6.10/docs/src/Data-X509-Validation.html#validateCertificateName if [[ -n "$FQDN" ]]; then server_address=$FQDN else