index.community/backend/config/config.exs

101 lines
2.8 KiB
Elixir
Raw Normal View History

2019-07-14 11:47:06 +00:00
# This file is responsible for configuring your application
# and its dependencies with the aid of the Mix.Config module.
#
# This configuration file is loaded before any dependency and
# is restricted to this project.
# General application configuration
import Config
config :backend,
ecto_repos: [Backend.Repo]
# Configures the endpoint
config :backend, BackendWeb.Endpoint,
url: [host: "localhost"],
2021-07-30 16:53:51 +00:00
secret_key_base: System.get_env("SECRET_KEY_BASE"),
render_errors: [view: BackendWeb.ErrorView, accepts: ~w(json)]
2019-07-14 11:47:06 +00:00
config :backend, Backend.Repo, queue_target: 5000
2019-07-26 22:30:11 +00:00
config :backend, Backend.Elasticsearch.Cluster,
2021-01-17 09:47:23 +00:00
url: "http://elastic:9200",
2019-07-26 22:30:11 +00:00
api: Elasticsearch.API.HTTP,
2019-08-15 14:19:26 +00:00
json_library: Jason
2019-07-26 22:30:11 +00:00
2019-07-14 11:47:06 +00:00
# Configures Elixir's Logger
config :logger, :console,
format: "$time $metadata[$level] $message\n",
metadata: [:request_id]
# Use Jason for JSON parsing in Phoenix
config :phoenix, :json_library, Jason
2019-08-07 12:41:29 +00:00
config :gollum,
2019-08-21 15:47:45 +00:00
# 24 hrs
2019-08-07 12:41:29 +00:00
refresh_secs: 86_400,
lazy_refresh: true,
2021-07-30 16:53:51 +00:00
user_agent: "index.community crawler"
2019-08-07 12:41:29 +00:00
2019-08-21 15:47:45 +00:00
config :backend, Graph.Cache,
# 1 hour
gc_interval: 3600
2019-07-25 15:56:03 +00:00
config :backend, Backend.Mailer,
2021-07-30 16:53:51 +00:00
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("MAILER_RELAY"),
username: System.get_env("MAILER_USERNAME"),
password: System.get_env("MAILER_PASSWORD"),
ssl: true,
tls: :always,
auth: :always,
port: 465
2019-07-25 15:56:03 +00:00
2019-08-23 13:08:05 +00:00
config :backend, Mastodon.Messenger,
domain: System.get_env("MASTODON_DOMAIN"),
token: System.get_env("MASTODON_TOKEN")
2019-07-14 11:47:06 +00:00
config :backend, :crawler,
status_age_limit_days: 28,
status_count_limit: 5000,
personal_instance_threshold: 10,
2020-01-16 15:24:36 +00:00
crawl_interval_mins: 30,
2020-02-19 10:11:28 +00:00
crawl_workers: 100,
2019-07-14 11:47:06 +00:00
blacklist: [
# spam
2019-07-18 10:21:06 +00:00
"gab.best",
# spam
2019-08-27 13:50:16 +00:00
"4chan.icu",
# *really* doesn't want to be listed on fediverse.space
2019-08-27 13:50:16 +00:00
"pleroma.site",
# dummy instances used for pleroma CI
2019-08-27 13:50:16 +00:00
"pleroma.online"
2019-07-14 11:47:06 +00:00
],
2021-07-30 16:53:51 +00:00
user_agent: "index.community crawler",
require_bidirectional_mentions: false,
2019-07-25 15:56:03 +00:00
admin_phone: System.get_env("ADMIN_PHONE"),
2019-08-02 19:46:40 +00:00
admin_email: System.get_env("ADMIN_EMAIL")
2019-07-14 11:47:06 +00:00
config :backend, Backend.Scheduler,
jobs: [
# At midnight every day
{"@daily", {Backend.Scheduler, :prune_crawls, [1, "month"]}},
# 00.15 daily
2019-07-18 15:20:09 +00:00
{"15 0 * * *", {Backend.Scheduler, :generate_edges, []}},
# 00.30 every night
2019-07-25 15:56:03 +00:00
{"30 0 * * *", {Backend.Scheduler, :generate_insularity_scores, []}},
2019-07-27 17:58:40 +00:00
# 00.45 every night
{"45 0 * * *", {Backend.Scheduler, :generate_status_rate, []}},
2019-07-27 10:32:42 +00:00
# Every 3 hours
{"0 */3 * * *", {Backend.Scheduler, :check_for_spam_instances, []}}
2019-07-14 11:47:06 +00:00
]
config :phoenix, :template_engines,
eex: Appsignal.Phoenix.Template.EExEngine,
exs: Appsignal.Phoenix.Template.ExsEngine
2019-07-14 11:47:06 +00:00
# Import environment specific config. This must remain at the bottom
# of this file so it overrides the configuration defined above.
import_config "#{Mix.env()}.exs"