Files
docker-compose/asciinema/custom.exs

37 lines
1.2 KiB
Elixir

import Config
# Configure Swoosh SMTP adapter to skip TLS certificate verification
# This is needed for IONOS SMTP server which has certificate key usage issues
config :asciinema, Asciinema.Emails.Mailer,
adapter: Swoosh.Adapters.SMTP,
relay: System.get_env("SMTP_HOST"),
username: System.get_env("SMTP_USERNAME"),
password: System.get_env("SMTP_PASSWORD"),
port: System.get_env("SMTP_PORT") || 587,
tls: :always,
auth: :always,
ssl: false,
tls_options: [
verify: :verify_none,
versions: [:"tlsv1.2", :"tlsv1.3"]
]
# Override static_paths to include our theme directory
# This allows serving custom CSS and favicon from /theme path
defmodule AsciinemaWeb do
def static_paths, do: ~w(assets fonts images js favicon.ico robots.txt theme)
end
# Define a custom layout view that injects our theme CSS and favicon
defmodule AsciinemaWeb.CustomLayoutView do
def head(_conn, _assigns) do
Phoenix.HTML.raw("""
<link rel="stylesheet" href="/theme/custom.css">
<link rel="icon" type="image/svg+xml" href="/theme/favicon.svg">
""")
end
end
# Override the layout view to use our custom head function
config :asciinema, AsciinemaWeb.LayoutView, head: &AsciinemaWeb.CustomLayoutView.head/2