import Config

config :lightning, :emails, admin_email: "support@openfn.org"

# Configure your database
config :lightning, Lightning.Repo,
  username: "postgres",
  password: "postgres",
  hostname: "localhost",
  database: "lightning_dev",
  show_sensitive_data_on_connection_error: true,
  pool_size: 10

# For development, we disable any cache and enable
# debugging and code reloading.
#
# The watchers configuration can be used to run external
# watchers to your application. For example, we use it
# with esbuild to bundle .js and .css sources.
config :lightning, LightningWeb.Endpoint,
  url: [host: "localhost", port: 4000, scheme: "http"],
  http: [
    ip: {0, 0, 0, 0},
    port: 4000,
    compress: true
  ],
  check_origin: false,
  code_reloader: true,
  debug_errors: true,
  secret_key_base:
    "52IzqaXS4XPqCTDUSKzP4VDRpYmumPWMzWLvCG+RNLYZ8MogoRkfUr9ULKBVBLKy",
  watchers: [
    # Start the esbuild watcher by calling Esbuild.install_and_run(:default, args)
    esbuild:
      {Esbuild, :install_and_run, [:default, ~w(--sourcemap=inline --watch)]},
    tailwind: {Tailwind, :install_and_run, [:default, ~w(--watch)]},
    storybook_tailwind: {Tailwind, :install_and_run, [:storybook, ~w(--watch)]}
  ]

config :lightning,
  schemas_path: "priv/schemas",
  adaptor_icons_path: "priv/static/images/adaptors",
  repo_connection_signing_secret:
    "39h9Qr6+v2wgzjlh4xQoJ90aDe+LY7qIvA5v7QLsTwIwGDfs8el9Z0oFk2Ege33E"

config :lightning, Lightning.Vault,
  primary_encryption_key: "M1zzWU6Ego6jV/FUS7e/sj7yF9kRIutgR8uLQ9czrVc="

config :lightning, Lightning.Runtime.RuntimeManager, start: true

config :lightning, :workers,
  private_key: """
  -----BEGIN PRIVATE KEY-----
  MIIEvQIBADANBgkqhkiG9w0BAQEFAASCBKcwggSjAgEAAoIBAQCpnpkjo7vhBrXa
  cQk4xufVKZgWnb0b1UFHd52b2Zi3Qo4R+5+QNRc7hzxvDjJQ2tJ2l4cxjfuoad3h
  FyiHRRMdVTsSqa/1S0dk9ws9aN/gGEow+EIN2/RY4JW5f0xYDRx84lT7n7gxesbp
  82KNL/LO8Zn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Gi+qV4kQKBgGtZ
  HawFYAmVlHlQQCTiJtVLPQTnw/2/Y1sKg1Phb1RG5JtK475Mlbpoghb6CPVp0pGy
  40j39vfImsGLBzZGbhsthIRcA04NY5LMYKCqzjIkmPRVfMhVM06zDdOpinBTx98H
  oSAoIGlWSYSwr8guL7wPV8TKZ8SgQF2K+GimmDMJAoGANA0h5UNuHFZI8cg7SwR3
  UHrjyn9sMGQcn6CUnpgHEtZa9i0Dw4Wcx0j7KcKV68XIIisIqRweFDvgrUC/XJiD
  8awEXEW3Y84FisbI3snDpqTHIPnsh4zaJfbHzr4HEeW9qeCKbmYrvC+nQJD+vu3J
  3wneQ/c7fH6DI81VAtBtMWA=
  -----END PRIVATE KEY-----
  """,
  worker_secret: "ZOr2sjacHZnql7WYETL2x61d6RDdecnyLWieoG+bX6Q="

# ## SSL Support
#
# In order to use HTTPS in development, a self-signed
# certificate can be generated by running the following
# Mix task:
#
#     mix phx.gen.cert
#
# Note that this task requires Erlang/OTP 20 or later.
# Run `mix help phx.gen.cert` for more information.
#
# The `http:` config above can be replaced with:
#
#     https: [
#       port: 4001,
#       cipher_suite: :strong,
#       keyfile: "priv/cert/selfsigned_key.pem",
#       certfile: "priv/cert/selfsigned.pem"
#     ],
#
# If desired, both `http:` and `https:` keys can be
# configured to run both http and https servers on
# different ports.

# Watch static and templates for browser reloading.
config :lightning, LightningWeb.Endpoint,
  live_reload: [
    patterns: [
      ~r"priv/static/.*(js|css|png|jpeg|jpg|gif|svg)$",
      ~r"priv/gettext/.*(po)$",
      ~r"lib/lightning_web/(live|components|views)/.*(ex|heex)$",
      ~r"lib/lightning_web/templates/.*(eex)$",
      ~r"storybook/.*(exs)$"
    ]
  ]

# Do not include metadata nor timestamps in development logs
config :logger, :console, format: "[$level] $message\n"

# Set a higher stacktrace during development. Avoid configuring such
# in production as building large stacktraces may be expensive.
config :phoenix, :stacktrace_depth, 20

# Initialize plugs at runtime for faster development compilation
config :phoenix, :plug_init_mode, :runtime

config :lightning, :is_resettable_demo, true

config :lightning, :apollo, endpoint: "http://localhost:3000", timeout: 30_000
