Browse Source

feat: configurable uploads dir

main
Inhji Y. 7 months ago
parent
commit
d8c5367dde
  1. 3
      .env.example
  2. 12
      config/releases.exs

3
.env.example

@ -2,5 +2,4 @@ SECRET_KEY_BASE=
DATABASE_URL=
PUBLIC_URL=
PORT=
MIRAGE_KEY_PATH=
MIRAGE_CERT_PATH=
UPLOAD_DIR=

12
config/releases.exs

@ -22,7 +22,14 @@ public_url =
System.get_env("PUBLIC_URL") ||
raise """
environment variable PUBLIC_URL is missing.
For example: mirage.gigalixirapp.com
For example: beta.inhji.de
"""
upload_dir =
System.get_env("UPLOAD_DIR") ||
raise """
environment variable UPLOAD_DIR is missing.
For example: /opt/mirage/uploads
"""
config :mirage, Mirage.Repo,
@ -37,3 +44,6 @@ config :mirage, MirageWeb.Endpoint,
url: [host: public_url, port: 443],
secret_key_base: secret_key_base,
server: true
config :waffle,
storage_dir_prefix: upload_dir

Loading…
Cancel
Save