From 00f544b97214e93b3734a4fe0fa0df5f9409f23e Mon Sep 17 00:00:00 2001 From: fabricedge Date: Mon, 7 Apr 2025 02:06:20 -0300 Subject: [PATCH 1/8] port 443 as usable elixir_auth_google.ex In my project i used port 443, so each time i was a trying to access it via this port the connection was blocked. This solution mighty be simple but it works. need to do: add error handler case server is using lets say port 4000 or 4001. --- lib/elixir_auth_google.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir_auth_google.ex b/lib/elixir_auth_google.ex index 15d8363..c84eaf8 100644 --- a/lib/elixir_auth_google.ex +++ b/lib/elixir_auth_google.ex @@ -26,7 +26,7 @@ defmodule ElixirAuthGoogle do `get_baseurl_from_conn/1` derives the base URL from the conn struct """ @spec get_baseurl_from_conn(conn) :: String.t() - def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) when p != 80 do + def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) when p != 80 || !=443 do "#{Atom.to_string(s)}://#{h}:#{p}" end From bea6f3313ce36917483159f9417951e80ff36871 Mon Sep 17 00:00:00 2001 From: fabricedge Date: Mon, 7 Apr 2025 02:09:20 -0300 Subject: [PATCH 2/8] Update elixir_auth_google.ex port 443 support --- lib/elixir_auth_google.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir_auth_google.ex b/lib/elixir_auth_google.ex index c84eaf8..fe83d32 100644 --- a/lib/elixir_auth_google.ex +++ b/lib/elixir_auth_google.ex @@ -26,7 +26,7 @@ defmodule ElixirAuthGoogle do `get_baseurl_from_conn/1` derives the base URL from the conn struct """ @spec get_baseurl_from_conn(conn) :: String.t() - def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) when p != 80 || !=443 do + def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) when p != 80 || p !=443 do "#{Atom.to_string(s)}://#{h}:#{p}" end From bc7ce6833d5a57e859482777f0ceb6cceebbb04a Mon Sep 17 00:00:00 2001 From: fabricedge Date: Mon, 7 Apr 2025 02:35:36 -0300 Subject: [PATCH 3/8] Update elixir_auth_google.ex Soo if the server starts using port 4001... its will only use the Scheme and Port cause most of the time the server its not being acessed with an port in the URL. --- lib/elixir_auth_google.ex | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/lib/elixir_auth_google.ex b/lib/elixir_auth_google.ex index fe83d32..0683300 100644 --- a/lib/elixir_auth_google.ex +++ b/lib/elixir_auth_google.ex @@ -25,11 +25,16 @@ defmodule ElixirAuthGoogle do @doc """ `get_baseurl_from_conn/1` derives the base URL from the conn struct """ - @spec get_baseurl_from_conn(conn) :: String.t() - def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) when p != 80 || p !=443 do - "#{Atom.to_string(s)}://#{h}:#{p}" + @spec get_baseurl_from_conn(conn) :: String.t() + def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) do + if p != 80 do + "#{Atom.to_string(s)}://#{h}" + else + "#{Atom.to_string(s)}://#{h}:#{p}" + end end + def get_baseurl_from_conn(%{host: h, scheme: s}) do "#{Atom.to_string(s)}://#{h}" end From 80e94779912a5e23c9ff07d6552aaa214e04704e Mon Sep 17 00:00:00 2001 From: fabricedge Date: Wed, 2 Jul 2025 03:10:42 -0300 Subject: [PATCH 4/8] Update elixir_auth_google.ex it mighty work now. --- lib/elixir_auth_google.ex | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/elixir_auth_google.ex b/lib/elixir_auth_google.ex index 0683300..a23c8db 100644 --- a/lib/elixir_auth_google.ex +++ b/lib/elixir_auth_google.ex @@ -27,7 +27,7 @@ defmodule ElixirAuthGoogle do """ @spec get_baseurl_from_conn(conn) :: String.t() def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) do - if p != 80 do + if p != p do "#{Atom.to_string(s)}://#{h}" else "#{Atom.to_string(s)}://#{h}:#{p}" From b0a8eced85804216f1d9a2e90f7d5b95853a329d Mon Sep 17 00:00:00 2001 From: fabricedge Date: Wed, 2 Jul 2025 04:21:54 -0300 Subject: [PATCH 5/8] Update elixir_auth_google.ex tested in prod. its working. --- lib/elixir_auth_google.ex | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/elixir_auth_google.ex b/lib/elixir_auth_google.ex index a23c8db..73c591c 100644 --- a/lib/elixir_auth_google.ex +++ b/lib/elixir_auth_google.ex @@ -25,12 +25,12 @@ defmodule ElixirAuthGoogle do @doc """ `get_baseurl_from_conn/1` derives the base URL from the conn struct """ - @spec get_baseurl_from_conn(conn) :: String.t() + @spec get_baseurl_from_conn(conn) :: String.t() def get_baseurl_from_conn(%{host: h, port: p, scheme: s}) do - if p != p do - "#{Atom.to_string(s)}://#{h}" - else - "#{Atom.to_string(s)}://#{h}:#{p}" + cond do + p == 443 -> "#{Atom.to_string(s)}://#{h}" + p == 80 -> "#{Atom.to_string(s)}://#{h}" + true -> "#{Atom.to_string(s)}://#{h}:#{p}" end end From 005d551c78b2d7bf04f3d80184d4e41aff78efa3 Mon Sep 17 00:00:00 2001 From: fabricedge Date: Thu, 3 Jul 2025 00:31:08 -0300 Subject: [PATCH 6/8] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 6cd1510..cdcffb0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: Elixir CI - +runs-on: self-hosted on: push: branches: [ main ] From 8def6588d29e1e051070affe2fd771d543803c01 Mon Sep 17 00:00:00 2001 From: fabricedge Date: Thu, 3 Jul 2025 00:32:01 -0300 Subject: [PATCH 7/8] Update ci.yml --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index cdcffb0..505343a 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -1,5 +1,5 @@ name: Elixir CI -runs-on: self-hosted + on: push: branches: [ main ] @@ -9,7 +9,7 @@ on: jobs: build: name: Build and test - runs-on: ubuntu-latest + runs-on: self-hosted steps: - uses: actions/checkout@v2 - name: Set up Elixir From 02de7257eaecf7ad48a87ec84158d7f13705a984 Mon Sep 17 00:00:00 2001 From: fabricedge Date: Thu, 3 Jul 2025 02:22:03 -0300 Subject: [PATCH 8/8] Update ci.yml --- .github/workflows/ci.yml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 505343a..6cd1510 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,7 +9,7 @@ on: jobs: build: name: Build and test - runs-on: self-hosted + runs-on: ubuntu-latest steps: - uses: actions/checkout@v2 - name: Set up Elixir