feat(dossier): lex.<domain> is the dossier app's address, with a banner that explains the name (S0b, R79)
bootstrap_sso.py: "lex" joins SUBDOMAINS; --dns-only added the tunnel ingress entry (25 hostnames, all 24 existing kept) and a proxied CNAME. Traefik: lex.<domain>/ is rewritten (replacePath) to the static page Gitea serves, /assets/dossier/ passes through, and a priority-10 catch-all redirects every other lex path to "/" via noop@internal, so Gitea's own pages never appear on lex. git-sso is first on every lex chain. The old git.<domain>/dossier now 302s to lex before SSO, so sign-in lands on lex; the unused dossier-page rewrite is gone and the git-host /assets/dossier/ routers stay behind SSO. Page: title "lex · Home or Residence Services"; the navbar reads "fhirworx | lex" with links back to git.<domain>; the banner says what lex is (Latin for law; a legal-epidemiology workbench) and keeps the build status as a smaller second line.
This commit is contained in:
@@ -278,6 +278,7 @@ SUBDOMAINS = [
|
||||
"bcda", # BCDA manager (P52) — Streamlit behind git-sso
|
||||
"lead", # LEAD public-data explorer — Streamlit behind git-sso
|
||||
"reach", # same public-data explorer, at reach.fhirworx.io
|
||||
"lex", # legal-epidemiology workbench (code-family dossiers) — static page via Gitea custom/public behind git-sso
|
||||
]
|
||||
|
||||
|
||||
|
||||
@@ -1,8 +1,10 @@
|
||||
"""Build the HOME-VISITS dossier page: a static snapshot with its data inlined.
|
||||
"""Build the lex dossier page (HOME-VISITS): a static snapshot, data inlined.
|
||||
|
||||
Served by Gitea from its bind-mounted custom directory at
|
||||
``git.<domain>/dossier`` (Traefik router ``dossier``, behind ``git-sso``;
|
||||
see infra/traefik/dynamic/services.yml). Run from the primary checkout,
|
||||
lex (Latin for law) is the legal-epidemiology workbench. The page is served
|
||||
by Gitea from its bind-mounted custom directory at ``lex.<domain>/``
|
||||
(Traefik routers ``lex*``, behind ``git-sso``; the old address
|
||||
``git.<domain>/dossier`` redirects there; see
|
||||
infra/traefik/dynamic/services.yml). Run from the primary checkout,
|
||||
never a worktree (the replica and bib.sqlite live in its data/):
|
||||
|
||||
bash -c 'cd /home/kert/stack && set -a && . ./.env && set +a && \
|
||||
@@ -52,6 +54,7 @@ from pfs.valuation import (
|
||||
|
||||
HERE = Path(__file__).resolve().parent
|
||||
ROOT = HERE.parents[2]
|
||||
DOMAIN = os.environ.get("DOMAIN", "fhirworx.io")
|
||||
FAMILY = "HOME-VISITS"
|
||||
DOCKET = "CMS-2022-0113"
|
||||
|
||||
@@ -794,10 +797,10 @@ if args.json:
|
||||
print(f"wrote {args.json} ({args.json.stat().st_size:,} bytes)", file=sys.stderr)
|
||||
|
||||
|
||||
def _fill(tpl: str, marker: str, value: str) -> str:
|
||||
if tpl.count(marker) != 1:
|
||||
def _fill(tpl: str, marker: str, value: str, count: int = 1) -> str:
|
||||
if tpl.count(marker) != count:
|
||||
raise SystemExit(
|
||||
f"template.html: expected one {marker!r}, found {tpl.count(marker)}"
|
||||
f"template.html: expected {count} {marker!r}, found {tpl.count(marker)}"
|
||||
)
|
||||
return tpl.replace(marker, value)
|
||||
|
||||
@@ -806,6 +809,8 @@ def _fill(tpl: str, marker: str, value: str) -> str:
|
||||
# string in it can close or confuse the <script> element.
|
||||
page = (HERE / "template.html").read_text(encoding="utf-8")
|
||||
page = _fill(page, "/*__BUILT__*/", html.escape(BUILT.strftime("%Y-%m-%d %H:%M %Z")))
|
||||
# navbar links back to Gitea (on lex.<domain>, "/" is this page)
|
||||
page = _fill(page, "/*__DOMAIN__*/", html.escape(DOMAIN), count=2)
|
||||
page = _fill(page, "/*__DATA__*/{}", blob.replace("<", "\\u003c"))
|
||||
dst = args.out
|
||||
dst.parent.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<meta charset="utf-8">
|
||||
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||
<meta name="robots" content="noindex, nofollow">
|
||||
<title>Home Visits Dossier</title>
|
||||
<title>lex · Home or Residence Services</title>
|
||||
<link rel="preconnect" href="https://fonts.googleapis.com">
|
||||
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin>
|
||||
<link rel="stylesheet" href="https://fonts.googleapis.com/css2?family=Playfair+Display:wght@600;700;800&family=Source+Serif+4:ital,opsz,wght@0,8..60,400;0,8..60,600;1,8..60,400&family=JetBrains+Mono:wght@400;500;600&display=swap">
|
||||
@@ -84,17 +84,22 @@ h1, h2, h3 { text-wrap: balance; }
|
||||
/* navbar: the fhirworx dark bar with its 3px ink line */
|
||||
.nav { background: var(--nav-bg); color: var(--nav-fg); border-bottom: 3px solid var(--ink-rule); }
|
||||
.nav-in { max-width: 1480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px; display: flex; align-items: center; gap: 18px; flex-wrap: wrap; }
|
||||
.brand-group { display: inline-flex; align-items: baseline; gap: 12px; }
|
||||
.brand { font-family: var(--f-display); font-weight: 700; font-size: 20px; letter-spacing: -.01em; color: var(--nav-fg); }
|
||||
.app { font-family: var(--f-display); font-style: italic; font-weight: 600; font-size: 20px; letter-spacing: .01em; color: var(--nav-fg); padding-left: 12px; border-left: 1px solid color-mix(in srgb, var(--nav-fg) 40%, transparent); }
|
||||
.nav-item { font-family: var(--f-mono); font-size: 12px; letter-spacing: .06em; color: var(--nav-fg); opacity: .78; padding: 4px 8px; }
|
||||
.nav-item.on { opacity: 1; background: var(--nav-hover); }
|
||||
a.brand, a.nav-item { text-decoration: none; }
|
||||
a.brand:hover, a.nav-item:hover { color: var(--nav-fg); opacity: 1; }
|
||||
a.brand, a.app, a.nav-item { text-decoration: none; }
|
||||
a.brand:hover, a.app:hover, a.nav-item:hover { color: var(--nav-fg); opacity: 1; }
|
||||
.nav-sp { flex: 1; }
|
||||
|
||||
.banner { background: var(--warn-bg); border-bottom: 1px solid var(--warn-line); }
|
||||
.banner-in { max-width: 1480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 9px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
|
||||
.banner strong { font-size: 15.5px; }
|
||||
.banner .eyebrow { color: var(--warn); font-weight: 600; }
|
||||
/* banner: what lex is, then the build status as a smaller second line */
|
||||
.banner { background: var(--surface-2); border-bottom: 1px solid var(--rule-soft); }
|
||||
.banner-in { max-width: 1480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); padding-block: 10px 9px; }
|
||||
.banner-what { margin: 0; max-width: 96ch; font-size: 15px; line-height: 1.5; text-wrap: pretty; }
|
||||
.banner-what .lex-word { font-family: var(--f-display); font-weight: 700; font-size: 17px; }
|
||||
.banner-status { margin: 5px 0 0; font-size: 12.5px; color: var(--fg-2); display: flex; gap: 4px 10px; align-items: baseline; flex-wrap: wrap; }
|
||||
.status-pill { font-family: var(--f-mono); font-size: 10.5px; font-weight: 600; text-transform: uppercase; letter-spacing: .12em; color: var(--warn); background: var(--warn-bg); border: 1px solid var(--warn-line); padding: 1px 6px; }
|
||||
|
||||
.shell { max-width: 1480px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); display: grid; grid-template-columns: 236px minmax(0, 1fr) 330px; align-items: start; }
|
||||
|
||||
@@ -305,16 +310,15 @@ button.dis { font-family: var(--f-mono); font-size: 11px; padding: 3px 8px; bord
|
||||
<body>
|
||||
|
||||
<header class="nav"><div class="nav-in">
|
||||
<a class="brand" href="/">fhirworx</a>
|
||||
<a class="nav-item" href="/explore/repos">Explore</a>
|
||||
<span class="brand-group"><a class="brand" href="https://git./*__DOMAIN__*//">fhirworx</a><a class="app" href="/" aria-current="page">lex</a></span>
|
||||
<a class="nav-item" href="https://git./*__DOMAIN__*//explore/repos">Explore</a>
|
||||
<span class="nav-item on">Dossier</span>
|
||||
<span class="nav-sp"></span>
|
||||
<span class="nav-item nav-note">Policy evidence · CMS payment and quality</span>
|
||||
</div></header>
|
||||
<div class="banner" role="note"><div class="banner-in">
|
||||
<span class="eyebrow">Preview</span>
|
||||
<strong>Static snapshot of live data, built /*__BUILT__*/. Not the finished app.</strong>
|
||||
<span class="small muted">Every value below comes from a stored row; each carries its source.</span>
|
||||
<p class="banner-what"><strong class="lex-word">lex</strong> — Latin for <em>law</em>. A legal-epidemiology workbench for CMS payment and quality rules: for each code family it traces what the rules said, how they changed, who argued for and against each change, and what happened after — to inform predictions, policy work and comment letters.</p>
|
||||
<p class="banner-status"><span class="status-pill">Preview</span><span>Static snapshot of live data, built /*__BUILT__*/. Not the finished app.</span><span class="muted">Every value below comes from a stored row; each carries its source.</span></p>
|
||||
</div></div>
|
||||
|
||||
<div class="shell">
|
||||
|
||||
@@ -63,17 +63,22 @@ http:
|
||||
rewrites:
|
||||
- regex: "</head>"
|
||||
replacement: '<link rel="icon" type="image/png" sizes="32x32" href="//dashboard.{{ $domain }}/fav32.png"><link rel="stylesheet" type="text/css" href="//dashboard.{{ $domain }}/fhirworx.css"></head>'
|
||||
# Dossier page (dev/scripts/dossier_page): git.<domain>/dossier is
|
||||
# rewritten to the static page Gitea serves from custom/public/assets.
|
||||
dossier-page:
|
||||
replacePathRegex:
|
||||
regex: "^/dossier/?$"
|
||||
replacement: "/assets/dossier/index.html"
|
||||
# Gitea caches /assets/ for 6 h; the dossier page is rebuilt in place.
|
||||
dossier-nocache:
|
||||
headers:
|
||||
customResponseHeaders:
|
||||
Cache-Control: "no-cache"
|
||||
# lex.<domain> (the dossier app): "/" is the static page Gitea serves.
|
||||
lex-page:
|
||||
replacePath:
|
||||
path: "/assets/dossier/index.html"
|
||||
# Anything else on lex, and the old git.<domain>/dossier address, goes
|
||||
# to the lex root. Matches every URL, so these routers never fall
|
||||
# through to a service.
|
||||
to-lex:
|
||||
redirectRegex:
|
||||
regex: "^.*$"
|
||||
replacement: "https://lex.{{ $domain }}/"
|
||||
routers:
|
||||
# auth.DOMAIN — oauth2-proxy public endpoints (login, callback, sign_out)
|
||||
auth-host:
|
||||
@@ -129,31 +134,31 @@ http:
|
||||
middlewares:
|
||||
- git-sso
|
||||
- secure-headers
|
||||
# Dossier page: git.<domain>/dossier behind the same SSO as llm, served
|
||||
# by Gitea from infra/gitea/custom/public/assets/dossier/. The second
|
||||
# pair keeps the page's own /assets/dossier/ path behind SSO too.
|
||||
# Dossier page (dev/scripts/dossier_page), served by Gitea from
|
||||
# infra/gitea/custom/public/assets/dossier/. Its address is lex.<domain>
|
||||
# (below); the old git.<domain>/dossier redirects there before SSO, so
|
||||
# sign-in lands on lex. The dossier-assets pair keeps the page's own
|
||||
# /assets/dossier/ path behind SSO on the git host too.
|
||||
dossier:
|
||||
rule: "Host(`git.{{ $domain }}`) && PathRegexp(`^/dossier/?$`)"
|
||||
priority: 1000
|
||||
service: git
|
||||
service: noop@internal
|
||||
entryPoints:
|
||||
- web
|
||||
middlewares:
|
||||
- to-lex
|
||||
- git-sso
|
||||
- dossier-page
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
dossier-tls:
|
||||
rule: "Host(`git.{{ $domain }}`) && PathRegexp(`^/dossier/?$`)"
|
||||
priority: 1000
|
||||
service: git
|
||||
service: noop@internal
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls: {}
|
||||
middlewares:
|
||||
- to-lex
|
||||
- git-sso
|
||||
- dossier-page
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
dossier-assets:
|
||||
rule: "Host(`git.{{ $domain }}`) && PathPrefix(`/assets/dossier/`)"
|
||||
@@ -176,6 +181,74 @@ http:
|
||||
- git-sso
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
# lex.<domain>: the dossier app (legal-epidemiology workbench). Only "/"
|
||||
# and /assets/dossier/ reach Gitea; every other path redirects to "/"
|
||||
# through noop@internal, so Gitea's own pages never appear on lex.
|
||||
lex:
|
||||
rule: "Host(`lex.{{ $domain }}`) && Path(`/`)"
|
||||
priority: 1000
|
||||
service: git
|
||||
entryPoints:
|
||||
- web
|
||||
middlewares:
|
||||
- git-sso
|
||||
- lex-page
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
lex-tls:
|
||||
rule: "Host(`lex.{{ $domain }}`) && Path(`/`)"
|
||||
priority: 1000
|
||||
service: git
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls: {}
|
||||
middlewares:
|
||||
- git-sso
|
||||
- lex-page
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
lex-assets:
|
||||
rule: "Host(`lex.{{ $domain }}`) && PathPrefix(`/assets/dossier/`)"
|
||||
priority: 1000
|
||||
service: git
|
||||
entryPoints:
|
||||
- web
|
||||
middlewares:
|
||||
- git-sso
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
lex-assets-tls:
|
||||
rule: "Host(`lex.{{ $domain }}`) && PathPrefix(`/assets/dossier/`)"
|
||||
priority: 1000
|
||||
service: git
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls: {}
|
||||
middlewares:
|
||||
- git-sso
|
||||
- dossier-nocache
|
||||
- secure-headers
|
||||
lex-other:
|
||||
rule: "Host(`lex.{{ $domain }}`)"
|
||||
priority: 10
|
||||
service: noop@internal
|
||||
entryPoints:
|
||||
- web
|
||||
middlewares:
|
||||
- git-sso
|
||||
- to-lex
|
||||
- secure-headers
|
||||
lex-other-tls:
|
||||
rule: "Host(`lex.{{ $domain }}`)"
|
||||
priority: 10
|
||||
service: noop@internal
|
||||
entryPoints:
|
||||
- websecure
|
||||
tls: {}
|
||||
middlewares:
|
||||
- git-sso
|
||||
- to-lex
|
||||
- secure-headers
|
||||
{{- range $name, $svc := $reef }}
|
||||
{{ $name }}:
|
||||
rule: "Host(`{{ get $svc "subdomain" | default $name }}.{{ $domain }}`){{ range get $svc "extra_hosts" | default list }} || Host(`{{ . }}`){{ end }}"
|
||||
|
||||
Reference in New Issue
Block a user