Compare commits
2
Commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
5bd878ac2d | ||
|
|
b1d4890320 |
@@ -1,3 +1,3 @@
|
||||
ARCHES := x86
|
||||
# overrides to s9pk.mk must precede the include statement
|
||||
include s9pk.mk
|
||||
include node_modules/@start9labs/start-sdk/s9pk.mk
|
||||
|
||||
@@ -125,7 +125,7 @@ mainnet-only.
|
||||
| Subspaces Prover | 8888 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | `subs-prover` RISC Zero prover server (no GPU). Its own StartOS interface. Optional HTTP basic auth — off by default, gated by **Enable Subspaces Prover Auth**. When on, `SUBS_PROVER_BASIC_AUTH_USER`/`SUBS_PROVER_BASIC_AUTH_PASSWORD` are enforced. Only useful while Subspaces (and the prover toggle) is enabled. |
|
||||
| Subspaces Registry | 8081 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | `registry-server` for publishing/resolving handles (remapped from its upstream default 8080 to avoid colliding with the gotty terminal on 8080). Its own StartOS interface. Only useful while Subspaces is enabled. |
|
||||
| Certrelay | 7778 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | `certrelay` server (always on). Serves cryptographic proofs binding handles to owner keys. **Setup:** run **Configure Certrelay** and set `CERTRELAY_SELF_URL` to the publicly visible URL StartOS exposes for this interface. |
|
||||
| Nacho | 8082 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | nacho Expo dev server (always on). The ignore list is read at runtime from `/data/nacho/ignore_names.txt` (managed by **Configure Nacho**). `EXPO_PUBLIC_API_BASE_URL` is derived dynamically from the Subs API StartOS interface (`sdk.serviceInterface.getOwn('subs-api').const()`), preferring the `.local` URL. Falls back to `http://127.0.0.1:7777` only if no address info is available. |
|
||||
| Nacho | 8082 | HTTP | LAN / `.local` / Tor / clearnet (via StartOS) | nacho Expo dev server (always on). The ignore list is read at runtime from `/data/nacho/ignore_names.txt` (managed by **Configure Nacho**). `EXPO_PUBLIC_API_BASE_URL` is derived dynamically from the Subs API StartOS interface (walked off its host: `sdk.host.getOwn(effects, 'subspaces-multi', h => h?.bindings[7777]?.interfaces['subs-api']).const()`), preferring the `.local` URL. Falls back to `http://127.0.0.1:7777` only if no address info is available. |
|
||||
| Spaces API (spaced RPC) | 7225 | HTTP JSON-RPC | LAN / `.local` / Tor / clearnet (via StartOS) | spaced JSON-RPC, bound to `0.0.0.0` and exposed as the **Spaces API** interface. Static-cred-authenticated via `SPACED_RPC_USER` / `SPACED_RPC_PASSWORD` from `store.json.spacedAuth`. Internal clients still connect over loopback. |
|
||||
|
||||
## Actions
|
||||
|
||||
@@ -1,13 +1,9 @@
|
||||
# TODO — bring Spaces from beta.9 to
|
||||
# TODO — bring Spaces from beta.9 to beta.10
|
||||
|
||||
Consult the packaging guide as you go
|
||||
(`start-technologies/projects/start-sdk/docs/src/recipes.md` is the intent index). Remove items as you finish
|
||||
them, and add items when you defer work.
|
||||
|
||||
## The service
|
||||
|
||||
- [ ] Update @start9labs/start-sdk to the latest version.
|
||||
|
||||
## Docs
|
||||
|
||||
- [ ] Write `README.md` (per `start-technologies/projects/start-sdk/docs/src/writing-readmes.md`).
|
||||
@@ -16,8 +12,17 @@ them, and add items when you defer work.
|
||||
|
||||
## Build, test, ship
|
||||
|
||||
- [ ] First test build: `make` (or `start-cli s9pk pack`); fix any `tsc` / pack errors.
|
||||
- [ ] Install on a StartOS box and verify the service runs (and is reachable, once it
|
||||
exposes an interface).
|
||||
- [ ] Build for arm (`ARCHES := x86 arm` in the `Makefile`). All four images declare
|
||||
`aarch64` in the manifest and every tag publishes an arm64 variant, so the
|
||||
package currently advertises support it never ships. Needs an arm box to verify.
|
||||
- [x] First test build: `make` (or `start-cli s9pk pack`); fix any `tsc` / pack errors.
|
||||
- [x] Install on a StartOS box and verify the service runs — done for 0.2.1:0 on
|
||||
natural-dean.local: all daemons up, nacho's `EXPO_PUBLIC_API_BASE_URL` resolved
|
||||
through the subs-api host rather than the loopback fallback.
|
||||
- [ ] Verify the Bitcoin RPC task on a *fresh* install (`accept`/`set` input under SDK
|
||||
2.0). `taskBtcAuth` returns early when `store.btcAuth` exists, so an update over
|
||||
an existing install never exercises it.
|
||||
- [ ] `npx prettier --write startos` — 9 files predate the current prettier config and
|
||||
fail `--check` (untouched by the SDK bump, so left out of that diff).
|
||||
- [ ] Backup / restore sanity check.
|
||||
- [ ] Review the README and instructions one more time against actual behavior.
|
||||
|
||||
Generated
+1309
-13
File diff suppressed because it is too large
Load Diff
+5
-2
@@ -6,13 +6,16 @@
|
||||
"check": "tsc --noEmit"
|
||||
},
|
||||
"dependencies": {
|
||||
"@start9labs/start-sdk": "1.5.1"
|
||||
"@start9labs/start-sdk": "2.0.9"
|
||||
},
|
||||
"overrides": {
|
||||
"@start9labs/start-sdk": "$@start9labs/start-sdk"
|
||||
},
|
||||
"devDependencies": {
|
||||
"@types/node": "^22.19.0",
|
||||
"@vercel/ncc": "^0.38.4",
|
||||
"prettier": "^3.6.2",
|
||||
"typescript": "^5.9.3"
|
||||
"typescript": "^6.0.3"
|
||||
},
|
||||
"prettier": {
|
||||
"trailingComma": "all",
|
||||
|
||||
@@ -1,132 +0,0 @@
|
||||
# ** Plumbing. DO NOT EDIT **.
|
||||
# This file is imported by ./Makefile. Make edits there
|
||||
|
||||
PACKAGE_ID := $(shell awk -F"'" '/id:/ {print $$2}' startos/manifest/index.ts)
|
||||
INGREDIENTS := $(shell start-cli s9pk list-ingredients 2>/dev/null)
|
||||
# Resolve the actual git dir so this works inside git worktrees, where .git
|
||||
# is a file pointing at <main>/.git/worktrees/<name> rather than a directory.
|
||||
GIT_DIR := $(shell git rev-parse --git-dir 2>/dev/null)
|
||||
GIT_DEPS := $(if $(GIT_DIR),$(GIT_DIR)/HEAD $(GIT_DIR)/index)
|
||||
ARCHES ?= x86 arm riscv
|
||||
TARGETS ?= arches
|
||||
ifdef VARIANT
|
||||
BASE_NAME := $(PACKAGE_ID)_$(VARIANT)
|
||||
else
|
||||
BASE_NAME := $(PACKAGE_ID)
|
||||
endif
|
||||
|
||||
.PHONY: all arches aarch64 x86_64 riscv64 arm arm64 x86 riscv arch/* clean install check-deps check-init package ingredients
|
||||
.DELETE_ON_ERROR:
|
||||
.SECONDARY:
|
||||
|
||||
define SUMMARY
|
||||
@manifest=$$(start-cli s9pk inspect $(1) manifest); \
|
||||
size=$$(du -h $(1) | awk '{print $$1}'); \
|
||||
title=$$(printf '%s' "$$manifest" | jq -r .title); \
|
||||
version=$$(printf '%s' "$$manifest" | jq -r .version); \
|
||||
arches=$$(printf '%s' "$$manifest" | jq -r '[.images[].arch // []] | flatten | unique | join(", ")'); \
|
||||
sdkv=$$(printf '%s' "$$manifest" | jq -r .sdkVersion); \
|
||||
gitHash=$$(printf '%s' "$$manifest" | jq -r .gitHash | sed -E 's/(.*-modified)$$/\x1b[0;31m\1\x1b[0m/'); \
|
||||
printf "\n"; \
|
||||
printf "\033[1;32m✅ Build Complete!\033[0m\n"; \
|
||||
printf "\n"; \
|
||||
printf "\033[1;37m📦 $$title\033[0m \033[36mv$$version\033[0m\n"; \
|
||||
printf "───────────────────────────────\n"; \
|
||||
printf " \033[1;36mFilename:\033[0m %s\n" "$(1)"; \
|
||||
printf " \033[1;36mSize:\033[0m %s\n" "$$size"; \
|
||||
printf " \033[1;36mArch:\033[0m %s\n" "$$arches"; \
|
||||
printf " \033[1;36mSDK:\033[0m %s\n" "$$sdkv"; \
|
||||
printf " \033[1;36mGit:\033[0m %s\n" "$$gitHash"; \
|
||||
echo ""
|
||||
endef
|
||||
|
||||
all: $(TARGETS)
|
||||
|
||||
arches: $(ARCHES)
|
||||
|
||||
universal: $(BASE_NAME).s9pk
|
||||
$(call SUMMARY,$<)
|
||||
|
||||
arch/%: $(BASE_NAME)_%.s9pk
|
||||
$(call SUMMARY,$<)
|
||||
|
||||
x86 x86_64: arch/x86_64
|
||||
arm arm64 aarch64: arch/aarch64
|
||||
riscv riscv64: arch/riscv64
|
||||
|
||||
$(BASE_NAME).s9pk: $(INGREDIENTS) $(GIT_DEPS)
|
||||
@$(MAKE) --no-print-directory ingredients
|
||||
@echo " Packing '$@'..."
|
||||
start-cli s9pk pack -o $@
|
||||
|
||||
$(BASE_NAME)_%.s9pk: $(INGREDIENTS) $(GIT_DEPS)
|
||||
@$(MAKE) --no-print-directory ingredients
|
||||
@echo " Packing '$@'..."
|
||||
start-cli s9pk pack --arch=$* -o $@
|
||||
|
||||
ingredients: $(INGREDIENTS)
|
||||
@echo " Re-evaluating ingredients..."
|
||||
|
||||
install: | check-deps check-init
|
||||
@HOST=$$(awk -F'/' '/^host:/ {print $$3}' ~/.startos/config.yaml); \
|
||||
if [ -z "$$HOST" ]; then \
|
||||
echo "Error: You must define \"host: http://server-name.local\" in ~/.startos/config.yaml"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
S9PK=$$(ls -t *.s9pk 2>/dev/null | head -1); \
|
||||
if [ -z "$$S9PK" ]; then \
|
||||
echo "Error: No .s9pk file found. Run 'make' first."; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
printf "\n🚀 Installing %s to %s ...\n" "$$S9PK" "$$HOST"; \
|
||||
start-cli package install -s "$$S9PK"
|
||||
|
||||
publish: | all
|
||||
@REGISTRY=$$(awk -F'/' '/^registry:/ {print $$3}' ~/.startos/config.yaml); \
|
||||
if [ -z "$$REGISTRY" ]; then \
|
||||
echo "Error: You must define \"registry: https://my-registry.tld\" in ~/.startos/config.yaml"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
S3BASE=$$(awk -F'/' '/^s9pk-s3base:/ {print $$3}' ~/.startos/config.yaml); \
|
||||
if [ -z "$$S3BASE" ]; then \
|
||||
echo "Error: You must define \"s3base: https://s9pks.my-s3-bucket.tld\" in ~/.startos/config.yaml"; \
|
||||
exit 1; \
|
||||
fi; \
|
||||
command -v s3cmd >/dev/null || \
|
||||
(echo "Error: s3cmd not found. It must be installed to publish using s3." && exit 1); \
|
||||
printf "\n🚀 Publishing to %s; indexing on %s ...\n" "$$S3BASE" "$$REGISTRY"; \
|
||||
for s9pk in *.s9pk; do \
|
||||
age=$$(( $$(date +%s) - $$(stat -c %Y "$$s9pk") )); \
|
||||
if [ "$$age" -gt 3600 ]; then \
|
||||
printf "\033[1;33m⚠️ %s is %d minutes old. Publish anyway? [y/N] \033[0m" "$$s9pk" "$$((age / 60))"; \
|
||||
read -r ans; \
|
||||
case "$$ans" in [yY]*) ;; *) echo "Skipping $$s9pk"; continue ;; esac; \
|
||||
fi; \
|
||||
start-cli s9pk publish "$$s9pk"; \
|
||||
done
|
||||
|
||||
check-deps:
|
||||
@command -v start-cli >/dev/null || \
|
||||
(echo "Error: start-cli not found. Please see https://docs.start9.com/latest/developer-guide/sdk/installing-the-sdk" && exit 1)
|
||||
@command -v npm >/dev/null || \
|
||||
(echo "Error: npm not found. Please install Node.js and npm." && exit 1)
|
||||
|
||||
check-init:
|
||||
@if [ ! -f ~/.startos/developer.key.pem ]; then \
|
||||
echo "Initializing StartOS developer environment..."; \
|
||||
start-cli init-key; \
|
||||
fi
|
||||
|
||||
javascript/index.js: $(shell find startos -type f) tsconfig.json node_modules
|
||||
npm run check
|
||||
npm run build
|
||||
|
||||
node_modules: package-lock.json
|
||||
npm ci
|
||||
|
||||
package-lock.json: package.json
|
||||
npm i
|
||||
|
||||
clean:
|
||||
@echo "Cleaning up build artifacts..."
|
||||
@rm -rf $(PACKAGE_ID).s9pk $(PACKAGE_ID)_x86_64.s9pk $(PACKAGE_ID)_aarch64.s9pk $(PACKAGE_ID)_riscv64.s9pk javascript node_modules
|
||||
@@ -22,7 +22,8 @@ export const taskBtcAuth = sdk.setupOnInit(async (effects) => {
|
||||
reason: i18n('Spaces needs RPC credentials in Bitcoin'),
|
||||
input: {
|
||||
kind: 'partial',
|
||||
value: { username, password },
|
||||
accept: [{ username, password }],
|
||||
set: { username, password },
|
||||
},
|
||||
})
|
||||
|
||||
|
||||
+16
-10
@@ -105,21 +105,21 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
readonly: false,
|
||||
})
|
||||
|
||||
const spacedSub = await sdk.SubContainer.of(
|
||||
const spacedSub = sdk.SubContainer.of(
|
||||
effects,
|
||||
{ imageId: 'spaces' },
|
||||
mounts,
|
||||
'spaced-sub',
|
||||
)
|
||||
|
||||
const termSub = await sdk.SubContainer.of(
|
||||
const termSub = sdk.SubContainer.of(
|
||||
effects,
|
||||
{ imageId: 'spaces' },
|
||||
mounts,
|
||||
'terminal-sub',
|
||||
)
|
||||
|
||||
const subspacesSub = await sdk.SubContainer.of(
|
||||
const subspacesSub = sdk.SubContainer.of(
|
||||
effects,
|
||||
{ imageId: 'subspaces' },
|
||||
mounts,
|
||||
@@ -183,7 +183,7 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
RUST_LOG: 'registry_server=info',
|
||||
}
|
||||
|
||||
const certrelaySub = await sdk.SubContainer.of(
|
||||
const certrelaySub = sdk.SubContainer.of(
|
||||
effects,
|
||||
{ imageId: 'certrelay' },
|
||||
mounts,
|
||||
@@ -206,7 +206,7 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
RUST_LOG: 'info',
|
||||
}
|
||||
|
||||
const nachoSub = await sdk.SubContainer.of(
|
||||
const nachoSub = sdk.SubContainer.of(
|
||||
effects,
|
||||
{ imageId: 'nacho' },
|
||||
mounts,
|
||||
@@ -217,11 +217,17 @@ export const main = sdk.setupMain(async ({ effects }) => {
|
||||
// tracks the actual host:port StartOS exposes (instead of a hardcoded
|
||||
// domain). Prefer the mdns/.local URL — matches how a LAN browser reaches
|
||||
// the device — then fall back to any non-local URL, then loopback.
|
||||
// `.const(effects)` makes this reactive: if the interface address changes
|
||||
// (clearnet enabled, Tor added, etc.), the service restarts and nacho
|
||||
// picks up the new URL.
|
||||
const subsApiIf = await sdk.serviceInterface
|
||||
.getOwn(effects, 'subs-api')
|
||||
// The interface is reached by walking its host ('subspaces-multi', the
|
||||
// MultiHost that bound 7777 in interfaces.ts). `.const()` makes this
|
||||
// reactive, and the `map` selector narrows the watch to this one interface:
|
||||
// if its address changes (clearnet enabled, Tor added, etc.), the service
|
||||
// restarts and nacho picks up the new URL.
|
||||
const subsApiIf = await sdk.host
|
||||
.getOwn(
|
||||
effects,
|
||||
'subspaces-multi',
|
||||
(host) => host?.bindings[SUBSPACES_UI_PORT]?.interfaces['subs-api'],
|
||||
)
|
||||
.const()
|
||||
const subsApiCandidateUrls = subsApiIf?.addressInfo
|
||||
? [
|
||||
|
||||
@@ -30,14 +30,6 @@ export const manifest = setupManifest({
|
||||
arch: ['x86_64', 'aarch64'],
|
||||
},
|
||||
},
|
||||
alerts: {
|
||||
install: null,
|
||||
update: null,
|
||||
uninstall: null,
|
||||
restore: null,
|
||||
start: null,
|
||||
stop: null,
|
||||
},
|
||||
dependencies: {
|
||||
bitcoind: {
|
||||
description: depBitcoindDescription,
|
||||
|
||||
@@ -0,0 +1,14 @@
|
||||
import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'
|
||||
|
||||
export const current = VersionInfo.of({
|
||||
version: '0.2.1:1',
|
||||
releaseNotes: {
|
||||
en_US: `Packaging-only revision — no upstream changes. The images are unchanged from 0.2.1:0 (\`spaces:v0.2.1\`, \`subs:v0.1.2\`, \`certrelay:v0.2.5\`, \`nacho:v1.0.0\`).
|
||||
|
||||
Rebuilt against \`start-sdk\` 2.0.9, which requires StartOS 0.4.0-beta.10.`,
|
||||
},
|
||||
migrations: {
|
||||
up: async ({ effects }) => {},
|
||||
down: IMPOSSIBLE,
|
||||
},
|
||||
})
|
||||
@@ -1,7 +1,7 @@
|
||||
import { VersionGraph } from '@start9labs/start-sdk'
|
||||
import { v_0_2_1_0 } from './v0.2.1.0'
|
||||
import { current } from './current'
|
||||
|
||||
export const versionGraph = VersionGraph.of({
|
||||
current: v_0_2_1_0,
|
||||
current,
|
||||
other: [],
|
||||
})
|
||||
|
||||
@@ -1,13 +0,0 @@
|
||||
import { IMPOSSIBLE, VersionInfo } from '@start9labs/start-sdk'
|
||||
|
||||
export const v_0_2_1_0 = VersionInfo.of({
|
||||
version: '0.2.1:0',
|
||||
releaseNotes: {
|
||||
en_US: `- **spaced image** updated to \`horologger/spaces:v0.2.1\` (from v0.0.9x).
|
||||
- **Certrelay image** updated to \`horologger/certrelay:v0.2.5\` (from v0.2.3).`,
|
||||
},
|
||||
migrations: {
|
||||
up: async ({ effects }) => {},
|
||||
down: IMPOSSIBLE,
|
||||
},
|
||||
})
|
||||
+2
-9
@@ -1,11 +1,4 @@
|
||||
{
|
||||
"include": ["startos/**/*.ts", "node_modules/**/startos"],
|
||||
"compilerOptions": {
|
||||
"target": "ES2018",
|
||||
"module": "CommonJS",
|
||||
"moduleResolution": "node",
|
||||
"esModuleInterop": true,
|
||||
"strict": true,
|
||||
"skipLibCheck": true
|
||||
}
|
||||
"extends": "@start9labs/start-sdk/tsconfig.base.json",
|
||||
"include": ["startos/**/*.ts", "node_modules/**/startos"]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user