johnandersen777.bsky.social/socialweb-computer-console
console.socialweb.computer: kcp, kubectl and ssh compiled to wasm in a browser tab with a terminal; a kcp fork
0
0
#!/usr/bin/env bash
set -euo pipefail
# Writes the Go -overlay file for browser-only socialweb files. The read-only
# socialweb tree is never modified; the overlay adds js-tagged files where the
# original tree only has unix/windows implementations.
repo_root="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
socialweb="${SOCIALWEB_KCP:-${repo_root}/../../linux-kcp/socialweb-computer-kcp}"
overlay_dir="${repo_root}/socialweb-wasm/overlays"
out="${1:-${repo_root}/socialweb-wasm/.go.wasm.overlay.json}"
socialweb="$(cd "${socialweb}" && pwd)"
python3 - "${out}" "${socialweb}" "${overlay_dir}" <<'PY'
import json, sys
out, socialweb, overlay_dir = sys.argv[1:4]
print(json.dumps({"Replace": {
f"{socialweb}/internal/hostos/lock_js.go": f"{overlay_dir}/hostos/lock_js.go",
f"{socialweb}/internal/hostos/proc_js.go": f"{overlay_dir}/hostos/proc_js.go",
f"{socialweb}/internal/portscan/scan_js.go": f"{overlay_dir}/portscan/scan_js.go",
f"{socialweb}/internal/atproto/repo/sqlite.go": f"{overlay_dir}/atproto/repo_sqlite.go",
f"{socialweb}/internal/atproto/pds/store.go": f"{overlay_dir}/atproto/pds_store.go",
f"{socialweb}/internal/atproto/oauth/scope.go": f"{overlay_dir}/oauth/scope.go",
f"{socialweb}/internal/identlink/walk.go": f"{overlay_dir}/identlink/walk.go",
f"{socialweb}/internal/identlink/remote.go": f"{overlay_dir}/identlink/remote.go",
f"{socialweb}/internal/policyengine/trust/trust.go": f"{overlay_dir}/trust/trust.go",
f"{socialweb}/internal/market/requester/market.go": f"{overlay_dir}/requester/market.go",
f"{socialweb}/internal/market/requester/mesh_js.go": f"{overlay_dir}/requester/mesh_js.go",
}}, indent=2), file=open(out, "w"))
PY
echo "wrote ${out}"