import Config

config :riichi_advanced, RiichiAdvancedWeb.Endpoint,
  # Binding to loopback ipv4 address prevents access from other machines.
  # Change to `ip: {0, 0, 0, 0}` to allow access from other machines.
  http: [
    ip: {0, 0, 0, 0},
    port: System.get_env("HTTP_PORT") || 80,
    thousand_island_options: [transport_options: [reuseport: true]],
  ],
  https: [
    port: System.get_env("HTTPS_PORT") || 443,
    thousand_island_options: [transport_options: [reuseport: true]],
    cipher_suite: :strong,
    certfile: "priv/cert/selfsigned.pem",
    keyfile: "priv/cert/selfsigned_key.pem"
  ],
  server: true,
  check_origin: true,
  debug_errors: true,
  # doesn't really matter what this is if you're running this locally
  secret_key_base: System.get_env("SECRET_KEY") || "250424b3a560dca9e9700e4adc1d166ca6bffb9b9910cbef270293751f0250a2",
  watchers: [
    esbuild: {Esbuild, :install_and_run, [:riichi_advanced, ~w(--sourcemap=inline --watch)]},
  ]


# Note we also include the path to a cache manifest
# containing the digested version of static files. This
# manifest is generated by the `mix assets.deploy` task,
# which you should run after static files are built and
# before starting your production server.
config :testme, RiichiAdvancedWeb.Endpoint, cache_static_manifest: "priv/static/cache_manifest.json"

# Configures Swoosh API Client
# config :swoosh, api_client: Swoosh.ApiClient.Finch, finch_name: Testme.Finch

# Disable Swoosh Local Memory Storage
# config :swoosh, local: false

# Do not print debug messages in production
# config :logger, level: :info

# Runtime production configuration, including reading
# of environment variables, is done on config/runtime.exs.

# Disable swoosh api client
config :swoosh, :api_client, false

# Enable dev routes for dashboard and mailbox
config :riichi_advanced, dev_routes: true

# serve files in the toplevel priv (instead of the one in the _build directory)
config :riichi_advanced, :priv_dir, Path.join(File.cwd!(), "priv")
