From fdb5dc1f982f93ff669e7fb892332bdd7fdaef56 Mon Sep 17 00:00:00 2001 From: Jamil Bou Kheir Date: Wed, 11 Nov 2020 12:15:34 -0600 Subject: [PATCH] more debugging... --- .github/workflows/ci.yml | 4 ++++ config/releases.exs | 2 +- pkg/debian/DEBIAN/postinst | 6 +++--- scripts/build_prod_release.sh | 11 +++++++++++ 4 files changed, 19 insertions(+), 4 deletions(-) create mode 100755 scripts/build_prod_release.sh diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 676670021..471f40ee5 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -88,6 +88,10 @@ jobs: echo "Checking if FireGuard service is active" sudo systemctl is-active fireguard + echo "Checking certs..." + cat /opt/fireguard/ssl/cert.pem + cat /opt/fireguard/ssl/key.pem + echo "Connecting with openssl" openssl s_client -connect localhost:8800 -showcerts -prexit -debug diff --git a/config/releases.exs b/config/releases.exs index 70b303a1a..ff5bff051 100644 --- a/config/releases.exs +++ b/config/releases.exs @@ -47,7 +47,7 @@ ssl_key_file = Environment variable SSL_KEY_FILE is missing. FireGuard requires SSL. """ -ssl_ca_cert_file = System.get_env("SSL_CA_CERT_FILE") || nil +ssl_ca_cert_file = System.get_env("SSL_CA_CERT_FILE") # Optional environment variables pool_size = String.to_integer(System.get_env("POOL_SIZE") || "10") diff --git a/pkg/debian/DEBIAN/postinst b/pkg/debian/DEBIAN/postinst index 2aee6ab87..a0f2a2638 100755 --- a/pkg/debian/DEBIAN/postinst +++ b/pkg/debian/DEBIAN/postinst @@ -60,7 +60,7 @@ SECRET_KEY_BASE="${secret_key_base}" # The URL to connect to your DB. Assumes the database has been created and this # user has privileges to create and modify tables. -DATABASE_URL="ecto://${db_user}:${db_password}@localhost/fireguard" +DATABASE_URL="ecto://${db_user}:${db_password}@${hostname}/fireguard" # The public key for the WireGuard interface controlled by FireGuard. # This should match what's in /etc/wireguard/wg-fireguard.conf. @@ -84,8 +84,8 @@ SSL_KEY_FILE=/opt/fireguard/ssl/key.pem SSL_CA_CERT_FILE= # Host to use for generating links back to the application, such as in -# outbound emails. Defaults to "localhost" -URL_HOST=localhost +# outbound emails. Defaults to "localhost". +URL_HOST=${hostname} # For public-facing sites, it's recommended to leave signups disabled. DISABLE_SIGNUP=yes diff --git a/scripts/build_prod_release.sh b/scripts/build_prod_release.sh new file mode 100755 index 000000000..82657ae13 --- /dev/null +++ b/scripts/build_prod_release.sh @@ -0,0 +1,11 @@ +#!/usr/bin/env bash + +od=$(pwd) +export MIX_ENV=prod + +cd apps/fg_http +npm run deploy --prefix assets +mix phx.digest + +cd $od +mix release