# 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: "social.hatthieves.es", scheme: "https", port: 443],
   secret_key_base: "cXHImR89EePUjWdclU3vJUr8ZiGQiKLalhU9AMsEY5YnSG2e6MLzjmVwmxCztqa8",
   signing_salt: "g0uP6uv4"

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

config :pleroma, :instance,
  name: "Pleroma/HatThieves.es",
  email: "info@hatthieves.es",
  notify_email: "info@hatthieves.es",
  limit: 5000,
  registrations_open: true,
  dedupe_media: true,
  upload_limit: 25_000_000,
  federating: true,
  allow_relay: true,
  rewrite_policy: Pleroma.Web.ActivityPub.MRF.NoOpPolicy,
  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, Pleroma.Uploaders.S3, s3_bucket: nil

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: [],
  media_nsfw: [],
  federated_timeline_removal: [],
  reject: [],
  accept: []

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: 10

# 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}}"
