# Pleroma instance configuration

# NOTE: This file should not be committed to a repo or otherwise made public
# without removing sensitive information.

use Mix.Config

# Configures the endpoint
config :pleroma, Pleroma.Web.Endpoint,
   url: [host: "pleroma.hatthieves.es", scheme: "https", port: 443],
   secret_key_base: "cXHImR89EePUjWdclU3vJUr8ZiGQiKLalhU9AMsEY5YnSG2e6MLzjmVwmxCztqa8",
   signing_salt: "g0uP6uv4"

config :pleroma, :instance,
  name: "Pleroma/HatThieves.es",
  email: "info@hatthieves.es",
  notify_email: "info@hatthieves.es",
  limit: 8192,
  registrations_open: true,
  dedupe_media: true,
  upload_limit: 25_000_000,
  federating: true,
  allow_relay: true,
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.SimplePolicy,
  public: true,
  quarantined_instances: [],
  dynamic_configuration: true

config :logger, :console,
  format: "$time $metadata[$level] $message\n",
  metadata: [:request_id]

#config :mime, :types, %{
#  "application/xml" => ["xml"],
#  "application/xrd+xml" => ["xrd+xml"],
#  "application/activity+json" => ["activity+json"],
#  "application/ld+json" => ["activity+json"]
#}

config :pleroma, :websub, Pleroma.Web.Websub
config :pleroma, :ostatus, Pleroma.Web.OStatus
config :pleroma, :httpoison, Pleroma.HTTP

version =
  with {version, 0} <- System.cmd("git", ["rev-parse", "HEAD"]) do
    "Pleroma #{Mix.Project.config()[:version]} #{String.trim(version)}"
  else
    _ -> "Pleroma #{Mix.Project.config()[:version]} dev"
  end

# Configures http settings, upstream proxy etc.
config :pleroma, :http, proxy_url: nil

config :pleroma, :activitypub,
  accept_blocks: true,
  unfollow_blocked: true,
  outgoing_blocks: true

config :pleroma, :hackney_pools,
  federation: [
    max_connections: 200,
    timeout: 300_000
  ],
  media: [
    max_connections: 100,
    timeout: 300_000
  ],
  upload: [
    max_connections: 100,
    timeout: 500_000
  ]

config :pleroma, :streamer,
  workers: 10,
  overflow_workers: 5

#config :pleroma, Pleroma.Uploaders.S3, s3_bucket: nil

config :pleroma, :emoji, shortcode_globs: ["/emoji/custom/**/*.png"]

config :pleroma, :uri_schemes, additionnal_schemes: []

config :pleroma, :user, deny_follow_blocked: true

config :pleroma, :mrf_rejectnonpublic,
  allow_followersonly: false,
  allow_direct: false

config :pleroma, :mrf_simple,
  media_removal: ["gab.com"],
  media_nsfw: [],
  federated_timeline_removal: ["gab.com"],
  report_removal: ["gab.com"],
  reject: ["gab.com"],
  accept: [],
  avatar_removal: ["gab.com"],
  banner_removal: ["gab.com"]

config :pleroma, :media_proxy,
  enabled: false,
  redirect_on_failure: true
  #base_url: "https://cache.pleroma.social"

config :pleroma, Pleroma.Repo,
  adapter: Ecto.Adapters.Postgres,
  username: "postgres",
  password: "pl3r0m4.",
  database: "pleroma",
  hostname: "172.2.0.102",
  pool_size: 130
#  timeout: 50000

# Configure web push notifications
config :web_push_encryption, :vapid_details,
  subject: "mailto:info@hatthieves.es",
  public_key: "BF7FikUMwkHL_bbWDaoJwzRep41IqeBz4JzMEMbHTJYGBAgDx-qRHUh-A1BAxlmCBDNdpexFEfONt8xEzvhEQAw",
  private_key: "t0FMHZsmzkZ1cXjI86ttRDlm_vzLiWQcMc8fhljqooY"

# Enable Strict-Transport-Security once SSL is working:
# config :pleroma, :http_security,
#   sts: true

# Configure S3 support if desired.
# The public S3 endpoint is different depending on region and provider,
# consult your S3 provider's documentation for details on what to use.
#
# config :pleroma, Pleroma.Uploaders.S3,
#   bucket: "some-bucket",
#   public_endpoint: "https://s3.amazonaws.com"
#
# Configure S3 credentials:
# config :ex_aws, :s3,
#   access_key_id: "xxxxxxxxxxxxx",
#   secret_access_key: "yyyyyyyyyyyy",
#   region: "us-east-1",
#   scheme: "https://"
#
# For using third-party S3 clones like wasabi, also do:
# config :ex_aws, :s3,
#   host: "s3.wasabisys.com"


# Configure Openstack Swift support if desired.
#
# Many openstack deployments are different, so config is left very open with
# no assumptions made on which provider you're using. This should allow very
# wide support without needing separate handlers for OVH, Rackspace, etc.
#
# config :pleroma, Pleroma.Uploaders.Swift,
#  container: "some-container",
#  username: "api-username-yyyy",
#  password: "api-key-xxxx",
#  tenant_id: "<openstack-project/tenant-id>",
#  auth_url: "https://keystone-endpoint.provider.com",
#  storage_url: "https://swift-endpoint.prodider.com/v1/AUTH_<tenant>/<container>",
#  object_url: "https://cdn-endpoint.provider.com/<container>"
#

#config :pleroma, Pleroma.Upload,
#  uploader: Pleroma.Uploaders.Local,
#  filters: [Pleroma.Upload.Filter.Dedupe],
#  link_name: true,
#  proxy_remote: true,
#  proxy_opts: [
#    redirect_on_failure: false,
#    max_body_length: 25 * 1_048_576,
#    http: [
#      follow_redirect: true,
#      pool: :upload
#    ]
#  ]

#config :pleroma, Pleroma.Uploaders.Local, uploads: "uploads"

config :pleroma, :chat, enabled: true

config :phoenix, :format_encoders, json: Jason

config :pleroma, :gopher,
  enabled: true,
  ip: {172, 2, 0, 101},
  port: 9999

config :pleroma, :suggestions,
  enabled: true,
  third_party_engine:
    "http://vinayaka.distsn.org/cgi-bin/vinayaka-user-match-suggestions-api.cgi?{{host}}+{{user}}",
  timeout: 300_000,
  web: "https://vinayaka.distsn.org/?{{host}}+{{user}}"
