Kaynağa Gözat

feat(redis): redis sentinel support ssl connect

zhanghongtong 4 yıl önce
ebeveyn
işleme
be36e51f6e

+ 9 - 2
.github/workflows/run_cts_tests.yaml

@@ -357,13 +357,20 @@ jobs:
           EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:6380
           EOF
       - name: setup
-        if: matrix.node_type == 'sentinel'
+        if: matrix.node_type == 'sentinel' && matrix.connect_type == 'tcp'
         run: |
           cat <<-EOF >> "$GITHUB_ENV"
           EMQX_AUTH__REDIS__TYPE=sentinel
           EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:26379
           EMQX_AUTH__REDIS__SENTINEL=mymaster
-          EMQX_AUTH__REDIS__POOL=1
+          EOF
+      - name: setup
+        if: matrix.node_type == 'sentinel' && matrix.connect_type == 'tls'
+        run: |
+          cat <<-EOF >> "$GITHUB_ENV"
+          EMQX_AUTH__REDIS__TYPE=sentinel
+          EMQX_AUTH__REDIS__SERVER=${redis_${{ matrix.network_type }}_address}:26380
+          EMQX_AUTH__REDIS__SENTINEL=mymaster
           EOF
       - name: setup
         if: matrix.node_type == 'cluster' && matrix.connect_type == 'tcp'

+ 1 - 1
apps/emqx_auth_redis/rebar.config

@@ -1,7 +1,7 @@
 {deps,
   %% NOTE: mind poolboy version when updating eredis_cluster version
   %% poolboy version may clash with emqx_auth_mongo
- [{eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.6.4"}}},
+ [
   {poolboy, {git, "https://github.com/emqx/poolboy.git", {tag, "1.5.2"}}}
  ]}.
 

+ 1 - 1
apps/emqx_auth_redis/src/emqx_auth_redis_cli.erl

@@ -38,7 +38,7 @@ connect(Opts) ->
     Host = case Sentinel =:= "" of
         true -> get_value(host, Opts);
         false ->
-            _ = eredis_sentinel:start_link(get_value(servers, Opts)),
+            _ = eredis_sentinel:start_link(get_value(servers, Opts), get_value(options, Opts, [])),
             "sentinel:" ++ Sentinel
     end,
     case eredis:start_link(Host,

+ 2 - 1
rebar.config

@@ -36,7 +36,8 @@
 {erl_first_files, ["src/emqx_logger.erl", "src/emqx_rule_actions_trans.erl"]}.
 
 {deps,
-    [ {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}
+    [ {eredis_cluster, {git, "https://github.com/emqx/eredis_cluster", {tag, "0.6.5"}}}
+    , {gproc, {git, "https://github.com/uwiger/gproc", {tag, "0.8.0"}}}
     , {jiffy, {git, "https://github.com/emqx/jiffy", {tag, "1.0.5"}}}
     , {cowboy, {git, "https://github.com/emqx/cowboy", {tag, "2.8.2"}}}
     , {esockd, {git, "https://github.com/emqx/esockd", {tag, "5.8.0"}}}