Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion .github/copilot-instructions.md
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,7 @@ quantecon/actions/
├── restore-jupyter-cache/ # Cache restore action (PRs)
├── preview-netlify/ # Netlify PR preview action
├── preview-cloudflare/ # Cloudflare Pages PR preview action
├── deploy-cloudflare/ # Members-only Worker deploy behind Cloudflare Access
├── publish-gh-pages/ # GitHub Pages publishing action
├── templates/ # Workflow templates for lecture repos
└── docs/ # Comprehensive documentation
Expand Down Expand Up @@ -132,5 +133,5 @@ gh run view RUN_ID --log > /tmp/gh-logs.txt && cat /tmp/gh-logs.txt
- **Updated:** June 16, 2026
- **Current Phase:** Infrastructure complete, ready for production migration (latest release: v0.11.1)
- **Containers:** ghcr.io/quantecon/quantecon:latest (full, 3.33 GB compressed / 8.60 GB on disk), ghcr.io/quantecon/quantecon-build:latest (lean, 2.93 GB compressed / 7.32 GB on disk)
- **Actions:** 7 composite actions complete and tested
- **Actions:** 8 composite actions (`deploy-cloudflare`'s real deploy is not exercised in CI; see TESTING.md)
- **Next:** Begin Phase 1 migration with lecture-dp repo
29 changes: 29 additions & 0 deletions .github/dependabot.yml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,7 @@ updates:
- "/restore-jupyter-cache"
- "/preview-netlify"
- "/preview-cloudflare"
- "/deploy-cloudflare"
- "/publish-gh-pages"
schedule:
interval: "weekly"
Expand All @@ -109,6 +110,34 @@ updates:
# Don't propose bumps to our own internal sibling references (floating @v0).
- dependency-name: "quantecon/actions*"

# ── npm (deploy-cloudflare's wrangler) ─────────────────────────────────────
# deploy-cloudflare installs wrangler with `npm ci` from the lockfile in its
# own directory, so the exact version is committed and bumps arrive here.
# The action harness dry-runs the generated config through the bumped
# wrangler (dc-wrangler-config), so a bump that breaks it goes red in CI.
- package-ecosystem: "npm"
directories:
- "/deploy-cloudflare"
schedule:
interval: "weekly"
open-pull-requests-limit: 10
labels:
- "maintenance"
commit-message:
prefix: "deps"
groups:
npm:
patterns:
- "*"
update-types:
- "minor"
- "patch"
npm-major:
patterns:
- "*"
update-types:
- "major"

# ── Container base image ───────────────────────────────────────────────────
# Tracks the `FROM ubuntu:24.04` base in each Dockerfile (not the Miniconda
# installer, which is pinned + checksummed in the RUN step).
Expand Down
61 changes: 61 additions & 0 deletions .github/fixtures/access-gate/server.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,61 @@
"""Local stand-in for a Cloudflare Access gate, for the check-access-gate.sh harness job.

Each path answers the way one real configuration would, so the probe can be run
against every shape it must tell apart without a Cloudflare account:

/gated/... 302 to the team's login domain (a correctly gated Worker)
/wrong-org/... 302 to a different *.cloudflareaccess.com (wrong Access org)
/public/... 200 with content (the alarm case: the site is public)
/same-host/... 307 back to this host (asset html_handling, not Access)
/no-location 302 with no Location header
/missing 404 (no Worker on this hostname)
/broken 500 (retried by the probe, then fails)
/mixed-case 302 to the team domain in mixed case with an explicit :443
/userinfo 302 whose real host is not the team domain, hidden behind
`\\@team-domain` userinfo

Usage: python3 server.py <port>
"""

import sys
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer

TEAM = "https://quantecon-harness.cloudflareaccess.com"


class Handler(BaseHTTPRequestHandler):
def do_GET(self):
path = self.path
if path.startswith("/gated"):
self.reply(302, {"Location": f"{TEAM}/cdn-cgi/access/login/site?redirect_url={path}"})
elif path.startswith("/wrong-org"):
self.reply(302, {"Location": "https://someone-else.cloudflareaccess.com/cdn-cgi/access/login/site"})
elif path.startswith("/public"):
self.reply(200, {"Content-Type": "text/html"}, b"<h1>private report</h1>")
elif path.startswith("/same-host"):
self.reply(307, {"Location": "/public/"})
elif path == "/no-location":
self.reply(302, {})
elif path == "/broken":
self.reply(500, {})
elif path == "/userinfo":
self.reply(302, {"Location": "https://evil.example\\@quantecon-harness.cloudflareaccess.com/"})
elif path == "/mixed-case":
self.reply(302, {"Location": "https://QuantEcon-Harness.CloudflareAccess.com:443/cdn-cgi/access/login/site"})
else:
self.reply(404, {})

def reply(self, code, headers, body=b""):
self.send_response(code)
for name, value in headers.items():
self.send_header(name, value)
self.send_header("Content-Length", str(len(body)))
self.end_headers()
self.wfile.write(body)

def log_message(self, fmt, *args):
sys.stderr.write("server: " + (fmt % args) + "\n")


if __name__ == "__main__":
ThreadingHTTPServer(("127.0.0.1", int(sys.argv[1])), Handler).serve_forever()
Loading
Loading