Nervesの初期設定では、hostnameが"nerves"
になっており、そのためNervesデバイスのIExにアクセスするときにはssh nerves.local
をよく使うと思います
それを自分のアプリ名に変更する言う話です
config/target.exs
config :mdns_lite,
# The `host` key specifies what hostnames mdns_lite advertises. `:hostname`
# advertises the device's hostname.local. For the official Nerves systems, this
# is "nerves-<4 digit serial#>.local". mdns_lite also advertises
# "nerves.local" for convenience. If more than one Nerves device is on the
# network, delete "nerves" from the list.
- host: [:hostname, "nerves"],
+ host: [:hostname, "my-nerves-app-name"],
ttl: 120,
これでssh my-nerves-app-name.local
でIExにアクセスできるようになりました
ネットワーク上にそのアプリが一つだけ存在している場合に、直感的にアクセスできるので気にいってます
そういえばどこかで見たことがあるな〜と思っていたら、やっぱりストック記事の中にありました