44 lines
1.2 KiB
Elixir
44 lines
1.2 KiB
Elixir
import Config
|
|
|
|
config :localiserd, Localiser.Repo,
|
|
database: Path.expand("../priv/db/localiser.db", Path.dirname(__ENV__.file)),
|
|
pool_size: 5
|
|
|
|
config :localiserd, ecto_repos: [Localiser.Repo]
|
|
|
|
config :localiserd, Localiser.Web.Endpoint,
|
|
adapter: Bandit.PhoenixAdapter,
|
|
http: [port: 4000],
|
|
secret_key_base: System.get_env("SECRET_KEY_BASE") ||
|
|
"localiser_dev_secret_key_base_change_in_prod_min64chars!!",
|
|
server: true,
|
|
pubsub_server: Localiser.PubSub,
|
|
render_errors: [formats: [json: Localiser.ErrorView], layout: false]
|
|
|
|
config :localiserd, :jwt_secret,
|
|
System.get_env("JWT_SECRET") || "localiser_dev_jwt_secret_change_in_prod!!"
|
|
|
|
config :localiserd, enrollment_timeout_ms: 20_000
|
|
|
|
config :mdns_lite,
|
|
hosts: ["localiser"],
|
|
ttl: 120,
|
|
services: [
|
|
# advertise this service on the local network for auto-discovery by clients
|
|
%{
|
|
id: :localiserd,
|
|
protocol: "localiserd",
|
|
transport: "tcp",
|
|
# todo: grab port from config
|
|
port: 4000
|
|
},
|
|
|
|
# also advertise the MQTT broker for direct discovery by new sensors
|
|
%{
|
|
id: :mqtt,
|
|
protocol: "mqtt",
|
|
transport: "tcp",
|
|
port: Application.compile_env(:localiserd, :mqtt_port, 1883)
|
|
}
|
|
]
|