Comments (4)
Hi, thank you for using the library and for bringing this up.
In a release you cannot serialize the configuration needed.
Do you mean that you can't pass a function in the Config when using a release?
Can you please explain what your proposed solution would be?
from fun_with_flags.
Yes. You can't serialize the :public_key.pkix_verify_hostname_match_fun(:https)
socket option when in a release.
Check out planswell@299250b . It adds a new option, aws for lack of a better option. When present it will deep merge the config required for Redix to connect.
from fun_with_flags.
I see, thanks for sharing.
To be honest I'm not too keen to add any AWS-specific config keyword. It might be the simplest solution, but it also doesn't seem very clean. This specific case is tricky because you can pass ssl: true
, so using SSL with a Redis that is not AWS ElastiCache would work.
The package already provides a solution for this: custom persistence adapters. You could copy and modify the Redis persistence adapter, add ElastiCache support, and then configure it. You could also release it as a standalone plugin package on Hex. The problem perhaps is that you can't do this (yet?) with the notifications adapter[1], but then you can configure the package to use the Phoenix.PubSub
notifications adapter instead of Redix.PubSub
, and then maybe configure that to use Phoenix.PubSub.Redis
under the hood, instead of Phoenix.PubSub.PG2
.
How does that sound?
[1]: Customizing the notifications adapter is a less common requirement than customizing the persistence adapter, so I didn't add it to keep the complexity under control.
from fun_with_flags.
I have found a workaround, not very clean but it does the job. It is possible to define the config like this:
socket_opts: [
verify: :verify_none,
customize_hostname_check: [
match_fun: &Elixir.MyApp.MyModule.pkix_verify_hostname_match_fun_https/2
]
]
and then define a specific module in your application:
defmodule MyApp.MyModule do
def pkix_verify_hostname_match_fun_https(a, b) do
:public_key.pkix_verify_hostname_match_fun(:https).(a,b)
end
end
This works because this syntax of anonymous function with arity is serializable during releases in the sys.config
file
from fun_with_flags.
Related Issues (20)
- (UndefinedFunctionError) function Ecto.Query.from/2 is undefined or private HOT 1
- Can't change config without doing a `mix deps.clean fun_with_flags`. HOT 3
- Changing `ecto_table_name` config requires recompile HOT 4
- Setting cache `enabled: false` crashes the app HOT 1
- [Question] Ensuring feature flags are in sync across dev environments HOT 3
- Proposed Postgrex Changes HOT 6
- The module `FunWithFlags.Supervisor` was given as a child to a supervisor but it does not exist HOT 11
- Support redis sentinel HOT 1
- Switch on ecto integration only if Ecto.Adapters.SQL exists HOT 5
- Warnings when FWF is used with ecto HOT 2
- Don't require compile-time configuration HOT 1
- Use case: flag <-> group relationship HOT 5
- mix release issue using Elixir 1.15.0 HOT 2
- Next release and Elixir 1.15 support HOT 2
- `disable/2` returns {:ok, true} HOT 1
- Suggest disabling cache for tests HOT 2
- low priority feature req - automatically remove stale flags HOT 1
- Feature request: Add timestamp columns HOT 1
- Asymmetry between options accepted by `enable`/`disable` compared to `enabled?/2` HOT 5
- Avoid Thundering Herd on Rollout of new Release HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from fun_with_flags.