Files
LithosAnanke/site/com/install.sh
T
Claude 3bd81097e1 chore(license): an SPDX header on every source file that had none (LicenseRef-Starship-1.0) [skip ci]
The header scan (Captain Bob, 2026-11-10): 788 source files -- 351 with the
SL-1.0 header, 12 with the old name (docs/working/experiments, kept by
ruling), 31 under someone else's licence (tools/kconfig, Linux's, GPL-2.0:
kept), and 394 with none. Ruled: the SPDX form; capsules (.4th, .f18) and
proofs (.thy) left for a ruling of their own (mkcapsule's 64x16 block format,
content-addressed capsules).

253 files now begin
    SPDX-License-Identifier: LicenseRef-Starship-1.0
    Copyright (c) 2023-2026 Robert A. James
as a /* */ block (C, headers, assembly, linker scripts) or # lines (scripts,
Makefiles, Kconfig; below a shebang or a coding line); tools/mkcapsule.c,
which had the copyright line, gets the SPDX line only.

Not touched: docs/working/ (archive and old campaign material, as the
ruling kept the experiments); v4/system/post_cases.c (generated by
v4/tools/mkpost.py, "do not edit" -- the generator has the header).

Comments only: the kernel builds on amd64, aarch64, riscv64; make -C v4
test-32: 39 programs, 0 failures; every changed script parses.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01GE3SDvQn5EoxdGufk84zz2
2026-11-10 04:12:49 +00:00

52 lines
2.4 KiB
Bash
Executable File

#!/bin/bash
# SPDX-License-Identifier: LicenseRef-Starship-1.0
# Copyright (c) 2023-2026 Robert A. James
# install.sh -- the starshipos-f18.com XWiki's pages, from the "StarshipOS.com" design canvas
# (build.py makes them): Main.WebHome (Home), Inquiries.WebHome, TryIt.WebHome, and the two
# images, attachments of Main.WebHome. All readable by everyone; the wiki's own rights decide the
# rest. Through XWiki's REST API:
#
# XWIKI_USER=rajames XWIKI_PASSWORD=... site/com/install.sh [https://starshipos-f18.com]
#
# Run it again after build.py: pages and images are replaced. It ends by checking, without
# logging in, that every page and image is there.
set -euo pipefail
cd "$(dirname "$0")"
base=${1:-https://starshipos-f18.com}
rest="$base/rest/wikis/xwiki"
user=${XWIKI_USER:?set XWIKI_USER}
pass=${XWIKI_PASSWORD:?set XWIKI_PASSWORD}
auth=(-u "$user:$pass")
page() { # page <space> <title> <file>: create or replace <space>.WebHome
local body
body=$(python3 -c '
import sys
from xml.sax.saxutils import escape
print("<page xmlns=\"http://www.xwiki.org\"><title>%s</title><syntax>xwiki/2.1</syntax>"
"<content>%s</content></page>" % (escape(sys.argv[1]), escape(open(sys.argv[2]).read())))' "$2" "$3")
curl -fsS -o /dev/null -w " page $1.WebHome: %{http_code}\n" "${auth[@]}" -X PUT \
-H 'Content-Type: application/xml' --data-binary "$body" "$rest/spaces/$1/pages/WebHome"
}
attach() { # attach <space> <file>: create or replace an attachment of <space>.WebHome
curl -fsS -o /dev/null -w " attachment $1.WebHome/$2: %{http_code}\n" "${auth[@]}" -X PUT \
-H 'Content-Type: image/jpeg' --data-binary "@$2" "$rest/spaces/$1/pages/WebHome/attachments/$2"
}
echo "=== $base, as $user"
page Main "StarshipOS" Main.WebHome.xwiki
attach Main badge.jpg
attach Main captain-bob.jpg
page Inquiries "Inquiries" Inquiries.WebHome.xwiki
page TryIt "Try StarshipOS" TryIt.WebHome.xwiki
echo "=== as a guest"
bad=
for u in /bin/view/Main/ /bin/view/Inquiries/ /bin/view/TryIt/ \
/bin/download/Main/WebHome/badge.jpg /bin/download/Main/WebHome/captain-bob.jpg; do
code=$(curl -s -o /dev/null -w '%{http_code}' "$base$u")
if [ "$code" = 200 ]; then echo " $u: 200"; else echo " $u: $code -- NOT readable"; bad=1; fi
done
[ -z "$bad" ] || { echo "install: a guest cannot read everything; see above" >&2; exit 1; }
echo "=== done: $base/bin/view/Main/"