Skip to content

Commit 30aaecf

Browse files
committed
Scope Shuttle remotes to laptop daemon
1 parent b4afce8 commit 30aaecf

1 file changed

Lines changed: 30 additions & 6 deletions

File tree

config/dev.exs

Lines changed: 30 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,31 @@
11
import Config
22

3+
hostname =
4+
case :inet.gethostname() do
5+
{:ok, name} -> to_string(name)
6+
_ -> ""
7+
end
8+
9+
remotes =
10+
if hostname in ["dapmcw68"] do
11+
[
12+
%{
13+
name: "candide",
14+
url: "http://127.0.0.1:4001",
15+
poll_interval_ms: 5000,
16+
request_timeout_ms: 8000
17+
},
18+
%{
19+
name: "cineca",
20+
url: "http://127.0.0.1:4002",
21+
poll_interval_ms: 5000,
22+
request_timeout_ms: 8000
23+
}
24+
]
25+
else
26+
[]
27+
end
28+
329
config :shuttle, ShuttleWeb.Endpoint,
430
http: [ip: {127, 0, 0, 1}, port: 4000],
531
check_origin: false,
@@ -10,9 +36,7 @@ config :shuttle, ShuttleWeb.Endpoint,
1036
secret_key_base: "shuttlelocaldevkeybaseshuttlelocaldevkeybaseshuttlelocaldevkeybase"
1137

1238
# Remote Shuttle daemons reachable over local SSH LocalForwards.
13-
# See ~/.ssh/config — candide -> :4001, cineca -> :4002
14-
config :shuttle,
15-
remotes: [
16-
%{name: "candide", url: "http://127.0.0.1:4001", poll_interval_ms: 5000, request_timeout_ms: 8000},
17-
%{name: "cineca", url: "http://127.0.0.1:4002", poll_interval_ms: 5000, request_timeout_ms: 8000}
18-
]
39+
# See ~/.ssh/config — candide -> :4001, cineca -> :4002. Only the
40+
# laptop daemon aggregates remotes; remote daemons should not try to
41+
# recover themselves through their own LocalForward map.
42+
config :shuttle, remotes: remotes

0 commit comments

Comments
 (0)