docker.exs 2.92 KB
Newer Older
1
2
3
4
# Mobilizon instance configuration

import Config

5
listen_ip = System.get_env("MOBILIZON_INSTANCE_LISTEN_IP", "0.0.0.0")
6
7

listen_ip =
Thomas Citharel's avatar
Thomas Citharel committed
8
  case listen_ip |> to_charlist() |> :inet.parse_address() do
9
10
11
12
    {:ok, listen_ip} -> listen_ip
    _ -> raise "MOBILIZON_INSTANCE_LISTEN_IP does not match the expected IP format."
  end

13
config :mobilizon, Mobilizon.Web.Endpoint,
14
15
  server: true,
  url: [host: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.lan")],
16
  http: [
17
    port: String.to_integer(System.get_env("MOBILIZON_INSTANCE_PORT", "4000")),
18
19
    ip: listen_ip
  ],
20
  secret_key_base: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY_BASE", "changethis")
21
22

config :mobilizon, Mobilizon.Web.Auth.Guardian,
pascoual's avatar
pascoual committed
23
  secret_key: System.get_env("MOBILIZON_INSTANCE_SECRET_KEY", "changethis")
24
25
26
27
28

config :mobilizon, :instance,
  name: System.get_env("MOBILIZON_INSTANCE_NAME", "Mobilizon"),
  description: "Change this to a proper description of your instance",
  hostname: System.get_env("MOBILIZON_INSTANCE_HOST", "mobilizon.lan"),
29
  registrations_open: System.get_env("MOBILIZON_INSTANCE_REGISTRATIONS_OPEN", "false") == "true",
30
31
32
33
  demo: false,
  allow_relay: true,
  federating: true,
  email_from: System.get_env("MOBILIZON_INSTANCE_EMAIL", "noreply@mobilizon.lan"),
pascoual's avatar
pascoual committed
34
  email_reply_to: System.get_env("MOBILIZON_REPLY_EMAIL", "noreply@mobilizon.lan")
35
36
37
38
39
40
41

config :mobilizon, Mobilizon.Storage.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: System.get_env("MOBILIZON_DATABASE_USERNAME", "username"),
  password: System.get_env("MOBILIZON_DATABASE_PASSWORD", "password"),
  database: System.get_env("MOBILIZON_DATABASE_DBNAME", "mobilizon"),
  hostname: System.get_env("MOBILIZON_DATABASE_HOST", "postgres"),
42
  port: 5432,
43
44
45
46
  pool_size: 10

config :mobilizon, Mobilizon.Web.Email.Mailer,
  adapter: Bamboo.SMTPAdapter,
pascoual's avatar
pascoual committed
47
48
49
50
51
  server: System.get_env("MOBILIZON_SMTP_SERVER", "localhost"),
  hostname: System.get_env("MOBILIZON_SMTP_HOSTNAME", "localhost"),
  port: System.get_env("MOBILIZON_SMTP_PORT", "25"),
  username: System.get_env("MOBILIZON_SMTP_USERNAME", nil),
  password: System.get_env("MOBILIZON_SMTP_PASSWORD", nil),
52
53
  tls: :if_available,
  allowed_tls_versions: [:tlsv1, :"tlsv1.1", :"tlsv1.2"],
pascoual's avatar
pascoual committed
54
  ssl: System.get_env("MOBILIZON_SMTP_SSL", "false"),
55
56
57
  retries: 1,
  no_mx_lookups: false,
  auth: :if_available
58
59
60
61
62
63
64
65
66
67

config :geolix,
  databases: [
    %{
      id: :city,
      adapter: Geolix.Adapter.MMDB2,
      source: "/var/lib/mobilizon/geo_db/GeoLite2-City.mmdb"
    }
  ]

68
69
70
config :mobilizon, Mobilizon.Web.Upload.Uploader.Local,
  uploads: System.get_env("MOBILIZON_UPLOADS", "/var/lib/mobilizon/uploads")

Thomas Citharel's avatar
Thomas Citharel committed
71
72
73
74
75
76
77
78
config :mobilizon, :exports,
  path: System.get_env("MOBILIZON_UPLOADS_EXPORTS", "/var/lib/mobilizon/uploads/exports"),
  formats: [
    Mobilizon.Service.Export.Participants.CSV,
    Mobilizon.Service.Export.Participants.PDF,
    Mobilizon.Service.Export.Participants.ODS
  ]

79
80
config :tz_world,
  data_dir: System.get_env("MOBILIZON_TIMEZONES_DIR", "/var/lib/mobilizon/timezones")