# 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
websocket_config = [
  path: "/socket",
  serializer: [
    {Phoenix.Socket.V1.JSONSerializer, "~> 1.0.0"},
    {Phoenix.Socket.V2.JSONSerializer, "~> 2.0.0"}
  ],
  timeout: 60_000,
  transport_log: false,
  compress: false
]

config :pleroma, Pleroma.Web.Endpoint,
  url: [host: "social.hatthieves.es", scheme: "https", port: 443],
  secret_key_base: "cXHImR89EePUjWdclU3vJUr8ZiGQiKLalhU9AMsEY5YnSG2e6MLzjmVwmxCztqa8",
  signing_salt: "g0uP6uv4",
  instrumenters: [Pleroma.Web.Endpoint.Instrumenter],
  http: [
    dispatch: [
      {:_,
       [
         {"/api/v1/streaming", Pleroma.Web.MastodonAPI.WebsocketHandler, []},
         {"/socket", Phoenix.Endpoint.CowboyWebSocket,
          {Phoenix.Transports.WebSocket,
           {Pleroma.Web.Endpoint, Pleroma.Web.UserSocket, websocket_config}}},
         {:_, Phoenix.Endpoint.Cowboy2Handler, {Pleroma.Web.Endpoint, []}}
       ]}
    ],
    port: 4000,
    ip: {0, 0, 0, 0}
#    ip: {172, 2, 0, 101}
  ],
  render_errors: [view: Pleroma.Web.ErrorView, accepts: ~w(json)],
  pubsub: [name: Pleroma.PubSub, adapter: Phoenix.PubSub.PG2],
  secure_cookie_flag: true

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

config :pleroma, :instance,
  name: "HatThieves/Pleroma",
  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,
  managed_config: true

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

config :pleroma, :frontend_configurations,
  pleroma_fe: %{
    theme: "monokai",
    background: "/static/aurora_borealis.jpg",
    logo: "/static/logo.png",
    logoMask: true,
    logoMargin: ".1em",
    redirectRootNoLogin: "/main/all",
    redirectRootLogin: "/main/friends",
    chatDisabled: false,
    showInstanceSpecificPanel: true,
    collapseMessageWithSubject: false,
    scopeCopy: true,
    subjectLineBehavior: "email",
    postContentType: "text/plain",
    alwaysShowSubjectInput: true,
    hidePostStats: false,
    hideUserStats: false,
    loginMethod: "password",
    webPushNotifications: true,
    noAttachmentLinks: false,
    nsfwCensorImage: "",
    showFeaturesPanel: true,
    minimalScopesMode: false
  },
  masto_fe: %{
    showInstanceSpecificPanel: true
  }

config :pleroma, :hackney_pools,
  federation: [
    max_connections: 130,
    timeout: 150_000
  ],
  media: [
    max_connections: 50,
    timeout: 150_000
  ],
  upload: [
    max_connections: 50,
    timeout: 300_000
  ]

config :logger, :console,
  level: :error,
  format: "$metadata[$level] $message",
  metadata: [:request_id]

config :logger, :ex_syslogger,
  level: :error,
  ident: "pleroma",
  format: "$metadata[$level] $message",
  metadata: [:request_id]

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

config :pleroma, Pleroma.Upload,
  uploader: Pleroma.Uploaders.Local,
  filters: [Pleroma.Upload.Filter.Dedupe],
  link_name: true,
  proxy_remote: false,
  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: false

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

#config :pleroma_job_queue, :queues,
#  federator_incoming: 100,
#  federator_outgoing: 100

import_config "#{Mix.env()}.secret.exs"
