move config to a file, update readme with compile/run instructions

master
Thurloat 6 years ago
parent 75ed3bad0d
commit f0c518c3c9
  1. 20
      README.md
  2. 1
      config/dev.exs
  3. 4
      config/prod.exs
  4. 3
      mix.exs
  5. 1
      mix.lock
  6. 6
      rel/config.exs
  7. 2
      rel/config/dough.toml

@ -22,20 +22,22 @@ proxy server from sources they actually trust.
## Running the server ## Running the server
You can compile a release by running the following: You can compile and run a release by executing the following.
``` ```
export REPLACE_OS_VARS=true $ mix deps.get
export MIX_ENV=prod
mix release --env=prod
```
Then to run the server, you can supply your own DNS server via the DOUGH_DNS $ MIX_ENV=prod mix release --env=prod
environment variable.
$ cp _build/prod/rel/dough/etc/dough.toml ~/.config
$ _build/prod/rel/dough/bin/dough foreground
``` ```
DOUGH_DNS="1.1.1.1" _build/prod/rel/dough/bin/dough foreground
``` Feel free to edit the config file at `~/.config/dough.toml` to configure it to
use your favourite DNS provider as the proxy. By default, it's configured to
use [OpenNIC](https://www.opennic.org/) DNS servers for maximum freedom (as in
birds).
## Configure Firefox ## Configure Firefox

@ -0,0 +1 @@
use Mix.Config

@ -1,4 +1,4 @@
use Mix.Config use Mix.Config
config :dough, #config :dough,
dns_server: "${DOUGH_DNS}" # dns_server: "${DOUGH_DNS}"

@ -26,7 +26,8 @@ defmodule Dough.MixProject do
{:plug, "~> 1.5"}, {:plug, "~> 1.5"},
{:dns, "~> 2.1.0"}, {:dns, "~> 2.1.0"},
{:cachex, "~> 3.0.3"}, {:cachex, "~> 3.0.3"},
{:distillery, "~> 2.0"} {:distillery, "~> 2.0"},
{:toml, "~> 0.3.0"}
] ]
end end
end end

@ -10,5 +10,6 @@
"plug": {:hex, :plug, "1.6.2", "e06a7bd2bb6de5145da0dd950070110dce88045351224bd98e84edfdaaf5ffee", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"}, "plug": {:hex, :plug, "1.6.2", "e06a7bd2bb6de5145da0dd950070110dce88045351224bd98e84edfdaaf5ffee", [:mix], [{:cowboy, "~> 1.0.1 or ~> 1.1 or ~> 2.4", [hex: :cowboy, repo: "hexpm", optional: true]}, {:mime, "~> 1.0", [hex: :mime, repo: "hexpm", optional: false]}], "hexpm"},
"ranch": {:hex, :ranch, "1.5.0", "f04166f456790fee2ac1aa05a02745cc75783c2bfb26d39faf6aefc9a3d3a58a", [:rebar3], [], "hexpm"}, "ranch": {:hex, :ranch, "1.5.0", "f04166f456790fee2ac1aa05a02745cc75783c2bfb26d39faf6aefc9a3d3a58a", [:rebar3], [], "hexpm"},
"socket": {:hex, :socket, "0.3.13", "98a2ab20ce17f95fb512c5cadddba32b57273e0d2dba2d2e5f976c5969d0c632", [:mix], [], "hexpm"}, "socket": {:hex, :socket, "0.3.13", "98a2ab20ce17f95fb512c5cadddba32b57273e0d2dba2d2e5f976c5969d0c632", [:mix], [], "hexpm"},
"toml": {:hex, :toml, "0.3.0", "069ca29f5458cb209c84b8839bf533304904d07eadcb90b6dd4dd4517772e458", [:mix], [], "hexpm"},
"unsafe": {:hex, :unsafe, "1.0.0", "7c21742cd05380c7875546b023481d3a26f52df8e5dfedcb9f958f322baae305", [:mix], [], "hexpm"}, "unsafe": {:hex, :unsafe, "1.0.0", "7c21742cd05380c7875546b023481d3a26f52df8e5dfedcb9f958f322baae305", [:mix], [], "hexpm"},
} }

@ -47,6 +47,12 @@ end
release :dough do release :dough do
set version: current_version(:dough) set version: current_version(:dough)
set config_providers: [
{Toml.Provider, [path: "${HOME}/.config/dough.toml"]}
]
set overlays: [
{:copy, "rel/config/dough.toml", "etc/dough.toml"}
]
set applications: [ set applications: [
:runtime_tools, :socket :runtime_tools, :socket
] ]

@ -0,0 +1,2 @@
[dough]
dns_server = "37.235.1.174"
Loading…
Cancel
Save