Fuck it. Environment variable hack.

This commit is contained in:
Logan Hunt 2023-02-01 10:25:20 -07:00
parent 0ad97a374a
commit 9b5133dcbb
No known key found for this signature in database
GPG Key ID: 8AC6A4B840C0EC49
5 changed files with 18 additions and 33 deletions

View File

@ -151,6 +151,7 @@ function build_server() {
cp "${build_dir}/.env" $temp_file
printf "\nNODE_ID=$node_conn\nRELEASE_NODE=chessh@192.168.100.${node_id}\nRELEASE_DISTRIBUTION=name\nRELEASE_COOKIE=chessh\n" >> $temp_file
printf "CLUSTER_NODES=$(printf "chessh@192.168.100.%s," ${server_node_ids[@]})\n" >> $temp_file
scp $ssh_opts $temp_file $node_conn:~/.env
cp "${build_dir}/chessh.service" $temp_file

View File

@ -12,11 +12,3 @@ config :hammer,
{Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]},
redis: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}
]
config :libcluster,
topologies: [
chessh_dev: [
strategy: Elixir.Cluster.Strategy.ErlangHosts,
config: [timeout: 30_000]
]
]

View File

@ -10,20 +10,3 @@ config :chessh, RateLimits,
max_concurrent_user_sessions: 5,
player_session_message_burst_ms: 750,
player_session_message_burst_rate: 8
config :libcluster,
topologies: [
chessh: [
strategy: Elixir.Cluster.Strategy.Gossip,
config: [
port: 45892,
if_addr: "0.0.0.0",
multicast_if: "192.168.1.1",
multicast_addr: "233.252.255.255",
multicast_ttl: 1
]
]
]
config :libcluster,
debug: true

View File

@ -13,6 +13,23 @@ config :chessh, Web,
System.get_env("SERVER_REDIRECT_URI", "http://127.0.0.1:3000/api/oauth/redirect"),
port: String.to_integer(System.get_env("WEB_PORT", "8080"))
config :libcluster,
topologies: [
chessh: [
strategy: Cluster.Strategy.Epmd,
config: [
hosts:
String.split(System.get_env("CLUSTER_NODES", ""), ",")
|> Enum.filter(fn x -> String.length(x) > 0 end)
|> Enum.map(&String.to_atom/1)
],
connect: {:net_kernel, :connect, []},
disconnect: {:net_kernel, :disconnect, []},
list_nodes: {:erlang, :nodes, [:connected]},
child_spec: [restart: :transient]
]
]
config :joken,
default_signer: System.get_env("JWT_SECRET")

View File

@ -18,14 +18,6 @@ config :hammer,
redis: {Hammer.Backend.ETS, [expiry_ms: 60_000 * 60 * 4, cleanup_interval_ms: 60_000 * 10]}
]
config :libcluster,
topologies: [
chessh_test: [
strategy: Elixir.Cluster.Strategy.Epmd
]
]
config :chessh,
ssh_port: 42_069,
key_dir: Path.join(Path.dirname(__DIR__), "priv/test_keys")