Skip to content

Render Domain routes and serve static files from the release (S-003-2..7, S-003-13..15) #162

Closed

Description

@shipmill-romamo

Builds part of spec S-003, docs/specs/003-domain-routes.md (feature issue #90): the acceptance criteria below. Each needs a test that names its id (test_s003_<k>_..., or a proves: S-003-2 comment line).

This is rendering the routes in cloudfall_nginx_site, the engine inventory's static directories, and the nginx worker's traverse-only access.

  • S-003-2: That Domain renders a vhost that nginx -t accepts, with TLS active and without it, on nginx 1.22.1 and 1.26.3
  • S-003-3: Against that vhost, GET /some/unknown/path answers 200 with the fallback file's bytes from <installRoot>/current/web/dist/index.html, and GET /assets/app.js answers that file's bytes
  • S-003-4: Against that vhost, GET /api/health is proxied to 127.0.0.1:8310 and the upstream sees the path /api/health
  • S-003-5: A static route without spaFallback answers 404 for a path with no matching file
  • S-003-6: After cloudfall rollback of the static route's component, GET / serves the previous release's index.html without re-running the domains playbook or reloading nginx
  • S-003-7: An existing Domain with only proxy.upstream renders a vhost byte-identical to the one the template on origin/main renders, for TLS active and inactive and both nginx versions
  • S-003-13: Locations in the rendered vhost appear longest path first, and two Domains with the same routes in different declared order render identical bytes
  • S-003-14: After the domains playbook runs, the www-data user can read <installRoot>/current/web/dist/index.html and cannot read <installRoot>/shared/env/<component>.env
  • S-003-15: The ACME challenge location still renders and serves /.well-known/acme-challenge/ from the webroot on a Domain with routes

Depends on #159

Activity

  1. shipmill-romamo commented on Oct 30, 2026

    @shipmill-romamo
    ContributorAuthor

    Triage: implement. Serves: G-3. A build issue of spec S-003 (docs/specs/003-domain-routes.md, approved in #99), sub-issue of #90. The criteria above are the scope; each gets a test naming its id. It starts once every issue on its Depends on line has closed.

  2. shipmill-romamo commented on Oct 30, 2026

    @shipmill-romamo
    ContributorAuthor

    The build is in #177: the vhost renders one location per route, longest path first; a static route serves <installRoot>/current/<directory>/ (with try_files for spaFallback), and the nginx worker gets traverse-only access through a POSIX ACL, never the application's group. An upstream-only Domain renders byte-identical to the origin/main template (golden files for TLS on and off, nginx 1.22.1 and 1.26.3). It also sets spec S-003 to built and closes #90.

    Trade-offs: the role now installs acl for Domains with static routes and needs bootstrap to have run first; release files are served only when the archive's own permissions let others read them (0644/0755 normally). A Domain with routes but no / route has no catch-all location, so an unmatched path gets nginx's default page rather than a 404; the spec doesn't say which. Unverified: no real nginx or ACL ran here (nginx -t, the GET answers, and www-data's access were checked against a model and stand-ins), so S-003-2..6, 14 and 15 still want a live proving run.

    This issue closes when #177 merges.

  3. added a commit that references this issue on Oct 30, 2026
    70a167f
  4. shipmill-romamo commented on Oct 30, 2026

    @shipmill-romamo
    ContributorAuthor

    Released in v0.8.0rc12 (pre-release).
    A plain install gets it with the next stable release.
    If you filed this: react 👍 on this comment once it works for you, or reply if it doesn't.

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

    enhancementNew feature or request

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions