{
    email {$ACME_EMAIL}
}

{$APP_DOMAIN} {
    encode zstd gzip
    @source path /source.tar.gz
    handle @source {
        root * /srv/source
        header Content-Type application/gzip
        header Content-Disposition "attachment; filename=source.tar.gz"
        file_server
    }
    handle {
        reverse_proxy frontend:4200
    }
}

{$API_DOMAIN} {
    encode zstd gzip
    # Deliberately closed until the controlled first-account bootstrap is
    # complete. Remove this matcher/response as part of an approved launch.
    @registration {
        method POST
        path /auth/register
    }
    @uploads path /uploads/*
    handle @registration {
        respond 403
    }
    handle @uploads {
        reverse_proxy frontend:4200
    }
    handle {
        reverse_proxy backend:3000
    }
}
