Advertisement
Guest User

Untitled

a guest
Sep 2nd, 2018
99
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Erlang 2.34 KB | None | 0 0
  1. # Configuration for the Raspberry Pi 3 (target rpi3)
  2. use Mix.Config
  3.  
  4. key_mgmt = System.get_env("NERVES_NETWORK_KEY_MGMT") || "WPA-PSK"
  5.  
  6. config :nerves_network,
  7.   regulatory_domain: "ES"
  8.  
  9. config :nerves_network, :default,
  10.   wlan0: [
  11.     ssid: System.get_env("NERVES_NETWORK_SSID"),
  12.     psk: System.get_env("NERVES_NETWORK_PSK"),
  13.     key_mgmt: String.to_atom(key_mgmt)
  14.   ],
  15.   eth0: [
  16.     ipv4_address_method: :dhcp
  17.   ]
  18.  
  19. # Uncomment the following line for the interface you intend to use,
  20. # if not the wired :eth0 interface.
  21. config :firmware, interface: :wlan0
  22. # config :firmware, interface: :eth0
  23. # config :firmware, interface: :usb0
  24.  
  25. # Nerves.Firmware.SSH An infrastruction to support "over-the-air" firmware updates with Nerves by using ssh
  26. config :nerves_firmware_ssh,
  27.   authorized_keys: [
  28.     File.read!(Path.join(System.user_home!(), ".skm/Mlopezc-rrbp3/id_rsa.pub")),
  29.     File.read!(Path.join(System.user_home!(), ".skm/johannrbpi/id_rsa.pub"))
  30.   ]
  31.  
  32. # Set a mdns domain and node_name to be able to remsh into the device.
  33. config :nerves_init_gadget,
  34.   ifname: "wlan0",
  35.   node_name: :firmware,
  36.   mdns_domain: ":firmware.local",
  37.   ssh_console_port: 22
  38.  
  39. # Configure your database
  40. config :uisrv, Uisrv.Repo,
  41.   adapter: Sqlite.Ecto2,
  42.   database: "/root/#{Mix.env()}.sqlite3"
  43.  
  44. # General application configuration
  45. config :uisrv,
  46.   ecto_repos: [Uisrv.Repo]
  47.  
  48. # Phoenix Endpoint configuration
  49. config :uisrv, UisrvWeb.Endpoint,
  50.   # This ip should be a public domain for an internet connected Raspberry
  51.   # For local test we fix our DHCP server to assing this ip to Raspberry's device wlan0
  52.  url: [host: "192.168.1.50"],
  53.  http: [port: 80],
  54.  secret_key_base: "s+p9jABrjMUuISSfH5VfOC3RR00QM9NQLBzUZ9VLN7IQN52HUjsNuShvsAi5qb1U",
  55.  root: Path.dirname(__DIR__),
  56.  server: true,
  57.  render_errors: [view: UisrvWeb.ErrorView, accepts: ~w(html json)],
  58.  pubsub: [name: Nerves.PubSub, adapter: Phoenix.PubSub.PG2],
  59.  code_reloader: false
  60.  
  61. # Configures Guardian
  62. config :uisrv, Uisrv.Auth.Guardian,
  63.  issuer: "uisrv",
  64.  secret_key: "Utahl6iK5poGWhrnunoDCLADNg3v4S0/XU4A4e2IjOfZvRZW3XX4TResib63ENiW",
  65.  token_ttl: %{
  66.    "magic" => {30, :minutes},
  67.    "access" => {1, :days}
  68.  }
  69.  
  70. config :uisrv, Uisrv.Mailer,
  71.  adapter: Swoosh.Adapters.Sendgrid,
  72.  api_key: System.get_env("SEND_GRID_PHANTABERRY_KEY")
  73.  
  74. config :uisrv, :defaults, wrap_tag: :li
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement