File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -25,5 +25,10 @@ CORS_ALLOWED_ORIGINS=
2525# are rejected with 413.
2626MAX_HTTP_BODY_SIZE =
2727
28+ # Directory holding the built portal dist; the node serves it on the REST
29+ # port with an SPA fallback. Empty/missing = portal serving disabled
30+ # (the REST API is unaffected).
31+ PORTAL_DIST_PATH =
32+
2833RUST_LOG =
2934OTEL_EXPORTER_OTLP_ENDPOINT =
Original file line number Diff line number Diff line change @@ -20,4 +20,10 @@ COPY --from=builder /build/target/release/aruna .
2020COPY --from=builder /build/target/release/aruna-doctor .
2121COPY --from=builder /build/target/bin/iroh-doctor .
2222
23+ # Portal dist baked into the image (stage 1 delivery). Populate portal-dist/
24+ # via scripts/fetch-portal.sh before building; an empty directory just
25+ # disables portal serving at runtime.
26+ ENV PORTAL_DIST_PATH=/var/lib/aruna/portal
27+ COPY portal-dist/ /var/lib/aruna/portal/
28+
2329CMD [ "/run/aruna" ]
Original file line number Diff line number Diff line change 1+ {
2+ "version": "",
3+ "sha256": "",
4+ "url": ""
5+ }
Original file line number Diff line number Diff line change 1+ #! /usr/bin/env bash
2+ # Resolves portal.lock and installs the pinned portal dist into portal-dist/
3+ # for image builds and local development. Refuses to install a dist whose
4+ # sha256 does not match the pin; there is no unverified mode.
5+ set -euo pipefail
6+
7+ ROOT=" $( cd " $( dirname " $0 " ) /.." && pwd) "
8+ LOCK=" $ROOT /portal.lock"
9+ DEST=" ${1:- $ROOT / portal-dist} "
10+
11+ field () { sed -n " s/.*\" $1 \" : *\" \([^\" ]*\)\" .*/\1/p" " $LOCK " | head -n1; }
12+ VERSION=" $( field version) "
13+ SHA256=" $( field sha256) "
14+ URL=" $( field url) "
15+
16+ if [ -z " $URL " ] || [ -z " $SHA256 " ]; then
17+ echo " portal.lock carries no pinned url/sha256 yet." >&2
18+ echo " Either pin a portal release in portal.lock or place a built dist into $DEST manually." >&2
19+ exit 1
20+ fi
21+
22+ TMP=" $( mktemp -d) "
23+ trap ' rm -rf "$TMP"' EXIT
24+
25+ echo " Fetching aruna portal dist ${VERSION} from ${URL} "
26+ curl -fsSL " $URL " -o " $TMP /dist.tar.gz"
27+ echo " $SHA256 $TMP /dist.tar.gz" | sha256sum -c - > /dev/null
28+
29+ mkdir -p " $TMP /unpack"
30+ tar -xzf " $TMP /dist.tar.gz" -C " $TMP /unpack"
31+ SRC=" $TMP /unpack"
32+ if [ -d " $TMP /unpack/dist" ]; then
33+ SRC=" $TMP /unpack/dist"
34+ fi
35+ if [ ! -f " $SRC /index.html" ]; then
36+ echo " Portal tarball holds no index.html; refusing to install." >&2
37+ exit 1
38+ fi
39+
40+ rm -rf " $DEST "
41+ mkdir -p " $( dirname " $DEST " ) "
42+ mv " $SRC " " $DEST "
43+ echo " Portal dist ${VERSION} installed at $DEST "
You can’t perform that action at this time.
0 commit comments