Skip to content

Local mails use Supabase's default templates instead of ours (on SELinux hosts) #2783

Description

@cies

Symptoms (any of):

  • A magic link or password reset mail in Mailpit (http://localhost:54324) looks nothing like
    supabase/templates/*.mustache: no DropNext styling, and the link points at
    http://127.0.0.1:54321/auth/v1/verify?token=… instead of the app's /auth-return.
  • The auth container's log repeats
    templatemailer_template_body_http_error ... /email/magic_link.mustache: status code 403
    (docker logs $(docker ps -q --filter ancestor=public.ecr.aws/supabase/gotrue:v2.195.0), adjust the tag).

Root cause: the CLI bind-mounts the template files into the Kong container and GoTrue fetches
them from Kong on every send. The mount carries no :z relabel, so on a host with SELinux
enforcing (the repo's files are labelled mnt_t when the checkout lives on its own mount) Kong
gets "Permission denied" on files that are world-readable, answers 403, and GoTrue silently
falls back to its built-in templates. Nothing fails loudly, the mail is just a different mail.

Workaroud: relabel the template files so containers may read them (reversible with restorecon):

chcon -t container_file_t supabase/templates/*.mustache

Bug report

This should not be so hard. I think the mounts should carry a :z label so this gets easier.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't working

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions