From 811f8bdf9275ca6b2fe2bba4f1aacca24a1e0370 Mon Sep 17 00:00:00 2001 From: Josh Kalderimis Date: Mon, 18 Dec 2023 12:56:41 +0700 Subject: [PATCH 1/3] support `ssl` and `ssl_opts` connection options --- README.md | 4 ++++ lib/strategy.ex | 2 ++ mix.exs | 2 +- 3 files changed, 7 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 190bf6b..61ab9cb 100644 --- a/README.md +++ b/README.md @@ -37,6 +37,10 @@ config :libcluster, database: "postgres", port: 5432, parameters: [], + # optional, defaults to false + ssl: true, + # optional, please refer to the Postgrex docs + ssl_opts: nil, # optional, defaults to node cookie channel_name: "cluster" ], diff --git a/lib/strategy.ex b/lib/strategy.ex index b24b6a3..25d5dfc 100644 --- a/lib/strategy.ex +++ b/lib/strategy.ex @@ -32,6 +32,8 @@ defmodule LibclusterPostgres.Strategy do password: Keyword.fetch!(state.config, :password), database: Keyword.fetch!(state.config, :database), port: Keyword.fetch!(state.config, :port), + ssl: Keyword.get(state.config, :ssl), + ssl_opts: Keyword.get(state.config, :ssl_opts), parameters: Keyword.fetch!(state.config, :parameters), channel_name: channel_name ] diff --git a/mix.exs b/mix.exs index b19b9bb..5f29689 100644 --- a/mix.exs +++ b/mix.exs @@ -5,7 +5,7 @@ defmodule LibclusterPostgres.MixProject do [ name: "libcluster_postgres", app: :libcluster_postgres, - version: "0.1.1", + version: "0.1.2", elixir: "~> 1.14", start_permanent: Mix.env() == :prod, deps: deps(), From 869d67368dd74ff7fb2b5d35aa187beb43e8cf1f Mon Sep 17 00:00:00 2001 From: Ziinc Date: Wed, 3 Jan 2024 22:24:46 +0700 Subject: [PATCH 2/3] docs: add elixir forum link (#16) --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 61ab9cb..51467e1 100644 --- a/README.md +++ b/README.md @@ -3,6 +3,7 @@ [![Hex version badge](https://img.shields.io/hexpm/v/libcluster_postgres.svg)](https://hex.pm/packages/libcluster_postgres) [![License badge](https://img.shields.io/hexpm/l/libcluster_postgres.svg)](https://github.com/supabase/libcluster_postgres/blob/main/LICENSE) [![Elixir CI](https://github.com/supabase/libcluster_postgres/actions/workflows/elixir.yaml/badge.svg)](https://github.com/supabase/libcluster_postgres/actions/workflows/elixir.yaml) +[![ElixirForum](https://img.shields.io/badge/Elixir_Forum-grey)](https://elixirforum.com/t/libcluster-postgres-clustering-strategy-for-libcluster/60053) Postgres Strategy for [libcluster](https://hexdocs.pm/libcluster/) which is used by Supabase on the [realtime](https://github.com/supabase/realtime), [supavisor](https://github.com/supabase/supavisor) and [logflare](https://github.com/logflare/logflare) projects. From 3d6511d8247471a2fb307df23f942ed09a5fce7c Mon Sep 17 00:00:00 2001 From: Ziinc Date: Wed, 3 Jan 2024 22:24:57 +0700 Subject: [PATCH 3/3] chore: publish to hex.pm workflow (#15) --- .github/workflows/publish.yaml | 25 +++++++++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 .github/workflows/publish.yaml diff --git a/.github/workflows/publish.yaml b/.github/workflows/publish.yaml new file mode 100644 index 0000000..8f1227c --- /dev/null +++ b/.github/workflows/publish.yaml @@ -0,0 +1,25 @@ +name: Publish Elixir package + +on: + workflow_dispatch: + +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: erlef/setup-beam@v1 + with: + version-file: .tool-versions + version-type: strict + - name: Restore dependencies cache + uses: actions/cache@v3 + with: + path: deps + key: ${{ runner.os }}-mix-${{ hashFiles('**/mix.lock') }} + restore-keys: ${{ runner.os }}-mix- + - run: mix deps.get + - run: mix hex.publish --yes + if: github.event_name == 'workflow_dispatch' + env: + HEX_API_KEY: ${{ secrets.HEX_AUTH_TOKEN }}