Compare commits
81 Commits
companion-
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
eb2fc0f37b | ||
|
|
94b5374f66 | ||
|
|
9f65f1e7ae | ||
|
|
c598bb8796 | ||
|
|
70996203f9 | ||
|
|
709922c293 | ||
|
|
0aee010f9c | ||
|
|
c5eeb4392f | ||
| 5457b98c66 | |||
|
|
1593c55894 | ||
|
|
1cc18e5b72 | ||
|
|
24582128c5 | ||
|
|
0b038434b1 | ||
|
|
d576f77435 | ||
|
|
7e8d3314d0 | ||
|
|
07772b563f | ||
|
|
d500214766 | ||
|
|
9cd507269c | ||
|
|
aa272bfcf4 | ||
|
|
3b6a32b2f8 | ||
|
|
c66ef048f4 | ||
|
|
32962db6a9 | ||
|
|
4edc50ae47 | ||
|
|
245fb1a815 | ||
|
|
6dffd8e2e8 | ||
|
|
365f3d7d18 | ||
|
|
70bcbc4acc | ||
|
|
56e4c30261 | ||
|
|
f7208e1769 | ||
|
|
77ee39a3df | ||
|
|
02917cc22c | ||
|
|
325b9ea9c9 | ||
|
|
9739bbb3db | ||
|
|
4db1b85fc5 | ||
|
|
a78aa02890 | ||
|
|
0365cc0f9d | ||
|
|
0880824fb3 | ||
|
|
c0d34bd836 | ||
|
|
c8d0dda656 | ||
|
|
57c6a4d512 | ||
|
|
a32e40da31 | ||
|
|
449ed7c1f7 | ||
| 729cee573a | |||
| 5b7ebd85b6 | |||
|
|
c6f11f8ddb | ||
|
|
a26090e561 | ||
|
|
2609f60e6c | ||
|
|
c4c558954b | ||
|
|
d4ea4ed636 | ||
|
|
0fadbb1d0f | ||
|
|
0e5cd24e18 | ||
|
|
1d8e57d564 | ||
|
|
00b7e1798f | ||
|
|
bca1698682 | ||
|
|
0641ee85ef | ||
| 901cf5713a | |||
|
|
875da6c630 | ||
|
|
4589e88442 | ||
|
|
5862689949 | ||
|
|
3995ab5cf5 | ||
|
|
9d83ee3770 | ||
|
|
7e3d01f633 | ||
| 385c950f00 | |||
|
|
98e15b3af0 | ||
|
|
df88d6d00a | ||
|
|
0dfc3a7cfb | ||
|
|
b163d30a0e | ||
| 85b25dd803 | |||
|
|
e3db5558e4 | ||
| 91c51c4d97 | |||
|
|
4343949005 | ||
|
|
5771f318bd | ||
|
|
408c605001 | ||
|
|
0cd2164d24 | ||
|
|
5227406341 | ||
|
|
d924c59c6c | ||
| 0fa2a866f5 | |||
|
|
9fcb68816b | ||
| 9a66f22138 | |||
|
|
504944fd08 | ||
|
|
8af2ca4ac2 |
62
.gitea/workflows/build-iso.yml
Normal file
62
.gitea/workflows/build-iso.yml
Normal file
@ -0,0 +1,62 @@
|
|||||||
|
name: Build Archipelago release ISO (gated)
|
||||||
|
|
||||||
|
# Resurrected from image-recipe/_archived/.gitea-workflows/build-iso-dev.yml.
|
||||||
|
# Dispatch-only on purpose: the ISO is cut per release, not per push, and
|
||||||
|
# the iso-builder runner is a live node — builds are deliberate events.
|
||||||
|
on:
|
||||||
|
workflow_dispatch:
|
||||||
|
|
||||||
|
jobs:
|
||||||
|
build-iso:
|
||||||
|
runs-on: iso-builder
|
||||||
|
timeout-minutes: 180
|
||||||
|
steps:
|
||||||
|
- name: Sync source to workspace
|
||||||
|
run: |
|
||||||
|
# Direct fetch + sync (actions/checkout token is broken on this Gitea)
|
||||||
|
REPO_DIR="$HOME/Projects/archy"
|
||||||
|
[ -d "$REPO_DIR" ] || REPO_DIR="$HOME/archy"
|
||||||
|
cd "$REPO_DIR" && git fetch origin main && git reset --hard origin/main
|
||||||
|
echo "=== Source at commit: $(git log --oneline -1) ==="
|
||||||
|
|
||||||
|
- name: Install ISO build dependencies
|
||||||
|
run: |
|
||||||
|
if dpkg -s debootstrap squashfs-tools xorriso isolinux syslinux-common mtools \
|
||||||
|
grub-efi-amd64-bin grub-pc-bin grub-common >/dev/null 2>&1; then
|
||||||
|
echo "ISO build deps already installed, skipping apt"
|
||||||
|
else
|
||||||
|
sudo apt-get update -qq
|
||||||
|
sudo apt-get install -y -qq \
|
||||||
|
debootstrap squashfs-tools xorriso \
|
||||||
|
isolinux syslinux-common mtools \
|
||||||
|
grub-efi-amd64-bin grub-pc-bin grub-common
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Build backend + frontend if stale
|
||||||
|
run: |
|
||||||
|
REPO_DIR="$HOME/Projects/archy"
|
||||||
|
[ -d "$REPO_DIR" ] || REPO_DIR="$HOME/archy"
|
||||||
|
cd "$REPO_DIR"
|
||||||
|
. "$HOME/.cargo/env" 2>/dev/null || true
|
||||||
|
VERSION=$(grep -m1 '^version' core/archipelago/Cargo.toml | sed 's/.*"\(.*\)".*/\1/')
|
||||||
|
if ! strings core/target/release/archipelago 2>/dev/null | grep -qF "$VERSION"; then
|
||||||
|
cargo build --release --manifest-path core/Cargo.toml -p archipelago
|
||||||
|
fi
|
||||||
|
if ! grep -rqoF "$VERSION" web/dist/neode-ui/assets/*.js 2>/dev/null; then
|
||||||
|
(cd neode-ui && npm ci && npm run build)
|
||||||
|
fi
|
||||||
|
|
||||||
|
- name: Gated ISO build (gates + build + smoke + qemu)
|
||||||
|
run: |
|
||||||
|
REPO_DIR="$HOME/Projects/archy"
|
||||||
|
[ -d "$REPO_DIR" ] || REPO_DIR="$HOME/archy"
|
||||||
|
cd "$REPO_DIR"
|
||||||
|
. "$HOME/.cargo/env" 2>/dev/null || true
|
||||||
|
bash scripts/build-iso-release.sh
|
||||||
|
|
||||||
|
- name: Report artifacts
|
||||||
|
if: always()
|
||||||
|
run: |
|
||||||
|
REPO_DIR="$HOME/Projects/archy"
|
||||||
|
[ -d "$REPO_DIR" ] || REPO_DIR="$HOME/archy"
|
||||||
|
ls -lh "$REPO_DIR"/image-recipe/results/*.iso 2>/dev/null | tail -3 || echo "no ISO produced"
|
||||||
18
.github/pull_request_template.md
vendored
18
.github/pull_request_template.md
vendored
@ -1,16 +1,16 @@
|
|||||||
## Summary
|
## Summary
|
||||||
|
|
||||||
<!-- Brief description of what this PR does -->
|
<!-- What changed and why? -->
|
||||||
|
|
||||||
## Changes
|
## Verification
|
||||||
|
|
||||||
-
|
<!-- Commands run, devices tested, screenshots, or reason testing was not run. -->
|
||||||
|
|
||||||
## Checklist
|
## Checklist
|
||||||
|
|
||||||
- [ ] TypeScript type-check passes (`npm run type-check`)
|
- [ ] Rust formatting/clippy/tests pass when backend code changed.
|
||||||
- [ ] Frontend builds (`npm run build`)
|
- [ ] Frontend type-check/build/tests pass when frontend code changed.
|
||||||
- [ ] Tests pass (`npm test`)
|
- [ ] App manifests validate when app packaging changed.
|
||||||
- [ ] Rust clippy clean (if backend changes)
|
- [ ] Generated catalogs are updated when manifest-owned catalog fields changed.
|
||||||
- [ ] No new compiler warnings
|
- [ ] Docs are updated for user-facing or developer-facing behavior changes.
|
||||||
- [ ] Tested on live server
|
- [ ] No secrets, generated build outputs, local screenshots, or private host details are included.
|
||||||
|
|||||||
31
.github/workflows/ci.yml
vendored
31
.github/workflows/ci.yml
vendored
@ -8,11 +8,11 @@ on:
|
|||||||
|
|
||||||
env:
|
env:
|
||||||
RUST_VERSION: stable
|
RUST_VERSION: stable
|
||||||
NODE_VERSION: 18
|
NODE_VERSION: 20
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
rust:
|
rust:
|
||||||
name: Rust (fmt + clippy + test)
|
name: Rust
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@ -28,17 +28,17 @@ jobs:
|
|||||||
toolchain: ${{ env.RUST_VERSION }}
|
toolchain: ${{ env.RUST_VERSION }}
|
||||||
components: rustfmt, clippy
|
components: rustfmt, clippy
|
||||||
|
|
||||||
- name: Check formatting
|
- name: Format
|
||||||
run: cargo fmt --all -- --check
|
run: cargo fmt --all -- --check
|
||||||
|
|
||||||
- name: Clippy
|
- name: Clippy
|
||||||
run: cargo clippy --all-targets --all-features -- -D warnings
|
run: cargo clippy --all-targets --all-features -- -D warnings
|
||||||
|
|
||||||
- name: Tests
|
- name: Test
|
||||||
run: cargo test --all-features
|
run: cargo test --all-features
|
||||||
|
|
||||||
frontend:
|
frontend:
|
||||||
name: Frontend (type-check + lint)
|
name: Frontend
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
defaults:
|
defaults:
|
||||||
run:
|
run:
|
||||||
@ -52,14 +52,31 @@ jobs:
|
|||||||
uses: actions/setup-node@v4
|
uses: actions/setup-node@v4
|
||||||
with:
|
with:
|
||||||
node-version: ${{ env.NODE_VERSION }}
|
node-version: ${{ env.NODE_VERSION }}
|
||||||
cache: 'npm'
|
cache: npm
|
||||||
cache-dependency-path: neode-ui/package-lock.json
|
cache-dependency-path: neode-ui/package-lock.json
|
||||||
|
|
||||||
- name: Install dependencies
|
- name: Install
|
||||||
run: npm ci
|
run: npm ci
|
||||||
|
|
||||||
- name: Type check
|
- name: Type check
|
||||||
run: npm run type-check
|
run: npm run type-check
|
||||||
|
|
||||||
|
- name: Test
|
||||||
|
run: npm test
|
||||||
|
|
||||||
- name: Build
|
- name: Build
|
||||||
run: npm run build
|
run: npm run build
|
||||||
|
|
||||||
|
manifests:
|
||||||
|
name: App Manifests
|
||||||
|
runs-on: ubuntu-latest
|
||||||
|
|
||||||
|
steps:
|
||||||
|
- name: Checkout
|
||||||
|
uses: actions/checkout@v4
|
||||||
|
|
||||||
|
- name: Validate manifests
|
||||||
|
run: |
|
||||||
|
for manifest in apps/*/manifest.yml; do
|
||||||
|
./scripts/validate-app-manifest.sh --repo-audit "$manifest"
|
||||||
|
done
|
||||||
|
|||||||
35
.gitignore
vendored
35
.gitignore
vendored
@ -1,10 +1,9 @@
|
|||||||
# SSH keys (sandbox copies)
|
# SSH keys and sandbox copies
|
||||||
.ssh/
|
.ssh/
|
||||||
|
|
||||||
# Rust build output
|
# Rust build output
|
||||||
target/
|
target/
|
||||||
**/target/
|
**/target/
|
||||||
Cargo.lock
|
|
||||||
|
|
||||||
# Node.js
|
# Node.js
|
||||||
node_modules/
|
node_modules/
|
||||||
@ -12,7 +11,6 @@ node_modules/
|
|||||||
npm-debug.log*
|
npm-debug.log*
|
||||||
yarn-debug.log*
|
yarn-debug.log*
|
||||||
yarn-error.log*
|
yarn-error.log*
|
||||||
package-lock.json
|
|
||||||
pnpm-debug.log*
|
pnpm-debug.log*
|
||||||
|
|
||||||
# Build outputs
|
# Build outputs
|
||||||
@ -28,49 +26,46 @@ build/
|
|||||||
*.swo
|
*.swo
|
||||||
*~
|
*~
|
||||||
.DS_Store
|
.DS_Store
|
||||||
|
._*
|
||||||
|
Thumbs.db
|
||||||
|
|
||||||
# Environment and local overrides
|
# Environment and local overrides
|
||||||
.env
|
.env
|
||||||
.env.local
|
.env.local
|
||||||
.env.*.local
|
.env.*.local
|
||||||
|
.env.production
|
||||||
|
core/.env.production
|
||||||
scripts/deploy-config.sh
|
scripts/deploy-config.sh
|
||||||
|
|
||||||
# Logs
|
# Logs
|
||||||
logs/
|
logs/
|
||||||
*.log
|
*.log
|
||||||
|
|
||||||
# OS
|
|
||||||
.DS_Store
|
|
||||||
Thumbs.db
|
|
||||||
|
|
||||||
# Testing
|
# Testing
|
||||||
coverage/
|
coverage/
|
||||||
.nyc_output/
|
.nyc_output/
|
||||||
|
|
||||||
# Temporary files
|
# Image / release artifacts
|
||||||
*.tmp
|
|
||||||
*.temp
|
|
||||||
|
|
||||||
# Build artifacts
|
|
||||||
*.iso
|
*.iso
|
||||||
*.img
|
*.img
|
||||||
*.dmg
|
*.dmg
|
||||||
*.app
|
*.app
|
||||||
|
*.apk
|
||||||
|
*.keystore
|
||||||
|
*.s9pk
|
||||||
|
*.tar.gz
|
||||||
|
|
||||||
# Release artifacts live in Gitea Release attachments, not Git history.
|
# Release artifacts live in release attachments, not Git history.
|
||||||
releases/**
|
releases/**
|
||||||
!releases/
|
!releases/
|
||||||
!releases/manifest.json
|
!releases/manifest.json
|
||||||
|
|
||||||
# macOS build output
|
|
||||||
build/macos/
|
|
||||||
|
|
||||||
# Image recipe output
|
# Image recipe output
|
||||||
image-recipe/output/
|
image-recipe/output/
|
||||||
image-recipe/*.iso
|
image-recipe/*.iso
|
||||||
image-recipe/*.img
|
image-recipe/*.img
|
||||||
|
|
||||||
# Loop tool artifacts (created in every subdirectory)
|
# Loop tool artifacts
|
||||||
*/loop/
|
*/loop/
|
||||||
loop/loop/
|
loop/loop/
|
||||||
loop/loop.log.bak
|
loop/loop.log.bak
|
||||||
@ -78,19 +73,17 @@ loop/loop.log.bak
|
|||||||
# Separate repos nested in tree
|
# Separate repos nested in tree
|
||||||
web/
|
web/
|
||||||
|
|
||||||
._*
|
# Resilience harness reports contain session cookies.
|
||||||
|
|
||||||
# Resilience harness reports (generated, contains session cookies)
|
|
||||||
scripts/resilience/reports/
|
scripts/resilience/reports/
|
||||||
|
|
||||||
# Codex / pnpm / python caches / editor backups
|
# Codex / pnpm / python caches / editor backups
|
||||||
.codex
|
.codex
|
||||||
.codex-target-*/
|
.codex-target-*/
|
||||||
.codex-tmp/
|
.codex-tmp/
|
||||||
|
.claude/
|
||||||
.pnpm-store/
|
.pnpm-store/
|
||||||
**/__pycache__/
|
**/__pycache__/
|
||||||
*.bak
|
*.bak
|
||||||
.claude/scheduled_tasks.lock
|
|
||||||
|
|
||||||
# Local evidence screenshots; intentional UI screenshots should live under an
|
# Local evidence screenshots; intentional UI screenshots should live under an
|
||||||
# app/docs asset path with a descriptive filename.
|
# app/docs asset path with a descriptive filename.
|
||||||
|
|||||||
@ -23,6 +23,10 @@ used by the `.githooks/pre-push` hook), which:
|
|||||||
**aborts** if any is missing.
|
**aborts** if any is missing.
|
||||||
5. Stages the signed APK at `neode-ui/public/packages/archipelago-companion.apk`,
|
5. Stages the signed APK at `neode-ui/public/packages/archipelago-companion.apk`,
|
||||||
commits, and pushes with `SHIP_COMPANION=1` (the sanctioned pre-push bypass).
|
commits, and pushes with `SHIP_COMPANION=1` (the sanctioned pre-push bypass).
|
||||||
|
6. The first-launch companion modal and Android "Share this app" QR point at
|
||||||
|
`http://146.59.87.168:2100/packages/archipelago-companion.apk`. After the
|
||||||
|
repo artifact is built, mirror that exact APK to the VPS2-served path before
|
||||||
|
calling the release done.
|
||||||
|
|
||||||
**Never** hand-roll `gradlew assembleDebug` + `cp` to the served path. That path
|
**Never** hand-roll `gradlew assembleDebug` + `cp` to the served path. That path
|
||||||
skips the clean build and the signature enforcement and is exactly how a broken
|
skips the clean build and the signature enforcement and is exactly how a broken
|
||||||
@ -82,13 +86,16 @@ home-screen app layouts wiped by an over-broad action.
|
|||||||
|
|
||||||
## Verify the published download after shipping
|
## Verify the published download after shipping
|
||||||
|
|
||||||
The download served to nodes is Gitea raw-on-main. Confirm the live bytes match
|
The checked-in artifact is Gitea raw-on-main. The QR/App Store download served
|
||||||
what you built and signed:
|
to users is the VPS2 `:2100` URL. Confirm both live byte streams match what you
|
||||||
|
built and signed:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
SERVED=neode-ui/public/packages/archipelago-companion.apk
|
SERVED=neode-ui/public/packages/archipelago-companion.apk
|
||||||
URL=http://146.59.87.168:3000/lfg2025/archy/raw/branch/main/$SERVED
|
GITEA_URL=http://146.59.87.168:3000/lfg2025/archy/raw/branch/main/$SERVED
|
||||||
curl -sS -o /tmp/live.apk "$URL"
|
QR_URL=http://146.59.87.168:2100/packages/archipelago-companion.apk
|
||||||
shasum -a 256 "$SERVED" /tmp/live.apk # must match
|
curl -sS -o /tmp/live-gitea.apk "$GITEA_URL"
|
||||||
apksigner verify -v --min-sdk-version 21 /tmp/live.apk | grep -i "scheme" # v1/v2/v3 = true
|
curl -sS -o /tmp/live-qr.apk "$QR_URL"
|
||||||
|
shasum -a 256 "$SERVED" /tmp/live-gitea.apk /tmp/live-qr.apk # all must match
|
||||||
|
apksigner verify -v --min-sdk-version 21 /tmp/live-qr.apk | grep -i "scheme" # v1/v2/v3 = true
|
||||||
```
|
```
|
||||||
|
|||||||
@ -11,8 +11,8 @@ android {
|
|||||||
applicationId = "com.archipelago.app"
|
applicationId = "com.archipelago.app"
|
||||||
minSdk = 26
|
minSdk = 26
|
||||||
targetSdk = 35
|
targetSdk = 35
|
||||||
versionCode = 29
|
versionCode = 45
|
||||||
versionName = "0.5.9"
|
versionName = "0.5.25"
|
||||||
|
|
||||||
vectorDrawables {
|
vectorDrawables {
|
||||||
useSupportLibrary = true
|
useSupportLibrary = true
|
||||||
|
|||||||
Binary file not shown.
@ -88,8 +88,18 @@ object ServerQrParser {
|
|||||||
|
|
||||||
private fun parseFips(uri: Uri): FipsPairInfo? {
|
private fun parseFips(uri: Uri): FipsPairInfo? {
|
||||||
val npub = uri.getQueryParameter("fnpub")?.trim()
|
val npub = uri.getQueryParameter("fnpub")?.trim()
|
||||||
val host = uri.getQueryParameter("fhost")?.trim()
|
var host = uri.getQueryParameter("fhost")?.trim()
|
||||||
if (npub.isNullOrBlank() || host.isNullOrBlank()) return null
|
if (npub.isNullOrBlank() || host.isNullOrBlank()) return null
|
||||||
|
// A .fips fhost is a dead dial hint: Android's system DNS can't
|
||||||
|
// resolve .fips, so every handshake send fails and first connect
|
||||||
|
// falls back to slow anchor discovery. If the QR's `url` host is a
|
||||||
|
// real address, dial that instead (QRs minted while the node UI was
|
||||||
|
// browsed over the mesh carry npub….fips here).
|
||||||
|
if (host.endsWith(".fips")) {
|
||||||
|
val urlHost = uri.getQueryParameter("url")
|
||||||
|
?.let { runCatching { Uri.parse(it).host }.getOrNull() }
|
||||||
|
if (!urlHost.isNullOrBlank() && !urlHost.endsWith(".fips")) host = urlHost
|
||||||
|
}
|
||||||
return FipsPairInfo(
|
return FipsPairInfo(
|
||||||
npub = npub,
|
npub = npub,
|
||||||
ula = uri.getQueryParameter("fip")?.trim().orEmpty(),
|
ula = uri.getQueryParameter("fip")?.trim().orEmpty(),
|
||||||
|
|||||||
@ -5,6 +5,10 @@ import android.app.NotificationChannel
|
|||||||
import android.app.NotificationManager
|
import android.app.NotificationManager
|
||||||
import android.app.PendingIntent
|
import android.app.PendingIntent
|
||||||
import android.content.Intent
|
import android.content.Intent
|
||||||
|
import android.net.ConnectivityManager
|
||||||
|
import android.net.Network
|
||||||
|
import android.net.NetworkCapabilities
|
||||||
|
import android.net.NetworkRequest
|
||||||
import android.net.VpnService
|
import android.net.VpnService
|
||||||
import android.os.Build
|
import android.os.Build
|
||||||
import android.util.Log
|
import android.util.Log
|
||||||
@ -34,6 +38,20 @@ class ArchyVpnService : VpnService() {
|
|||||||
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
private val scope = CoroutineScope(SupervisorJob() + Dispatchers.IO)
|
||||||
private var warmerJob: Job? = null
|
private var warmerJob: Job? = null
|
||||||
|
|
||||||
|
// Seamless transport handoff (Wi-Fi ⇄ 5G ⇄ future BLE). Without this the
|
||||||
|
// tunnel's underlying network stays pinned to the interface that was
|
||||||
|
// default when the VPN came up; when the phone leaves Wi-Fi for 5G the
|
||||||
|
// mesh sockets ride a dead network and sessions never recover until the
|
||||||
|
// app is restarted (user-reported 2026-07-27). The callback (a) re-pins
|
||||||
|
// the tunnel to the new default network via setUnderlyingNetworks and
|
||||||
|
// (b) forces an immediate mesh re-home so discovery + sessions rebuild
|
||||||
|
// on the new path within seconds instead of waiting out dead-link
|
||||||
|
// timeouts.
|
||||||
|
private var connectivityManager: ConnectivityManager? = null
|
||||||
|
private var networkCallback: ConnectivityManager.NetworkCallback? = null
|
||||||
|
@Volatile
|
||||||
|
private var currentUnderlying: Network? = null
|
||||||
|
|
||||||
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
override fun onStartCommand(intent: Intent?, flags: Int, startId: Int): Int {
|
||||||
if (intent?.action == ACTION_STOP) {
|
if (intent?.action == ACTION_STOP) {
|
||||||
shutdown()
|
shutdown()
|
||||||
@ -113,6 +131,7 @@ class ArchyVpnService : VpnService() {
|
|||||||
shutdown()
|
shutdown()
|
||||||
} else {
|
} else {
|
||||||
startSessionWarmer()
|
startSessionWarmer()
|
||||||
|
registerNetworkHandoff()
|
||||||
// Phone-to-phone chat/beam + the phone's own mesh-served page.
|
// Phone-to-phone chat/beam + the phone's own mesh-served page.
|
||||||
FlareServer.start(this, identity.address, identity.npub, prefs.partyName())
|
FlareServer.start(this, identity.address, identity.npub, prefs.partyName())
|
||||||
// Mutual pairing: when a phone that scanned OUR QR announces
|
// Mutual pairing: when a phone that scanned OUR QR announces
|
||||||
@ -153,19 +172,28 @@ class ArchyVpnService : VpnService() {
|
|||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
emptyList()
|
emptyList()
|
||||||
}.distinct()
|
}.distinct()
|
||||||
for ((ula, port) in targets) {
|
if (round == 0) Log.i(TAG, "session warmer: ${targets.map { it.first }}")
|
||||||
try {
|
// Probe all targets CONCURRENTLY with a short timeout — the
|
||||||
java.net.Socket().use { s ->
|
// old sequential 20s-per-target loop let one cold node starve
|
||||||
s.connect(
|
// every other target for the whole aggressive window.
|
||||||
java.net.InetSocketAddress(java.net.InetAddress.getByName(ula), port),
|
targets.map { (ula, port) ->
|
||||||
20_000,
|
launch {
|
||||||
)
|
try {
|
||||||
|
java.net.Socket().use { s ->
|
||||||
|
s.connect(
|
||||||
|
java.net.InetSocketAddress(
|
||||||
|
java.net.InetAddress.getByName(ula),
|
||||||
|
port,
|
||||||
|
),
|
||||||
|
5_000,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
} catch (_: Exception) {
|
||||||
|
// Cold path / node away — the attempt still drove
|
||||||
|
// session establishment; try again next round.
|
||||||
}
|
}
|
||||||
} catch (_: Exception) {
|
|
||||||
// Cold path / node away — the connect attempt still
|
|
||||||
// drove session establishment; try again next round.
|
|
||||||
}
|
}
|
||||||
}
|
}.forEach { it.join() }
|
||||||
round++
|
round++
|
||||||
// Aggressive for the first ~minute (session bring-up), then a
|
// Aggressive for the first ~minute (session bring-up), then a
|
||||||
// slow keep-warm tick that costs nearly nothing.
|
// slow keep-warm tick that costs nearly nothing.
|
||||||
@ -174,8 +202,75 @@ class ArchyVpnService : VpnService() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Track the phone's default network and hand the mesh over to it as the
|
||||||
|
* phone roams (Wi-Fi ⇄ 5G, and later BLE). Two actions per change:
|
||||||
|
* 1. setUnderlyingNetworks(new) — the tunnel's packets follow the live
|
||||||
|
* network instead of dying on the one it launched with.
|
||||||
|
* 2. re-home the mesh — kick the session warmer so discovery + sessions
|
||||||
|
* rebuild on the new path immediately; the node's own fast-reconnect
|
||||||
|
* (1s) redials peers over the new route.
|
||||||
|
* onAvailable also fires for the FIRST network, which is how the initial
|
||||||
|
* underlying network gets set.
|
||||||
|
*/
|
||||||
|
private fun registerNetworkHandoff() {
|
||||||
|
if (networkCallback != null) return
|
||||||
|
val cm = getSystemService(ConnectivityManager::class.java) ?: return
|
||||||
|
connectivityManager = cm
|
||||||
|
val request = NetworkRequest.Builder()
|
||||||
|
.addCapability(NetworkCapabilities.NET_CAPABILITY_INTERNET)
|
||||||
|
.build()
|
||||||
|
val cb = object : ConnectivityManager.NetworkCallback() {
|
||||||
|
override fun onAvailable(network: Network) {
|
||||||
|
handoffTo(network)
|
||||||
|
}
|
||||||
|
|
||||||
|
override fun onLost(network: Network) {
|
||||||
|
// The lost network was our underlying one — clear the pin so
|
||||||
|
// the system falls back to whatever default remains; the next
|
||||||
|
// onAvailable re-pins explicitly.
|
||||||
|
if (network == currentUnderlying) {
|
||||||
|
currentUnderlying = null
|
||||||
|
runCatching { setUnderlyingNetworks(null) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
networkCallback = cb
|
||||||
|
// requestNetwork tracks the BEST network of the request; when the
|
||||||
|
// phone moves Wi-Fi→5G the callback re-fires onAvailable with the new
|
||||||
|
// one. (registerDefaultNetworkCallback would also work; requestNetwork
|
||||||
|
// lets us extend to BLE-capable transports later.)
|
||||||
|
runCatching { cm.requestNetwork(request, cb) }
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun handoffTo(network: Network) {
|
||||||
|
val changed = network != currentUnderlying
|
||||||
|
currentUnderlying = network
|
||||||
|
// Always re-assert; cheap and covers capability changes on the same
|
||||||
|
// Network object.
|
||||||
|
runCatching { setUnderlyingNetworks(arrayOf(network)) }
|
||||||
|
if (changed && FipsNative.isRunning()) {
|
||||||
|
Log.i(TAG, "network handoff → re-homing mesh on new default network")
|
||||||
|
// Fresh warmer pass drives immediate rediscovery/session rebuild
|
||||||
|
// on the new path instead of waiting out dead-link timeouts.
|
||||||
|
startSessionWarmer()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private fun unregisterNetworkHandoff() {
|
||||||
|
val cm = connectivityManager
|
||||||
|
val cb = networkCallback
|
||||||
|
if (cm != null && cb != null) {
|
||||||
|
runCatching { cm.unregisterNetworkCallback(cb) }
|
||||||
|
}
|
||||||
|
networkCallback = null
|
||||||
|
connectivityManager = null
|
||||||
|
currentUnderlying = null
|
||||||
|
}
|
||||||
|
|
||||||
private fun shutdown() {
|
private fun shutdown() {
|
||||||
warmerJob?.cancel()
|
warmerJob?.cancel()
|
||||||
|
unregisterNetworkHandoff()
|
||||||
FlareServer.stop()
|
FlareServer.stop()
|
||||||
FipsNative.stop()
|
FipsNative.stop()
|
||||||
stopForeground(STOP_FOREGROUND_REMOVE)
|
stopForeground(STOP_FOREGROUND_REMOVE)
|
||||||
@ -183,6 +278,7 @@ class ArchyVpnService : VpnService() {
|
|||||||
}
|
}
|
||||||
|
|
||||||
override fun onDestroy() {
|
override fun onDestroy() {
|
||||||
|
unregisterNetworkHandoff()
|
||||||
FipsNative.stop()
|
FipsNative.stop()
|
||||||
scope.cancel()
|
scope.cancel()
|
||||||
super.onDestroy()
|
super.onDestroy()
|
||||||
|
|||||||
@ -41,7 +41,15 @@ object FipsManager {
|
|||||||
ensureIdentity(prefs)
|
ensureIdentity(prefs)
|
||||||
prefs.upsertNodePeer(info, alias)
|
prefs.upsertNodePeer(info, alias)
|
||||||
peersDirty = true
|
peersDirty = true
|
||||||
_consentNeeded.value = true
|
// Restart the mesh with the new peer RIGHT NOW when consent already
|
||||||
|
// exists — relying on the consentNeeded collector left a running
|
||||||
|
// mesh on the OLD peer list whenever the collector wasn't active
|
||||||
|
// (fresh pairings looked dead until a full app restart).
|
||||||
|
if (VpnService.prepare(context) == null) {
|
||||||
|
startService(context)
|
||||||
|
} else {
|
||||||
|
_consentNeeded.value = true
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Generate-once mesh identity. Returns null only if the RNG/native fails. */
|
/** Generate-once mesh identity. Returns null only if the RNG/native fails. */
|
||||||
|
|||||||
@ -25,6 +25,26 @@ internal const val ARCHY_ANCHOR_NPUB =
|
|||||||
internal const val ARCHY_ANCHOR_ADDR = "146.59.87.168:8444"
|
internal const val ARCHY_ANCHOR_ADDR = "146.59.87.168:8444"
|
||||||
internal const val ARCHY_ANCHOR_TRANSPORT = "tcp"
|
internal const val ARCHY_ANCHOR_TRANSPORT = "tcp"
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Public FIPS network anchors (join.fips.network — the dual-transport TCP
|
||||||
|
* pair; keep in lockstep with core/archipelago/src/fips/anchors.rs
|
||||||
|
* fips_network_anchors()). Baked into every pairing at trailing priority so
|
||||||
|
* a degraded/unreachable vps2 anchor can never strand the phone: the mesh
|
||||||
|
* still joins the public tree and routes to the node through it.
|
||||||
|
*/
|
||||||
|
internal val PUBLIC_FIPS_ANCHORS = listOf(
|
||||||
|
Triple(
|
||||||
|
"npub10yffd020a4ag8zcy75f9pruq3rnghvvhd5hphl9s62zgp35s560qrksp9u",
|
||||||
|
"23.182.128.74:443",
|
||||||
|
"tcp",
|
||||||
|
),
|
||||||
|
Triple(
|
||||||
|
"npub1qmc3cvfz0yu2hx96nq3gp55zdan2qclealn7xshgr448d3nh6lks7zel98",
|
||||||
|
"217.77.8.91:443",
|
||||||
|
"tcp",
|
||||||
|
),
|
||||||
|
)
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Mesh identity + known node peers. Follows the same plaintext-DataStore
|
* Mesh identity + known node peers. Follows the same plaintext-DataStore
|
||||||
* storage model as ServerPreferences (the server password lives there the
|
* storage model as ServerPreferences (the server password lives there the
|
||||||
@ -126,7 +146,7 @@ class FipsPreferences(private val context: Context) {
|
|||||||
if (peer.ip.isBlank() || peer.port <= 0) continue
|
if (peer.ip.isBlank() || peer.port <= 0) continue
|
||||||
merged.put(JSONObject().apply {
|
merged.put(JSONObject().apply {
|
||||||
put("npub", peer.npub)
|
put("npub", peer.npub)
|
||||||
put("alias", peer.name.ifBlank { "Party phone" })
|
put("alias", hostSafeAlias(peer.name.ifBlank { "party-phone" }))
|
||||||
put("addresses", JSONArray().put(JSONObject().apply {
|
put("addresses", JSONArray().put(JSONObject().apply {
|
||||||
put("transport", "udp")
|
put("transport", "udp")
|
||||||
put("addr", "${peer.ip}:${peer.port}")
|
put("addr", "${peer.ip}:${peer.port}")
|
||||||
@ -145,7 +165,7 @@ class FipsPreferences(private val context: Context) {
|
|||||||
) {
|
) {
|
||||||
merged.put(JSONObject().apply {
|
merged.put(JSONObject().apply {
|
||||||
put("npub", ARCHY_ANCHOR_NPUB)
|
put("npub", ARCHY_ANCHOR_NPUB)
|
||||||
put("alias", "Archipelago anchor")
|
put("alias", "archipelago-anchor")
|
||||||
put("addresses", JSONArray().put(JSONObject().apply {
|
put("addresses", JSONArray().put(JSONObject().apply {
|
||||||
put("transport", ARCHY_ANCHOR_TRANSPORT)
|
put("transport", ARCHY_ANCHOR_TRANSPORT)
|
||||||
put("addr", ARCHY_ANCHOR_ADDR)
|
put("addr", ARCHY_ANCHOR_ADDR)
|
||||||
@ -153,9 +173,40 @@ class FipsPreferences(private val context: Context) {
|
|||||||
}))
|
}))
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
// Backfill anchor peers for entries paired before newer QR/app
|
||||||
|
// releases added them. `upsertNodePeer` persists these on re-scan, but
|
||||||
|
// startup must also self-heal old DataStore state so updating the APK is
|
||||||
|
// enough to get off-LAN redundancy.
|
||||||
|
if (merged.length() > 0) {
|
||||||
|
addAnchorIfMissing(merged, ARCHY_ANCHOR_NPUB, "archipelago-anchor", ARCHY_ANCHOR_ADDR, ARCHY_ANCHOR_TRANSPORT, 40)
|
||||||
|
for ((i, anchor) in PUBLIC_FIPS_ANCHORS.withIndex()) {
|
||||||
|
val (npub, addr, transport) = anchor
|
||||||
|
addAnchorIfMissing(merged, npub, "fips-network-anchor-${i + 1}", addr, transport, 50 + i * 10)
|
||||||
|
}
|
||||||
|
}
|
||||||
return merged.toString()
|
return merged.toString()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private fun addAnchorIfMissing(
|
||||||
|
peers: JSONArray,
|
||||||
|
npub: String,
|
||||||
|
alias: String,
|
||||||
|
addr: String,
|
||||||
|
transport: String,
|
||||||
|
priority: Int,
|
||||||
|
) {
|
||||||
|
if ((0 until peers.length()).any { peers.optJSONObject(it)?.optString("npub") == npub }) return
|
||||||
|
peers.put(JSONObject().apply {
|
||||||
|
put("npub", npub)
|
||||||
|
put("alias", alias)
|
||||||
|
put("addresses", JSONArray().put(JSONObject().apply {
|
||||||
|
put("transport", transport)
|
||||||
|
put("addr", addr)
|
||||||
|
put("priority", priority)
|
||||||
|
}))
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
private fun parsePartyPeers(json: String): List<PartyPeer> = try {
|
private fun parsePartyPeers(json: String): List<PartyPeer> = try {
|
||||||
val arr = JSONArray(json)
|
val arr = JSONArray(json)
|
||||||
(0 until arr.length()).mapNotNull { i ->
|
(0 until arr.length()).mapNotNull { i ->
|
||||||
@ -200,16 +251,19 @@ class FipsPreferences(private val context: Context) {
|
|||||||
val incoming = mutableListOf<JSONObject>()
|
val incoming = mutableListOf<JSONObject>()
|
||||||
incoming += JSONObject().apply {
|
incoming += JSONObject().apply {
|
||||||
put("npub", info.npub)
|
put("npub", info.npub)
|
||||||
put("alias", alias.ifBlank { "Archipelago" })
|
put("alias", hostSafeAlias(alias.ifBlank { "Archipelago" }))
|
||||||
val addresses = JSONArray()
|
val addresses = JSONArray()
|
||||||
if (info.udpPort > 0) {
|
// .fips hosts are unresolvable on Android (no system .fips DNS):
|
||||||
|
// storing one gives the mesh a dial target that fails every
|
||||||
|
// handshake and stalls first connect on anchor discovery.
|
||||||
|
if (info.udpPort > 0 && !info.host.endsWith(".fips")) {
|
||||||
addresses.put(JSONObject().apply {
|
addresses.put(JSONObject().apply {
|
||||||
put("transport", "udp")
|
put("transport", "udp")
|
||||||
put("addr", "${info.host}:${info.udpPort}")
|
put("addr", "${info.host}:${info.udpPort}")
|
||||||
put("priority", 10)
|
put("priority", 10)
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
if (info.tcpPort > 0) {
|
if (info.tcpPort > 0 && !info.host.endsWith(".fips")) {
|
||||||
addresses.put(JSONObject().apply {
|
addresses.put(JSONObject().apply {
|
||||||
put("transport", "tcp")
|
put("transport", "tcp")
|
||||||
put("addr", "${info.host}:${info.tcpPort}")
|
put("addr", "${info.host}:${info.tcpPort}")
|
||||||
@ -220,9 +274,10 @@ class FipsPreferences(private val context: Context) {
|
|||||||
}
|
}
|
||||||
for (anchor in info.anchors) {
|
for (anchor in info.anchors) {
|
||||||
if (anchor.npub == info.npub) continue
|
if (anchor.npub == info.npub) continue
|
||||||
|
if (anchor.addr.substringBeforeLast(":").endsWith(".fips")) continue
|
||||||
incoming += JSONObject().apply {
|
incoming += JSONObject().apply {
|
||||||
put("npub", anchor.npub)
|
put("npub", anchor.npub)
|
||||||
put("alias", "Mesh anchor")
|
put("alias", "mesh-anchor")
|
||||||
put("addresses", JSONArray().put(JSONObject().apply {
|
put("addresses", JSONArray().put(JSONObject().apply {
|
||||||
put("transport", anchor.transport)
|
put("transport", anchor.transport)
|
||||||
put("addr", anchor.addr)
|
put("addr", anchor.addr)
|
||||||
@ -237,7 +292,7 @@ class FipsPreferences(private val context: Context) {
|
|||||||
) {
|
) {
|
||||||
incoming += JSONObject().apply {
|
incoming += JSONObject().apply {
|
||||||
put("npub", ARCHY_ANCHOR_NPUB)
|
put("npub", ARCHY_ANCHOR_NPUB)
|
||||||
put("alias", "Archipelago anchor")
|
put("alias", "archipelago-anchor")
|
||||||
put("addresses", JSONArray().put(JSONObject().apply {
|
put("addresses", JSONArray().put(JSONObject().apply {
|
||||||
put("transport", ARCHY_ANCHOR_TRANSPORT)
|
put("transport", ARCHY_ANCHOR_TRANSPORT)
|
||||||
put("addr", ARCHY_ANCHOR_ADDR)
|
put("addr", ARCHY_ANCHOR_ADDR)
|
||||||
@ -245,6 +300,21 @@ class FipsPreferences(private val context: Context) {
|
|||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
// And the public FIPS network anchors at trailing priority, so one
|
||||||
|
// degraded rendezvous (vps2, 2026-07-24) can never strand the phone.
|
||||||
|
for ((i, anchor) in PUBLIC_FIPS_ANCHORS.withIndex()) {
|
||||||
|
val (npub, addr, transport) = anchor
|
||||||
|
if (info.npub == npub || incoming.any { it.optString("npub") == npub }) continue
|
||||||
|
incoming += JSONObject().apply {
|
||||||
|
put("npub", npub)
|
||||||
|
put("alias", "fips-network-anchor-${i + 1}")
|
||||||
|
put("addresses", JSONArray().put(JSONObject().apply {
|
||||||
|
put("transport", transport)
|
||||||
|
put("addr", addr)
|
||||||
|
put("priority", 50 + i * 10)
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
}
|
||||||
val incomingNpubs = incoming.map { it.optString("npub") }.toSet()
|
val incomingNpubs = incoming.map { it.optString("npub") }.toSet()
|
||||||
context.fipsDataStore.edit { prefs ->
|
context.fipsDataStore.edit { prefs ->
|
||||||
val current = JSONArray(prefs[peersKey] ?: "[]")
|
val current = JSONArray(prefs[peersKey] ?: "[]")
|
||||||
@ -258,3 +328,14 @@ class FipsPreferences(private val context: Context) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Peer aliases feed the fips host map as `<alias>.fips` hostnames; anything
|
||||||
|
* that isn't a valid DNS label ("Framework PT" — the space) gets rejected and
|
||||||
|
* silently drops the peer from name resolution. Slug it instead of losing it.
|
||||||
|
*/
|
||||||
|
internal fun hostSafeAlias(alias: String): String =
|
||||||
|
alias.lowercase()
|
||||||
|
.replace(Regex("[^a-z0-9.-]+"), "-")
|
||||||
|
.trim('-', '.')
|
||||||
|
.ifBlank { "archipelago" }
|
||||||
|
|||||||
@ -1,6 +1,7 @@
|
|||||||
package com.archipelago.app.ui.components
|
package com.archipelago.app.ui.components
|
||||||
|
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.border
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
@ -12,6 +13,7 @@ import androidx.compose.material3.Text
|
|||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
|
import androidx.compose.ui.draw.clip
|
||||||
import androidx.compose.ui.graphics.Color
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.text.font.FontWeight
|
import androidx.compose.ui.text.font.FontWeight
|
||||||
import androidx.compose.ui.text.style.TextAlign
|
import androidx.compose.ui.text.style.TextAlign
|
||||||
@ -37,7 +39,22 @@ fun MeshLoadingScreen(message: String = "Dialing your node by its key — no IPs
|
|||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
Column(horizontalAlignment = Alignment.CenterHorizontally) {
|
||||||
PixelArtLogo(Modifier.size(96.dp))
|
// The brand's circle-container logo (as on the connect screen /
|
||||||
|
// web login): pixel-art "a" centered in a black disc.
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.size(120.dp)
|
||||||
|
.clip(androidx.compose.foundation.shape.CircleShape)
|
||||||
|
.background(Color.Black)
|
||||||
|
.border(
|
||||||
|
1.dp,
|
||||||
|
Color.White.copy(alpha = 0.14f),
|
||||||
|
androidx.compose.foundation.shape.CircleShape,
|
||||||
|
),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
PixelArtLogo(Modifier.size(64.dp))
|
||||||
|
}
|
||||||
Spacer(Modifier.height(20.dp))
|
Spacer(Modifier.height(20.dp))
|
||||||
Text(
|
Text(
|
||||||
text = "F*CK IPs MESH",
|
text = "F*CK IPs MESH",
|
||||||
|
|||||||
@ -23,6 +23,7 @@ import androidx.compose.foundation.layout.width
|
|||||||
import androidx.compose.foundation.shape.CircleShape
|
import androidx.compose.foundation.shape.CircleShape
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Palette
|
||||||
import androidx.compose.material.icons.filled.Settings
|
import androidx.compose.material.icons.filled.Settings
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
@ -108,6 +109,7 @@ fun NESController(
|
|||||||
onKey: (String) -> Unit,
|
onKey: (String) -> Unit,
|
||||||
onMenu: () -> Unit,
|
onMenu: () -> Unit,
|
||||||
onPlayerToggle: () -> Unit = {},
|
onPlayerToggle: () -> Unit = {},
|
||||||
|
onToggleStyle: (() -> Unit)? = null,
|
||||||
modifier: Modifier = Modifier,
|
modifier: Modifier = Modifier,
|
||||||
) {
|
) {
|
||||||
val c = paletteFor(style)
|
val c = paletteFor(style)
|
||||||
@ -205,6 +207,7 @@ fun NESController(
|
|||||||
) {
|
) {
|
||||||
PlayerPill(c, playerId, onPlayerToggle)
|
PlayerPill(c, playerId, onPlayerToggle)
|
||||||
SettingsBtn(c, Modifier, onMenu)
|
SettingsBtn(c, Modifier, onMenu)
|
||||||
|
onToggleStyle?.let { StyleBtn(c, Modifier, it) }
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -431,6 +434,23 @@ fun SettingsBtn(c: NESPalette, modifier: Modifier = Modifier, onClick: () -> Uni
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Dark/Classic style toggle — lives next to the settings gear (the menu hub
|
||||||
|
* no longer carries it). */
|
||||||
|
@Composable
|
||||||
|
fun StyleBtn(c: NESPalette, modifier: Modifier = Modifier, onClick: () -> Unit) {
|
||||||
|
var p by remember { mutableStateOf(false) }
|
||||||
|
Box(
|
||||||
|
modifier = modifier
|
||||||
|
.size(48.dp)
|
||||||
|
.clip(CircleShape)
|
||||||
|
.background(if (p) c.capsulePress else c.capsule)
|
||||||
|
.pointerInput(Unit) { detectTapGestures(onPress = { p = true; onClick(); tryAwaitRelease(); p = false }) },
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
Icon(Icons.Default.Palette, "Controller style", Modifier.size(26.dp), tint = c.labelMuted)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/** Player ID toggle pill (P1/P2/ALL) */
|
/** Player ID toggle pill (P1/P2/ALL) */
|
||||||
@Composable
|
@Composable
|
||||||
fun PlayerPill(c: NESPalette, playerId: Int, onToggle: () -> Unit) {
|
fun PlayerPill(c: NESPalette, playerId: Int, onToggle: () -> Unit) {
|
||||||
|
|||||||
@ -21,20 +21,40 @@ import androidx.compose.foundation.layout.padding
|
|||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
import androidx.compose.foundation.layout.widthIn
|
import androidx.compose.foundation.layout.widthIn
|
||||||
|
import androidx.compose.foundation.layout.statusBarsPadding
|
||||||
|
import androidx.compose.foundation.rememberScrollState
|
||||||
|
import androidx.compose.foundation.verticalScroll
|
||||||
|
import androidx.compose.material.icons.automirrored.filled.ArrowBack
|
||||||
|
import androidx.compose.material.icons.filled.Bolt
|
||||||
|
import androidx.compose.material.icons.filled.Dashboard
|
||||||
|
import androidx.compose.material.icons.filled.Dns
|
||||||
|
import androidx.compose.material.icons.filled.Groups
|
||||||
|
import androidx.compose.material.icons.filled.Keyboard
|
||||||
|
import androidx.compose.material.icons.filled.SportsEsports
|
||||||
|
import androidx.compose.foundation.layout.heightIn
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
import androidx.compose.foundation.text.KeyboardActions
|
import androidx.compose.foundation.text.KeyboardActions
|
||||||
import androidx.compose.foundation.text.KeyboardOptions
|
import androidx.compose.foundation.text.KeyboardOptions
|
||||||
import androidx.compose.material.icons.Icons
|
import androidx.compose.material.icons.Icons
|
||||||
|
import androidx.compose.material.icons.filled.Close
|
||||||
import androidx.compose.material.icons.filled.QrCodeScanner
|
import androidx.compose.material.icons.filled.QrCodeScanner
|
||||||
import androidx.compose.material3.Icon
|
import androidx.compose.material3.Icon
|
||||||
import androidx.compose.material3.OutlinedTextField
|
import androidx.compose.material3.OutlinedTextField
|
||||||
import androidx.compose.material3.OutlinedTextFieldDefaults
|
import androidx.compose.material3.OutlinedTextFieldDefaults
|
||||||
import androidx.compose.material3.Text
|
import androidx.compose.material3.Text
|
||||||
import androidx.compose.runtime.Composable
|
import androidx.compose.runtime.Composable
|
||||||
|
import androidx.compose.runtime.LaunchedEffect
|
||||||
import androidx.compose.runtime.getValue
|
import androidx.compose.runtime.getValue
|
||||||
import androidx.compose.runtime.mutableStateOf
|
import androidx.compose.runtime.mutableStateOf
|
||||||
import androidx.compose.runtime.remember
|
import androidx.compose.runtime.remember
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
|
import androidx.compose.ui.platform.LocalClipboardManager
|
||||||
|
import androidx.compose.ui.platform.LocalConfiguration
|
||||||
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.compose.ui.text.AnnotatedString
|
||||||
|
import com.archipelago.app.fips.FipsManager
|
||||||
|
import com.archipelago.app.fips.FipsNative
|
||||||
|
import com.archipelago.app.fips.FipsPreferences
|
||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
@ -51,7 +71,6 @@ import androidx.compose.ui.unit.sp
|
|||||||
import com.archipelago.app.R
|
import com.archipelago.app.R
|
||||||
import com.archipelago.app.data.ServerEntry
|
import com.archipelago.app.data.ServerEntry
|
||||||
import com.archipelago.app.ui.theme.BitcoinOrange
|
import com.archipelago.app.ui.theme.BitcoinOrange
|
||||||
import com.archipelago.app.ui.theme.ControllerStyle
|
|
||||||
import com.archipelago.app.ui.theme.SurfaceDark
|
import com.archipelago.app.ui.theme.SurfaceDark
|
||||||
import com.archipelago.app.ui.theme.TextMuted
|
import com.archipelago.app.ui.theme.TextMuted
|
||||||
import com.archipelago.app.ui.theme.TextPrimary
|
import com.archipelago.app.ui.theme.TextPrimary
|
||||||
@ -75,27 +94,29 @@ fun NESMenu(
|
|||||||
visible: Boolean,
|
visible: Boolean,
|
||||||
servers: List<ServerEntry>,
|
servers: List<ServerEntry>,
|
||||||
activeServer: ServerEntry?,
|
activeServer: ServerEntry?,
|
||||||
isGamepadMode: Boolean,
|
|
||||||
controllerStyle: ControllerStyle,
|
|
||||||
onDismiss: () -> Unit,
|
onDismiss: () -> Unit,
|
||||||
onSelectServer: (ServerEntry) -> Unit,
|
onSelectServer: (ServerEntry) -> Unit,
|
||||||
onAddServer: (ServerEntry) -> Unit,
|
onAddServer: (ServerEntry) -> Unit,
|
||||||
onScanQr: (() -> Unit)? = null,
|
onScanQr: (() -> Unit)? = null,
|
||||||
onEditServer: (ServerEntry, ServerEntry) -> Unit,
|
onEditServer: (ServerEntry, ServerEntry) -> Unit,
|
||||||
onRemoveServer: (ServerEntry) -> Unit,
|
onRemoveServer: (ServerEntry) -> Unit,
|
||||||
onToggleMode: () -> Unit,
|
onRemote: () -> Unit,
|
||||||
onToggleStyle: () -> Unit,
|
onKeyboard: () -> Unit,
|
||||||
onBackToWebView: (() -> Unit)? = null,
|
onBackToWebView: (() -> Unit)? = null,
|
||||||
onMeshParty: (() -> Unit)? = null,
|
onMeshParty: (() -> Unit)? = null,
|
||||||
) {
|
) {
|
||||||
AnimatedVisibility(visible = visible, enter = fadeIn(), exit = fadeOut()) {
|
AnimatedVisibility(visible = visible, enter = fadeIn(), exit = fadeOut()) {
|
||||||
|
// Contained hub overlay: a centred glass panel (not full-screen) that
|
||||||
|
// holds the card page and its sub-pages (Nodes, FIPS) and scrolls
|
||||||
|
// inside its own bounds when content is tall. Tapping the dimmed
|
||||||
|
// backdrop dismisses.
|
||||||
Box(
|
Box(
|
||||||
Modifier.fillMaxSize().background(Color.Black.copy(alpha = 0.7f))
|
Modifier.fillMaxSize().background(Color.Black.copy(alpha = 0.7f))
|
||||||
.clickable(indication = null, interactionSource = remember { MutableInteractionSource() }) { onDismiss() },
|
.clickable(indication = null, interactionSource = remember { MutableInteractionSource() }) { onDismiss() },
|
||||||
contentAlignment = Alignment.Center,
|
contentAlignment = Alignment.Center,
|
||||||
) {
|
) {
|
||||||
AnimatedVisibility(visible = visible, enter = fadeIn() + scaleIn(initialScale = 0.95f), exit = fadeOut() + scaleOut(targetScale = 0.95f)) {
|
AnimatedVisibility(visible = visible, enter = fadeIn() + scaleIn(initialScale = 0.95f), exit = fadeOut() + scaleOut(targetScale = 0.95f)) {
|
||||||
MenuPanel(servers, activeServer, isGamepadMode, controllerStyle, onDismiss, onSelectServer, onAddServer, onScanQr, onEditServer, onRemoveServer, onToggleMode, onToggleStyle, onBackToWebView, onMeshParty)
|
MenuPanel(servers, activeServer, onDismiss, onSelectServer, onAddServer, onScanQr, onEditServer, onRemoveServer, onRemote, onKeyboard, onBackToWebView, onMeshParty)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -105,16 +126,14 @@ fun NESMenu(
|
|||||||
private fun MenuPanel(
|
private fun MenuPanel(
|
||||||
servers: List<ServerEntry>,
|
servers: List<ServerEntry>,
|
||||||
activeServer: ServerEntry?,
|
activeServer: ServerEntry?,
|
||||||
isGamepadMode: Boolean,
|
|
||||||
controllerStyle: ControllerStyle,
|
|
||||||
onDismiss: () -> Unit,
|
onDismiss: () -> Unit,
|
||||||
onSelectServer: (ServerEntry) -> Unit,
|
onSelectServer: (ServerEntry) -> Unit,
|
||||||
onAddServer: (ServerEntry) -> Unit,
|
onAddServer: (ServerEntry) -> Unit,
|
||||||
onScanQr: (() -> Unit)?,
|
onScanQr: (() -> Unit)?,
|
||||||
onEditServer: (ServerEntry, ServerEntry) -> Unit,
|
onEditServer: (ServerEntry, ServerEntry) -> Unit,
|
||||||
onRemoveServer: (ServerEntry) -> Unit,
|
onRemoveServer: (ServerEntry) -> Unit,
|
||||||
onToggleMode: () -> Unit,
|
onRemote: () -> Unit,
|
||||||
onToggleStyle: () -> Unit,
|
onKeyboard: () -> Unit,
|
||||||
onBackToWebView: (() -> Unit)?,
|
onBackToWebView: (() -> Unit)?,
|
||||||
onMeshParty: (() -> Unit)?,
|
onMeshParty: (() -> Unit)?,
|
||||||
) {
|
) {
|
||||||
@ -124,14 +143,15 @@ private fun MenuPanel(
|
|||||||
var nm by remember { mutableStateOf("") }
|
var nm by remember { mutableStateOf("") }
|
||||||
var addr by remember { mutableStateOf("") }
|
var addr by remember { mutableStateOf("") }
|
||||||
var pwd by remember { mutableStateOf("") }
|
var pwd by remember { mutableStateOf("") }
|
||||||
|
var https by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
fun resetForm() {
|
fun resetForm() {
|
||||||
nm = ""; addr = ""; pwd = ""; showAdd = false; editing = null
|
nm = ""; addr = ""; pwd = ""; https = false; showAdd = false; editing = null
|
||||||
}
|
}
|
||||||
|
|
||||||
fun startEdit(server: ServerEntry) {
|
fun startEdit(server: ServerEntry) {
|
||||||
editing = server
|
editing = server
|
||||||
nm = server.name; addr = server.address; pwd = server.password
|
nm = server.name; addr = server.address; pwd = server.password; https = server.useHttps
|
||||||
showAdd = false
|
showAdd = false
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -139,161 +159,381 @@ private fun MenuPanel(
|
|||||||
if (addr.isBlank()) return
|
if (addr.isBlank()) return
|
||||||
val orig = editing
|
val orig = editing
|
||||||
if (orig != null) {
|
if (orig != null) {
|
||||||
// Preserve fields the compact form doesn't expose (scheme, port).
|
// Preserve port (compact form doesn't expose it); scheme is now editable.
|
||||||
onEditServer(orig, orig.copy(address = addr, password = pwd, name = nm))
|
onEditServer(orig, orig.copy(address = addr, useHttps = https, password = pwd, name = nm))
|
||||||
} else {
|
} else {
|
||||||
onAddServer(ServerEntry(addr, false, password = pwd, name = nm))
|
onAddServer(ServerEntry(addr, https, password = pwd, name = nm))
|
||||||
}
|
}
|
||||||
resetForm()
|
resetForm()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
var page by remember { mutableStateOf(HubPage.HUB) }
|
||||||
|
|
||||||
Column(
|
Column(
|
||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.widthIn(max = 420.dp)
|
.widthIn(max = 420.dp)
|
||||||
|
.fillMaxWidth()
|
||||||
.padding(horizontal = 20.dp)
|
.padding(horizontal = 20.dp)
|
||||||
|
// Cap height just short of the full screen; the panel wraps short
|
||||||
|
// content and only scrolls in the rare case it outgrows this.
|
||||||
|
.heightIn(max = (LocalConfiguration.current.screenHeightDp * 0.92f).dp)
|
||||||
.clip(RoundedCornerShape(PANEL_R))
|
.clip(RoundedCornerShape(PANEL_R))
|
||||||
.background(PanelBg)
|
.background(PanelBg.copy(alpha = 0.86f))
|
||||||
.border(1.dp, PanelBorder, RoundedCornerShape(PANEL_R))
|
.border(1.dp, PanelBorder, RoundedCornerShape(PANEL_R))
|
||||||
.clickable(indication = null, interactionSource = remember { MutableInteractionSource() }) {}
|
.clickable(indication = null, interactionSource = remember { MutableInteractionSource() }) {}
|
||||||
.padding(22.dp),
|
.verticalScroll(rememberScrollState())
|
||||||
verticalArrangement = Arrangement.spacedBy(10.dp),
|
.padding(20.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(12.dp),
|
||||||
) {
|
) {
|
||||||
// Title
|
// Header: back (on sub-pages) or title, and a close on the hub.
|
||||||
Text(
|
Row(
|
||||||
"Menu",
|
Modifier.fillMaxWidth(),
|
||||||
color = TextPrimary,
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
fontSize = 18.sp,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
fontWeight = FontWeight.SemiBold,
|
) {
|
||||||
letterSpacing = 2.sp,
|
if (page == HubPage.HUB) {
|
||||||
modifier = Modifier.fillMaxWidth(),
|
Text("Menu", color = TextPrimary, fontSize = 20.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 2.sp)
|
||||||
textAlign = TextAlign.Center,
|
IconRound(Icons.Default.Close, "Close") { onDismiss() }
|
||||||
)
|
} else {
|
||||||
Spacer(Modifier.height(2.dp))
|
Row(verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
IconRound(Icons.AutoMirrored.Filled.ArrowBack, "Back") { resetForm(); page = HubPage.HUB }
|
||||||
// Servers
|
Spacer(Modifier.width(12.dp))
|
||||||
servers.forEach { server ->
|
|
||||||
val active = server.serialize() == activeServer?.serialize()
|
|
||||||
MenuItem(
|
|
||||||
label = server.displayName(),
|
|
||||||
selected = active,
|
|
||||||
onClick = { onSelectServer(server) },
|
|
||||||
onEdit = { startEdit(server) },
|
|
||||||
onRemove = { onRemoveServer(server) },
|
|
||||||
)
|
|
||||||
}
|
|
||||||
|
|
||||||
if (servers.isEmpty()) {
|
|
||||||
Text("No servers", color = TextMuted, fontSize = 14.sp, modifier = Modifier.padding(vertical = 4.dp))
|
|
||||||
}
|
|
||||||
|
|
||||||
// Add / edit server
|
|
||||||
if (showAdd || editing != null) {
|
|
||||||
Column(
|
|
||||||
Modifier
|
|
||||||
.fillMaxWidth()
|
|
||||||
.clip(RoundedCornerShape(ROW_R))
|
|
||||||
.background(FieldBg)
|
|
||||||
.border(1.dp, RowBorder, RoundedCornerShape(ROW_R))
|
|
||||||
.padding(12.dp),
|
|
||||||
verticalArrangement = Arrangement.spacedBy(8.dp),
|
|
||||||
) {
|
|
||||||
Row(
|
|
||||||
Modifier.fillMaxWidth(),
|
|
||||||
verticalAlignment = Alignment.CenterVertically,
|
|
||||||
horizontalArrangement = Arrangement.SpaceBetween,
|
|
||||||
) {
|
|
||||||
Text(
|
Text(
|
||||||
if (editing != null) "Edit Server" else "Add Server",
|
if (page == HubPage.NODES) "Nodes" else "FIPS Mesh",
|
||||||
color = TextMuted,
|
color = TextPrimary, fontSize = 20.sp, fontWeight = FontWeight.SemiBold, letterSpacing = 1.sp,
|
||||||
fontSize = 13.sp,
|
|
||||||
letterSpacing = 1.sp,
|
|
||||||
fontWeight = FontWeight.Medium,
|
|
||||||
)
|
|
||||||
Text(
|
|
||||||
"Cancel",
|
|
||||||
color = TextMuted,
|
|
||||||
fontSize = 13.sp,
|
|
||||||
modifier = Modifier.clickable { resetForm() }.padding(start = 8.dp),
|
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
GlassField(
|
IconRound(Icons.Default.Close, "Close") { onDismiss() }
|
||||||
value = nm, onValueChange = { nm = it },
|
|
||||||
placeholder = "Name (optional)",
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Next),
|
|
||||||
)
|
|
||||||
GlassField(
|
|
||||||
value = addr, onValueChange = { addr = it.trim() },
|
|
||||||
placeholder = "192.168.1.100",
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Uri, imeAction = ImeAction.Next),
|
|
||||||
)
|
|
||||||
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically) {
|
|
||||||
GlassField(
|
|
||||||
value = pwd, onValueChange = { pwd = it },
|
|
||||||
placeholder = "Password",
|
|
||||||
modifier = Modifier.weight(1f),
|
|
||||||
visualTransformation = PasswordVisualTransformation(),
|
|
||||||
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = ImeAction.Go),
|
|
||||||
keyboardActions = KeyboardActions(onGo = { submit() }),
|
|
||||||
)
|
|
||||||
Box(
|
|
||||||
Modifier.size(FIELD_H).clip(RoundedCornerShape(12.dp)).background(BitcoinOrange.copy(alpha = 0.15f))
|
|
||||||
.border(1.dp, BitcoinOrange.copy(alpha = 0.4f), RoundedCornerShape(12.dp))
|
|
||||||
.clickable { submit() },
|
|
||||||
contentAlignment = Alignment.Center,
|
|
||||||
) { Text("OK", color = BitcoinOrange, fontSize = 14.sp, fontWeight = FontWeight.Bold) }
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
} else {
|
}
|
||||||
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
Spacer(Modifier.height(4.dp))
|
||||||
Box(Modifier.weight(1f)) {
|
|
||||||
MenuItem(label = "Add Server", labelColor = BitcoinOrange, onClick = { showAdd = true })
|
when (page) {
|
||||||
|
HubPage.HUB -> {
|
||||||
|
// Card page — one card per destination. Dashboard first: it's a
|
||||||
|
// peer of the others so three-finger → hub → Dashboard returns
|
||||||
|
// to the node UI, same shape as every other option.
|
||||||
|
if (onBackToWebView != null) {
|
||||||
|
HubCard(Icons.Default.Dashboard, "Dashboard", "The node's web interface") { onBackToWebView() }
|
||||||
}
|
}
|
||||||
if (onScanQr != null) {
|
HubCard(Icons.Default.SportsEsports, "Remote", "Game controller for the node") { onRemote() }
|
||||||
// Add server by scanning the node's pairing QR
|
HubCard(Icons.Default.Keyboard, "Keyboard", "Type into the node") { onKeyboard() }
|
||||||
Box(
|
HubCard(Icons.Default.Dns, "Nodes", activeServer?.displayName() ?: "Add or switch servers") {
|
||||||
|
page = HubPage.NODES
|
||||||
|
}
|
||||||
|
if (FipsNative.available) {
|
||||||
|
HubCard(Icons.Default.Bolt, "FIPS Mesh", "Mesh identity & status") { page = HubPage.FIPS }
|
||||||
|
}
|
||||||
|
if (onMeshParty != null) {
|
||||||
|
HubCard(Icons.Default.Groups, "Mesh Party", "Phone-to-phone chat & beam") { onMeshParty() }
|
||||||
|
}
|
||||||
|
// Dark/Classic style lives on the remote/keyboard screen next to
|
||||||
|
// the settings button — not here.
|
||||||
|
}
|
||||||
|
|
||||||
|
HubPage.NODES -> {
|
||||||
|
servers.forEach { server ->
|
||||||
|
val active = server.serialize() == activeServer?.serialize()
|
||||||
|
MenuItem(
|
||||||
|
label = server.displayName(),
|
||||||
|
selected = active,
|
||||||
|
onClick = { onSelectServer(server) },
|
||||||
|
onEdit = { startEdit(server) },
|
||||||
|
onRemove = { onRemoveServer(server) },
|
||||||
|
)
|
||||||
|
}
|
||||||
|
if (servers.isEmpty()) {
|
||||||
|
Text("No servers", color = TextMuted, fontSize = 14.sp, modifier = Modifier.padding(vertical = 4.dp))
|
||||||
|
}
|
||||||
|
|
||||||
|
if (showAdd || editing != null) {
|
||||||
|
Column(
|
||||||
Modifier
|
Modifier
|
||||||
.size(ROW_H)
|
.fillMaxWidth()
|
||||||
.clip(RoundedCornerShape(ROW_R))
|
.clip(RoundedCornerShape(ROW_R))
|
||||||
.background(RowBg)
|
.background(FieldBg)
|
||||||
.border(1.dp, RowBorder, RoundedCornerShape(ROW_R))
|
.border(1.dp, RowBorder, RoundedCornerShape(ROW_R))
|
||||||
.clickable { onScanQr() },
|
.padding(12.dp),
|
||||||
contentAlignment = Alignment.Center,
|
verticalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
) {
|
) {
|
||||||
Icon(
|
Row(
|
||||||
Icons.Default.QrCodeScanner,
|
Modifier.fillMaxWidth(),
|
||||||
contentDescription = stringResource(R.string.add_server_qr),
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
tint = BitcoinOrange,
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
modifier = Modifier.size(24.dp),
|
) {
|
||||||
|
Text(
|
||||||
|
if (editing != null) "Edit Server" else "Add Server",
|
||||||
|
color = TextMuted, fontSize = 13.sp, letterSpacing = 1.sp, fontWeight = FontWeight.Medium,
|
||||||
|
)
|
||||||
|
Text(
|
||||||
|
"Cancel", color = TextMuted, fontSize = 13.sp,
|
||||||
|
modifier = Modifier.clickable { resetForm() }.padding(start = 8.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
GlassField(
|
||||||
|
value = nm, onValueChange = { nm = it },
|
||||||
|
placeholder = "Name (optional)",
|
||||||
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Text, imeAction = ImeAction.Next),
|
||||||
)
|
)
|
||||||
|
GlassField(
|
||||||
|
value = addr, onValueChange = { addr = it.trim() },
|
||||||
|
placeholder = "192.168.1.100",
|
||||||
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Uri, imeAction = ImeAction.Next),
|
||||||
|
)
|
||||||
|
Row(horizontalArrangement = Arrangement.spacedBy(8.dp), verticalAlignment = Alignment.CenterVertically) {
|
||||||
|
GlassField(
|
||||||
|
value = pwd, onValueChange = { pwd = it },
|
||||||
|
placeholder = "Password",
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
visualTransformation = PasswordVisualTransformation(),
|
||||||
|
keyboardOptions = KeyboardOptions(keyboardType = KeyboardType.Password, imeAction = ImeAction.Go),
|
||||||
|
keyboardActions = KeyboardActions(onGo = { submit() }),
|
||||||
|
)
|
||||||
|
Box(
|
||||||
|
Modifier.size(FIELD_H).clip(RoundedCornerShape(12.dp)).background(BitcoinOrange.copy(alpha = 0.15f))
|
||||||
|
.border(1.dp, BitcoinOrange.copy(alpha = 0.4f), RoundedCornerShape(12.dp))
|
||||||
|
.clickable { submit() },
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) { Text("OK", color = BitcoinOrange, fontSize = 14.sp, fontWeight = FontWeight.Bold) }
|
||||||
|
}
|
||||||
|
// HTTPS scheme toggle (available on both add and edit).
|
||||||
|
Row(
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.clip(RoundedCornerShape(ROW_R))
|
||||||
|
.clickable { https = !https }
|
||||||
|
.padding(vertical = 2.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
) {
|
||||||
|
Text("Use HTTPS", color = TextMuted, fontSize = 13.sp)
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.width(46.dp).height(26.dp)
|
||||||
|
.clip(RoundedCornerShape(13.dp))
|
||||||
|
.background(if (https) BitcoinOrange.copy(alpha = 0.9f) else RowBg)
|
||||||
|
.border(1.dp, if (https) BitcoinOrange else RowBorder, RoundedCornerShape(13.dp)),
|
||||||
|
contentAlignment = if (https) Alignment.CenterEnd else Alignment.CenterStart,
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.padding(horizontal = 3.dp)
|
||||||
|
.size(20.dp)
|
||||||
|
.clip(RoundedCornerShape(10.dp))
|
||||||
|
.background(if (https) Color.White else TextMuted),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
Row(Modifier.fillMaxWidth(), horizontalArrangement = Arrangement.spacedBy(10.dp)) {
|
||||||
|
Box(Modifier.weight(1f)) {
|
||||||
|
MenuItem(label = "Add Server", labelColor = BitcoinOrange, onClick = { showAdd = true })
|
||||||
|
}
|
||||||
|
if (onScanQr != null) {
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.size(ROW_H)
|
||||||
|
.clip(RoundedCornerShape(ROW_R))
|
||||||
|
.background(RowBg)
|
||||||
|
.border(1.dp, RowBorder, RoundedCornerShape(ROW_R))
|
||||||
|
.clickable { onScanQr() },
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
Icon(
|
||||||
|
Icons.Default.QrCodeScanner,
|
||||||
|
contentDescription = stringResource(R.string.add_server_qr),
|
||||||
|
tint = BitcoinOrange,
|
||||||
|
modifier = Modifier.size(24.dp),
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
HubPage.FIPS -> {
|
||||||
|
FipsSection(embedded = true)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Spacer(Modifier.height(2.dp))
|
private enum class HubPage { HUB, NODES, FIPS }
|
||||||
Box(Modifier.fillMaxWidth().height(1.dp).background(PanelBorder))
|
|
||||||
Spacer(Modifier.height(2.dp))
|
|
||||||
|
|
||||||
// Mode toggle
|
/** Big tappable destination card for the hub page: icon + title + subtitle. */
|
||||||
MenuItem(
|
@Composable
|
||||||
label = if (isGamepadMode) "Switch to Keyboard" else "Switch to Gamepad",
|
private fun HubCard(
|
||||||
onClick = onToggleMode,
|
icon: androidx.compose.ui.graphics.vector.ImageVector,
|
||||||
)
|
title: String,
|
||||||
|
subtitle: String,
|
||||||
// Style toggle
|
onClick: () -> Unit,
|
||||||
MenuItem(
|
) {
|
||||||
label = if (controllerStyle == ControllerStyle.CLASSIC) "Style: Classic" else "Style: Dark",
|
Row(
|
||||||
onClick = onToggleStyle,
|
Modifier
|
||||||
)
|
.fillMaxWidth()
|
||||||
|
.clip(RoundedCornerShape(ROW_R))
|
||||||
// Phone↔phone mesh pairing + chat
|
.background(RowBg)
|
||||||
if (onMeshParty != null) {
|
.border(1.dp, RowBorder, RoundedCornerShape(ROW_R))
|
||||||
MenuItem(label = "Mesh Party", labelColor = BitcoinOrange, onClick = onMeshParty)
|
.clickable { onClick() }
|
||||||
|
.padding(16.dp),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.spacedBy(14.dp),
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
Modifier.size(40.dp).clip(RoundedCornerShape(12.dp)).background(BitcoinOrange.copy(alpha = 0.14f)),
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
Icon(icon, contentDescription = title, tint = BitcoinOrange, modifier = Modifier.size(22.dp))
|
||||||
}
|
}
|
||||||
|
Column(Modifier.weight(1f)) {
|
||||||
|
Text(title, color = TextPrimary, fontSize = 16.sp, fontWeight = FontWeight.SemiBold)
|
||||||
|
Text(subtitle, color = TextMuted, fontSize = 12.sp, maxLines = 1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Back to dashboard
|
/** Small circular icon button used in the hub header. */
|
||||||
if (onBackToWebView != null) {
|
@Composable
|
||||||
MenuItem(label = "Back to Dashboard", onClick = onBackToWebView)
|
private fun IconRound(
|
||||||
|
icon: androidx.compose.ui.graphics.vector.ImageVector,
|
||||||
|
desc: String,
|
||||||
|
onClick: () -> Unit,
|
||||||
|
) {
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.size(40.dp)
|
||||||
|
.clip(RoundedCornerShape(20.dp))
|
||||||
|
.background(RowBg)
|
||||||
|
.border(1.dp, RowBorder, RoundedCornerShape(20.dp))
|
||||||
|
.clickable { onClick() },
|
||||||
|
contentAlignment = Alignment.Center,
|
||||||
|
) {
|
||||||
|
Icon(icon, contentDescription = desc, tint = TextPrimary, modifier = Modifier.size(20.dp))
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/** Snapshot of the phone's mesh identity + state for the FIPS menu section. */
|
||||||
|
private data class FipsInfo(
|
||||||
|
val available: Boolean,
|
||||||
|
val running: Boolean,
|
||||||
|
val npub: String,
|
||||||
|
val meshAddress: String,
|
||||||
|
val peerCount: Int,
|
||||||
|
)
|
||||||
|
|
||||||
|
/**
|
||||||
|
* FIPS mesh oversight: shows what the phone's embedded mesh node is doing —
|
||||||
|
* running state, its mesh identity (npub), its mesh address (fd…ULA), how
|
||||||
|
* many peers/anchors it's configured with — and a one-tap Reconnect that
|
||||||
|
* re-homes the mesh (also the manual fix if a network handoff ever misses).
|
||||||
|
* Collapsed by default so the menu stays compact.
|
||||||
|
*/
|
||||||
|
@Composable
|
||||||
|
private fun FipsSection(embedded: Boolean = false) {
|
||||||
|
if (!FipsNative.available) return
|
||||||
|
val context = LocalContext.current
|
||||||
|
val clipboard = LocalClipboardManager.current
|
||||||
|
var expanded by remember { mutableStateOf(embedded) }
|
||||||
|
var info by remember { mutableStateOf<FipsInfo?>(null) }
|
||||||
|
|
||||||
|
// Load identity/state when the section opens (cheap DataStore + JSON read).
|
||||||
|
LaunchedEffect(expanded) {
|
||||||
|
if (expanded && info == null) {
|
||||||
|
val prefs = FipsPreferences(context)
|
||||||
|
val id = prefs.identity()
|
||||||
|
val peers = runCatching {
|
||||||
|
org.json.JSONArray(prefs.peersJson()).length()
|
||||||
|
}.getOrDefault(0)
|
||||||
|
info = FipsInfo(
|
||||||
|
available = true,
|
||||||
|
running = FipsNative.isRunning(),
|
||||||
|
npub = id?.npub.orEmpty(),
|
||||||
|
meshAddress = id?.address.orEmpty(),
|
||||||
|
peerCount = peers,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
Column(Modifier.fillMaxWidth()) {
|
||||||
|
// Embedded in the hub's FIPS sub-page the header row would duplicate
|
||||||
|
// the page title, so only the standalone (collapsible) form shows it.
|
||||||
|
if (!embedded) MenuItem(
|
||||||
|
label = "FIPS Mesh",
|
||||||
|
labelColor = BitcoinOrange,
|
||||||
|
onClick = { expanded = !expanded },
|
||||||
|
)
|
||||||
|
if (expanded) {
|
||||||
|
val i = info
|
||||||
|
Column(
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.padding(top = 6.dp)
|
||||||
|
.clip(RoundedCornerShape(ROW_R))
|
||||||
|
.background(FieldBg)
|
||||||
|
.border(1.dp, RowBorder, RoundedCornerShape(ROW_R))
|
||||||
|
.padding(14.dp),
|
||||||
|
verticalArrangement = Arrangement.spacedBy(10.dp),
|
||||||
|
) {
|
||||||
|
if (i == null) {
|
||||||
|
Text("Loading…", color = TextMuted, fontSize = 13.sp)
|
||||||
|
} else {
|
||||||
|
FipsRow("Status", if (i.running) "Connected" else "Stopped",
|
||||||
|
valueColor = if (i.running) BitcoinOrange else TextMuted)
|
||||||
|
if (i.meshAddress.isNotBlank()) {
|
||||||
|
FipsRow("Mesh address", i.meshAddress, mono = true,
|
||||||
|
onCopy = { clipboard.setText(AnnotatedString(i.meshAddress)) })
|
||||||
|
}
|
||||||
|
if (i.npub.isNotBlank()) {
|
||||||
|
FipsRow("Identity (npub)", i.npub, mono = true,
|
||||||
|
onCopy = { clipboard.setText(AnnotatedString(i.npub)) })
|
||||||
|
}
|
||||||
|
FipsRow("Peers & anchors", i.peerCount.toString())
|
||||||
|
Text(
|
||||||
|
"Your node reaches this phone over the mesh by its npub — no ports opened to the internet.",
|
||||||
|
color = TextMuted, fontSize = 11.sp,
|
||||||
|
)
|
||||||
|
MenuItem(
|
||||||
|
label = "Reconnect mesh",
|
||||||
|
labelColor = BitcoinOrange,
|
||||||
|
onClick = {
|
||||||
|
FipsManager.requestMeshRestart(context)
|
||||||
|
info = null
|
||||||
|
if (!embedded) expanded = false
|
||||||
|
},
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Composable
|
||||||
|
private fun FipsRow(
|
||||||
|
label: String,
|
||||||
|
value: String,
|
||||||
|
valueColor: Color = TextPrimary,
|
||||||
|
mono: Boolean = false,
|
||||||
|
onCopy: (() -> Unit)? = null,
|
||||||
|
) {
|
||||||
|
Row(
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.then(if (onCopy != null) Modifier.clickable { onCopy() } else Modifier),
|
||||||
|
verticalAlignment = Alignment.CenterVertically,
|
||||||
|
horizontalArrangement = Arrangement.SpaceBetween,
|
||||||
|
) {
|
||||||
|
Text(label, color = TextMuted, fontSize = 12.sp, modifier = Modifier.width(120.dp))
|
||||||
|
Text(
|
||||||
|
value,
|
||||||
|
color = valueColor,
|
||||||
|
fontSize = if (mono) 11.sp else 13.sp,
|
||||||
|
fontWeight = FontWeight.Medium,
|
||||||
|
modifier = Modifier.weight(1f),
|
||||||
|
textAlign = TextAlign.End,
|
||||||
|
)
|
||||||
|
if (onCopy != null) {
|
||||||
|
Text("⧉", color = TextMuted, fontSize = 13.sp, modifier = Modifier.padding(start = 8.dp))
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -43,6 +43,7 @@ fun NESPortraitController(
|
|||||||
onMouseScroll: (Int) -> Unit = { _ -> },
|
onMouseScroll: (Int) -> Unit = { _ -> },
|
||||||
onMenu: () -> Unit,
|
onMenu: () -> Unit,
|
||||||
onPlayerToggle: () -> Unit = {},
|
onPlayerToggle: () -> Unit = {},
|
||||||
|
onToggleStyle: (() -> Unit)? = null,
|
||||||
) {
|
) {
|
||||||
val c = paletteFor(style)
|
val c = paletteFor(style)
|
||||||
val isClassic = style == ControllerStyle.CLASSIC
|
val isClassic = style == ControllerStyle.CLASSIC
|
||||||
@ -151,6 +152,10 @@ fun NESPortraitController(
|
|||||||
PlayerPill(c, playerId, onPlayerToggle)
|
PlayerPill(c, playerId, onPlayerToggle)
|
||||||
Spacer(Modifier.width(10.dp))
|
Spacer(Modifier.width(10.dp))
|
||||||
SettingsBtn(c, Modifier, onMenu)
|
SettingsBtn(c, Modifier, onMenu)
|
||||||
|
onToggleStyle?.let {
|
||||||
|
Spacer(Modifier.width(10.dp))
|
||||||
|
StyleBtn(c, Modifier, it)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -238,6 +238,7 @@ internal fun CameraQrPreview(onDecoded: (String) -> Unit) {
|
|||||||
val mainExecutor = ContextCompat.getMainExecutor(context)
|
val mainExecutor = ContextCompat.getMainExecutor(context)
|
||||||
val providerFuture = ProcessCameraProvider.getInstance(context)
|
val providerFuture = ProcessCameraProvider.getInstance(context)
|
||||||
var provider: ProcessCameraProvider? = null
|
var provider: ProcessCameraProvider? = null
|
||||||
|
val focusScheduler = Executors.newSingleThreadScheduledExecutor()
|
||||||
|
|
||||||
providerFuture.addListener({
|
providerFuture.addListener({
|
||||||
val p = providerFuture.get()
|
val p = providerFuture.get()
|
||||||
@ -245,12 +246,15 @@ internal fun CameraQrPreview(onDecoded: (String) -> Unit) {
|
|||||||
val preview = Preview.Builder().build().also {
|
val preview = Preview.Builder().build().also {
|
||||||
it.setSurfaceProvider(previewView.surfaceProvider)
|
it.setSurfaceProvider(previewView.surfaceProvider)
|
||||||
}
|
}
|
||||||
// CameraX's analysis default is 640x480 — too few pixels per module
|
// Dense Lightning-invoice QRs need BOTH enough pixels per module and
|
||||||
// to decode a modal-sized QR at arm's length. 1280x720 more than
|
// sharp focus. 1280x720 + a far-focused camera (e.g. Pixel 9a's main
|
||||||
// doubles the pixel density at negligible analysis cost.
|
// lens, which won't focus close) left dense invoices undecodable
|
||||||
|
// while sparse address QRs still read — the "scanner doesn't pick up
|
||||||
|
// invoices" report. 1920x1080 roughly doubles module resolution so a
|
||||||
|
// QR held at the camera's actual focus distance still resolves.
|
||||||
@Suppress("DEPRECATION")
|
@Suppress("DEPRECATION")
|
||||||
val analysis = ImageAnalysis.Builder()
|
val analysis = ImageAnalysis.Builder()
|
||||||
.setTargetResolution(android.util.Size(1280, 720))
|
.setTargetResolution(android.util.Size(1920, 1080))
|
||||||
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
|
.setBackpressureStrategy(ImageAnalysis.STRATEGY_KEEP_ONLY_LATEST)
|
||||||
.build()
|
.build()
|
||||||
.also {
|
.also {
|
||||||
@ -261,13 +265,27 @@ internal fun CameraQrPreview(onDecoded: (String) -> Unit) {
|
|||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
p.unbindAll()
|
p.unbindAll()
|
||||||
p.bindToLifecycle(lifecycleOwner, CameraSelector.DEFAULT_BACK_CAMERA, preview, analysis)
|
val cam = p.bindToLifecycle(lifecycleOwner, CameraSelector.DEFAULT_BACK_CAMERA, preview, analysis)
|
||||||
|
// Force a centre autofocus on a repeating tick. A hand-held QR is
|
||||||
|
// a static scene, so continuous-AF often never retriggers and the
|
||||||
|
// lens sits at its resting (far) focus — fatal for dense codes.
|
||||||
|
// A normalized centre point works before the view is measured.
|
||||||
|
val point = androidx.camera.core.SurfaceOrientedMeteringPointFactory(1f, 1f)
|
||||||
|
.createPoint(0.5f, 0.5f)
|
||||||
|
val focusAction = androidx.camera.core.FocusMeteringAction.Builder(
|
||||||
|
point,
|
||||||
|
androidx.camera.core.FocusMeteringAction.FLAG_AF,
|
||||||
|
).disableAutoCancel().build()
|
||||||
|
focusScheduler.scheduleWithFixedDelay({
|
||||||
|
runCatching { cam.cameraControl.startFocusAndMetering(focusAction) }
|
||||||
|
}, 0, 2, java.util.concurrent.TimeUnit.SECONDS)
|
||||||
} catch (_: Exception) {
|
} catch (_: Exception) {
|
||||||
// Camera unavailable — the user can dismiss and enter details manually.
|
// Camera unavailable — the user can dismiss and enter details manually.
|
||||||
}
|
}
|
||||||
}, mainExecutor)
|
}, mainExecutor)
|
||||||
|
|
||||||
onDispose {
|
onDispose {
|
||||||
|
focusScheduler.shutdownNow()
|
||||||
provider?.unbindAll()
|
provider?.unbindAll()
|
||||||
analysisExecutor.shutdown()
|
analysisExecutor.shutdown()
|
||||||
}
|
}
|
||||||
|
|||||||
@ -12,9 +12,11 @@ import androidx.compose.runtime.remember
|
|||||||
import androidx.compose.runtime.rememberCoroutineScope
|
import androidx.compose.runtime.rememberCoroutineScope
|
||||||
import androidx.compose.runtime.setValue
|
import androidx.compose.runtime.setValue
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
|
import androidx.navigation.NavType
|
||||||
import androidx.navigation.compose.NavHost
|
import androidx.navigation.compose.NavHost
|
||||||
import androidx.navigation.compose.composable
|
import androidx.navigation.compose.composable
|
||||||
import androidx.navigation.compose.rememberNavController
|
import androidx.navigation.compose.rememberNavController
|
||||||
|
import androidx.navigation.navArgument
|
||||||
import com.archipelago.app.data.PairResult
|
import com.archipelago.app.data.PairResult
|
||||||
import com.archipelago.app.data.ServerEntry
|
import com.archipelago.app.data.ServerEntry
|
||||||
import com.archipelago.app.data.ServerPreferences
|
import com.archipelago.app.data.ServerPreferences
|
||||||
@ -177,11 +179,25 @@ fun AppNavHost(
|
|||||||
onRemoteInput = {
|
onRemoteInput = {
|
||||||
navController.navigate(Routes.REMOTE_INPUT)
|
navController.navigate(Routes.REMOTE_INPUT)
|
||||||
},
|
},
|
||||||
|
onRemoteKeyboard = {
|
||||||
|
navController.navigate("${Routes.REMOTE_INPUT}?keyboard=true")
|
||||||
|
},
|
||||||
|
onMeshParty = {
|
||||||
|
navController.navigate(Routes.MESH_PARTY)
|
||||||
|
},
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
composable(Routes.REMOTE_INPUT) {
|
composable(
|
||||||
|
"${Routes.REMOTE_INPUT}?keyboard={keyboard}",
|
||||||
|
arguments = listOf(
|
||||||
|
navArgument("keyboard") {
|
||||||
|
type = NavType.BoolType
|
||||||
|
defaultValue = false
|
||||||
|
},
|
||||||
|
),
|
||||||
|
) { entry ->
|
||||||
RemoteInputScreen(
|
RemoteInputScreen(
|
||||||
onBack = {
|
onBack = {
|
||||||
navController.popBackStack()
|
navController.popBackStack()
|
||||||
@ -189,6 +205,7 @@ fun AppNavHost(
|
|||||||
onMeshParty = {
|
onMeshParty = {
|
||||||
navController.navigate(Routes.MESH_PARTY)
|
navController.navigate(Routes.MESH_PARTY)
|
||||||
},
|
},
|
||||||
|
startInKeyboard = entry.arguments?.getBoolean("keyboard") == true,
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -4,8 +4,10 @@ import android.content.res.Configuration
|
|||||||
import androidx.activity.compose.BackHandler
|
import androidx.activity.compose.BackHandler
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
@ -54,7 +56,12 @@ import com.archipelago.app.ui.theme.TextMuted
|
|||||||
import kotlinx.coroutines.launch
|
import kotlinx.coroutines.launch
|
||||||
|
|
||||||
@Composable
|
@Composable
|
||||||
fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
fun RemoteInputScreen(
|
||||||
|
onBack: () -> Unit,
|
||||||
|
onMeshParty: (() -> Unit)? = null,
|
||||||
|
// Land on the keyboard instead of the gamepad (hub menu's Keyboard card).
|
||||||
|
startInKeyboard: Boolean = false,
|
||||||
|
) {
|
||||||
val context = LocalContext.current
|
val context = LocalContext.current
|
||||||
val prefs = remember { ServerPreferences(context) }
|
val prefs = remember { ServerPreferences(context) }
|
||||||
val scope = rememberCoroutineScope()
|
val scope = rememberCoroutineScope()
|
||||||
@ -63,7 +70,7 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
val savedServers by prefs.savedServers.collectAsState(initial = emptyList())
|
val savedServers by prefs.savedServers.collectAsState(initial = emptyList())
|
||||||
val activeServer by prefs.activeServer.collectAsState(initial = null)
|
val activeServer by prefs.activeServer.collectAsState(initial = null)
|
||||||
|
|
||||||
var isGamepadMode by remember { mutableStateOf(true) }
|
var isGamepadMode by remember { mutableStateOf(!startInKeyboard) }
|
||||||
var showModal by remember { mutableStateOf(false) }
|
var showModal by remember { mutableStateOf(false) }
|
||||||
var showQrScanner by remember { mutableStateOf(false) }
|
var showQrScanner by remember { mutableStateOf(false) }
|
||||||
var controllerStyle by remember { mutableStateOf(ControllerStyle.DARK) }
|
var controllerStyle by remember { mutableStateOf(ControllerStyle.DARK) }
|
||||||
@ -90,6 +97,9 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
playerId = when (playerId) { 0 -> 1; 1 -> 2; else -> 0 }
|
playerId = when (playerId) { 0 -> 1; 1 -> 2; else -> 0 }
|
||||||
ws.playerId = playerId
|
ws.playerId = playerId
|
||||||
}
|
}
|
||||||
|
fun toggleStyle() {
|
||||||
|
controllerStyle = if (controllerStyle == ControllerStyle.CLASSIC) ControllerStyle.DARK else ControllerStyle.CLASSIC
|
||||||
|
}
|
||||||
val connectionState by ws.state.collectAsState()
|
val connectionState by ws.state.collectAsState()
|
||||||
val lifecycleOwner = LocalLifecycleOwner.current
|
val lifecycleOwner = LocalLifecycleOwner.current
|
||||||
|
|
||||||
@ -153,6 +163,7 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
onKey = { ws.sendKey(it) },
|
onKey = { ws.sendKey(it) },
|
||||||
onMenu = { showModal = true },
|
onMenu = { showModal = true },
|
||||||
onPlayerToggle = ::togglePlayer,
|
onPlayerToggle = ::togglePlayer,
|
||||||
|
onToggleStyle = ::toggleStyle,
|
||||||
)
|
)
|
||||||
isGamepadMode && !isLandscape -> NESPortraitController(
|
isGamepadMode && !isLandscape -> NESPortraitController(
|
||||||
style = controllerStyle,
|
style = controllerStyle,
|
||||||
@ -163,6 +174,7 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
onMouseScroll = { ws.sendScroll(it) },
|
onMouseScroll = { ws.sendScroll(it) },
|
||||||
onMenu = { showModal = true },
|
onMenu = { showModal = true },
|
||||||
onPlayerToggle = ::togglePlayer,
|
onPlayerToggle = ::togglePlayer,
|
||||||
|
onToggleStyle = ::toggleStyle,
|
||||||
)
|
)
|
||||||
else -> {
|
else -> {
|
||||||
// Keyboard mode: trackpad fills top, keyboard pinned bottom
|
// Keyboard mode: trackpad fills top, keyboard pinned bottom
|
||||||
@ -182,12 +194,20 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
modifier = Modifier.fillMaxWidth(),
|
modifier = Modifier.fillMaxWidth(),
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
// Settings icon top-right in keyboard mode
|
// Settings + style icons top-right in keyboard mode
|
||||||
com.archipelago.app.ui.components.SettingsBtn(
|
Row(
|
||||||
c = com.archipelago.app.ui.components.paletteFor(controllerStyle),
|
Modifier.align(Alignment.TopEnd).padding(8.dp),
|
||||||
modifier = Modifier.align(Alignment.TopEnd).padding(8.dp),
|
horizontalArrangement = Arrangement.spacedBy(8.dp),
|
||||||
onClick = { showModal = true },
|
) {
|
||||||
)
|
com.archipelago.app.ui.components.SettingsBtn(
|
||||||
|
c = com.archipelago.app.ui.components.paletteFor(controllerStyle),
|
||||||
|
onClick = { showModal = true },
|
||||||
|
)
|
||||||
|
com.archipelago.app.ui.components.StyleBtn(
|
||||||
|
c = com.archipelago.app.ui.components.paletteFor(controllerStyle),
|
||||||
|
onClick = ::toggleStyle,
|
||||||
|
)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -210,8 +230,6 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
visible = showModal,
|
visible = showModal,
|
||||||
servers = savedServers,
|
servers = savedServers,
|
||||||
activeServer = activeServer,
|
activeServer = activeServer,
|
||||||
isGamepadMode = isGamepadMode,
|
|
||||||
controllerStyle = controllerStyle,
|
|
||||||
onDismiss = { showModal = false },
|
onDismiss = { showModal = false },
|
||||||
onSelectServer = { server ->
|
onSelectServer = { server ->
|
||||||
scope.launch { ws.disconnect(); prefs.setActiveServer(server) }; showModal = false
|
scope.launch { ws.disconnect(); prefs.setActiveServer(server) }; showModal = false
|
||||||
@ -245,10 +263,8 @@ fun RemoteInputScreen(onBack: () -> Unit, onMeshParty: (() -> Unit)? = null) {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
onToggleMode = { isGamepadMode = !isGamepadMode; showModal = false },
|
onRemote = { isGamepadMode = true; showModal = false },
|
||||||
onToggleStyle = {
|
onKeyboard = { isGamepadMode = false; showModal = false },
|
||||||
controllerStyle = if (controllerStyle == ControllerStyle.CLASSIC) ControllerStyle.DARK else ControllerStyle.CLASSIC
|
|
||||||
},
|
|
||||||
onBackToWebView = { showModal = false; onBack() },
|
onBackToWebView = { showModal = false; onBack() },
|
||||||
onMeshParty = onMeshParty?.let { open -> { showModal = false; open() } },
|
onMeshParty = onMeshParty?.let { open -> { showModal = false; open() } },
|
||||||
)
|
)
|
||||||
|
|||||||
@ -23,20 +23,26 @@ import androidx.compose.animation.fadeIn
|
|||||||
import androidx.compose.animation.fadeOut
|
import androidx.compose.animation.fadeOut
|
||||||
import androidx.compose.foundation.Image
|
import androidx.compose.foundation.Image
|
||||||
import androidx.compose.foundation.background
|
import androidx.compose.foundation.background
|
||||||
|
import androidx.compose.foundation.clickable
|
||||||
|
import androidx.compose.foundation.interaction.MutableInteractionSource
|
||||||
import androidx.compose.foundation.layout.Arrangement
|
import androidx.compose.foundation.layout.Arrangement
|
||||||
import androidx.compose.foundation.layout.Box
|
import androidx.compose.foundation.layout.Box
|
||||||
import androidx.compose.foundation.layout.Column
|
import androidx.compose.foundation.layout.Column
|
||||||
import androidx.compose.foundation.layout.Row
|
import androidx.compose.foundation.layout.Row
|
||||||
import androidx.compose.foundation.layout.Spacer
|
import androidx.compose.foundation.layout.Spacer
|
||||||
import androidx.compose.foundation.layout.WindowInsets
|
import androidx.compose.foundation.layout.WindowInsets
|
||||||
|
import androidx.compose.foundation.layout.WindowInsetsSides
|
||||||
import androidx.compose.foundation.layout.fillMaxSize
|
import androidx.compose.foundation.layout.fillMaxSize
|
||||||
import androidx.compose.foundation.layout.fillMaxWidth
|
import androidx.compose.foundation.layout.fillMaxWidth
|
||||||
import androidx.compose.foundation.layout.height
|
import androidx.compose.foundation.layout.height
|
||||||
|
import androidx.compose.foundation.layout.navigationBars
|
||||||
|
import androidx.compose.foundation.layout.only
|
||||||
import androidx.compose.foundation.layout.padding
|
import androidx.compose.foundation.layout.padding
|
||||||
import androidx.compose.foundation.layout.safeDrawing
|
import androidx.compose.foundation.layout.safeDrawing
|
||||||
import androidx.compose.foundation.layout.size
|
import androidx.compose.foundation.layout.size
|
||||||
import androidx.compose.foundation.layout.statusBars
|
import androidx.compose.foundation.layout.statusBars
|
||||||
import androidx.compose.foundation.layout.width
|
import androidx.compose.foundation.layout.width
|
||||||
|
import androidx.compose.foundation.layout.windowInsetsBottomHeight
|
||||||
import androidx.compose.foundation.layout.windowInsetsPadding
|
import androidx.compose.foundation.layout.windowInsetsPadding
|
||||||
import androidx.compose.foundation.layout.windowInsetsTopHeight
|
import androidx.compose.foundation.layout.windowInsetsTopHeight
|
||||||
import androidx.compose.foundation.shape.RoundedCornerShape
|
import androidx.compose.foundation.shape.RoundedCornerShape
|
||||||
@ -66,6 +72,7 @@ import androidx.compose.runtime.snapshotFlow
|
|||||||
import androidx.compose.ui.Alignment
|
import androidx.compose.ui.Alignment
|
||||||
import androidx.compose.ui.Modifier
|
import androidx.compose.ui.Modifier
|
||||||
import androidx.compose.ui.draw.clip
|
import androidx.compose.ui.draw.clip
|
||||||
|
import androidx.compose.ui.graphics.Color
|
||||||
import androidx.compose.ui.graphics.asImageBitmap
|
import androidx.compose.ui.graphics.asImageBitmap
|
||||||
import androidx.compose.ui.platform.LocalContext
|
import androidx.compose.ui.platform.LocalContext
|
||||||
import androidx.compose.ui.res.stringResource
|
import androidx.compose.ui.res.stringResource
|
||||||
@ -81,8 +88,11 @@ import androidx.compose.ui.viewinterop.AndroidView
|
|||||||
import android.webkit.ValueCallback
|
import android.webkit.ValueCallback
|
||||||
import com.archipelago.app.R
|
import com.archipelago.app.R
|
||||||
import com.archipelago.app.data.ServerPreferences
|
import com.archipelago.app.data.ServerPreferences
|
||||||
|
import com.archipelago.app.fips.FipsManager
|
||||||
import com.archipelago.app.ui.components.GestureHintOverlay
|
import com.archipelago.app.ui.components.GestureHintOverlay
|
||||||
import com.archipelago.app.ui.components.MeshLoadingScreen
|
import com.archipelago.app.ui.components.MeshLoadingScreen
|
||||||
|
import com.archipelago.app.ui.components.NESMenu
|
||||||
|
import com.archipelago.app.ui.components.QrScannerOverlay
|
||||||
import com.archipelago.app.ui.components.WalletQrScannerModal
|
import com.archipelago.app.ui.components.WalletQrScannerModal
|
||||||
import com.archipelago.app.ui.theme.BitcoinOrange
|
import com.archipelago.app.ui.theme.BitcoinOrange
|
||||||
import com.archipelago.app.ui.theme.ErrorRed
|
import com.archipelago.app.ui.theme.ErrorRed
|
||||||
@ -150,6 +160,106 @@ private object KioskWebView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Inject the safe-area CSS vars from the CURRENT window insets. Android
|
||||||
|
* WebView doesn't populate env(safe-area-inset-*); worse, on a cold start
|
||||||
|
* onPageFinished can run before the view is attached — rootWindowInsets is
|
||||||
|
* null then, and injecting 0px collapsed the UI's top/bottom margins (and
|
||||||
|
* put the tab bar inside the gesture zone, killing its taps). Called from
|
||||||
|
* onPageFinished, from the window-insets listener (fires when real insets
|
||||||
|
* arrive), and on reattach. */
|
||||||
|
private fun injectSafeAreaVars(view: WebView) {
|
||||||
|
val insets = view.rootWindowInsets ?: return // listener re-fires when real
|
||||||
|
val density = view.resources.displayMetrics.density
|
||||||
|
val sat = (insets.getInsets(android.view.WindowInsets.Type.statusBars()).top / density).toInt()
|
||||||
|
val sab = (insets.getInsets(android.view.WindowInsets.Type.navigationBars()).bottom / density).toInt()
|
||||||
|
view.evaluateJavascript(
|
||||||
|
"""
|
||||||
|
(function() {
|
||||||
|
var style = document.getElementById('archipelago-android-insets');
|
||||||
|
if (!style) {
|
||||||
|
style = document.createElement('style');
|
||||||
|
style.id = 'archipelago-android-insets';
|
||||||
|
document.head.appendChild(style);
|
||||||
|
}
|
||||||
|
style.textContent = ':root { --safe-area-top: ${sat}px; --safe-area-bottom: ${sab}px; }';
|
||||||
|
// Vue components sample the var into reactive state; tell them it
|
||||||
|
// changed (an authenticated session can mount before we run).
|
||||||
|
window.dispatchEvent(new CustomEvent('archy-insets', { detail: { top: ${sat}, bottom: ${sab} } }));
|
||||||
|
})();
|
||||||
|
""".trimIndent(),
|
||||||
|
null,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
|
/** In-app browser pages (node apps + same-node links) don't consume the
|
||||||
|
* neode-ui `--safe-area-top` var, so with the WebView drawing edge-to-edge
|
||||||
|
* their content ran up under the status bar. Pad the document body down by
|
||||||
|
* the status-bar height: the padded strip shows the page's OWN background
|
||||||
|
* (padding is inside the element), so the bar keeps the page colour while
|
||||||
|
* content starts below it — the pre-edge-to-edge look, without the black bar.
|
||||||
|
*
|
||||||
|
* Body padding only moves normal-flow content. fixed/sticky elements anchored
|
||||||
|
* at the viewport top (IndeeHub's floating header) stayed glued under the
|
||||||
|
* status bar, so we also push each of those down by the inset — once, marked
|
||||||
|
* via data attribute — and keep a throttled MutationObserver running so
|
||||||
|
* headers an SPA mounts after load get the same treatment.
|
||||||
|
* Idempotent; runs on start (early) and finish (after the app rewrites head). */
|
||||||
|
private fun injectTopInset(view: WebView) {
|
||||||
|
val insets = view.rootWindowInsets ?: return
|
||||||
|
val density = view.resources.displayMetrics.density
|
||||||
|
val sat = (insets.getInsets(android.view.WindowInsets.Type.statusBars()).top / density).toInt()
|
||||||
|
if (sat <= 0) return
|
||||||
|
view.evaluateJavascript(
|
||||||
|
"""
|
||||||
|
(function() {
|
||||||
|
var SAT = $sat;
|
||||||
|
var s = document.getElementById('archy-top-inset');
|
||||||
|
if (!s) {
|
||||||
|
s = document.createElement('style');
|
||||||
|
s.id = 'archy-top-inset';
|
||||||
|
(document.head || document.documentElement).appendChild(s);
|
||||||
|
}
|
||||||
|
s.textContent =
|
||||||
|
'body{padding-top:' + SAT + 'px!important;box-sizing:border-box!important;}';
|
||||||
|
function push(el) {
|
||||||
|
if (el.dataset.archyInset) return;
|
||||||
|
var cs = getComputedStyle(el);
|
||||||
|
if (cs.position !== 'fixed' && cs.position !== 'sticky') return;
|
||||||
|
var top = parseFloat(cs.top); // 'auto' -> NaN skips bottom bars
|
||||||
|
if (isNaN(top) || top >= SAT) return;
|
||||||
|
el.style.setProperty('top', (top + SAT) + 'px', 'important');
|
||||||
|
el.dataset.archyInset = '1';
|
||||||
|
}
|
||||||
|
function sweep() {
|
||||||
|
if (!document.body) return;
|
||||||
|
// Fixed/sticky bars live shallow in the tree (portals mount on
|
||||||
|
// body); depth cap keeps the computed-style pass off big lists.
|
||||||
|
var els = document.body.querySelectorAll(
|
||||||
|
'body > *, body > * > *, body > * > * > *, body > * > * > * > *');
|
||||||
|
for (var i = 0; i < els.length; i++) push(els[i]);
|
||||||
|
}
|
||||||
|
sweep();
|
||||||
|
if (!window.__archyInsetObserver) {
|
||||||
|
var queued = false, last = 0;
|
||||||
|
window.__archyInsetObserver = new MutationObserver(function() {
|
||||||
|
if (queued) return;
|
||||||
|
queued = true;
|
||||||
|
var wait = Math.max(0, 250 - (Date.now() - last));
|
||||||
|
setTimeout(function() {
|
||||||
|
queued = false;
|
||||||
|
last = Date.now();
|
||||||
|
sweep();
|
||||||
|
}, wait);
|
||||||
|
});
|
||||||
|
window.__archyInsetObserver.observe(document.documentElement,
|
||||||
|
{ childList: true, subtree: true });
|
||||||
|
}
|
||||||
|
})();
|
||||||
|
""".trimIndent(),
|
||||||
|
null,
|
||||||
|
)
|
||||||
|
}
|
||||||
|
|
||||||
/** True when a TCP listener answers at [base]'s host:port within [timeoutMs]. */
|
/** True when a TCP listener answers at [base]'s host:port within [timeoutMs]. */
|
||||||
private fun tcpAnswers(base: String, timeoutMs: Int): Boolean = try {
|
private fun tcpAnswers(base: String, timeoutMs: Int): Boolean = try {
|
||||||
val u = android.net.Uri.parse(base)
|
val u = android.net.Uri.parse(base)
|
||||||
@ -163,13 +273,17 @@ private fun tcpAnswers(base: String, timeoutMs: Int): Boolean = try {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/** Fastest answering origin: LAN inside a short window, else the mesh ULA
|
/** Fastest answering origin: LAN inside a short window, else the mesh ULA
|
||||||
* (patient — a cold session may still be establishing), else LAN anyway so
|
* (patient — a cold session may still be establishing). If NEITHER answers,
|
||||||
* the existing error/fallback path handles it. */
|
* fall back to the mesh URL when we have one — off-LAN the LAN IP is
|
||||||
|
* unreachable, and loading it just produced a confusing "can't reach
|
||||||
|
* 192.168.x.x" error page (user-reported 2026-07-27). Targeting the mesh URL
|
||||||
|
* instead means the load retries against the path that's actually coming up,
|
||||||
|
* and any error shows the mesh address rather than a dead LAN IP. */
|
||||||
private suspend fun pickStartUrl(lanUrl: String, meshUrl: String?): String =
|
private suspend fun pickStartUrl(lanUrl: String, meshUrl: String?): String =
|
||||||
withContext(Dispatchers.IO) {
|
withContext(Dispatchers.IO) {
|
||||||
if (tcpAnswers(lanUrl, 2500)) return@withContext lanUrl
|
if (tcpAnswers(lanUrl, 2500)) return@withContext lanUrl
|
||||||
if (meshUrl != null && tcpAnswers(meshUrl, 12_000)) return@withContext meshUrl
|
if (meshUrl != null && tcpAnswers(meshUrl, 12_000)) return@withContext meshUrl
|
||||||
lanUrl
|
meshUrl ?: lanUrl
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Apply the WebView settings shared by the kiosk view and the in-app browser.
|
/** Apply the WebView settings shared by the kiosk view and the in-app browser.
|
||||||
@ -210,6 +324,10 @@ fun WebViewScreen(
|
|||||||
serverUrl: String,
|
serverUrl: String,
|
||||||
onDisconnect: () -> Unit,
|
onDisconnect: () -> Unit,
|
||||||
onRemoteInput: () -> Unit = {},
|
onRemoteInput: () -> Unit = {},
|
||||||
|
// Like onRemoteInput but landing on the keyboard (the hub menu's Keyboard card).
|
||||||
|
onRemoteKeyboard: () -> Unit = {},
|
||||||
|
// Opens the phone-to-phone Mesh Party screen; null hides its hub card.
|
||||||
|
onMeshParty: (() -> Unit)? = null,
|
||||||
// Stored password for this server (from QR pairing or manual entry). When
|
// Stored password for this server (from QR pairing or manual entry). When
|
||||||
// non-blank, the login page is auto-filled and submitted — the one-step
|
// non-blank, the login page is auto-filled and submitted — the one-step
|
||||||
// demo flow from docs/companion-pairing-qr.md.
|
// demo flow from docs/companion-pairing-qr.md.
|
||||||
@ -288,6 +406,14 @@ fun WebViewScreen(
|
|||||||
// One-time three-finger-hold teaching overlay (initial=true: never flash
|
// One-time three-finger-hold teaching overlay (initial=true: never flash
|
||||||
// it while DataStore is still loading).
|
// it while DataStore is still loading).
|
||||||
val prefs = remember { ServerPreferences(webViewContext) }
|
val prefs = remember { ServerPreferences(webViewContext) }
|
||||||
|
|
||||||
|
// Hub menu overlay state — the three-finger hold opens the menu right here
|
||||||
|
// over the dashboard (it used to jump to the remote screen).
|
||||||
|
val savedServers by prefs.savedServers.collectAsState(initial = emptyList())
|
||||||
|
val activeServer by prefs.activeServer.collectAsState(initial = null)
|
||||||
|
var showHubMenu by remember { mutableStateOf(false) }
|
||||||
|
var showPairScanner by remember { mutableStateOf(false) }
|
||||||
|
|
||||||
val gestureHintSeen by prefs.gestureHintSeen.collectAsState(initial = true)
|
val gestureHintSeen by prefs.gestureHintSeen.collectAsState(initial = true)
|
||||||
var gestureHintDismissed by remember { mutableStateOf(false) }
|
var gestureHintDismissed by remember { mutableStateOf(false) }
|
||||||
// Don't teach the gesture on top of the login/splash — arm the overlay
|
// Don't teach the gesture on top of the login/splash — arm the overlay
|
||||||
@ -429,6 +555,14 @@ fun WebViewScreen(
|
|||||||
|
|
||||||
val webViewRef = this
|
val webViewRef = this
|
||||||
|
|
||||||
|
// Re-inject the safe-area vars whenever REAL insets
|
||||||
|
// arrive — on cold start onPageFinished often beats
|
||||||
|
// window attachment and would otherwise bake in 0px.
|
||||||
|
setOnApplyWindowInsetsListener { v, insets ->
|
||||||
|
(v as? WebView)?.let { injectSafeAreaVars(it) }
|
||||||
|
v.onApplyWindowInsets(insets)
|
||||||
|
}
|
||||||
|
|
||||||
// Decide where an outbound URL goes:
|
// Decide where an outbound URL goes:
|
||||||
// - same host as the node → in-app WebView overlay
|
// - same host as the node → in-app WebView overlay
|
||||||
// (this is the "open in browser" target for apps the
|
// (this is the "open in browser" target for apps the
|
||||||
@ -515,34 +649,7 @@ fun WebViewScreen(
|
|||||||
isLoading = false
|
isLoading = false
|
||||||
if (view == null) return
|
if (view == null) return
|
||||||
|
|
||||||
// Convert physical pixels → CSS pixels
|
injectSafeAreaVars(view)
|
||||||
val density = view.resources.displayMetrics.density
|
|
||||||
val satPx = view.rootWindowInsets
|
|
||||||
?.getInsets(android.view.WindowInsets.Type.statusBars())
|
|
||||||
?.top ?: 0
|
|
||||||
val sabPx = view.rootWindowInsets
|
|
||||||
?.getInsets(android.view.WindowInsets.Type.navigationBars())
|
|
||||||
?.bottom ?: 0
|
|
||||||
val sat = (satPx / density).toInt()
|
|
||||||
val sab = (sabPx / density).toInt()
|
|
||||||
|
|
||||||
// Android WebView doesn't populate env(safe-area-inset-*).
|
|
||||||
// Set CSS custom properties the web UI can use as fallback:
|
|
||||||
// var(--safe-area-top, env(safe-area-inset-top, 0px))
|
|
||||||
view.evaluateJavascript(
|
|
||||||
"""
|
|
||||||
(function() {
|
|
||||||
var style = document.getElementById('archipelago-android-insets');
|
|
||||||
if (!style) {
|
|
||||||
style = document.createElement('style');
|
|
||||||
style.id = 'archipelago-android-insets';
|
|
||||||
document.head.appendChild(style);
|
|
||||||
}
|
|
||||||
style.textContent = ':root { --safe-area-top: ${sat}px; --safe-area-bottom: ${sab}px; }';
|
|
||||||
})();
|
|
||||||
""".trimIndent(),
|
|
||||||
null,
|
|
||||||
)
|
|
||||||
|
|
||||||
// Auto-login with the stored password (QR pairing /
|
// Auto-login with the stored password (QR pairing /
|
||||||
// saved server) — only on our own server's pages
|
// saved server) — only on our own server's pages
|
||||||
@ -692,7 +799,8 @@ fun WebViewScreen(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
// Three-finger hold (500ms) → navigate to remote input.
|
// Three-finger hold (500ms) → open the hub menu overlay
|
||||||
|
// in place (Remote/Keyboard cards do the navigating).
|
||||||
// Three fingers, not two: two-finger scroll/pinch on the
|
// Three fingers, not two: two-finger scroll/pinch on the
|
||||||
// page collided with the old two-finger hold.
|
// page collided with the old two-finger hold.
|
||||||
var threeFingerStart = 0L
|
var threeFingerStart = 0L
|
||||||
@ -710,7 +818,7 @@ fun WebViewScreen(
|
|||||||
if (pointerCount >= 3 && !threeFingerFired && threeFingerStart > 0) {
|
if (pointerCount >= 3 && !threeFingerFired && threeFingerStart > 0) {
|
||||||
if (System.currentTimeMillis() - threeFingerStart > 500) {
|
if (System.currentTimeMillis() - threeFingerStart > 500) {
|
||||||
threeFingerFired = true
|
threeFingerFired = true
|
||||||
onRemoteInput()
|
showHubMenu = true
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -733,10 +841,12 @@ fun WebViewScreen(
|
|||||||
} else {
|
} else {
|
||||||
// Reattached views keep stale measurements until an
|
// Reattached views keep stale measurements until an
|
||||||
// input event — that was the top/bottom UI being
|
// input event — that was the top/bottom UI being
|
||||||
// wrong until a tap. Force a fresh pass.
|
// wrong until a tap. Force a fresh pass, and re-sync
|
||||||
|
// the page's safe-area vars while we're at it.
|
||||||
post {
|
post {
|
||||||
requestLayout()
|
requestLayout()
|
||||||
invalidate()
|
invalidate()
|
||||||
|
injectSafeAreaVars(this)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -833,6 +943,68 @@ fun WebViewScreen(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Hub menu overlay — opened by the three-finger hold, drawn above
|
||||||
|
// everything (also reachable from the error screen, where switching
|
||||||
|
// servers is exactly what's needed).
|
||||||
|
NESMenu(
|
||||||
|
visible = showHubMenu,
|
||||||
|
servers = savedServers,
|
||||||
|
activeServer = activeServer,
|
||||||
|
onDismiss = { showHubMenu = false },
|
||||||
|
onSelectServer = { server ->
|
||||||
|
showHubMenu = false
|
||||||
|
scope.launch { prefs.setActiveServer(server) }
|
||||||
|
},
|
||||||
|
onAddServer = { server ->
|
||||||
|
scope.launch {
|
||||||
|
prefs.addSavedServer(server)
|
||||||
|
if (activeServer == null) prefs.setActiveServer(server)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onScanQr = { showPairScanner = true },
|
||||||
|
onEditServer = { original, updated ->
|
||||||
|
scope.launch {
|
||||||
|
prefs.updateSavedServer(original, updated)
|
||||||
|
// Editing the live server reloads the kiosk with the new
|
||||||
|
// address/credentials via the activeServer recomposition.
|
||||||
|
if (original.serialize() == activeServer?.serialize()) {
|
||||||
|
prefs.setActiveServer(updated)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onRemoveServer = { server ->
|
||||||
|
scope.launch {
|
||||||
|
prefs.removeSavedServer(server)
|
||||||
|
// Nothing left to show — back to the Connect screen.
|
||||||
|
val remaining = savedServers.count { it.serialize() != server.serialize() }
|
||||||
|
if (remaining == 0) {
|
||||||
|
prefs.clearActiveServer()
|
||||||
|
showHubMenu = false
|
||||||
|
onDisconnect()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
onRemote = { showHubMenu = false; onRemoteInput() },
|
||||||
|
onKeyboard = { showHubMenu = false; onRemoteKeyboard() },
|
||||||
|
onBackToWebView = { showHubMenu = false },
|
||||||
|
onMeshParty = onMeshParty?.let { open -> { showHubMenu = false; open() } },
|
||||||
|
)
|
||||||
|
|
||||||
|
// Pairing-QR scan launched from the menu's Nodes page; the menu stays
|
||||||
|
// open behind it so the new entry appears as soon as it closes.
|
||||||
|
QrScannerOverlay(
|
||||||
|
visible = showPairScanner,
|
||||||
|
onDismiss = { showPairScanner = false },
|
||||||
|
onServerScanned = { scan ->
|
||||||
|
showPairScanner = false
|
||||||
|
scope.launch {
|
||||||
|
val merged = prefs.upsertServer(scan.server)
|
||||||
|
FipsManager.registerNode(webViewContext, scan.fips, merged.displayName())
|
||||||
|
if (activeServer == null) prefs.setActiveServer(merged)
|
||||||
|
}
|
||||||
|
},
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -879,7 +1051,17 @@ private fun InAppBrowser(
|
|||||||
fun isSameNode(u: String): Boolean =
|
fun isSameNode(u: String): Boolean =
|
||||||
isSameHost(u, serverUrl) || (meshUrl != null && isSameHost(u, meshUrl))
|
isSameHost(u, serverUrl) || (meshUrl != null && isSameHost(u, meshUrl))
|
||||||
var browser by remember { mutableStateOf<WebView?>(null) }
|
var browser by remember { mutableStateOf<WebView?>(null) }
|
||||||
var title by remember { mutableStateOf(android.net.Uri.parse(url).host ?: url) }
|
// Loader title: never show a raw IP host — a mesh ULA like
|
||||||
|
// [fd79:1aa:…] is technically the host but reads as garbage on the
|
||||||
|
// loading screen. Show a neutral name until the page reports its
|
||||||
|
// real <title> (onReceivedTitle upgrades it).
|
||||||
|
var title by remember {
|
||||||
|
mutableStateOf(
|
||||||
|
android.net.Uri.parse(url).host
|
||||||
|
?.takeUnless { it.contains(':') || it.matches(Regex("^\\d+(\\.\\d+){3}$")) }
|
||||||
|
?: "Archipelago",
|
||||||
|
)
|
||||||
|
}
|
||||||
var favicon by remember { mutableStateOf<Bitmap?>(null) }
|
var favicon by remember { mutableStateOf<Bitmap?>(null) }
|
||||||
var progress by remember { mutableIntStateOf(0) }
|
var progress by remember { mutableIntStateOf(0) }
|
||||||
var loading by remember { mutableStateOf(true) }
|
var loading by remember { mutableStateOf(true) }
|
||||||
@ -917,7 +1099,22 @@ private fun InAppBrowser(
|
|||||||
modifier = Modifier
|
modifier = Modifier
|
||||||
.fillMaxSize()
|
.fillMaxSize()
|
||||||
.background(SurfaceBlack)
|
.background(SurfaceBlack)
|
||||||
.windowInsetsPadding(WindowInsets.safeDrawing),
|
// Whole-overlay touch shield: every touch not handled by a child
|
||||||
|
// (control-bar gaps, inset strips) dies here instead of falling
|
||||||
|
// through to the kiosk's tab bar behind (a near-miss on Close
|
||||||
|
// was opening the AIUI tab underneath).
|
||||||
|
.clickable(
|
||||||
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
|
indication = null,
|
||||||
|
onClick = {},
|
||||||
|
)
|
||||||
|
// Bottom inset handled by the touch-shield strip below the bar.
|
||||||
|
// No TOP inset padding: the WebView draws edge-to-edge behind the
|
||||||
|
// status bar so the app's own background fills it — the padded
|
||||||
|
// version painted an opaque black bar there (user-rejected look).
|
||||||
|
.windowInsetsPadding(
|
||||||
|
WindowInsets.safeDrawing.only(WindowInsetsSides.Horizontal)
|
||||||
|
),
|
||||||
) {
|
) {
|
||||||
// WebView + loading overlay fill the area above the bottom control bar.
|
// WebView + loading overlay fill the area above the bottom control bar.
|
||||||
Box(modifier = Modifier.weight(1f).fillMaxWidth()) {
|
Box(modifier = Modifier.weight(1f).fillMaxWidth()) {
|
||||||
@ -968,12 +1165,14 @@ private fun InAppBrowser(
|
|||||||
webViewClient = object : WebViewClient() {
|
webViewClient = object : WebViewClient() {
|
||||||
override fun onPageStarted(view: WebView?, u: String?, favicon: Bitmap?) {
|
override fun onPageStarted(view: WebView?, u: String?, favicon: Bitmap?) {
|
||||||
loading = true
|
loading = true
|
||||||
|
view?.let { injectTopInset(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun onPageFinished(view: WebView?, u: String?) {
|
override fun onPageFinished(view: WebView?, u: String?) {
|
||||||
loading = false
|
loading = false
|
||||||
canGoBack = view?.canGoBack() == true
|
canGoBack = view?.canGoBack() == true
|
||||||
canGoForward = view?.canGoForward() == true
|
canGoForward = view?.canGoForward() == true
|
||||||
|
view?.let { injectTopInset(it) }
|
||||||
}
|
}
|
||||||
|
|
||||||
override fun doUpdateVisitedHistory(view: WebView?, u: String?, isReload: Boolean) {
|
override fun doUpdateVisitedHistory(view: WebView?, u: String?, isReload: Boolean) {
|
||||||
@ -1106,6 +1305,21 @@ private fun InAppBrowser(
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Touch-shield over the gesture-nav strip: solid black AND consumes
|
||||||
|
// taps — stray touches below the control bar landed on the kiosk's
|
||||||
|
// tab bar behind this overlay (opening the AIUI chat by accident).
|
||||||
|
Box(
|
||||||
|
Modifier
|
||||||
|
.fillMaxWidth()
|
||||||
|
.windowInsetsBottomHeight(WindowInsets.navigationBars)
|
||||||
|
.background(Color.Black)
|
||||||
|
.clickable(
|
||||||
|
interactionSource = remember { MutableInteractionSource() },
|
||||||
|
indication = null,
|
||||||
|
onClick = {},
|
||||||
|
),
|
||||||
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
2
Android/rust/archy-fips-core/Cargo.lock
generated
2
Android/rust/archy-fips-core/Cargo.lock
generated
@ -464,7 +464,7 @@ checksum = "5baebc0774151f905a1a2cc41989300b1e6fbb29aff0ceffa1064fdd3088d582"
|
|||||||
[[package]]
|
[[package]]
|
||||||
name = "fips"
|
name = "fips"
|
||||||
version = "0.3.0-dev"
|
version = "0.3.0-dev"
|
||||||
source = "git+https://github.com/9qeklajc/fips-native?rev=46494a74fc85b878305d275d42ab719082b06ba6#46494a74fc85b878305d275d42ab719082b06ba6"
|
source = "git+https://github.com/Zazawowow/fips-native?rev=07d21d4482be56b14295d2525e41f8386d1bfe6f#07d21d4482be56b14295d2525e41f8386d1bfe6f"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"bech32",
|
"bech32",
|
||||||
"chacha20poly1305",
|
"chacha20poly1305",
|
||||||
|
|||||||
@ -23,7 +23,10 @@ crate-type = ["lib", "cdylib"]
|
|||||||
|
|
||||||
[dependencies]
|
[dependencies]
|
||||||
# default-features drops the ratatui TUI; tun-support enables Node::start_with_tun_fd.
|
# default-features drops the ratatui TUI; tun-support enables Node::start_with_tun_fd.
|
||||||
fips = { git = "https://github.com/9qeklajc/fips-native", rev = "46494a74fc85b878305d275d42ab719082b06ba6", default-features = false, features = ["tun-support"] }
|
# Zazawowow/fips-native `fast-join-pinned` = upstream pinned rev 46494a74 +
|
||||||
|
# discovery re-fire on topology change (fresh 5G join: first route no longer
|
||||||
|
# waits out doomed pre-join lookups). Upstream 9qeklajc denies pushes.
|
||||||
|
fips = { git = "https://github.com/Zazawowow/fips-native", rev = "07d21d4482be56b14295d2525e41f8386d1bfe6f", default-features = false, features = ["tun-support"] }
|
||||||
anyhow = "1.0"
|
anyhow = "1.0"
|
||||||
serde_json = "1.0"
|
serde_json = "1.0"
|
||||||
hex = "0.4"
|
hex = "0.4"
|
||||||
|
|||||||
@ -85,6 +85,27 @@ pub fn build_config(secret: &str, peers: Vec<PeerConfig>, listen_port: u16) -> C
|
|||||||
});
|
});
|
||||||
// TCP with no bind_addr = outbound-only (fallback when UDP is blocked).
|
// TCP with no bind_addr = outbound-only (fallback when UDP is blocked).
|
||||||
cfg.transports.tcp = TransportInstances::Single(Default::default());
|
cfg.transports.tcp = TransportInstances::Single(Default::default());
|
||||||
|
// Fast-connect profile — a phone opens the app and expects the node NOW.
|
||||||
|
// Stock pacing is tuned for always-on routers: a failed discovery backs
|
||||||
|
// off 30s, session resends gap out to 8-16s, dead links redial at
|
||||||
|
// 5s→300s. Over 5G that stacked into a ~40s first connect (observed
|
||||||
|
// 2026-07-24: anchor +10s, session +40s). Retries only fire while a
|
||||||
|
// link/session is down, so steady-state traffic is unchanged.
|
||||||
|
cfg.node.retry.base_interval_secs = 1; // dead-link redial 1s,2s,4s…
|
||||||
|
cfg.node.retry.max_backoff_secs = 30; // …capped at 30s, not 5 min
|
||||||
|
cfg.node.retry.max_retries = 30;
|
||||||
|
cfg.node.rate_limit.handshake_resend_interval_ms = 400;
|
||||||
|
cfg.node.rate_limit.handshake_resend_backoff = 1.5;
|
||||||
|
cfg.node.rate_limit.handshake_max_resends = 10;
|
||||||
|
cfg.node.discovery.backoff_base_secs = 1; // failed lookup retries fast
|
||||||
|
cfg.node.discovery.backoff_max_secs = 30;
|
||||||
|
cfg.node.discovery.retry_interval_secs = 2;
|
||||||
|
cfg.node.discovery.max_attempts = 3;
|
||||||
|
// Lookups launched before the tree position settles are doomed; a 10s
|
||||||
|
// completion timeout made each one cost 10s before the 1s retry could
|
||||||
|
// fire (observed: 19s to a route on a fresh join). Fail fast instead —
|
||||||
|
// the resend-within-window above still gives each attempt two shots.
|
||||||
|
cfg.node.discovery.timeout_secs = 5;
|
||||||
cfg.peers = peers;
|
cfg.peers = peers;
|
||||||
cfg
|
cfg
|
||||||
}
|
}
|
||||||
|
|||||||
52
CHANGELOG.md
52
CHANGELOG.md
@ -1,7 +1,57 @@
|
|||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## v1.7.112-alpha (2026-07-22)
|
## v1.7.117-alpha (2026-07-27)
|
||||||
|
|
||||||
|
- FIPS startup is more reliable on nodes that have the packaged `fips.service` instead of Archipelago's `archipelago-fips.service`. Startup self-heal, onboarding, dashboard Start, and reconnect now use the systemd unit the node actually has, so FIPS no longer looks like it needs to be installed when it only needs to be started.
|
||||||
|
- App screens over the FIPS mesh now bind their relay only to the node's FIPS address instead of reserving the same host ports Podman needs. This keeps apps such as FileBrowser and Botfights from restart-looping because the backend was already holding their published ports.
|
||||||
|
- Companion WebView safe-area handling now also moves fixed and sticky top bars below the phone status bar, including headers mounted after page load by single-page apps.
|
||||||
|
- Public-source preparation now includes a Nostr Git hosting plan using `ngit`, NIP-34, and GRASP: anyone can clone, fork, review, and propose changes from their Archipelago node, while canonical merge authority stays with a small signed maintainer set in the style of Bitcoin Core.
|
||||||
|
- Node OS release notes for v1.7.117 are still open; add any installer, service, kernel, firewall, or package changes here before cutting the release.
|
||||||
|
|
||||||
|
## v1.7.116-alpha (2026-07-27)
|
||||||
|
|
||||||
|
- Nodes no longer get stuck on "server starting up" after an update or reboot. On a node running many apps, the backend used to spend minutes recovering containers before it told the system it was ready, and anything that touched it during that window could leave it down for good. It now reports ready immediately and recovers in the background, and it always restarts itself if it ever does go down.
|
||||||
|
- Installing apps no longer crashes the node. A change that made app screens reachable over the mesh was accidentally holding onto every app's network port in advance — so installing an app like Grafana, Photoprism, Uptime Kuma, or Jellyfin collided with it and the port-cleanup step took the whole backend down, rolling the install back. Installs are now clean and the backend can never be caught by that cleanup.
|
||||||
|
- Rolls up everything from v1.7.115: app screens and the dashboard load over the mesh out of the box (firewall openings shipped automatically, IPv6 support end to end), and nodes rejoin the mesh in seconds after their rendezvous point restarts.
|
||||||
|
|
||||||
|
## v1.7.115-alpha (2026-07-26)
|
||||||
|
|
||||||
|
- The companion app can reach your node's screen from anywhere again. The recent security hardening locked down the node's mesh interface so tightly that the dashboard itself was blocked — the phone would pair and connect, then sit on a blank screen. The node now explicitly opens its own web interface (and only that) through the mesh firewall on every install and upgrade, so the phone's view of your node works out of the box, on any network, and can't silently break in a future update.
|
||||||
|
- The node's web interface also answers on IPv6 everywhere it answers on IPv4 — the mesh runs entirely on IPv6, and one v4-only listener was enough to make a working connection show nothing.
|
||||||
|
- Nodes now come back onto the mesh in seconds instead of minutes after their rendezvous anchor restarts: the fast-reconnect tuning proven on the phone this week is now baked into every node's mesh configuration, and it survives upgrades.
|
||||||
|
|
||||||
|
## v1.7.114-alpha (2026-07-26)
|
||||||
|
|
||||||
|
- Plugging in a mesh radio no longer traps it in an endless reboot loop. The device detector itself was causing it: every scan pulsed the radio's reset line, the same board was probed twice under two names, and retries came so fast the radio never finished booting before the next reset hit. Detection now gives the board real time to boot, probes it once, backs off properly between attempts, and no longer fights the "device detected" popup for the port. Radios that could never connect now come up within a minute of being plugged in.
|
||||||
|
- The Lightning channels screen now has All / Active / Pending / Closed tabs. Pending gathers everything in motion (opening, closing, force-closing — each with its own status dot and a link to the closing transaction), and Closed is a real history: how each channel ended, what settled back to you, and the closing transaction for each.
|
||||||
|
- Sending bitcoin on-chain now puts you in charge of the network fee: pick Fast, Standard, or Slow (Standard is the default), or set your own target blocks or sats-per-vByte. The confirmation step shows the estimated fee for your chosen speed before any money moves.
|
||||||
|
- Type on-chain amounts in whichever unit you think in — a sats/BTC switch on the amount field converts as you type.
|
||||||
|
- Back up your seed by scanning it. Every recovery-phrase screen (onboarding, Settings, and the Lightning wallet seed) now has Words and QR code tabs — words always shown first. The QR for your node's recovery phrase uses the SeedQR standard, so hardware wallets like Passport Prime, SeedSigner, and Keystone can import it with a single scan (a plain-text option remains for wallets that read the phrase as text). The Lightning seed's QR is plain text with an honest note: it's an LND-format seed that restores into Lightning wallets like Zeus or Blixt, not into hardware wallets.
|
||||||
|
|
||||||
|
## v1.7.113-alpha (2026-07-25)
|
||||||
|
|
||||||
|
- Fixed a money bug in Cashu ecash sends: the token you handed a recipient could carry your own change proofs along with it, letting the same sats be credited twice. Change now stays in your wallet — only the amount you meant to send leaves it.
|
||||||
|
- Closing a Lightning channel is no longer a leap of faith. The close used to hang (or time out with an error) even though it had actually gone through; it now comes back within seconds with the closing transaction ID. Channels mid-close appear in the channel list as Closing or Force-closing with their transaction attached, and a new closed-channels history keeps past closes visible instead of letting them vanish from the list.
|
||||||
|
- The wallet card now leads with your total bitcoin across everything, and the on-chain balance gets its own chain icon so the rows read at a glance.
|
||||||
|
- The companion phone app (0.5.15) connects dramatically faster away from home: a cold connect over 5G dropped from 40+ seconds to about 5. First connects no longer stall on unreachable mesh dial hints, fresh joins fail fast and retry instead of waiting out long timeouts, and the phone re-announces itself the moment the network around it changes. The node side's mesh-join handling was hardened to match.
|
||||||
|
|
||||||
|
## v1.7.112-alpha (2026-07-23)
|
||||||
|
|
||||||
|
- Sound works on TVs out of the box. Fresh installs were missing the audio system entirely, and even when present a boot-time race left HDMI silent until the cable was unplugged and replugged. Both are fixed: installer images now ship the full audio stack, and a small background helper detects the silent-HDMI state and heals it automatically.
|
||||||
|
- Plug in a game controller and drive the whole TV interface with it — navigation, menus, and media playback all respond to the gamepad, and dialogs that pop up are controller-navigable too.
|
||||||
|
- The companion phone app took a huge leap (0.5.9). Your node and its apps now work from anywhere — on 5G or any internet connection, the phone reaches the node over the encrypted mesh with zero port forwarding or VPN setup. Startup away from home is instant, apps on your node open inside the app, the phone's native camera handles QR scanning, and a branded full-screen loader shows while the mesh connects.
|
||||||
|
- Mesh Party: two phones scan each other's QR and instantly get a direct encrypted chat and app sharing between them — plus a "Share this app" QR that anyone can scan with a normal camera to install the companion app.
|
||||||
|
- Pairing a second phone no longer silently logs out the first. Every device now keeps its own named access credential, ending the mystery reconnects when a household paired more than one phone.
|
||||||
|
- The companion pairing QR is scannable again (it had grown too dense for phone cameras) and now identifies your node by its identity key, so the app recognizes your node even after it moves or gets a new address.
|
||||||
|
- Every app your node serves on your home network is now also reachable over the mesh — remote access covers the apps themselves, not just the dashboard.
|
||||||
|
- Selling files: you now choose which payment methods you accept (Lightning, ecash, …) and buyers are only offered those — enforced by the node itself, not just the buttons. Paying twice for the same file is impossible now, purchases file themselves into a new Paid Files tab, purchased music always plays in the bottom-bar player, and videos get picture-in-picture.
|
||||||
|
- Sending Lightning is invoice-first: paste or scan an invoice and the amount fills in and locks by itself. An expired invoice now tells you plainly to ask for a fresh one instead of failing cryptically, and payment errors always reach your screen.
|
||||||
|
- Sending to a pasted address gets a confirmation step showing exactly what will happen before any money moves, and buying ecash is an explicit two-step — no more accidental purchases.
|
||||||
|
- Apps keep running when you change how they're displayed. Switching an app between windowed and fullscreen used to reload it from scratch (stopping any playing media); the app now stays live through the switch, and each app remembers its own preferred display mode.
|
||||||
|
- A watchdog notices when the Lightning (LND) node wedges and revives it before you do; Fedi ecash gets its own send option with scannable token QR codes.
|
||||||
|
- Fedimint's Lightning gateway and guardian now follow whichever bitcoin version is actually running instead of pointing at a stale address — switching bitcoin versions no longer strands them.
|
||||||
|
- If your router starts handing out different addresses, the Pine voice speaker re-links itself automatically instead of staying silent until someone re-configures it.
|
||||||
|
- Polish: mesh radios never show garbled device names anymore, the TV kiosk uses slim overlay scrollbars instead of fat grey bars, and the AI chat's background artwork shows through again.
|
||||||
- Your mesh messages now survive restarts. Chat history — channels and DMs alike — used to live only in memory, so a reboot or update wiped every conversation; worse, other nodes silently discarded the first messages you sent after a reboot. Everything is now saved on the node and restored on startup, and post-reboot messages deliver reliably.
|
- Your mesh messages now survive restarts. Chat history — channels and DMs alike — used to live only in memory, so a reboot or update wiped every conversation; worse, other nodes silently discarded the first messages you sent after a reboot. Everything is now saved on the node and restored on startup, and post-reboot messages deliver reliably.
|
||||||
- Plug in any LoRa radio and the node walks you through it. A setup window appears every time a radio is connected, shows what firmware is already on it (MeshCore, Meshtastic, or Reticulum RNode — with its current name, region, and channels where available), and offers two honest choices: "Set Up with Archipelago Settings" (a preview screen shows exactly what will be written before anything touches the radio) or "Keep As Is" (the radio is used untouched, and you can hot-swap radios freely). Swapping sticks mid-session now just works — including Reticulum RNodes, which fresh installer images now support out of the box.
|
- Plug in any LoRa radio and the node walks you through it. A setup window appears every time a radio is connected, shows what firmware is already on it (MeshCore, Meshtastic, or Reticulum RNode — with its current name, region, and channels where available), and offers two honest choices: "Set Up with Archipelago Settings" (a preview screen shows exactly what will be written before anything touches the radio) or "Keep As Is" (the radio is used untouched, and you can hot-swap radios freely). Swapping sticks mid-session now just works — including Reticulum RNodes, which fresh installer images now support out of the box.
|
||||||
- Incoming bitcoin appears in your wallet within seconds of being sent — balance and the yellow "unconfirmed" entry update live, no refresh, no waiting for the next poll.
|
- Incoming bitcoin appears in your wallet within seconds of being sent — balance and the yellow "unconfirmed" entry update live, no refresh, no waiting for the next poll.
|
||||||
|
|||||||
19
CODE_OF_CONDUCT.md
Normal file
19
CODE_OF_CONDUCT.md
Normal file
@ -0,0 +1,19 @@
|
|||||||
|
# Code of Conduct
|
||||||
|
|
||||||
|
## Our standard
|
||||||
|
|
||||||
|
Be direct, respectful, and focused on the work. Healthy disagreement is welcome;
|
||||||
|
harassment, personal attacks, and discriminatory language are not.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
This code of conduct applies to project repositories, issue trackers, pull
|
||||||
|
requests, documentation, chat, and community spaces connected to Archipelago.
|
||||||
|
|
||||||
|
## Enforcement
|
||||||
|
|
||||||
|
Maintainers may edit, hide, or remove comments and may restrict participation
|
||||||
|
for behavior that makes collaboration unsafe or unproductive.
|
||||||
|
|
||||||
|
Report conduct concerns privately through the repository owner account or the
|
||||||
|
private contact channel listed on the project homepage.
|
||||||
191
CONTRIBUTING.md
191
CONTRIBUTING.md
@ -1,161 +1,100 @@
|
|||||||
# Contributing to Archipelago
|
# Contributing to Archipelago
|
||||||
|
|
||||||
Thank you for your interest in contributing to Archipelago! This document covers the process for contributing code, reporting bugs, and submitting apps.
|
This project is preparing for public developer contribution. The highest-value
|
||||||
|
contributions are focused fixes, tests, app manifests, documentation
|
||||||
|
improvements, and clear bug reports with reproducible evidence.
|
||||||
|
|
||||||
## Code of Conduct
|
## Development setup
|
||||||
|
|
||||||
Be respectful. We follow the [Contributor Covenant](https://www.contributor-covenant.org/version/2/1/code_of_conduct/).
|
### Frontend
|
||||||
|
|
||||||
## Getting Started
|
|
||||||
|
|
||||||
1. Fork the repository on the project's Gitea instance
|
|
||||||
2. Clone your fork: `git clone <your-fork-url>/archy.git`
|
|
||||||
3. Set up the dev environment (see `docs/developer-guide.md`)
|
|
||||||
4. Create a feature branch: `git checkout -b feature/your-feature`
|
|
||||||
|
|
||||||
## Development Setup
|
|
||||||
|
|
||||||
### Frontend (Vue.js)
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd neode-ui
|
cd neode-ui
|
||||||
npm install
|
npm install
|
||||||
npm start # Dev server on :8100
|
npm start
|
||||||
npm run type-check # TypeScript validation
|
npm run type-check
|
||||||
npm run build # Production build
|
npm test
|
||||||
npm test # Run tests
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Backend (Rust)
|
### Backend
|
||||||
|
|
||||||
Build on a Linux server (Debian 13), **not** macOS:
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cargo clippy --all-targets --all-features
|
cd core
|
||||||
cargo fmt --all
|
cargo fmt --all -- --check
|
||||||
|
cargo clippy --all-targets --all-features -- -D warnings
|
||||||
cargo test --all-features
|
cargo test --all-features
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deploy to dev server
|
Linux is required for host integration work involving Podman, systemd,
|
||||||
|
networking, or image builds. Frontend development works locally with the mock
|
||||||
|
backend.
|
||||||
|
|
||||||
|
## App manifests
|
||||||
|
|
||||||
|
App packages live under `apps/<app-id>/manifest.yml` and use the schema
|
||||||
|
documented in [docs/app-manifest-spec.md](docs/app-manifest-spec.md). Validate
|
||||||
|
before submitting:
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./scripts/deploy-to-target.sh --live
|
./scripts/validate-app-manifest.sh apps/<app-id>/manifest.yml
|
||||||
|
python3 scripts/generate-app-catalog.py
|
||||||
|
python3 scripts/check-app-catalog-drift.py --release --strict
|
||||||
```
|
```
|
||||||
|
|
||||||
## Code Style
|
App submissions must:
|
||||||
|
|
||||||
### Frontend (TypeScript + Vue)
|
- pin container image versions;
|
||||||
|
- avoid hardcoded secrets;
|
||||||
|
- use `security.no_new_privileges: true`;
|
||||||
|
- use `security.readonly_root: true` unless the manifest explains why writable
|
||||||
|
root is required;
|
||||||
|
- request only necessary Linux capabilities;
|
||||||
|
- store durable data under `/var/lib/archipelago/<app-id>/`;
|
||||||
|
- define truthful health checks and launch interfaces for user-facing UIs.
|
||||||
|
|
||||||
- `<script setup lang="ts">` — always Composition API
|
## Code style
|
||||||
- TypeScript strict mode — no `any`, use `unknown` or proper types
|
|
||||||
- Global CSS classes in `src/style.css` — never inline Tailwind in components
|
|
||||||
- Pinia for state management — focused single-purpose stores
|
|
||||||
- Use `@/api/rpc-client.ts` for RPC calls
|
|
||||||
|
|
||||||
### Backend (Rust)
|
- Rust: prefer `?` over `unwrap()`/`expect()` in production paths.
|
||||||
|
- Rust: use `tracing` for structured logs.
|
||||||
|
- TypeScript: avoid `any`; use explicit types or `unknown`.
|
||||||
|
- Vue: prefer `<script setup lang="ts">`.
|
||||||
|
- Keep changes scoped; do not mix drive-by refactors with behavioral changes.
|
||||||
|
- Remove dead code rather than commenting it out.
|
||||||
|
- Add tests for new behavior and regression tests for bug fixes.
|
||||||
|
|
||||||
- No `unwrap()` or `expect()` in production code — use `?` operator
|
## Pull requests
|
||||||
- `thiserror` for library errors, `anyhow` for application errors
|
|
||||||
- `tracing` for structured logging — never `println!`
|
|
||||||
- Run `cargo clippy` and `cargo fmt` before commits
|
|
||||||
|
|
||||||
### General
|
1. Open one focused PR per behavior or documentation change.
|
||||||
|
2. Explain what changed, why it changed, and how it was verified.
|
||||||
|
3. Include screenshots for UI changes.
|
||||||
|
4. Link relevant issues or docs.
|
||||||
|
5. Keep generated catalog changes in sync with manifest changes.
|
||||||
|
|
||||||
- Functions under 50 lines, single responsibility
|
Suggested commit format:
|
||||||
- Comment WHY not WHAT
|
|
||||||
- Remove dead code — never comment it out
|
|
||||||
- No `TODO`/`FIXME` in commits
|
|
||||||
|
|
||||||
## Commit Format
|
```text
|
||||||
|
feat: add backup scheduling
|
||||||
```
|
fix: reject unsafe manifest volume
|
||||||
type: description
|
docs: clarify app deployment flow
|
||||||
|
test: cover catalog drift check
|
||||||
```
|
```
|
||||||
|
|
||||||
**Types**: `feat:`, `fix:`, `docs:`, `refactor:`, `test:`, `chore:`, `perf:`
|
## Reporting bugs
|
||||||
|
|
||||||
Examples:
|
Include:
|
||||||
- `feat: add backup scheduling to settings page`
|
|
||||||
- `fix: handle WiFi connection timeout gracefully`
|
|
||||||
- `test: add unit tests for RPC client retry logic`
|
|
||||||
|
|
||||||
## Pull Request Process
|
- exact version or commit;
|
||||||
|
- host platform and architecture;
|
||||||
|
- steps to reproduce;
|
||||||
|
- expected and actual behavior;
|
||||||
|
- logs from the relevant component;
|
||||||
|
- screenshots for UI issues.
|
||||||
|
|
||||||
1. Ensure your branch is up to date with `main`
|
## Security
|
||||||
2. All checks must pass: TypeScript, build, tests, clippy
|
|
||||||
3. Include a clear description of what changed and why
|
|
||||||
4. Link any related issues
|
|
||||||
5. Request review from a maintainer
|
|
||||||
|
|
||||||
### PR Checklist
|
Do not report vulnerabilities in public issues. Follow [SECURITY.md](SECURITY.md).
|
||||||
|
|
||||||
- [ ] TypeScript type-check passes (`npm run type-check`)
|
|
||||||
- [ ] Frontend builds (`npm run build`)
|
|
||||||
- [ ] Tests pass (`npm test`)
|
|
||||||
- [ ] Rust clippy clean (`cargo clippy --all-targets --all-features`)
|
|
||||||
- [ ] No new compiler warnings
|
|
||||||
- [ ] Follows code style guidelines above
|
|
||||||
|
|
||||||
## Testing Requirements
|
|
||||||
|
|
||||||
- New features need tests
|
|
||||||
- Bug fixes need a regression test
|
|
||||||
- Frontend: Vitest + Vue Test Utils
|
|
||||||
- Backend: `#[test]` and `#[tokio::test]`
|
|
||||||
- Target: maintain or improve existing coverage
|
|
||||||
|
|
||||||
## Reporting Bugs
|
|
||||||
|
|
||||||
Use the **Bug Report** issue template. Include:
|
|
||||||
|
|
||||||
1. Steps to reproduce
|
|
||||||
2. Expected behavior
|
|
||||||
3. Actual behavior
|
|
||||||
4. System info (hardware, OS version, Archipelago version)
|
|
||||||
5. Screenshots if applicable
|
|
||||||
6. Relevant logs (`journalctl -u archipelago`)
|
|
||||||
|
|
||||||
## Feature Requests
|
|
||||||
|
|
||||||
Use the **Feature Request** issue template. Include:
|
|
||||||
|
|
||||||
1. Problem description
|
|
||||||
2. Proposed solution
|
|
||||||
3. Alternatives considered
|
|
||||||
4. Impact on existing users
|
|
||||||
|
|
||||||
## App Submissions
|
|
||||||
|
|
||||||
To submit an app for the Archipelago marketplace:
|
|
||||||
|
|
||||||
1. Create a manifest following `docs/app-manifest-spec.md`
|
|
||||||
2. Ensure the container image is published to a public registry
|
|
||||||
3. Test on Archipelago hardware (x86_64 and ARM64 if possible)
|
|
||||||
4. Open a PR adding the app to the curated list
|
|
||||||
5. Include: app description, icon, resource requirements, dependencies
|
|
||||||
|
|
||||||
### App Requirements
|
|
||||||
|
|
||||||
- Container must run as non-root (UID > 1000)
|
|
||||||
- `readonly_root: true` unless explicitly justified
|
|
||||||
- Drop all capabilities except those required
|
|
||||||
- `no-new-privileges: true`
|
|
||||||
- Pin specific image versions (no `latest` tag)
|
|
||||||
- No hardcoded secrets
|
|
||||||
|
|
||||||
## Security Disclosure
|
|
||||||
|
|
||||||
**Do NOT open public issues for security vulnerabilities.**
|
|
||||||
|
|
||||||
Email security concerns to the maintainers directly. Include:
|
|
||||||
|
|
||||||
1. Description of the vulnerability
|
|
||||||
2. Steps to reproduce
|
|
||||||
3. Potential impact
|
|
||||||
4. Suggested fix (if any)
|
|
||||||
|
|
||||||
We will acknowledge receipt within 48 hours and provide a timeline for a fix.
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
By contributing, you agree that your contributions will be licensed under the same license as the project.
|
By contributing, you agree that your contribution is licensed under the
|
||||||
|
project's MIT License.
|
||||||
|
|||||||
21
LICENSE
Normal file
21
LICENSE
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
MIT License
|
||||||
|
|
||||||
|
Copyright (c) 2026 Dorian and the Archipelago Project contributors
|
||||||
|
|
||||||
|
Permission is hereby granted, free of charge, to any person obtaining a copy
|
||||||
|
of this software and associated documentation files (the "Software"), to deal
|
||||||
|
in the Software without restriction, including without limitation the rights
|
||||||
|
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
||||||
|
copies of the Software, and to permit persons to whom the Software is
|
||||||
|
furnished to do so, subject to the following conditions:
|
||||||
|
|
||||||
|
The above copyright notice and this permission notice shall be included in all
|
||||||
|
copies or substantial portions of the Software.
|
||||||
|
|
||||||
|
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
||||||
|
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
||||||
|
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
||||||
|
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
||||||
|
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
||||||
|
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
||||||
|
SOFTWARE.
|
||||||
73
NOTICE
Normal file
73
NOTICE
Normal file
@ -0,0 +1,73 @@
|
|||||||
|
# Archipelago — Third-Party Notices
|
||||||
|
|
||||||
|
Archipelago is licensed under the MIT License (see LICENSE).
|
||||||
|
This file lists third-party components included in this repository and its
|
||||||
|
release artifacts, with their licenses and required attributions.
|
||||||
|
|
||||||
|
## Embedded / vendored components
|
||||||
|
|
||||||
|
- **FIPS mesh networking** — https://github.com/jmcorgan/fips
|
||||||
|
Copyright (c) 2026 Johnathan Corgan. MIT License.
|
||||||
|
Used as the embedded mesh VPN in the OS (`fips` daemon, pinned v0.4.1) and
|
||||||
|
compiled into the Android companion app (`Android/rust/archy-fips-core`).
|
||||||
|
|
||||||
|
- **QR Code Generator for JavaScript** — http://www.d-project.com/
|
||||||
|
Copyright (c) 2009 Kazuhiko Arase. MIT License.
|
||||||
|
Vendored at `docker/lnd-ui/qrcode.js` and `docker/electrs-ui/qrcode.js`
|
||||||
|
(original headers preserved).
|
||||||
|
|
||||||
|
- **nostr-rs-relay** — https://github.com/scsibug/nostr-rs-relay — MIT License.
|
||||||
|
Binary extracted into the OS image at `/opt/archipelago/bin/`.
|
||||||
|
|
||||||
|
- **Reticulum (RNS) and LXMF** — https://github.com/markqvist/Reticulum
|
||||||
|
Copyright Mark Qvist. Distributed under the Reticulum License (an MIT-style
|
||||||
|
license with field-of-use restrictions: no use in systems designed to harm
|
||||||
|
human beings, and no use in AI/ML training datasets). The optional
|
||||||
|
`archy-reticulum-daemon` binary bundles RNS 1.3.5 and LXMF 1.0.1. The
|
||||||
|
Reticulum License is NOT an OSI-approved open-source license; it applies
|
||||||
|
only to that optional component, not to Archipelago itself.
|
||||||
|
|
||||||
|
## Fonts
|
||||||
|
|
||||||
|
- **Montserrat** — SIL Open Font License 1.1
|
||||||
|
(`neode-ui/public/assets/fonts/Montserrat/OFL.txt`).
|
||||||
|
- **Open Sans** — Apache License 2.0
|
||||||
|
(`neode-ui/public/assets/fonts/Open_Sans/LICENSE.txt`).
|
||||||
|
|
||||||
|
## Artwork and icons
|
||||||
|
|
||||||
|
- **Mesh device artwork** (`neode-ui/public/assets/img/mesh-devices/`):
|
||||||
|
device illustrations from the Meshtastic project — https://meshtastic.org
|
||||||
|
© Meshtastic contributors, GPL-3.0. Meshtastic® is a registered trademark
|
||||||
|
of Meshtastic LLC. See the ATTRIBUTION.md in that directory.
|
||||||
|
- Some UI icons are derived from **game-icons.net** (CC BY 3.0 — see
|
||||||
|
ATTRIBUTION.md in `neode-ui/public/assets/icon/`) and **pixelarticons**
|
||||||
|
(MIT, https://github.com/halfmage/pixelarticons).
|
||||||
|
- Third-party application logos under `neode-ui/public/assets/img/app-icons/`
|
||||||
|
and `service-icons/` are trademarks of their respective owners, used solely
|
||||||
|
to identify the corresponding applications. No endorsement is implied.
|
||||||
|
|
||||||
|
## Original media
|
||||||
|
|
||||||
|
All demo content (music, photos, posters in `demo/`), UI sound effects,
|
||||||
|
background images, and intro video in `neode-ui/public/assets/` are original
|
||||||
|
works created and owned by the Archipelago project author, released with the
|
||||||
|
project. The welcome voice line (`welcome-noderunner.mp3`) was generated with
|
||||||
|
ElevenLabs TTS under a commercial-use plan.
|
||||||
|
|
||||||
|
## Redistributed software (ISO and container registry)
|
||||||
|
|
||||||
|
The Archipelago OS image is based on Debian and redistributes Debian packages
|
||||||
|
(including the Linux kernel, GRUB, and non-free firmware/microcode blobs
|
||||||
|
required for hardware support); per-package license texts are preserved at
|
||||||
|
`/usr/share/doc/*/copyright` in the installed system, and corresponding source
|
||||||
|
is available via Debian (https://snapshot.debian.org) as referenced in each
|
||||||
|
release's notes. Container images offered through the app catalog and mirror
|
||||||
|
registry remain under their upstream licenses (including GPL/AGPL software
|
||||||
|
such as mempool, Nextcloud, Vaultwarden, SearXNG, PhotoPrism, Immich,
|
||||||
|
Jellyfin, MariaDB, AdGuard Home, and strfry); source links are provided in
|
||||||
|
the app catalog. The modified mempool-frontend image is built from
|
||||||
|
`docker/mempool-frontend/` in this repository (AGPL-3.0 corresponding source).
|
||||||
|
|
||||||
|
Full per-crate and per-package license inventories for release binaries are
|
||||||
|
generated at build time (see THIRD-PARTY-LICENSES files in release artifacts).
|
||||||
229
README.md
229
README.md
@ -1,8 +1,11 @@
|
|||||||
# Archipelago
|
# Archipelago
|
||||||
|
|
||||||
> Self-Sovereign Bitcoin Node OS
|
> Self-sovereign Bitcoin node OS and manifest-driven app platform.
|
||||||
|
|
||||||
**Archipelago** is a bootable personal server OS. Flash it to a USB drive, install on any x86_64 or ARM64 machine, and manage Bitcoin infrastructure, self-hosted apps, mesh communication, and decentralized identity through a glassmorphism web UI.
|
Archipelago is a bootable personal server OS for Bitcoin infrastructure,
|
||||||
|
self-hosted apps, mesh communication, decentralized identity, and federation.
|
||||||
|
Apps are packaged as declarative `manifest.yml` files and run as rootless
|
||||||
|
Podman containers managed by the Rust backend.
|
||||||
|
|
||||||
[](https://www.debian.org/)
|
[](https://www.debian.org/)
|
||||||
[](LICENSE)
|
[](LICENSE)
|
||||||
@ -10,193 +13,101 @@
|
|||||||
[](https://vuejs.org/)
|
[](https://vuejs.org/)
|
||||||
[]()
|
[]()
|
||||||
|
|
||||||
## Philosophy
|
## What is here
|
||||||
|
|
||||||
Archipelago is being built as a **developer-ready app platform**, not a fixed appliance:
|
- `core/` - Rust workspace: backend API, container runtime, security, OpenWrt
|
||||||
|
helpers, and performance/resource management.
|
||||||
|
- `neode-ui/` - Vue 3 + TypeScript frontend.
|
||||||
|
- `apps/` - app manifests and custom app container sources.
|
||||||
|
- `docker/` - supporting container build contexts for UI companion surfaces.
|
||||||
|
- `image-recipe/` - bootable image/ISO build inputs.
|
||||||
|
- `Android/` - Android companion app.
|
||||||
|
- `scripts/` - development, release, deployment, and validation tooling.
|
||||||
|
- `docs/` - architecture, app packaging, operations, API, and roadmap docs.
|
||||||
|
|
||||||
- **Manifest-driven apps.** Every app is declared in a single `manifest.yml` — image, ports, volumes, secrets, health checks, security policy. The orchestrator owns the entire lifecycle; there is no per-app installer code and no host-level provisioning.
|
## Platform model
|
||||||
- **Signed distribution.** App manifests ship inside an Ed25519-signed catalog verified against a pinned release-root key, not as loose files on disk. OTA release manifests are signed the same way.
|
|
||||||
- **Decentralized marketplace.** Third-party developers publish apps via Nostr-based discovery (NIP-78) with DID-signed manifests and federation-weighted trust scoring — no gatekept central store.
|
|
||||||
- **Rootless and secure by default.** Rootless Podman only. Read-only root, no-new-privileges, capability allow-list, secrets materialised 0600 and never logged. Never rootful, never a Docker socket mount.
|
|
||||||
- **100%-uptime-capable.** Every container is a systemd Quadlet unit under `user.slice` that survives backend restarts; a level-triggered reconciler self-heals drift every 30 seconds; migrations never destroy data.
|
|
||||||
|
|
||||||
## Features
|
Archipelago is built as a developer-ready app platform, not a fixed appliance:
|
||||||
|
|
||||||
### Bitcoin Infrastructure
|
- Apps are declared in `apps/<app-id>/manifest.yml`.
|
||||||
- **Bitcoin Core and Bitcoin Knots** full nodes with per-app version pinning and bulletproof version switching, automatic prune/full mode based on disk size
|
- The Rust parser in `core/container/src/manifest.rs` is the canonical schema.
|
||||||
- **LND** and **Core Lightning** with channel management
|
- The orchestrator compiles manifests to rootless Podman/Quadlet runtime state.
|
||||||
- **ElectrumX** Electrum server for wallet connectivity
|
- App data lives under `/var/lib/archipelago/<app-id>/`.
|
||||||
- **BTCPay Server** for accepting Bitcoin payments
|
- Secrets are generated or read from `/var/lib/archipelago/secrets/` and
|
||||||
- **Mempool** block explorer and fee estimator
|
injected through Podman secrets rather than static environment values.
|
||||||
- **Fedimint** federation guardian, gateway, and client — plus Cashu ecash wallet support
|
- Release and app catalogs are signed and verified against a pinned trust
|
||||||
|
anchor.
|
||||||
|
|
||||||
### Self-Hosted Apps (50+)
|
Start with:
|
||||||
Storage (FileBrowser, Immich, Nextcloud), Productivity (Vaultwarden), Media (Jellyfin, PhotoPrism, IndeeHub), Search (SearXNG), Network (NetBird, Tailscale), Home (Home Assistant), Nostr (nostr-rs-relay, strfry), Dev/Ops (Gitea, Grafana, Portainer, Uptime Kuma), and more — 27 curated in the store UI, 50+ packaged as manifests.
|
|
||||||
|
|
||||||
### Mesh Networking (tri-protocol)
|
- [Architecture](docs/architecture.md)
|
||||||
- **Meshtastic**, **MeshCore**, and **Reticulum (RNS/LXMF)** LoRa transports behind one mesh chat UI
|
- [Developer Guide](docs/developer-guide.md)
|
||||||
- End-to-end encryption with X3DH key agreement + double-ratchet
|
- [App Developer Guide](docs/app-developer-guide.md)
|
||||||
- RNode radio support with an OS-level `archy-rnodeconf` tool; interop verified against Sideband
|
- [App Manifest Spec](docs/app-manifest-spec.md)
|
||||||
- Image/voice attachments, mesh AI assistant (`!ai`), Bitcoin balance relay over mesh
|
- [Nostr Git Source Hosting Plan](docs/nostr-git-source-hosting.md)
|
||||||
|
- [Operations Runbook](docs/operations-runbook.md)
|
||||||
|
- [Troubleshooting](docs/troubleshooting.md)
|
||||||
|
|
||||||
### Decentralized Identity
|
## Quick start
|
||||||
- Ed25519 node identity with DID Documents (did:key)
|
|
||||||
- Multi-identity management (Personal/Business/Anonymous)
|
|
||||||
- W3C Verifiable Credentials issuance and verification
|
|
||||||
- Nostr integration: NIP-33 node discovery, NIP-44/NIP-04 encryption, NIP-07 signer bridge for iframe apps, relay hosting
|
|
||||||
- Decentralized Web Node (DWN) record sync between federated nodes over Tor
|
|
||||||
|
|
||||||
### Multi-Node Federation
|
### Frontend
|
||||||
- Invite-based node joining over Tor hidden services
|
|
||||||
- Trust levels (Trusted/Verified/Untrusted) with DID-based auth
|
|
||||||
- State sync and app deployment across federated nodes
|
|
||||||
- File sharing with access controls (free/peers-only/paid via Lightning, on-chain, or ecash)
|
|
||||||
|
|
||||||
### System Updates
|
|
||||||
- OTA updates from a self-hosted Gitea release server, Ed25519-signature-verified against a pinned release-root key
|
|
||||||
- Resumable downloads, automatic pre-update backup, rollback with a post-update self-verify window
|
|
||||||
- Manual, scheduled-check, and auto-apply modes (auto-apply refuses unsigned manifests)
|
|
||||||
|
|
||||||
### Security
|
|
||||||
- Argon2id password hashing (transparent upgrade from legacy hashes), ChaCha20-Poly1305 encrypted secrets at rest
|
|
||||||
- Rootless Podman: read-only root, cap-drop ALL with a reviewed allow-list, no-new-privileges
|
|
||||||
- Signed release manifests and signed app catalog (Ed25519, pinned trust anchor)
|
|
||||||
- TOTP two-factor authentication, per-endpoint rate limiting, CSRF protection
|
|
||||||
- AppArmor profiles for container confinement; Tor hidden services for inter-node traffic
|
|
||||||
- Independent security audit of an early version archived in [`docs/archive/`](docs/archive/security-code-audit-2026-03.md); top findings since remediated
|
|
||||||
|
|
||||||
## Roadmap
|
|
||||||
|
|
||||||
**Done**
|
|
||||||
- Single-node production gate **green** — install / stop / start / restart / reinstall / reboot-survive / uninstall, 5 consecutive full runs with zero failures on real hardware
|
|
||||||
- Quadlet migration validated (all backends as `user.slice` services on the canary node)
|
|
||||||
- Release signing ceremony completed — release-root key pinned, catalog and OTA manifests signed
|
|
||||||
- Reticulum third mesh transport (real-RF LoRa gates passed), Bitcoin Core/Knots multi-version switching, decentralized marketplace backend, public demo
|
|
||||||
|
|
||||||
**In progress**
|
|
||||||
- Multinode pass: the same production gate across the whole test fleet ([`docs/multinode-testing-plan.md`](docs/multinode-testing-plan.md))
|
|
||||||
- Quadlet default flip fleet-wide + container-flapping elimination
|
|
||||||
- 1.8.0 release hardening tail ([`docs/1.8.0-RELEASE-HARDENING-PLAN.md`](docs/1.8.0-RELEASE-HARDENING-PLAN.md)): OTA upgrade soak on real hardware, ISO/image hardening (per-device keys, no default creds, signed ISO)
|
|
||||||
|
|
||||||
**Planned**
|
|
||||||
- Developer CLI (`archy app validate/render/install/test`) to open third-party app publishing
|
|
||||||
- External marketplace trust UX + publishing tooling ([`docs/marketplace-protocol.md`](docs/marketplace-protocol.md))
|
|
||||||
- DHT/P2P distribution of releases and app images ([`docs/dht-distribution-design.md`](docs/dht-distribution-design.md))
|
|
||||||
- P2P encrypted voice/video over Tor, dual-ecash (Fedimint + Cashu) phases, paid streaming, hardware signer support
|
|
||||||
|
|
||||||
The live, priority-ordered task list is [`docs/UNIFIED-TASK-TRACKER.md`](docs/UNIFIED-TASK-TRACKER.md); the full narrative plan is [`docs/PRODUCTION-MASTER-PLAN.md`](docs/PRODUCTION-MASTER-PLAN.md).
|
|
||||||
|
|
||||||
## Quick Start
|
|
||||||
|
|
||||||
### Install from ISO
|
|
||||||
|
|
||||||
1. Build or download the ISO for your architecture (x86_64 or ARM64) — see [`image-recipe/`](image-recipe/)
|
|
||||||
2. Flash to USB drive with Balena Etcher or `dd`
|
|
||||||
3. Boot from USB on target hardware and follow the automated installer
|
|
||||||
4. Access the web UI at `http://<device-ip>`
|
|
||||||
5. Set your password and complete the onboarding wizard (seed backup, DID identity)
|
|
||||||
|
|
||||||
### Supported Hardware
|
|
||||||
|
|
||||||
| Platform | Examples | Minimum |
|
|
||||||
|----------|----------|---------|
|
|
||||||
| **x86_64** | Intel NUC, mini PCs, any 64-bit PC | 4GB RAM, 32GB storage |
|
|
||||||
| **ARM64** | Raspberry Pi 5, ARM64 SBCs | 4GB RAM, 32GB storage |
|
|
||||||
|
|
||||||
**Recommended**: 8GB+ RAM, 1TB+ NVMe SSD (for a full Bitcoin node). Optional: an RNode-compatible LoRa radio for mesh networking.
|
|
||||||
|
|
||||||
## Development
|
|
||||||
|
|
||||||
### Prerequisites
|
|
||||||
- macOS or Linux for frontend development
|
|
||||||
- Linux dev server (Debian 13) for backend builds — **never build Rust on macOS for Linux**
|
|
||||||
- Node.js 20+, Rust stable toolchain
|
|
||||||
|
|
||||||
### Frontend Development
|
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd neode-ui
|
cd neode-ui
|
||||||
npm install
|
npm install
|
||||||
npm start # Dev server on http://localhost:8100 (mock backend on :5959)
|
npm start
|
||||||
npm run type-check # TypeScript validation
|
|
||||||
npm run build # Production build → web/dist/neode-ui/
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### Backend Development
|
The dev UI runs at `http://localhost:8100` with a mock backend on `:5959`.
|
||||||
|
|
||||||
|
### Backend
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
cd core # Rust workspace root (no Cargo.toml at repo root)
|
cd core
|
||||||
cargo build
|
cargo build
|
||||||
cargo test
|
cargo test --all-features
|
||||||
```
|
```
|
||||||
|
|
||||||
### Deploy to a Test Node
|
Linux is the supported backend runtime and release-build target. macOS is fine
|
||||||
|
for frontend work and many Rust compile/test loops, but host integration tests
|
||||||
|
that touch Podman, systemd, networking, or image build paths require Linux.
|
||||||
|
|
||||||
|
### App manifests
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
./scripts/deploy-to-target.sh --live # Deploy to primary dev server
|
./scripts/validate-app-manifest.sh apps/filebrowser/manifest.yml
|
||||||
./scripts/deploy-to-target.sh --both # Deploy to both LAN servers
|
python3 scripts/generate-app-catalog.py
|
||||||
|
python3 scripts/check-app-catalog-drift.py --release --strict
|
||||||
```
|
```
|
||||||
|
|
||||||
### Release (tarball-only)
|
`scripts/generate-app-catalog.py` requires Python with PyYAML installed.
|
||||||
|
|
||||||
Releases ship as a backend binary and a frontend tarball referenced by
|
## Documentation map
|
||||||
`releases/manifest.json`, published to the self-hosted Gitea release server.
|
|
||||||
|
|
||||||
```bash
|
|
||||||
./scripts/create-release.sh 1.2.3
|
|
||||||
git push origin main --tags
|
|
||||||
```
|
|
||||||
|
|
||||||
## Architecture
|
|
||||||
|
|
||||||
```
|
|
||||||
Debian 13 (Trixie)
|
|
||||||
├── Rootless Podman — every app a systemd Quadlet unit under user.slice
|
|
||||||
├── Nginx (reverse proxy, security headers, rate limiting)
|
|
||||||
├── Rust Backend (JSON-RPC API on 127.0.0.1:5678, ~380 RPC methods)
|
|
||||||
│ ├── core/archipelago/ — API, orchestrator + reconciler, mesh, identity,
|
|
||||||
│ │ federation, wallet, updates, marketplace
|
|
||||||
│ ├── core/container/ — Podman client, manifest schema, Quadlet compiler,
|
|
||||||
│ │ health monitor, signed app catalog
|
|
||||||
│ ├── core/security/ — AppArmor/seccomp policy, secrets manager
|
|
||||||
│ ├── core/openwrt/ — TollGate gateway provisioning (SSH/UCI)
|
|
||||||
│ └── core/performance/ — resource limits
|
|
||||||
├── Vue 3 Frontend (Composition API + TypeScript strict + Pinia + Tailwind, PWA)
|
|
||||||
│ └── Three UI modes (Pro/Easy/Chat) + gamepad navigation + i18n
|
|
||||||
├── Reticulum daemon (supervised Python/PyInstaller, one per LoRa radio)
|
|
||||||
└── System Tor (hidden services, SOCKS5 proxy)
|
|
||||||
```
|
|
||||||
|
|
||||||
~117,000 lines of Rust | ~69,000 lines of TypeScript/Vue | 51 packaged apps | Android companion app
|
|
||||||
|
|
||||||
## Documentation
|
|
||||||
|
|
||||||
| Doc | Purpose |
|
| Doc | Purpose |
|
||||||
|-----|---------|
|
|-----|---------|
|
||||||
| [Architecture](docs/architecture.md) | System design, crate map, data paths |
|
| [Architecture](docs/architecture.md) | System layers, crates, data paths, security model |
|
||||||
| [Developer Guide](docs/developer-guide.md) | Dev setup, workflow, code conventions |
|
| [Developer Guide](docs/developer-guide.md) | Local setup, code workflow, testing |
|
||||||
| [API Reference](docs/api-reference.md) | RPC endpoint reference |
|
| [API Reference](docs/api-reference.md) | JSON-RPC API overview |
|
||||||
| [App Developer Guide](docs/app-developer-guide.md) | Building and publishing apps |
|
| [App Developer Guide](docs/app-developer-guide.md) | How to package and test apps |
|
||||||
| [App Manifest Spec](docs/app-manifest-spec.md) | The `manifest.yml` schema |
|
| [App Manifest Spec](docs/app-manifest-spec.md) | Manifest schema and validation rules |
|
||||||
| [User Walkthrough](docs/user-walkthrough.md) | End-user installation and usage guide |
|
| [Nostr Git Source Hosting Plan](docs/nostr-git-source-hosting.md) | ngit/NIP-34 contribution workflow and maintainer model |
|
||||||
| [Troubleshooting](docs/troubleshooting.md) | Diagnostic scenarios and solutions |
|
| [Apps README](apps/README.md) | Packaged app catalog overview |
|
||||||
| [Operations Runbook](docs/operations-runbook.md) | Ops commands and emergency recovery |
|
| [Image Recipe](image-recipe/README.md) | Bootable image build flow |
|
||||||
| [Production Master Plan](docs/PRODUCTION-MASTER-PLAN.md) | North star and workstream narrative |
|
| [Operations Runbook](docs/operations-runbook.md) | Production operations and recovery |
|
||||||
| [Unified Task Tracker](docs/UNIFIED-TASK-TRACKER.md) | Live, priority-ordered open items |
|
| [Open Source Readiness](docs/OPEN_SOURCE_READINESS.md) | Public-release cleanup checklist |
|
||||||
| [Test Gate](tests/lifecycle/TESTING.md) | Production lifecycle test gate (definition of done) |
|
| [Roadmap](docs/ROADMAP.md) | Shipped, in-progress, and planned work |
|
||||||
| [Archive](docs/archive/) | Historical audits, session logs, shipped designs |
|
| [Unified Task Tracker](docs/UNIFIED-TASK-TRACKER.md) | Launch hardening task list |
|
||||||
|
| [Archive](docs/archive/) | Historical plans, audits, and handoffs |
|
||||||
|
|
||||||
## Contributing
|
## Contributing
|
||||||
|
|
||||||
1. Fork the repository
|
Read [CONTRIBUTING.md](CONTRIBUTING.md) before opening a pull request. For
|
||||||
2. Create a feature branch (`feature/description`)
|
security issues, follow [SECURITY.md](SECURITY.md) and do not open a public
|
||||||
3. Follow the coding standards in [CONTRIBUTING.md](CONTRIBUTING.md) and [CLAUDE.md](CLAUDE.md)
|
issue.
|
||||||
4. Submit a pull request
|
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
[MIT License](LICENSE)
|
Archipelago is licensed under the [MIT License](LICENSE). Third-party notices
|
||||||
|
are listed in [NOTICE](NOTICE) and generated license inventories in component
|
||||||
## Acknowledgments
|
release artifacts.
|
||||||
|
|
||||||
Built with: [Rust](https://www.rust-lang.org/), [Vue.js](https://vuejs.org/), [Podman](https://podman.io/), [Bitcoin Core](https://bitcoin.org/), [LND](https://lightning.engineering/), [Reticulum](https://reticulum.network/), [Debian](https://www.debian.org/)
|
|
||||||
|
|||||||
38
SECURITY.md
Normal file
38
SECURITY.md
Normal file
@ -0,0 +1,38 @@
|
|||||||
|
# Security Policy
|
||||||
|
|
||||||
|
## Reporting vulnerabilities
|
||||||
|
|
||||||
|
Please do not open a public issue for a security vulnerability.
|
||||||
|
|
||||||
|
Until a dedicated security intake address is published, report privately to the
|
||||||
|
project maintainer through the repository owner account or the private contact
|
||||||
|
channel listed on the project homepage.
|
||||||
|
|
||||||
|
Include:
|
||||||
|
|
||||||
|
- affected commit, version, or release;
|
||||||
|
- affected component;
|
||||||
|
- reproduction steps;
|
||||||
|
- expected impact;
|
||||||
|
- logs, proof of concept, or packet captures when relevant;
|
||||||
|
- whether the issue is already public.
|
||||||
|
|
||||||
|
We aim to acknowledge credible reports within 48 hours and coordinate fixes
|
||||||
|
before public disclosure.
|
||||||
|
|
||||||
|
## Scope
|
||||||
|
|
||||||
|
Security-sensitive areas include:
|
||||||
|
|
||||||
|
- authentication, session handling, CSRF, and rate limiting;
|
||||||
|
- release and app-catalog signature verification;
|
||||||
|
- container manifest validation and runtime compilation;
|
||||||
|
- Podman/Quadlet isolation, capabilities, volumes, and secret injection;
|
||||||
|
- backup encryption and key derivation;
|
||||||
|
- federation, Tor, Nostr, mesh, DID, and credential flows;
|
||||||
|
- Android companion pairing and device-token handling.
|
||||||
|
|
||||||
|
## Supported versions
|
||||||
|
|
||||||
|
Archipelago is currently pre-1.0 alpha software. Security fixes target the
|
||||||
|
current `main` branch and the latest published alpha release.
|
||||||
@ -76,7 +76,17 @@ podman run -p 18084:8080 \
|
|||||||
|
|
||||||
## Integration Checklist
|
## Integration Checklist
|
||||||
|
|
||||||
Adding a new app requires updates in multiple places. See the full checklist in [CLAUDE.md](../CLAUDE.md) under "App Integration Checklist".
|
Adding a new app requires updates in multiple places:
|
||||||
|
|
||||||
|
- add `apps/<app-id>/manifest.yml`;
|
||||||
|
- add a Dockerfile and source directory only when the app is built locally;
|
||||||
|
- choose non-conflicting ports from [PORTS.md](./PORTS.md);
|
||||||
|
- declare `interfaces.main` for user-facing web UIs;
|
||||||
|
- declare generated secrets instead of hardcoding credentials;
|
||||||
|
- run `./scripts/validate-app-manifest.sh apps/<app-id>/manifest.yml`;
|
||||||
|
- regenerate catalogs with `python3 scripts/generate-app-catalog.py`;
|
||||||
|
- verify drift with `python3 scripts/check-app-catalog-drift.py --release --strict`;
|
||||||
|
- test install, launch, stop, start, restart, uninstall, and reinstall.
|
||||||
|
|
||||||
## Port Assignments
|
## Port Assignments
|
||||||
|
|
||||||
|
|||||||
@ -1,33 +0,0 @@
|
|||||||
# Archipelago Production Configuration
|
|
||||||
# This file is bundled with the macOS app
|
|
||||||
|
|
||||||
# Server Configuration
|
|
||||||
ARCHIPELAGO_HOST=127.0.0.1
|
|
||||||
ARCHIPELAGO_PORT=8100
|
|
||||||
ARCHIPELAGO_BACKEND_PORT=3030
|
|
||||||
|
|
||||||
# Data Directories (relative to ~/Library/Application Support/Archipelago)
|
|
||||||
ARCHIPELAGO_DATA_DIR=data
|
|
||||||
ARCHIPELAGO_LOG_DIR=logs
|
|
||||||
|
|
||||||
# Frontend Configuration
|
|
||||||
ARCHIPELAGO_FRONTEND_DIR=frontend
|
|
||||||
|
|
||||||
# Docker UI Configuration
|
|
||||||
ARCHIPELAGO_DOCKER_UI_DIR=docker-ui
|
|
||||||
|
|
||||||
# Security
|
|
||||||
ARCHIPELAGO_SESSION_SECRET=CHANGE_ME_ON_FIRST_RUN
|
|
||||||
|
|
||||||
# Logging
|
|
||||||
RUST_LOG=info
|
|
||||||
|
|
||||||
# Production Mode
|
|
||||||
NODE_ENV=production
|
|
||||||
ARCHIPELAGO_MODE=production
|
|
||||||
|
|
||||||
# Docker Configuration
|
|
||||||
DOCKER_HOST=unix:///var/run/docker.sock
|
|
||||||
|
|
||||||
# Disable External API Calls in Production
|
|
||||||
ARCHIPELAGO_DISABLE_EXTERNAL_APIS=true
|
|
||||||
2
core/Cargo.lock
generated
2
core/Cargo.lock
generated
@ -95,7 +95,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "archipelago"
|
name = "archipelago"
|
||||||
version = "1.7.111-alpha"
|
version = "1.7.116-alpha"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"archipelago-container",
|
"archipelago-container",
|
||||||
|
|||||||
656
core/THIRD-PARTY-LICENSES.md
Normal file
656
core/THIRD-PARTY-LICENSES.md
Normal file
@ -0,0 +1,656 @@
|
|||||||
|
# Third-Party Rust Crate Licenses — Archipelago core
|
||||||
|
|
||||||
|
Generated from `cargo metadata` (all features) on 2026-07-23. 649 external crates.
|
||||||
|
Full license texts ship with release artifacts (cargo-about; see docs/LICENSE-COMPLIANCE-AUDIT.md).
|
||||||
|
|
||||||
|
| Crate | Version | License | Source |
|
||||||
|
|---|---|---|---|
|
||||||
|
| adler2 | 2.0.1 | 0BSD OR MIT OR Apache-2.0 | https://github.com/oyvindln/adler2 |
|
||||||
|
| aead | 0.5.2 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| aes | 0.8.4 | MIT OR Apache-2.0 | https://github.com/RustCrypto/block-ciphers |
|
||||||
|
| aes-gcm | 0.10.3 | Apache-2.0 OR MIT | https://github.com/RustCrypto/AEADs |
|
||||||
|
| ahash | 0.7.8 | MIT OR Apache-2.0 | https://github.com/tkaitchuck/ahash |
|
||||||
|
| aho-corasick | 1.1.4 | Unlicense OR MIT | https://github.com/BurntSushi/aho-corasick |
|
||||||
|
| allocator-api2 | 0.2.21 | MIT OR Apache-2.0 | https://github.com/zakarumych/allocator-api2 |
|
||||||
|
| android_system_properties | 0.1.5 | MIT/Apache-2.0 | https://github.com/nical/android_system_properties |
|
||||||
|
| anyhow | 1.0.100 | MIT OR Apache-2.0 | https://github.com/dtolnay/anyhow |
|
||||||
|
| arc-swap | 1.9.1 | MIT OR Apache-2.0 | https://github.com/vorner/arc-swap |
|
||||||
|
| argon2 | 0.5.3 | MIT OR Apache-2.0 | https://github.com/RustCrypto/password-hashes/tree/master/argon2 |
|
||||||
|
| arrayref | 0.3.9 | BSD-2-Clause | https://github.com/droundy/arrayref |
|
||||||
|
| arrayvec | 0.7.6 | MIT OR Apache-2.0 | https://github.com/bluss/arrayvec |
|
||||||
|
| asn1-rs | 0.7.2 | MIT OR Apache-2.0 | https://github.com/rusticata/asn1-rs.git |
|
||||||
|
| asn1-rs-derive | 0.6.0 | MIT OR Apache-2.0 | https://github.com/rusticata/asn1-rs.git |
|
||||||
|
| asn1-rs-impl | 0.2.0 | MIT/Apache-2.0 | https://github.com/rusticata/asn1-rs.git |
|
||||||
|
| async-trait | 0.1.89 | MIT OR Apache-2.0 | https://github.com/dtolnay/async-trait |
|
||||||
|
| async-utility | 0.3.1 | MIT | https://github.com/yukibtc/async-utility.git |
|
||||||
|
| async-wsocket | 0.13.1 | MIT | https://github.com/yukibtc/async-wsocket.git |
|
||||||
|
| async_io_stream | 0.3.3 | Unlicense | https://github.com/najamelan/async_io_stream |
|
||||||
|
| atomic-destructor | 0.3.0 | MIT | https://github.com/yukibtc/atomic-destructor.git |
|
||||||
|
| atomic-polyfill | 1.0.3 | MIT OR Apache-2.0 | https://github.com/embassy-rs/atomic-polyfill |
|
||||||
|
| atomic-waker | 1.1.2 | Apache-2.0 OR MIT | https://github.com/smol-rs/atomic-waker |
|
||||||
|
| attohttpc | 0.30.1 | MPL-2.0 | https://github.com/sbstp/attohttpc |
|
||||||
|
| autocfg | 1.5.0 | Apache-2.0 OR MIT | https://github.com/cuviper/autocfg |
|
||||||
|
| backon | 1.6.0 | Apache-2.0 | https://github.com/Xuanwo/backon |
|
||||||
|
| bao-tree | 0.16.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/bao-tree |
|
||||||
|
| base16ct | 1.0.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| base32 | 0.5.1 | MIT OR Apache-2.0 | https://github.com/andreasots/base32 |
|
||||||
|
| base58ck | 0.1.0 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin/ |
|
||||||
|
| base64 | 0.21.7 | MIT OR Apache-2.0 | https://github.com/marshallpierce/rust-base64 |
|
||||||
|
| base64 | 0.22.1 | MIT OR Apache-2.0 | https://github.com/marshallpierce/rust-base64 |
|
||||||
|
| base64ct | 1.8.3 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| bcrypt | 0.15.1 | MIT | https://github.com/Keats/rust-bcrypt |
|
||||||
|
| bech32 | 0.11.1 | MIT | https://github.com/rust-bitcoin/rust-bech32 |
|
||||||
|
| binary-merge | 0.1.2 | MIT OR Apache-2.0 | https://github.com/rklaehn/binary-merge |
|
||||||
|
| bip39 | 2.1.0 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bip39/ |
|
||||||
|
| bit-vec | 0.9.1 | Apache-2.0 OR MIT | https://github.com/contain-rs/bit-vec |
|
||||||
|
| bitcoin | 0.32.5 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin/ |
|
||||||
|
| bitcoin-internals | 0.2.0 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin/ |
|
||||||
|
| bitcoin-internals | 0.3.0 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin/ |
|
||||||
|
| bitcoin-io | 0.1.4 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin |
|
||||||
|
| bitcoin-units | 0.1.2 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin/ |
|
||||||
|
| bitcoin_hashes | 0.13.0 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin |
|
||||||
|
| bitcoin_hashes | 0.14.1 | CC0-1.0 | https://github.com/rust-bitcoin/rust-bitcoin |
|
||||||
|
| bitflags | 1.3.2 | MIT/Apache-2.0 | https://github.com/bitflags/bitflags |
|
||||||
|
| bitflags | 2.13.0 | MIT OR Apache-2.0 | https://github.com/bitflags/bitflags |
|
||||||
|
| blake2 | 0.10.6 | MIT OR Apache-2.0 | https://github.com/RustCrypto/hashes |
|
||||||
|
| blake3 | 1.8.5 | CC0-1.0 OR Apache-2.0 OR Apache-2.0 WITH LLVM-exception | https://github.com/BLAKE3-team/BLAKE3 |
|
||||||
|
| block-buffer | 0.10.4 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| block-buffer | 0.12.1 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| block-padding | 0.3.3 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| block2 | 0.6.2 | MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| blowfish | 0.9.1 | MIT OR Apache-2.0 | https://github.com/RustCrypto/block-ciphers |
|
||||||
|
| bs58 | 0.5.1 | MIT/Apache-2.0 | https://github.com/Nullus157/bs58-rs |
|
||||||
|
| bumpalo | 3.19.1 | MIT OR Apache-2.0 | https://github.com/fitzgen/bumpalo |
|
||||||
|
| bytemuck | 1.25.0 | Zlib OR Apache-2.0 OR MIT | https://github.com/Lokathor/bytemuck |
|
||||||
|
| byteorder | 1.5.0 | Unlicense OR MIT | https://github.com/BurntSushi/byteorder |
|
||||||
|
| byteorder-lite | 0.1.0 | Unlicense OR MIT | https://github.com/image-rs/byteorder-lite |
|
||||||
|
| bytes | 1.11.0 | MIT | https://github.com/tokio-rs/bytes |
|
||||||
|
| cbc | 0.1.2 | MIT OR Apache-2.0 | https://github.com/RustCrypto/block-modes |
|
||||||
|
| cc | 1.2.54 | MIT OR Apache-2.0 | https://github.com/rust-lang/cc-rs |
|
||||||
|
| cesu8 | 1.1.0 | Apache-2.0/MIT | https://github.com/emk/cesu8-rs |
|
||||||
|
| cfg-if | 1.0.4 | MIT OR Apache-2.0 | https://github.com/rust-lang/cfg-if |
|
||||||
|
| cfg_aliases | 0.2.1 | MIT | https://github.com/katharostech/cfg_aliases |
|
||||||
|
| chacha20 | 0.10.0 | MIT OR Apache-2.0 | https://github.com/RustCrypto/stream-ciphers |
|
||||||
|
| chacha20 | 0.9.1 | Apache-2.0 OR MIT | https://github.com/RustCrypto/stream-ciphers |
|
||||||
|
| chacha20poly1305 | 0.10.1 | Apache-2.0 OR MIT | https://github.com/RustCrypto/AEADs/tree/master/chacha20poly1305 |
|
||||||
|
| chrono | 0.4.43 | MIT OR Apache-2.0 | https://github.com/chronotope/chrono |
|
||||||
|
| ciborium | 0.2.2 | Apache-2.0 | https://github.com/enarx/ciborium |
|
||||||
|
| ciborium-io | 0.2.2 | Apache-2.0 | https://github.com/enarx/ciborium |
|
||||||
|
| ciborium-ll | 0.2.2 | Apache-2.0 | https://github.com/enarx/ciborium |
|
||||||
|
| cipher | 0.4.4 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| cmov | 0.5.4 | Apache-2.0 OR MIT | https://github.com/RustCrypto/utils |
|
||||||
|
| cobs | 0.3.0 | MIT OR Apache-2.0 | https://github.com/jamesmunns/cobs.rs |
|
||||||
|
| combine | 4.6.7 | MIT | https://github.com/Marwes/combine |
|
||||||
|
| const-oid | 0.10.2 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| const-oid | 0.9.6 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats/tree/master/const-oid |
|
||||||
|
| constant_time_eq | 0.3.1 | CC0-1.0 OR MIT-0 OR Apache-2.0 | https://github.com/cesarb/constant_time_eq |
|
||||||
|
| constant_time_eq | 0.4.2 | CC0-1.0 OR MIT-0 OR Apache-2.0 | https://github.com/cesarb/constant_time_eq |
|
||||||
|
| convert_case | 0.10.0 | MIT | https://github.com/rutrum/convert-case |
|
||||||
|
| cordyceps | 0.3.4 | MIT | https://github.com/hawkw/mycelium |
|
||||||
|
| core-foundation | 0.10.1 | MIT OR Apache-2.0 | https://github.com/servo/core-foundation-rs |
|
||||||
|
| core-foundation | 0.9.4 | MIT OR Apache-2.0 | https://github.com/servo/core-foundation-rs |
|
||||||
|
| core-foundation-sys | 0.8.7 | MIT OR Apache-2.0 | https://github.com/servo/core-foundation-rs |
|
||||||
|
| cpufeatures | 0.2.17 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| cpufeatures | 0.3.0 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| crc | 3.4.0 | MIT OR Apache-2.0 | https://github.com/mrhooray/crc-rs.git |
|
||||||
|
| crc-catalog | 2.4.0 | MIT OR Apache-2.0 | https://github.com/akhilles/crc-catalog.git |
|
||||||
|
| crc32fast | 1.5.0 | MIT OR Apache-2.0 | https://github.com/srijs/rust-crc32fast |
|
||||||
|
| critical-section | 1.2.0 | MIT OR Apache-2.0 | https://github.com/rust-embedded/critical-section |
|
||||||
|
| crossbeam-channel | 0.5.15 | MIT OR Apache-2.0 | https://github.com/crossbeam-rs/crossbeam |
|
||||||
|
| crossbeam-epoch | 0.9.18 | MIT OR Apache-2.0 | https://github.com/crossbeam-rs/crossbeam |
|
||||||
|
| crossbeam-utils | 0.8.21 | MIT OR Apache-2.0 | https://github.com/crossbeam-rs/crossbeam |
|
||||||
|
| crunchy | 0.2.4 | MIT | https://github.com/eira-fransham/crunchy |
|
||||||
|
| crypto-common | 0.1.7 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| crypto-common | 0.2.2 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| ctr | 0.9.2 | MIT OR Apache-2.0 | https://github.com/RustCrypto/block-modes |
|
||||||
|
| ctutils | 0.4.2 | Apache-2.0 OR MIT | https://github.com/RustCrypto/utils |
|
||||||
|
| curve25519-dalek | 4.1.3 | BSD-3-Clause | https://github.com/dalek-cryptography/curve25519-dalek/tree/main/curve25519-dalek |
|
||||||
|
| curve25519-dalek | 5.0.0-rc.0 | BSD-3-Clause | https://github.com/dalek-cryptography/curve25519-dalek/tree/main/curve25519-dalek |
|
||||||
|
| curve25519-dalek-derive | 0.1.1 | MIT/Apache-2.0 | https://github.com/dalek-cryptography/curve25519-dalek |
|
||||||
|
| darling | 0.20.11 | MIT | https://github.com/TedDriggs/darling |
|
||||||
|
| darling_core | 0.20.11 | MIT | https://github.com/TedDriggs/darling |
|
||||||
|
| darling_macro | 0.20.11 | MIT | https://github.com/TedDriggs/darling |
|
||||||
|
| data-encoding | 2.11.0 | MIT | https://github.com/ia0/data-encoding |
|
||||||
|
| data-encoding-macro | 0.1.20 | MIT | https://github.com/ia0/data-encoding |
|
||||||
|
| data-encoding-macro-internal | 0.1.18 | MIT | https://github.com/ia0/data-encoding |
|
||||||
|
| der | 0.7.10 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats/tree/master/der |
|
||||||
|
| der | 0.8.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| der-parser | 10.0.0 | MIT OR Apache-2.0 | https://github.com/rusticata/der-parser.git |
|
||||||
|
| deranged | 0.5.8 | MIT OR Apache-2.0 | https://github.com/jhpratt/deranged |
|
||||||
|
| derive_builder | 0.20.2 | MIT OR Apache-2.0 | https://github.com/colin-kiegel/rust-derive-builder |
|
||||||
|
| derive_builder_core | 0.20.2 | MIT OR Apache-2.0 | https://github.com/colin-kiegel/rust-derive-builder |
|
||||||
|
| derive_builder_macro | 0.20.2 | MIT OR Apache-2.0 | https://github.com/colin-kiegel/rust-derive-builder |
|
||||||
|
| derive_more | 2.1.1 | MIT | https://github.com/JelteF/derive_more |
|
||||||
|
| derive_more-impl | 2.1.1 | MIT | https://github.com/JelteF/derive_more |
|
||||||
|
| diatomic-waker | 0.2.3 | MIT OR Apache-2.0 | https://github.com/asynchronics/diatomic-waker |
|
||||||
|
| digest | 0.10.7 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| digest | 0.11.3 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| dispatch2 | 0.3.1 | Zlib OR Apache-2.0 OR MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| displaydoc | 0.2.5 | MIT OR Apache-2.0 | https://github.com/yaahc/displaydoc |
|
||||||
|
| dlopen2 | 0.8.2 | MIT | https://github.com/OpenByteDev/dlopen2 |
|
||||||
|
| ed25519 | 2.2.3 | Apache-2.0 OR MIT | https://github.com/RustCrypto/signatures/tree/master/ed25519 |
|
||||||
|
| ed25519 | 3.0.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/signatures |
|
||||||
|
| ed25519-dalek | 2.2.0 | BSD-3-Clause | https://github.com/dalek-cryptography/curve25519-dalek/tree/main/ed25519-dalek |
|
||||||
|
| ed25519-dalek | 3.0.0-rc.0 | BSD-3-Clause | https://github.com/dalek-cryptography/curve25519-dalek/tree/main/ed25519-dalek |
|
||||||
|
| either | 1.15.0 | MIT OR Apache-2.0 | https://github.com/rayon-rs/either |
|
||||||
|
| embedded-io | 0.4.0 | MIT OR Apache-2.0 | https://github.com/embassy-rs/embedded-io |
|
||||||
|
| embedded-io | 0.6.1 | MIT OR Apache-2.0 | https://github.com/rust-embedded/embedded-hal |
|
||||||
|
| encoding_rs | 0.8.35 | (Apache-2.0 OR MIT) AND BSD-3-Clause | https://github.com/hsivonen/encoding_rs |
|
||||||
|
| enum-assoc | 1.3.0 | MIT OR Apache-2.0 | https://github.com/Eolu/enum-assoc |
|
||||||
|
| env_logger | 0.10.2 | MIT OR Apache-2.0 | https://github.com/rust-cli/env_logger |
|
||||||
|
| equivalent | 1.0.2 | Apache-2.0 OR MIT | https://github.com/indexmap-rs/equivalent |
|
||||||
|
| errno | 0.3.14 | MIT OR Apache-2.0 | https://github.com/lambda-fairy/rust-errno |
|
||||||
|
| fastbloom | 0.17.0 | MIT OR Apache-2.0 | https://github.com/tomtomwombat/fastbloom/ |
|
||||||
|
| fastrand | 2.3.0 | Apache-2.0 OR MIT | https://github.com/smol-rs/fastrand |
|
||||||
|
| fiat-crypto | 0.2.9 | MIT OR Apache-2.0 OR BSD-1-Clause | https://github.com/mit-plv/fiat-crypto |
|
||||||
|
| fiat-crypto | 0.3.0 | MIT OR Apache-2.0 OR BSD-1-Clause | https://github.com/mit-plv/fiat-crypto |
|
||||||
|
| filetime | 0.2.27 | MIT/Apache-2.0 | https://github.com/alexcrichton/filetime |
|
||||||
|
| find-msvc-tools | 0.1.8 | MIT OR Apache-2.0 | https://github.com/rust-lang/cc-rs |
|
||||||
|
| flate2 | 1.1.9 | MIT OR Apache-2.0 | https://github.com/rust-lang/flate2-rs |
|
||||||
|
| flume | 0.11.1 | Apache-2.0/MIT | https://github.com/zesterer/flume |
|
||||||
|
| fnv | 1.0.7 | Apache-2.0 / MIT | https://github.com/servo/rust-fnv |
|
||||||
|
| foldhash | 0.1.5 | Zlib | https://github.com/orlp/foldhash |
|
||||||
|
| foldhash | 0.2.0 | Zlib | https://github.com/orlp/foldhash |
|
||||||
|
| form_urlencoded | 1.2.2 | MIT OR Apache-2.0 | https://github.com/servo/rust-url |
|
||||||
|
| futures | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-buffered | 0.2.13 | MIT | https://github.com/conradludgate/futures-buffered |
|
||||||
|
| futures-channel | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-core | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-executor | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-io | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-lite | 2.6.1 | Apache-2.0 OR MIT | https://github.com/smol-rs/futures-lite |
|
||||||
|
| futures-macro | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-sink | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-task | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| futures-util | 0.3.31 | MIT OR Apache-2.0 | https://github.com/rust-lang/futures-rs |
|
||||||
|
| genawaiter | 0.99.1 | MIT | https://github.com/whatisaphone/genawaiter |
|
||||||
|
| genawaiter-macro | 0.99.1 | MIT/Apache-2.0 | https://github.com/whatisaphone/genawaiter |
|
||||||
|
| genawaiter-proc-macro | 0.99.1 | MIT/Apache-2.0 | https://github.com/whatisaphone/genawaiter |
|
||||||
|
| generator | 0.8.9 | MIT/Apache-2.0 | https://github.com/Xudong-Huang/generator-rs.git |
|
||||||
|
| generic-array | 0.14.7 | MIT | https://github.com/fizyk20/generic-array.git |
|
||||||
|
| getrandom | 0.2.17 | MIT OR Apache-2.0 | https://github.com/rust-random/getrandom |
|
||||||
|
| getrandom | 0.3.4 | MIT OR Apache-2.0 | https://github.com/rust-random/getrandom |
|
||||||
|
| getrandom | 0.4.2 | MIT OR Apache-2.0 | https://github.com/rust-random/getrandom |
|
||||||
|
| ghash | 0.5.1 | Apache-2.0 OR MIT | https://github.com/RustCrypto/universal-hashes |
|
||||||
|
| gloo-timers | 0.3.0 | MIT OR Apache-2.0 | https://github.com/rustwasm/gloo/tree/master/crates/timers |
|
||||||
|
| h2 | 0.3.27 | MIT | https://github.com/hyperium/h2 |
|
||||||
|
| h2 | 0.4.13 | MIT | https://github.com/hyperium/h2 |
|
||||||
|
| half | 2.7.1 | MIT OR Apache-2.0 | https://github.com/VoidStarKat/half-rs |
|
||||||
|
| hash32 | 0.2.1 | MIT OR Apache-2.0 | https://github.com/japaric/hash32 |
|
||||||
|
| hashbrown | 0.12.3 | MIT OR Apache-2.0 | https://github.com/rust-lang/hashbrown |
|
||||||
|
| hashbrown | 0.15.5 | MIT OR Apache-2.0 | https://github.com/rust-lang/hashbrown |
|
||||||
|
| hashbrown | 0.16.1 | MIT OR Apache-2.0 | https://github.com/rust-lang/hashbrown |
|
||||||
|
| hashbrown | 0.17.1 | MIT OR Apache-2.0 | https://github.com/rust-lang/hashbrown |
|
||||||
|
| heapless | 0.7.17 | MIT OR Apache-2.0 | https://github.com/japaric/heapless |
|
||||||
|
| heck | 0.5.0 | MIT OR Apache-2.0 | https://github.com/withoutboats/heck |
|
||||||
|
| hermit-abi | 0.5.2 | MIT OR Apache-2.0 | https://github.com/hermit-os/hermit-rs |
|
||||||
|
| hex | 0.4.3 | MIT OR Apache-2.0 | https://github.com/KokaKiwi/rust-hex |
|
||||||
|
| hex-conservative | 0.1.2 | CC0-1.0 | https://github.com/rust-bitcoin/hex-conservative |
|
||||||
|
| hex-conservative | 0.2.2 | CC0-1.0 | https://github.com/rust-bitcoin/hex-conservative |
|
||||||
|
| hex_lit | 0.1.1 | MITNFA | https://github.com/Kixunil/hex_lit |
|
||||||
|
| hickory-net | 0.26.1 | MIT OR Apache-2.0 | https://github.com/hickory-dns/hickory-dns |
|
||||||
|
| hickory-proto | 0.26.1 | MIT OR Apache-2.0 | https://github.com/hickory-dns/hickory-dns |
|
||||||
|
| hickory-resolver | 0.26.1 | MIT OR Apache-2.0 | https://github.com/hickory-dns/hickory-dns |
|
||||||
|
| hkdf | 0.12.4 | MIT OR Apache-2.0 | https://github.com/RustCrypto/KDFs/ |
|
||||||
|
| hmac | 0.12.1 | MIT OR Apache-2.0 | https://github.com/RustCrypto/MACs |
|
||||||
|
| http | 0.2.12 | MIT OR Apache-2.0 | https://github.com/hyperium/http |
|
||||||
|
| http | 1.4.0 | MIT OR Apache-2.0 | https://github.com/hyperium/http |
|
||||||
|
| http-body | 0.4.6 | MIT | https://github.com/hyperium/http-body |
|
||||||
|
| http-body | 1.0.1 | MIT | https://github.com/hyperium/http-body |
|
||||||
|
| http-body-util | 0.1.3 | MIT | https://github.com/hyperium/http-body |
|
||||||
|
| httparse | 1.10.1 | MIT OR Apache-2.0 | https://github.com/seanmonstar/httparse |
|
||||||
|
| httpdate | 1.0.3 | MIT OR Apache-2.0 | https://github.com/pyfisch/httpdate |
|
||||||
|
| humantime | 2.3.0 | MIT OR Apache-2.0 | https://github.com/chronotope/humantime |
|
||||||
|
| hybrid-array | 0.4.12 | MIT OR Apache-2.0 | https://github.com/RustCrypto/hybrid-array |
|
||||||
|
| hyper | 0.14.32 | MIT | https://github.com/hyperium/hyper |
|
||||||
|
| hyper | 1.8.1 | MIT | https://github.com/hyperium/hyper |
|
||||||
|
| hyper-rustls | 0.24.2 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/hyper-rustls |
|
||||||
|
| hyper-rustls | 0.27.9 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/hyper-rustls |
|
||||||
|
| hyper-util | 0.1.19 | MIT | https://github.com/hyperium/hyper-util |
|
||||||
|
| hyper-ws-listener | 0.3.0 | MIT | |
|
||||||
|
| iana-time-zone | 0.1.64 | MIT OR Apache-2.0 | https://github.com/strawlab/iana-time-zone |
|
||||||
|
| iana-time-zone-haiku | 0.1.2 | MIT OR Apache-2.0 | https://github.com/strawlab/iana-time-zone |
|
||||||
|
| icu_collections | 2.1.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| icu_locale_core | 2.1.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| icu_normalizer | 2.1.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| icu_normalizer_data | 2.1.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| icu_properties | 2.1.2 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| icu_properties_data | 2.1.2 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| icu_provider | 2.1.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| id-arena | 2.3.0 | MIT/Apache-2.0 | https://github.com/fitzgen/id-arena |
|
||||||
|
| ident_case | 1.0.1 | MIT/Apache-2.0 | https://github.com/TedDriggs/ident_case |
|
||||||
|
| identity-hash | 0.1.0 | Apache-2.0 OR MIT | https://github.com/offsetting/identity-hash |
|
||||||
|
| idna | 1.1.0 | MIT OR Apache-2.0 | https://github.com/servo/rust-url/ |
|
||||||
|
| idna_adapter | 1.2.1 | Apache-2.0 OR MIT | https://github.com/hsivonen/idna_adapter |
|
||||||
|
| if-addrs | 0.15.0 | MIT OR BSD-3-Clause | https://github.com/messense/if-addrs |
|
||||||
|
| igd-next | 0.17.1 | MIT | https://github.com/dariusc93/rust-igd |
|
||||||
|
| image | 0.25.9 | MIT OR Apache-2.0 | https://github.com/image-rs/image |
|
||||||
|
| indexmap | 2.13.0 | Apache-2.0 OR MIT | https://github.com/indexmap-rs/indexmap |
|
||||||
|
| inout | 0.1.4 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| inplace-vec-builder | 0.1.1 | MIT OR Apache-2.0 | https://github.com/rklaehn/inplace-vec-builder |
|
||||||
|
| instant | 0.1.13 | BSD-3-Clause | https://github.com/sebcrozet/instant |
|
||||||
|
| ipconfig | 0.3.4 | MIT/Apache-2.0 | https://github.com/liranringel/ipconfig |
|
||||||
|
| ipnet | 2.12.0 | MIT OR Apache-2.0 | https://github.com/krisprice/ipnet |
|
||||||
|
| iri-string | 0.7.12 | MIT OR Apache-2.0 | https://github.com/lo48576/iri-string |
|
||||||
|
| iroh | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh |
|
||||||
|
| iroh-base | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh |
|
||||||
|
| iroh-blobs | 0.103.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh-blobs |
|
||||||
|
| iroh-dns | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh |
|
||||||
|
| iroh-io | 0.6.2 | Apache-2.0 OR MIT | https://github.com/n0-computer/iroh |
|
||||||
|
| iroh-metrics | 1.0.1 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh-metrics |
|
||||||
|
| iroh-metrics-derive | 1.0.1 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh-metrics |
|
||||||
|
| iroh-relay | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh |
|
||||||
|
| iroh-tickets | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh-tickets |
|
||||||
|
| iroh-util | 0.6.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh-util |
|
||||||
|
| irpc | 0.17.0 | Apache-2.0/MIT | https://github.com/n0-computer/irpc |
|
||||||
|
| irpc-derive | 0.17.0 | Apache-2.0/MIT | https://github.com/n0-computer/irpc |
|
||||||
|
| is-terminal | 0.4.17 | MIT | https://github.com/sunfishcode/is-terminal |
|
||||||
|
| itoa | 1.0.17 | MIT OR Apache-2.0 | https://github.com/dtolnay/itoa |
|
||||||
|
| jni | 0.21.1 | MIT/Apache-2.0 | https://github.com/jni-rs/jni-rs |
|
||||||
|
| jni | 0.22.4 | MIT OR Apache-2.0 | https://github.com/jni-rs/jni-rs |
|
||||||
|
| jni-macros | 0.22.4 | MIT OR Apache-2.0 | https://github.com/jni-rs/jni-rs |
|
||||||
|
| jni-sys | 0.3.1 | MIT OR Apache-2.0 | https://github.com/jni-rs/jni-sys |
|
||||||
|
| jni-sys | 0.4.1 | MIT OR Apache-2.0 | https://github.com/jni-rs/jni-sys |
|
||||||
|
| jni-sys-macros | 0.4.1 | MIT OR Apache-2.0 | https://github.com/jni-rs/jni-sys |
|
||||||
|
| js-sys | 0.3.85 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/js-sys |
|
||||||
|
| lazy_static | 1.5.0 | MIT OR Apache-2.0 | https://github.com/rust-lang-nursery/lazy-static.rs |
|
||||||
|
| leb128fmt | 0.1.0 | MIT OR Apache-2.0 | https://github.com/bluk/leb128fmt |
|
||||||
|
| libc | 0.2.180 | MIT OR Apache-2.0 | https://github.com/rust-lang/libc |
|
||||||
|
| libm | 0.2.16 | MIT | https://github.com/rust-lang/compiler-builtins |
|
||||||
|
| libredox | 0.1.14 | MIT | https://gitlab.redox-os.org/redox-os/libredox.git |
|
||||||
|
| libssh2-sys | 0.3.1 | MIT OR Apache-2.0 | https://github.com/alexcrichton/ssh2-rs |
|
||||||
|
| libz-sys | 1.1.29 | MIT OR Apache-2.0 | https://github.com/rust-lang/libz-sys |
|
||||||
|
| linux-raw-sys | 0.11.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/sunfishcode/linux-raw-sys |
|
||||||
|
| litemap | 0.8.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| lock_api | 0.4.14 | MIT OR Apache-2.0 | https://github.com/Amanieu/parking_lot |
|
||||||
|
| log | 0.4.29 | MIT OR Apache-2.0 | https://github.com/rust-lang/log |
|
||||||
|
| loom | 0.7.2 | MIT | https://github.com/tokio-rs/loom |
|
||||||
|
| lru | 0.12.5 | MIT | https://github.com/jeromefroe/lru-rs.git |
|
||||||
|
| lru | 0.16.3 | MIT | https://github.com/jeromefroe/lru-rs.git |
|
||||||
|
| lru | 0.18.0 | MIT | https://github.com/jeromefroe/lru-rs.git |
|
||||||
|
| lru | 0.7.8 | MIT | https://github.com/jeromefroe/lru-rs.git |
|
||||||
|
| lru-slab | 0.1.2 | MIT OR Apache-2.0 OR Zlib | https://github.com/Ralith/lru-slab |
|
||||||
|
| mac-addr | 0.3.0 | MIT | https://github.com/shellrow/mac-addr |
|
||||||
|
| mainline | 2.0.1 | MIT | https://github.com/nuhvi/mainline |
|
||||||
|
| matchers | 0.2.0 | MIT | https://github.com/hawkw/matchers |
|
||||||
|
| mdns-sd | 0.18.2 | Apache-2.0 OR MIT | https://github.com/keepsimple1/mdns-sd |
|
||||||
|
| memchr | 2.7.6 | Unlicense OR MIT | https://github.com/BurntSushi/memchr |
|
||||||
|
| mime | 0.3.17 | MIT OR Apache-2.0 | https://github.com/hyperium/mime |
|
||||||
|
| minimal-lexical | 0.2.1 | MIT/Apache-2.0 | https://github.com/Alexhuszagh/minimal-lexical |
|
||||||
|
| miniz_oxide | 0.8.9 | MIT OR Zlib OR Apache-2.0 | https://github.com/Frommi/miniz_oxide/tree/master/miniz_oxide |
|
||||||
|
| mio | 1.1.1 | MIT | https://github.com/tokio-rs/mio |
|
||||||
|
| moka | 0.12.15 | (MIT OR Apache-2.0) AND Apache-2.0 | https://github.com/moka-rs/moka |
|
||||||
|
| moxcms | 0.7.11 | BSD-3-Clause OR Apache-2.0 | https://github.com/awxkee/moxcms.git |
|
||||||
|
| n0-error | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/n0-error |
|
||||||
|
| n0-error-macros | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/n0-error |
|
||||||
|
| n0-future | 0.3.2 | MIT OR Apache-2.0 | https://github.com/n0-computer/n0-future |
|
||||||
|
| n0-watcher | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/n0-watcher |
|
||||||
|
| ndk-context | 0.1.1 | MIT OR Apache-2.0 | https://github.com/rust-windowing/android-ndk-rs |
|
||||||
|
| negentropy | 0.5.0 | MIT | https://github.com/rust-nostr/negentropy.git |
|
||||||
|
| nested_enum_utils | 0.2.3 | MIT OR Apache-2.0 | https://github.com/n0-computer/nested-enum-utils |
|
||||||
|
| netdev | 0.44.0 | MIT | https://github.com/shellrow/netdev |
|
||||||
|
| netlink-packet-core | 0.8.1 | MIT | https://github.com/rust-netlink/netlink-packet-core |
|
||||||
|
| netlink-packet-route | 0.29.0 | MIT | https://github.com/rust-netlink/netlink-packet-route |
|
||||||
|
| netlink-packet-route | 0.31.0 | MIT | https://github.com/rust-netlink/netlink-packet-route |
|
||||||
|
| netlink-proto | 0.12.0 | MIT | https://github.com/rust-netlink/netlink-proto |
|
||||||
|
| netlink-sys | 0.8.8 | MIT | https://github.com/rust-netlink/netlink-sys |
|
||||||
|
| netwatch | 0.19.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/net-tools |
|
||||||
|
| nom | 7.1.3 | MIT | https://github.com/Geal/nom |
|
||||||
|
| noq | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/noq |
|
||||||
|
| noq-proto | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/noq |
|
||||||
|
| noq-udp | 1.0.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/noq |
|
||||||
|
| nostr | 0.44.2 | MIT | https://github.com/rust-nostr/nostr.git |
|
||||||
|
| nostr-database | 0.44.0 | MIT | https://github.com/rust-nostr/nostr.git |
|
||||||
|
| nostr-gossip | 0.44.0 | MIT | https://github.com/rust-nostr/nostr.git |
|
||||||
|
| nostr-relay-pool | 0.44.0 | MIT | https://github.com/rust-nostr/nostr.git |
|
||||||
|
| nostr-sdk | 0.44.1 | MIT | https://github.com/rust-nostr/nostr.git |
|
||||||
|
| nu-ansi-term | 0.50.3 | MIT | https://github.com/nushell/nu-ansi-term |
|
||||||
|
| num-bigint | 0.4.6 | MIT OR Apache-2.0 | https://github.com/rust-num/num-bigint |
|
||||||
|
| num-conv | 0.2.2 | MIT OR Apache-2.0 | https://github.com/jhpratt/num-conv |
|
||||||
|
| num-integer | 0.1.46 | MIT OR Apache-2.0 | https://github.com/rust-num/num-integer |
|
||||||
|
| num-traits | 0.2.19 | MIT OR Apache-2.0 | https://github.com/rust-num/num-traits |
|
||||||
|
| num_enum | 0.7.6 | BSD-3-Clause OR MIT OR Apache-2.0 | https://github.com/illicitonion/num_enum |
|
||||||
|
| num_enum_derive | 0.7.6 | BSD-3-Clause OR MIT OR Apache-2.0 | https://github.com/illicitonion/num_enum |
|
||||||
|
| num_threads | 0.1.7 | MIT OR Apache-2.0 | https://github.com/jhpratt/num_threads |
|
||||||
|
| objc2 | 0.6.4 | MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-core-foundation | 0.3.2 | Zlib OR Apache-2.0 OR MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-core-wlan | 0.3.2 | Zlib OR Apache-2.0 OR MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-encode | 4.1.0 | MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-foundation | 0.3.2 | MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-security | 0.3.2 | Zlib OR Apache-2.0 OR MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-security-foundation | 0.3.2 | Zlib OR Apache-2.0 OR MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| objc2-system-configuration | 0.3.2 | Zlib OR Apache-2.0 OR MIT | https://github.com/madsmtm/objc2 |
|
||||||
|
| oid-registry | 0.8.1 | MIT OR Apache-2.0 | https://github.com/rusticata/oid-registry.git |
|
||||||
|
| once_cell | 1.21.3 | MIT OR Apache-2.0 | https://github.com/matklad/once_cell |
|
||||||
|
| opaque-debug | 0.3.1 | MIT OR Apache-2.0 | https://github.com/RustCrypto/utils |
|
||||||
|
| openssl-probe | 0.2.1 | MIT OR Apache-2.0 | https://github.com/rustls/openssl-probe |
|
||||||
|
| openssl-sys | 0.9.117 | MIT | https://github.com/rust-openssl/rust-openssl |
|
||||||
|
| papaya | 0.2.4 | MIT | https://github.com/ibraheemdev/papaya |
|
||||||
|
| parking | 2.2.1 | Apache-2.0 OR MIT | https://github.com/smol-rs/parking |
|
||||||
|
| parking_lot | 0.11.2 | Apache-2.0/MIT | https://github.com/Amanieu/parking_lot |
|
||||||
|
| parking_lot | 0.12.5 | MIT OR Apache-2.0 | https://github.com/Amanieu/parking_lot |
|
||||||
|
| parking_lot_core | 0.8.6 | Apache-2.0/MIT | https://github.com/Amanieu/parking_lot |
|
||||||
|
| parking_lot_core | 0.9.12 | MIT OR Apache-2.0 | https://github.com/Amanieu/parking_lot |
|
||||||
|
| password-hash | 0.5.0 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits/tree/master/password-hash |
|
||||||
|
| paste | 1.0.15 | MIT OR Apache-2.0 | https://github.com/dtolnay/paste |
|
||||||
|
| pbkdf2 | 0.12.2 | MIT OR Apache-2.0 | https://github.com/RustCrypto/password-hashes/tree/master/pbkdf2 |
|
||||||
|
| pem | 3.0.6 | MIT | https://github.com/jcreekmore/pem-rs.git |
|
||||||
|
| pem-rfc7468 | 1.0.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| percent-encoding | 2.3.2 | MIT OR Apache-2.0 | https://github.com/servo/rust-url/ |
|
||||||
|
| pharos | 0.5.3 | Unlicense | https://github.com/najamelan/pharos |
|
||||||
|
| pin-project | 1.1.13 | Apache-2.0 OR MIT | https://github.com/taiki-e/pin-project |
|
||||||
|
| pin-project-internal | 1.1.13 | Apache-2.0 OR MIT | https://github.com/taiki-e/pin-project |
|
||||||
|
| pin-project-lite | 0.2.16 | Apache-2.0 OR MIT | https://github.com/taiki-e/pin-project-lite |
|
||||||
|
| pin-utils | 0.1.0 | MIT OR Apache-2.0 | https://github.com/rust-lang-nursery/pin-utils |
|
||||||
|
| pkcs8 | 0.10.2 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats/tree/master/pkcs8 |
|
||||||
|
| pkcs8 | 0.11.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| pkg-config | 0.3.33 | MIT OR Apache-2.0 | https://github.com/rust-lang/pkg-config-rs |
|
||||||
|
| plain | 0.2.3 | MIT/Apache-2.0 | https://github.com/randomites/plain |
|
||||||
|
| plist | 1.9.0 | MIT | https://github.com/ebarnard/rust-plist/ |
|
||||||
|
| poly1305 | 0.8.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/universal-hashes |
|
||||||
|
| polyval | 0.6.2 | Apache-2.0 OR MIT | https://github.com/RustCrypto/universal-hashes |
|
||||||
|
| portable-atomic | 1.13.1 | Apache-2.0 OR MIT | https://github.com/taiki-e/portable-atomic |
|
||||||
|
| portmapper | 0.19.0 | MIT OR Apache-2.0 | https://github.com/n0-computer/net-tools |
|
||||||
|
| positioned-io | 0.3.5 | MIT | https://github.com/vasi/positioned-io |
|
||||||
|
| postcard | 1.1.3 | MIT OR Apache-2.0 | https://github.com/jamesmunns/postcard |
|
||||||
|
| postcard-derive | 0.2.2 | MIT OR Apache-2.0 | https://github.com/jamesmunns/postcard |
|
||||||
|
| potential_utf | 0.1.4 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| powerfmt | 0.2.0 | MIT OR Apache-2.0 | https://github.com/jhpratt/powerfmt |
|
||||||
|
| ppv-lite86 | 0.2.21 | MIT OR Apache-2.0 | https://github.com/cryptocorrosion/cryptocorrosion |
|
||||||
|
| prefix-trie | 0.8.4 | MIT OR Apache-2.0 | https://github.com/tiborschneider/prefix-trie |
|
||||||
|
| prettyplease | 0.2.37 | MIT OR Apache-2.0 | https://github.com/dtolnay/prettyplease |
|
||||||
|
| proc-macro-crate | 3.5.0 | MIT OR Apache-2.0 | https://github.com/bkchr/proc-macro-crate |
|
||||||
|
| proc-macro-error | 0.4.12 | MIT OR Apache-2.0 | https://gitlab.com/CreepySkeleton/proc-macro-error |
|
||||||
|
| proc-macro-error-attr | 0.4.12 | MIT OR Apache-2.0 | https://gitlab.com/CreepySkeleton/proc-macro-error |
|
||||||
|
| proc-macro-hack | 0.5.20+deprecated | MIT OR Apache-2.0 | https://github.com/dtolnay/proc-macro-hack |
|
||||||
|
| proc-macro2 | 1.0.106 | MIT OR Apache-2.0 | https://github.com/dtolnay/proc-macro2 |
|
||||||
|
| pxfm | 0.1.28 | BSD-3-Clause OR Apache-2.0 | https://github.com/awxkee/pxfm |
|
||||||
|
| qrcode | 0.14.1 | MIT OR Apache-2.0 | https://github.com/kennytm/qrcode-rust |
|
||||||
|
| quick-xml | 0.39.4 | MIT | https://github.com/tafia/quick-xml |
|
||||||
|
| quote | 1.0.44 | MIT OR Apache-2.0 | https://github.com/dtolnay/quote |
|
||||||
|
| r-efi | 5.3.0 | MIT OR Apache-2.0 OR LGPL-2.1-or-later | https://github.com/r-efi/r-efi |
|
||||||
|
| r-efi | 6.0.0 | MIT OR Apache-2.0 OR LGPL-2.1-or-later | https://github.com/r-efi/r-efi |
|
||||||
|
| rand | 0.10.1 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand | 0.8.5 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand | 0.9.2 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand_chacha | 0.3.1 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand_chacha | 0.9.0 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand_core | 0.10.1 | MIT OR Apache-2.0 | https://github.com/rust-random/rand_core |
|
||||||
|
| rand_core | 0.6.4 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand_core | 0.9.5 | MIT OR Apache-2.0 | https://github.com/rust-random/rand |
|
||||||
|
| rand_pcg | 0.10.2 | MIT OR Apache-2.0 | https://github.com/rust-random/rngs |
|
||||||
|
| range-collections | 0.4.6 | MIT OR Apache-2.0 | https://github.com/rklaehn/range-collections |
|
||||||
|
| rcgen | 0.14.8 | MIT OR Apache-2.0 | https://github.com/rustls/rcgen |
|
||||||
|
| redb | 4.1.0 | MIT OR Apache-2.0 | https://github.com/cberner/redb |
|
||||||
|
| redox_syscall | 0.2.16 | MIT | https://gitlab.redox-os.org/redox-os/syscall |
|
||||||
|
| redox_syscall | 0.5.18 | MIT | https://gitlab.redox-os.org/redox-os/syscall |
|
||||||
|
| redox_syscall | 0.7.3 | MIT | https://gitlab.redox-os.org/redox-os/syscall |
|
||||||
|
| reed-solomon-erasure | 6.0.0 | MIT | https://github.com/darrenldl/reed-solomon-erasure |
|
||||||
|
| ref-cast | 1.0.25 | MIT OR Apache-2.0 | https://github.com/dtolnay/ref-cast |
|
||||||
|
| ref-cast-impl | 1.0.25 | MIT OR Apache-2.0 | https://github.com/dtolnay/ref-cast |
|
||||||
|
| reflink-copy | 0.1.29 | MIT/Apache-2.0 | https://github.com/cargo-bins/reflink-copy |
|
||||||
|
| regex | 1.12.2 | MIT OR Apache-2.0 | https://github.com/rust-lang/regex |
|
||||||
|
| regex-automata | 0.4.13 | MIT OR Apache-2.0 | https://github.com/rust-lang/regex |
|
||||||
|
| regex-syntax | 0.8.8 | MIT OR Apache-2.0 | https://github.com/rust-lang/regex |
|
||||||
|
| reqwest | 0.11.27 | MIT OR Apache-2.0 | https://github.com/seanmonstar/reqwest |
|
||||||
|
| reqwest | 0.13.4 | MIT OR Apache-2.0 | https://github.com/seanmonstar/reqwest |
|
||||||
|
| resolv-conf | 0.7.6 | MIT OR Apache-2.0 | https://github.com/hickory-dns/resolv-conf |
|
||||||
|
| ring | 0.17.14 | Apache-2.0 AND ISC | https://github.com/briansmith/ring |
|
||||||
|
| rustc-hash | 2.1.2 | Apache-2.0 OR MIT | https://github.com/rust-lang/rustc-hash |
|
||||||
|
| rustc_version | 0.4.1 | MIT OR Apache-2.0 | https://github.com/djc/rustc-version-rs |
|
||||||
|
| rusticata-macros | 4.1.0 | MIT/Apache-2.0 | https://github.com/rusticata/rusticata-macros.git |
|
||||||
|
| rustix | 1.1.3 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/rustix |
|
||||||
|
| rustls | 0.21.12 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/rustls |
|
||||||
|
| rustls | 0.23.36 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/rustls |
|
||||||
|
| rustls-native-certs | 0.8.4 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/rustls-native-certs |
|
||||||
|
| rustls-pemfile | 1.0.4 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/pemfile |
|
||||||
|
| rustls-pki-types | 1.14.0 | MIT OR Apache-2.0 | https://github.com/rustls/pki-types |
|
||||||
|
| rustls-platform-verifier | 0.7.0 | MIT OR Apache-2.0 | https://github.com/rustls/rustls-platform-verifier |
|
||||||
|
| rustls-platform-verifier-android | 0.1.1 | MIT OR Apache-2.0 | https://github.com/rustls/rustls-platform-verifier |
|
||||||
|
| rustls-webpki | 0.101.7 | ISC | https://github.com/rustls/webpki |
|
||||||
|
| rustls-webpki | 0.103.9 | ISC | https://github.com/rustls/webpki |
|
||||||
|
| rustversion | 1.0.22 | MIT OR Apache-2.0 | https://github.com/dtolnay/rustversion |
|
||||||
|
| ryu | 1.0.22 | Apache-2.0 OR BSL-1.0 | https://github.com/dtolnay/ryu |
|
||||||
|
| salsa20 | 0.10.2 | MIT OR Apache-2.0 | https://github.com/RustCrypto/stream-ciphers |
|
||||||
|
| same-file | 1.0.6 | Unlicense/MIT | https://github.com/BurntSushi/same-file |
|
||||||
|
| schannel | 0.1.29 | MIT | https://github.com/steffengy/schannel-rs |
|
||||||
|
| scoped-tls | 1.0.1 | MIT/Apache-2.0 | https://github.com/alexcrichton/scoped-tls |
|
||||||
|
| scopeguard | 1.2.0 | MIT OR Apache-2.0 | https://github.com/bluss/scopeguard |
|
||||||
|
| scrypt | 0.11.0 | MIT OR Apache-2.0 | https://github.com/RustCrypto/password-hashes/tree/master/scrypt |
|
||||||
|
| sct | 0.7.1 | Apache-2.0 OR ISC OR MIT | https://github.com/rustls/sct.rs |
|
||||||
|
| sd-notify | 0.4.5 | MIT OR Apache-2.0 | https://github.com/lnicola/sd-notify |
|
||||||
|
| secp256k1 | 0.29.1 | CC0-1.0 | https://github.com/rust-bitcoin/rust-secp256k1/ |
|
||||||
|
| secp256k1-sys | 0.10.1 | CC0-1.0 | https://github.com/rust-bitcoin/rust-secp256k1/ |
|
||||||
|
| security-framework | 3.7.0 | MIT OR Apache-2.0 | https://github.com/kornelski/rust-security-framework |
|
||||||
|
| security-framework-sys | 2.17.0 | MIT OR Apache-2.0 | https://github.com/kornelski/rust-security-framework |
|
||||||
|
| seize | 0.5.1 | MIT | https://github.com/ibraheemdev/seize |
|
||||||
|
| self_cell | 1.2.2 | Apache-2.0 OR GPL-2.0-only | https://github.com/Voultapher/self_cell |
|
||||||
|
| semver | 1.0.27 | MIT OR Apache-2.0 | https://github.com/dtolnay/semver |
|
||||||
|
| send_wrapper | 0.6.0 | MIT/Apache-2.0 | https://github.com/thk1/send_wrapper |
|
||||||
|
| serde | 1.0.228 | MIT OR Apache-2.0 | https://github.com/serde-rs/serde |
|
||||||
|
| serde_bencode | 0.2.4 | MIT | https://github.com/toby/serde-bencode |
|
||||||
|
| serde_bytes | 0.11.19 | MIT OR Apache-2.0 | https://github.com/serde-rs/bytes |
|
||||||
|
| serde_core | 1.0.228 | MIT OR Apache-2.0 | https://github.com/serde-rs/serde |
|
||||||
|
| serde_derive | 1.0.228 | MIT OR Apache-2.0 | https://github.com/serde-rs/serde |
|
||||||
|
| serde_json | 1.0.149 | MIT OR Apache-2.0 | https://github.com/serde-rs/json |
|
||||||
|
| serde_spanned | 0.6.9 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| serde_urlencoded | 0.7.1 | MIT/Apache-2.0 | https://github.com/nox/serde_urlencoded |
|
||||||
|
| serde_yaml | 0.9.34+deprecated | MIT OR Apache-2.0 | https://github.com/dtolnay/serde-yaml |
|
||||||
|
| serdect | 0.4.3 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| serial2 | 0.2.34 | BSD-2-Clause OR Apache-2.0 | https://github.com/de-vri-es/serial2-rs |
|
||||||
|
| serial2-tokio | 0.1.21 | BSD-2-Clause OR Apache-2.0 | https://github.com/de-vri-es/serial2-tokio-rs |
|
||||||
|
| sha-1 | 0.10.1 | MIT OR Apache-2.0 | https://github.com/RustCrypto/hashes |
|
||||||
|
| sha1 | 0.10.6 | MIT OR Apache-2.0 | https://github.com/RustCrypto/hashes |
|
||||||
|
| sha1_smol | 1.0.1 | BSD-3-Clause | https://github.com/mitsuhiko/sha1-smol |
|
||||||
|
| sha2 | 0.10.9 | MIT OR Apache-2.0 | https://github.com/RustCrypto/hashes |
|
||||||
|
| sha2 | 0.11.0 | MIT OR Apache-2.0 | https://github.com/RustCrypto/hashes |
|
||||||
|
| sharded-slab | 0.1.7 | MIT | https://github.com/hawkw/sharded-slab |
|
||||||
|
| shlex | 1.3.0 | MIT OR Apache-2.0 | https://github.com/comex/rust-shlex |
|
||||||
|
| signal-hook-registry | 1.4.8 | MIT OR Apache-2.0 | https://github.com/vorner/signal-hook |
|
||||||
|
| signature | 2.2.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/traits/tree/master/signature |
|
||||||
|
| signature | 3.0.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/traits |
|
||||||
|
| simd-adler32 | 0.3.8 | MIT | https://github.com/mcountryman/simd-adler32 |
|
||||||
|
| simd_cesu8 | 1.1.1 | Apache-2.0 OR MIT | https://github.com/seancroach/simd_cesu8 |
|
||||||
|
| simdutf8 | 0.1.5 | MIT OR Apache-2.0 | https://github.com/rusticstuff/simdutf8 |
|
||||||
|
| simple-dns | 0.11.3 | MIT | https://github.com/balliegojr/simple-dns |
|
||||||
|
| siphasher | 1.0.3 | MIT/Apache-2.0 | https://github.com/jedisct1/rust-siphash |
|
||||||
|
| slab | 0.4.11 | MIT | https://github.com/tokio-rs/slab |
|
||||||
|
| smallvec | 1.15.1 | MIT OR Apache-2.0 | https://github.com/servo/rust-smallvec |
|
||||||
|
| socket-pktinfo | 0.3.2 | MIT | https://github.com/pixsper/socket-pktinfo |
|
||||||
|
| socket2 | 0.5.10 | MIT OR Apache-2.0 | https://github.com/rust-lang/socket2 |
|
||||||
|
| socket2 | 0.6.2 | MIT OR Apache-2.0 | https://github.com/rust-lang/socket2 |
|
||||||
|
| sorted-index-buffer | 0.2.1 | MIT OR Apache-2.0 | https://github.com/n0-computer/iroh |
|
||||||
|
| spez | 0.1.2 | BSD-2-Clause | https://github.com/m-ou-se/spez |
|
||||||
|
| spin | 0.10.0 | MIT | https://github.com/mvdnes/spin-rs.git |
|
||||||
|
| spin | 0.9.8 | MIT | https://github.com/mvdnes/spin-rs.git |
|
||||||
|
| spki | 0.7.3 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats/tree/master/spki |
|
||||||
|
| spki | 0.8.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/formats |
|
||||||
|
| ssh2 | 0.9.5 | MIT OR Apache-2.0 | https://github.com/alexcrichton/ssh2-rs |
|
||||||
|
| stable_deref_trait | 1.2.1 | MIT OR Apache-2.0 | https://github.com/storyyeller/stable_deref_trait |
|
||||||
|
| strsim | 0.11.1 | MIT | https://github.com/rapidfuzz/strsim-rs |
|
||||||
|
| strum | 0.28.0 | MIT | https://github.com/Peternator7/strum |
|
||||||
|
| strum_macros | 0.28.0 | MIT | https://github.com/Peternator7/strum |
|
||||||
|
| subtle | 2.6.1 | BSD-3-Clause | https://github.com/dalek-cryptography/subtle |
|
||||||
|
| syn | 1.0.109 | MIT OR Apache-2.0 | https://github.com/dtolnay/syn |
|
||||||
|
| syn | 2.0.114 | MIT OR Apache-2.0 | https://github.com/dtolnay/syn |
|
||||||
|
| syn-mid | 0.5.4 | Apache-2.0 OR MIT | https://github.com/taiki-e/syn-mid |
|
||||||
|
| sync_wrapper | 0.1.2 | Apache-2.0 | https://github.com/Actyx/sync_wrapper |
|
||||||
|
| sync_wrapper | 1.0.2 | Apache-2.0 | https://github.com/Actyx/sync_wrapper |
|
||||||
|
| synstructure | 0.13.2 | MIT | https://github.com/mystor/synstructure |
|
||||||
|
| system-configuration | 0.5.1 | MIT OR Apache-2.0 | https://github.com/mullvad/system-configuration-rs |
|
||||||
|
| system-configuration | 0.6.1 | MIT OR Apache-2.0 | https://github.com/mullvad/system-configuration-rs |
|
||||||
|
| system-configuration | 0.7.0 | MIT OR Apache-2.0 | https://github.com/mullvad/system-configuration-rs |
|
||||||
|
| system-configuration-sys | 0.5.0 | MIT OR Apache-2.0 | https://github.com/mullvad/system-configuration-rs |
|
||||||
|
| system-configuration-sys | 0.6.0 | MIT OR Apache-2.0 | https://github.com/mullvad/system-configuration-rs |
|
||||||
|
| tagptr | 0.2.0 | MIT/Apache-2.0 | https://github.com/oliver-giersch/tagptr.git |
|
||||||
|
| tar | 0.4.44 | MIT OR Apache-2.0 | https://github.com/alexcrichton/tar-rs |
|
||||||
|
| tempfile | 3.24.0 | MIT OR Apache-2.0 | https://github.com/Stebalien/tempfile |
|
||||||
|
| termcolor | 1.4.1 | Unlicense OR MIT | https://github.com/BurntSushi/termcolor |
|
||||||
|
| thiserror | 1.0.69 | MIT OR Apache-2.0 | https://github.com/dtolnay/thiserror |
|
||||||
|
| thiserror | 2.0.18 | MIT OR Apache-2.0 | https://github.com/dtolnay/thiserror |
|
||||||
|
| thiserror-impl | 1.0.69 | MIT OR Apache-2.0 | https://github.com/dtolnay/thiserror |
|
||||||
|
| thiserror-impl | 2.0.18 | MIT OR Apache-2.0 | https://github.com/dtolnay/thiserror |
|
||||||
|
| thread_local | 1.1.9 | MIT OR Apache-2.0 | https://github.com/Amanieu/thread_local-rs |
|
||||||
|
| time | 0.3.49 | MIT OR Apache-2.0 | https://github.com/time-rs/time |
|
||||||
|
| time-core | 0.1.9 | MIT OR Apache-2.0 | https://github.com/time-rs/time |
|
||||||
|
| time-macros | 0.2.29 | MIT OR Apache-2.0 | https://github.com/time-rs/time |
|
||||||
|
| tinystr | 0.8.2 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| tinyvec | 1.10.0 | Zlib OR Apache-2.0 OR MIT | https://github.com/Lokathor/tinyvec |
|
||||||
|
| tinyvec_macros | 0.1.1 | MIT OR Apache-2.0 OR Zlib | https://github.com/Soveu/tinyvec_macros |
|
||||||
|
| tokio | 1.49.0 | MIT | https://github.com/tokio-rs/tokio |
|
||||||
|
| tokio-macros | 2.6.0 | MIT | https://github.com/tokio-rs/tokio |
|
||||||
|
| tokio-rustls | 0.24.1 | MIT/Apache-2.0 | https://github.com/rustls/tokio-rustls |
|
||||||
|
| tokio-rustls | 0.26.4 | MIT OR Apache-2.0 | https://github.com/rustls/tokio-rustls |
|
||||||
|
| tokio-socks | 0.5.2 | MIT | https://github.com/sticnarf/tokio-socks |
|
||||||
|
| tokio-stream | 0.1.18 | MIT | https://github.com/tokio-rs/tokio |
|
||||||
|
| tokio-test | 0.4.5 | MIT | https://github.com/tokio-rs/tokio |
|
||||||
|
| tokio-tungstenite | 0.20.1 | MIT | https://github.com/snapview/tokio-tungstenite |
|
||||||
|
| tokio-tungstenite | 0.26.2 | MIT | https://github.com/snapview/tokio-tungstenite |
|
||||||
|
| tokio-util | 0.7.18 | MIT | https://github.com/tokio-rs/tokio |
|
||||||
|
| tokio-websockets | 0.13.2 | MIT | https://github.com/Gelbpunkt/tokio-websockets/ |
|
||||||
|
| toml | 0.8.23 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| toml_datetime | 0.6.11 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| toml_datetime | 1.1.1+spec-1.1.0 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| toml_edit | 0.22.27 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| toml_edit | 0.25.12+spec-1.1.0 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| toml_parser | 1.1.2+spec-1.1.0 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| toml_write | 0.1.2 | MIT OR Apache-2.0 | https://github.com/toml-rs/toml |
|
||||||
|
| totp-rs | 5.7.0 | MIT | https://github.com/constantoine/totp-rs |
|
||||||
|
| tower | 0.5.3 | MIT | https://github.com/tower-rs/tower |
|
||||||
|
| tower-http | 0.6.8 | MIT | https://github.com/tower-rs/tower-http |
|
||||||
|
| tower-layer | 0.3.3 | MIT | https://github.com/tower-rs/tower |
|
||||||
|
| tower-service | 0.3.3 | MIT | https://github.com/tower-rs/tower |
|
||||||
|
| tracing | 0.1.44 | MIT | https://github.com/tokio-rs/tracing |
|
||||||
|
| tracing-attributes | 0.1.31 | MIT | https://github.com/tokio-rs/tracing |
|
||||||
|
| tracing-core | 0.1.36 | MIT | https://github.com/tokio-rs/tracing |
|
||||||
|
| tracing-log | 0.2.0 | MIT | https://github.com/tokio-rs/tracing |
|
||||||
|
| tracing-subscriber | 0.3.22 | MIT | https://github.com/tokio-rs/tracing |
|
||||||
|
| try-lock | 0.2.5 | MIT | https://github.com/seanmonstar/try-lock |
|
||||||
|
| tungstenite | 0.20.1 | MIT OR Apache-2.0 | https://github.com/snapview/tungstenite-rs |
|
||||||
|
| tungstenite | 0.26.2 | MIT OR Apache-2.0 | https://github.com/snapview/tungstenite-rs |
|
||||||
|
| typenum | 1.20.1 | MIT OR Apache-2.0 | https://github.com/paholg/typenum |
|
||||||
|
| unicode-ident | 1.0.22 | (MIT OR Apache-2.0) AND Unicode-3.0 | https://github.com/dtolnay/unicode-ident |
|
||||||
|
| unicode-normalization | 0.1.22 | MIT/Apache-2.0 | https://github.com/unicode-rs/unicode-normalization |
|
||||||
|
| unicode-segmentation | 1.13.3 | MIT OR Apache-2.0 | https://github.com/unicode-rs/unicode-segmentation |
|
||||||
|
| unicode-xid | 0.2.6 | MIT OR Apache-2.0 | https://github.com/unicode-rs/unicode-xid |
|
||||||
|
| universal-hash | 0.5.1 | MIT OR Apache-2.0 | https://github.com/RustCrypto/traits |
|
||||||
|
| unsafe-libyaml | 0.2.11 | MIT | https://github.com/dtolnay/unsafe-libyaml |
|
||||||
|
| untrusted | 0.9.0 | ISC | https://github.com/briansmith/untrusted |
|
||||||
|
| url | 2.5.8 | MIT OR Apache-2.0 | https://github.com/servo/rust-url |
|
||||||
|
| urlencoding | 2.1.3 | MIT | https://github.com/kornelski/rust_urlencoding |
|
||||||
|
| utf-8 | 0.7.6 | MIT OR Apache-2.0 | https://github.com/SimonSapin/rust-utf8 |
|
||||||
|
| utf8_iter | 1.0.4 | Apache-2.0 OR MIT | https://github.com/hsivonen/utf8_iter |
|
||||||
|
| uuid | 1.19.0 | Apache-2.0 OR MIT | https://github.com/uuid-rs/uuid |
|
||||||
|
| valuable | 0.1.1 | MIT | https://github.com/tokio-rs/valuable |
|
||||||
|
| vcpkg | 0.2.15 | MIT/Apache-2.0 | https://github.com/mcgoo/vcpkg-rs |
|
||||||
|
| vergen | 9.1.0 | MIT OR Apache-2.0 | https://github.com/rustyhorde/vergen |
|
||||||
|
| vergen-gitcl | 9.1.0 | MIT OR Apache-2.0 | https://github.com/rustyhorde/vergen |
|
||||||
|
| vergen-lib | 9.1.0 | MIT OR Apache-2.0 | https://github.com/rustyhorde/vergen |
|
||||||
|
| version_check | 0.9.5 | MIT/Apache-2.0 | https://github.com/SergioBenitez/version_check |
|
||||||
|
| walkdir | 2.5.0 | Unlicense/MIT | https://github.com/BurntSushi/walkdir |
|
||||||
|
| want | 0.3.1 | MIT | https://github.com/seanmonstar/want |
|
||||||
|
| wasi | 0.11.1+wasi-snapshot-preview1 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasi |
|
||||||
|
| wasip2 | 1.0.2+wasi-0.2.9 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasi-rs |
|
||||||
|
| wasip3 | 0.4.0+wasi-0.3.0-rc-2026-01-06 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasi-rs |
|
||||||
|
| wasm-bindgen | 0.2.108 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen |
|
||||||
|
| wasm-bindgen-futures | 0.4.58 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/futures |
|
||||||
|
| wasm-bindgen-macro | 0.2.108 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro |
|
||||||
|
| wasm-bindgen-macro-support | 0.2.108 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/macro-support |
|
||||||
|
| wasm-bindgen-shared | 0.2.108 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/shared |
|
||||||
|
| wasm-encoder | 0.244.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-encoder |
|
||||||
|
| wasm-metadata | 0.244.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasm-metadata |
|
||||||
|
| wasm-streams | 0.4.2 | MIT OR Apache-2.0 | https://github.com/MattiasBuelens/wasm-streams/ |
|
||||||
|
| wasm-streams | 0.5.0 | MIT OR Apache-2.0 | https://github.com/MattiasBuelens/wasm-streams/ |
|
||||||
|
| wasmparser | 0.244.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wasmparser |
|
||||||
|
| web-sys | 0.3.85 | MIT OR Apache-2.0 | https://github.com/wasm-bindgen/wasm-bindgen/tree/master/crates/web-sys |
|
||||||
|
| web-time | 1.1.0 | MIT OR Apache-2.0 | https://github.com/daxpedda/web-time |
|
||||||
|
| webpki-root-certs | 1.0.7 | CDLA-Permissive-2.0 | https://github.com/rustls/webpki-roots |
|
||||||
|
| webpki-roots | 0.25.4 | MPL-2.0 | https://github.com/rustls/webpki-roots |
|
||||||
|
| webpki-roots | 0.26.11 | CDLA-Permissive-2.0 | https://github.com/rustls/webpki-roots |
|
||||||
|
| webpki-roots | 1.0.6 | CDLA-Permissive-2.0 | https://github.com/rustls/webpki-roots |
|
||||||
|
| widestring | 1.2.1 | MIT OR Apache-2.0 | https://github.com/VoidStarKat/widestring-rs |
|
||||||
|
| winapi | 0.3.9 | MIT/Apache-2.0 | https://github.com/retep998/winapi-rs |
|
||||||
|
| winapi-i686-pc-windows-gnu | 0.4.0 | MIT/Apache-2.0 | https://github.com/retep998/winapi-rs |
|
||||||
|
| winapi-util | 0.1.11 | Unlicense OR MIT | https://github.com/BurntSushi/winapi-util |
|
||||||
|
| winapi-x86_64-pc-windows-gnu | 0.4.0 | MIT/Apache-2.0 | https://github.com/retep998/winapi-rs |
|
||||||
|
| windows | 0.62.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-collections | 0.3.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-core | 0.62.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-future | 0.3.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-implement | 0.60.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-interface | 0.59.3 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-link | 0.2.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-numerics | 0.3.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-registry | 0.6.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-result | 0.4.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-strings | 0.5.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-sys | 0.45.0 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-sys | 0.48.0 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-sys | 0.52.0 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-sys | 0.60.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-sys | 0.61.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-targets | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-targets | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-targets | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-targets | 0.53.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows-threading | 0.2.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_gnullvm | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_gnullvm | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_gnullvm | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_gnullvm | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_msvc | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_msvc | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_msvc | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_aarch64_msvc | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_gnu | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_gnu | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_gnu | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_gnu | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_gnullvm | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_gnullvm | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_msvc | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_msvc | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_msvc | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_i686_msvc | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnu | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnu | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnu | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnu | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnullvm | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnullvm | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnullvm | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_gnullvm | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_msvc | 0.42.2 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_msvc | 0.48.5 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_msvc | 0.52.6 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| windows_x86_64_msvc | 0.53.1 | MIT OR Apache-2.0 | https://github.com/microsoft/windows-rs |
|
||||||
|
| winnow | 0.7.14 | MIT | https://github.com/winnow-rs/winnow |
|
||||||
|
| winnow | 1.0.3 | MIT | https://github.com/winnow-rs/winnow |
|
||||||
|
| winreg | 0.50.0 | MIT | https://github.com/gentoo90/winreg-rs |
|
||||||
|
| wit-bindgen | 0.51.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wit-bindgen |
|
||||||
|
| wit-bindgen-core | 0.51.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wit-bindgen |
|
||||||
|
| wit-bindgen-rust | 0.51.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wit-bindgen |
|
||||||
|
| wit-bindgen-rust-macro | 0.51.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wit-bindgen |
|
||||||
|
| wit-component | 0.244.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-component |
|
||||||
|
| wit-parser | 0.244.0 | Apache-2.0 WITH LLVM-exception OR Apache-2.0 OR MIT | https://github.com/bytecodealliance/wasm-tools/tree/main/crates/wit-parser |
|
||||||
|
| wmi | 0.18.4 | MIT OR Apache-2.0 | https://github.com/ohadravid/wmi-rs |
|
||||||
|
| writeable | 0.6.2 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| ws_stream_wasm | 0.7.5 | Unlicense | https://github.com/najamelan/ws_stream_wasm |
|
||||||
|
| x509-parser | 0.18.1 | MIT OR Apache-2.0 | https://github.com/rusticata/x509-parser.git |
|
||||||
|
| xattr | 1.6.1 | MIT OR Apache-2.0 | https://github.com/Stebalien/xattr |
|
||||||
|
| xml-rs | 0.8.28 | MIT | https://github.com/kornelski/xml-rs |
|
||||||
|
| xmltree | 0.10.3 | MIT | https://github.com/eminence/xmltree-rs |
|
||||||
|
| yasna | 0.6.0 | MIT OR Apache-2.0 | https://github.com/qnighy/yasna.rs |
|
||||||
|
| yoke | 0.8.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| yoke-derive | 0.8.1 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| zbase32 | 0.1.2 | LGPL-3.0+ | https://gitlab.com/pgerber/zbase32-rust |
|
||||||
|
| zerocopy | 0.8.33 | BSD-2-Clause OR Apache-2.0 OR MIT | https://github.com/google/zerocopy |
|
||||||
|
| zerocopy-derive | 0.8.33 | BSD-2-Clause OR Apache-2.0 OR MIT | https://github.com/google/zerocopy |
|
||||||
|
| zerofrom | 0.1.6 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| zerofrom-derive | 0.1.6 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| zeroize | 1.9.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/utils |
|
||||||
|
| zeroize_derive | 1.5.0 | Apache-2.0 OR MIT | https://github.com/RustCrypto/utils |
|
||||||
|
| zerotrie | 0.2.3 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| zerovec | 0.11.5 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| zerovec-derive | 0.11.2 | Unicode-3.0 | https://github.com/unicode-org/icu4x |
|
||||||
|
| zmij | 1.0.16 | MIT | https://github.com/dtolnay/zmij |
|
||||||
@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "archipelago"
|
name = "archipelago"
|
||||||
version = "1.7.111-alpha"
|
version = "1.7.116-alpha"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "Archipelago Bitcoin Node OS - Native backend"
|
description = "Archipelago Bitcoin Node OS - Native backend"
|
||||||
authors = ["Archipelago Team"]
|
authors = ["Archipelago Team"]
|
||||||
|
|||||||
@ -202,7 +202,9 @@ impl ApiHandler {
|
|||||||
return Ok(build_response(
|
return Ok(build_response(
|
||||||
StatusCode::BAD_REQUEST,
|
StatusCode::BAD_REQUEST,
|
||||||
"application/json",
|
"application/json",
|
||||||
hyper::Body::from(r#"{"error":"The seller does not accept Lightning for this item"}"#),
|
hyper::Body::from(
|
||||||
|
r#"{"error":"The seller does not accept Lightning for this item"}"#,
|
||||||
|
),
|
||||||
));
|
));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -279,6 +279,7 @@ impl RpcHandler {
|
|||||||
.service(crate::settings::transport::PeerService::PeerFiles)
|
.service(crate::settings::transport::PeerService::PeerFiles)
|
||||||
.header("X-Federation-DID", local_did)
|
.header("X-Federation-DID", local_did)
|
||||||
.timeout(std::time::Duration::from_secs(120))
|
.timeout(std::time::Duration::from_secs(120))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(8))
|
||||||
.send_get()
|
.send_get()
|
||||||
.await
|
.await
|
||||||
.context("Failed to connect to peer")?;
|
.context("Failed to connect to peer")?;
|
||||||
@ -364,6 +365,11 @@ impl RpcHandler {
|
|||||||
crate::fips::dial::PeerRequest::new(fips_npub.as_deref(), onion, "/content")
|
crate::fips::dial::PeerRequest::new(fips_npub.as_deref(), onion, "/content")
|
||||||
.service(crate::settings::transport::PeerService::PeerFiles)
|
.service(crate::settings::transport::PeerService::PeerFiles)
|
||||||
.timeout(std::time::Duration::from_secs(30))
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
// The Cloud page's hottest call: without a fast-fail cap a
|
||||||
|
// cold FIPS path burned ~16.6s before Tor even started,
|
||||||
|
// against the UI's 30s deadline — users saw errors, not
|
||||||
|
// fallback.
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6))
|
||||||
.send_get()
|
.send_get()
|
||||||
.await
|
.await
|
||||||
.context("Failed to connect to peer")?;
|
.context("Failed to connect to peer")?;
|
||||||
@ -443,8 +449,7 @@ impl RpcHandler {
|
|||||||
&& (o.content_id == content_id
|
&& (o.content_id == content_id
|
||||||
|| filename.is_some_and(|f| {
|
|| filename.is_some_and(|f| {
|
||||||
!f.is_empty()
|
!f.is_empty()
|
||||||
&& o.filename.trim_start_matches('/')
|
&& o.filename.trim_start_matches('/') == f.trim_start_matches('/')
|
||||||
== f.trim_start_matches('/')
|
|
||||||
}))
|
}))
|
||||||
});
|
});
|
||||||
if let Some(o) = already {
|
if let Some(o) = already {
|
||||||
@ -454,12 +459,9 @@ impl RpcHandler {
|
|||||||
owned_as = %o.content_id,
|
owned_as = %o.content_id,
|
||||||
"paid download: already owned — serving cached copy, NOT paying again"
|
"paid download: already owned — serving cached copy, NOT paying again"
|
||||||
);
|
);
|
||||||
if let Some((mime, bytes)) = crate::content_owned::read_owned(
|
if let Some((mime, bytes)) =
|
||||||
&self.config.data_dir,
|
crate::content_owned::read_owned(&self.config.data_dir, &o.onion, &o.content_id)
|
||||||
&o.onion,
|
.await
|
||||||
&o.content_id,
|
|
||||||
)
|
|
||||||
.await
|
|
||||||
{
|
{
|
||||||
use base64::Engine;
|
use base64::Engine;
|
||||||
return Ok(serde_json::json!({
|
return Ok(serde_json::json!({
|
||||||
@ -692,10 +694,7 @@ impl RpcHandler {
|
|||||||
n += 1;
|
n += 1;
|
||||||
}
|
}
|
||||||
match tokio::fs::write(&target, &bytes).await {
|
match tokio::fs::write(&target, &bytes).await {
|
||||||
Ok(()) => tracing::info!(
|
Ok(()) => tracing::info!("paid download: filed into {}", target.display()),
|
||||||
"paid download: filed into {}",
|
|
||||||
target.display()
|
|
||||||
),
|
|
||||||
Err(e) => tracing::warn!(
|
Err(e) => tracing::warn!(
|
||||||
"paid download: filing into {} failed (non-fatal): {e}",
|
"paid download: filing into {} failed (non-fatal): {e}",
|
||||||
target.display()
|
target.display()
|
||||||
@ -1144,6 +1143,7 @@ impl RpcHandler {
|
|||||||
crate::fips::dial::PeerRequest::new(fips_npub.as_deref(), onion, &path)
|
crate::fips::dial::PeerRequest::new(fips_npub.as_deref(), onion, &path)
|
||||||
.service(crate::settings::transport::PeerService::PeerFiles)
|
.service(crate::settings::transport::PeerService::PeerFiles)
|
||||||
.timeout(std::time::Duration::from_secs(30))
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6))
|
||||||
.send_get()
|
.send_get()
|
||||||
.await
|
.await
|
||||||
.context("Failed to connect to peer for preview")?;
|
.context("Failed to connect to peer for preview")?;
|
||||||
|
|||||||
@ -124,12 +124,15 @@ impl RpcHandler {
|
|||||||
}
|
}
|
||||||
"lnd.getinfo" => self.handle_lnd_getinfo().await,
|
"lnd.getinfo" => self.handle_lnd_getinfo().await,
|
||||||
"lnd.listchannels" => self.handle_lnd_listchannels().await,
|
"lnd.listchannels" => self.handle_lnd_listchannels().await,
|
||||||
|
"lnd.closedchannels" => self.handle_lnd_closedchannels().await,
|
||||||
"lnd.openchannel" => self.handle_lnd_openchannel(params).await,
|
"lnd.openchannel" => self.handle_lnd_openchannel(params).await,
|
||||||
"lnd.closechannel" => self.handle_lnd_closechannel(params).await,
|
"lnd.closechannel" => self.handle_lnd_closechannel(params).await,
|
||||||
"lnd.newaddress" => self.handle_lnd_newaddress().await,
|
"lnd.newaddress" => self.handle_lnd_newaddress().await,
|
||||||
"lnd.sendcoins" => self.handle_lnd_sendcoins(params).await,
|
"lnd.sendcoins" => self.handle_lnd_sendcoins(params).await,
|
||||||
|
"lnd.estimatefee" => self.handle_lnd_estimatefee(params).await,
|
||||||
"lnd.createinvoice" => self.handle_lnd_createinvoice(params).await,
|
"lnd.createinvoice" => self.handle_lnd_createinvoice(params).await,
|
||||||
"lnd.payinvoice" => self.handle_lnd_payinvoice(params).await,
|
"lnd.payinvoice" => self.handle_lnd_payinvoice(params).await,
|
||||||
|
"lnd.paymentstatus" => self.handle_lnd_paymentstatus(params).await,
|
||||||
"lnd.create-psbt" => self.handle_lnd_create_psbt(params).await,
|
"lnd.create-psbt" => self.handle_lnd_create_psbt(params).await,
|
||||||
"lnd.finalize-psbt" => self.handle_lnd_finalize_psbt(params).await,
|
"lnd.finalize-psbt" => self.handle_lnd_finalize_psbt(params).await,
|
||||||
"lnd.create-raw-tx" => self.handle_lnd_create_raw_tx(params).await,
|
"lnd.create-raw-tx" => self.handle_lnd_create_raw_tx(params).await,
|
||||||
|
|||||||
@ -865,7 +865,8 @@ impl RpcHandler {
|
|||||||
"/rpc/v1",
|
"/rpc/v1",
|
||||||
)
|
)
|
||||||
.service(crate::settings::transport::PeerService::Peers)
|
.service(crate::settings::transport::PeerService::Peers)
|
||||||
.timeout(std::time::Duration::from_secs(30));
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6));
|
||||||
|
|
||||||
match req.send_json(&body).await {
|
match req.send_json(&body).await {
|
||||||
Ok((resp, transport)) if resp.status().is_success() => {
|
Ok((resp, transport)) if resp.status().is_success() => {
|
||||||
|
|||||||
@ -23,9 +23,11 @@ impl RpcHandler {
|
|||||||
/// host/IP itself — it knows which origin the browser reached the node on.
|
/// host/IP itself — it knows which origin the browser reached the node on.
|
||||||
pub(super) async fn handle_fips_pair_info(&self) -> Result<serde_json::Value> {
|
pub(super) async fn handle_fips_pair_info(&self) -> Result<serde_json::Value> {
|
||||||
let identity_dir = fips::identity_dir_from(&self.config.data_dir);
|
let identity_dir = fips::identity_dir_from(&self.config.data_dir);
|
||||||
let npub = crate::identity::fips_npub(&identity_dir).await?.ok_or_else(|| {
|
let npub = crate::identity::fips_npub(&identity_dir)
|
||||||
anyhow::anyhow!("FIPS identity not provisioned yet — complete onboarding first")
|
.await?
|
||||||
})?;
|
.ok_or_else(|| {
|
||||||
|
anyhow::anyhow!("FIPS identity not provisioned yet — complete onboarding first")
|
||||||
|
})?;
|
||||||
let ula = fips::iface::fips0_ula().map(|ip| ip.to_string());
|
let ula = fips::iface::fips0_ula().map(|ip| ip.to_string());
|
||||||
// The node's seed anchors ride along so the phone can rendezvous
|
// The node's seed anchors ride along so the phone can rendezvous
|
||||||
// through the same public mesh points when the node's LAN endpoint
|
// through the same public mesh points when the node's LAN endpoint
|
||||||
@ -81,7 +83,8 @@ impl RpcHandler {
|
|||||||
pub(super) async fn handle_fips_install(&self) -> Result<serde_json::Value> {
|
pub(super) async fn handle_fips_install(&self) -> Result<serde_json::Value> {
|
||||||
let identity_dir = fips::identity_dir_from(&self.config.data_dir);
|
let identity_dir = fips::identity_dir_from(&self.config.data_dir);
|
||||||
fips::config::install(&identity_dir).await?;
|
fips::config::install(&identity_dir).await?;
|
||||||
fips::service::activate(fips::SERVICE_UNIT).await?;
|
let unit = fips::service::activation_unit().await;
|
||||||
|
fips::service::activate(unit).await?;
|
||||||
let status = fips::FipsStatus::query(&self.config.data_dir).await;
|
let status = fips::FipsStatus::query(&self.config.data_dir).await;
|
||||||
Ok(serde_json::to_value(status)?)
|
Ok(serde_json::to_value(status)?)
|
||||||
}
|
}
|
||||||
|
|||||||
@ -30,6 +30,8 @@ struct ChannelInfo {
|
|||||||
active: bool,
|
active: bool,
|
||||||
status: String,
|
status: String,
|
||||||
channel_point: String,
|
channel_point: String,
|
||||||
|
#[serde(skip_serializing_if = "String::is_empty")]
|
||||||
|
closing_txid: String,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Serialize)]
|
#[derive(Debug, Serialize)]
|
||||||
@ -58,6 +60,10 @@ struct LndChannel {
|
|||||||
#[derive(Debug, Deserialize, Default)]
|
#[derive(Debug, Deserialize, Default)]
|
||||||
struct LndPendingChannelsResponse {
|
struct LndPendingChannelsResponse {
|
||||||
pending_open_channels: Option<Vec<LndPendingOpenChannel>>,
|
pending_open_channels: Option<Vec<LndPendingOpenChannel>>,
|
||||||
|
// Cooperative closes waiting for their closing tx to confirm
|
||||||
|
waiting_close_channels: Option<Vec<LndWaitingCloseChannel>>,
|
||||||
|
// Force closes serving out their timelock
|
||||||
|
pending_force_closing_channels: Option<Vec<LndForceClosingChannel>>,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
@ -65,6 +71,18 @@ struct LndPendingOpenChannel {
|
|||||||
channel: Option<LndPendingChannel>,
|
channel: Option<LndPendingChannel>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
struct LndWaitingCloseChannel {
|
||||||
|
channel: Option<LndPendingChannel>,
|
||||||
|
closing_txid: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
struct LndForceClosingChannel {
|
||||||
|
channel: Option<LndPendingChannel>,
|
||||||
|
closing_txid: Option<String>,
|
||||||
|
}
|
||||||
|
|
||||||
#[derive(Debug, Deserialize)]
|
#[derive(Debug, Deserialize)]
|
||||||
struct LndPendingChannel {
|
struct LndPendingChannel {
|
||||||
remote_node_pub: Option<String>,
|
remote_node_pub: Option<String>,
|
||||||
@ -74,6 +92,52 @@ struct LndPendingChannel {
|
|||||||
channel_point: Option<String>,
|
channel_point: Option<String>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
impl LndPendingChannel {
|
||||||
|
fn into_channel_info(self, status: &str, closing_txid: Option<String>) -> ChannelInfo {
|
||||||
|
let parse = |s: &Option<String>| s.as_deref().and_then(|v| v.parse().ok()).unwrap_or(0);
|
||||||
|
ChannelInfo {
|
||||||
|
chan_id: String::new(),
|
||||||
|
remote_pubkey: self.remote_node_pub.clone().unwrap_or_default(),
|
||||||
|
capacity: parse(&self.capacity),
|
||||||
|
local_balance: parse(&self.local_balance),
|
||||||
|
remote_balance: parse(&self.remote_balance),
|
||||||
|
active: false,
|
||||||
|
status: status.into(),
|
||||||
|
channel_point: self.channel_point.unwrap_or_default(),
|
||||||
|
closing_txid: closing_txid.unwrap_or_default(),
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize, Default)]
|
||||||
|
struct LndClosedChannelsResponse {
|
||||||
|
channels: Option<Vec<LndClosedChannel>>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Deserialize)]
|
||||||
|
struct LndClosedChannel {
|
||||||
|
chan_id: Option<String>,
|
||||||
|
remote_pubkey: Option<String>,
|
||||||
|
capacity: Option<String>,
|
||||||
|
settled_balance: Option<String>,
|
||||||
|
close_type: Option<String>,
|
||||||
|
closing_tx_hash: Option<String>,
|
||||||
|
channel_point: Option<String>,
|
||||||
|
close_height: Option<i64>,
|
||||||
|
}
|
||||||
|
|
||||||
|
#[derive(Debug, Serialize)]
|
||||||
|
struct ClosedChannelInfo {
|
||||||
|
chan_id: String,
|
||||||
|
remote_pubkey: String,
|
||||||
|
capacity: i64,
|
||||||
|
settled_balance: i64,
|
||||||
|
close_type: String,
|
||||||
|
closing_tx_hash: String,
|
||||||
|
channel_point: String,
|
||||||
|
close_height: i64,
|
||||||
|
}
|
||||||
|
|
||||||
impl RpcHandler {
|
impl RpcHandler {
|
||||||
pub(in crate::api::rpc) async fn handle_lnd_listchannels(&self) -> Result<serde_json::Value> {
|
pub(in crate::api::rpc) async fn handle_lnd_listchannels(&self) -> Result<serde_json::Value> {
|
||||||
let (client, macaroon_hex) = self.lnd_client().await?;
|
let (client, macaroon_hex) = self.lnd_client().await?;
|
||||||
@ -131,6 +195,7 @@ impl RpcHandler {
|
|||||||
"inactive".into()
|
"inactive".into()
|
||||||
},
|
},
|
||||||
channel_point: ch.channel_point.unwrap_or_default(),
|
channel_point: ch.channel_point.unwrap_or_default(),
|
||||||
|
closing_txid: String::new(),
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect();
|
.collect();
|
||||||
@ -138,31 +203,20 @@ impl RpcHandler {
|
|||||||
let mut pending_channels: Vec<ChannelInfo> = Vec::new();
|
let mut pending_channels: Vec<ChannelInfo> = Vec::new();
|
||||||
for pch in pending_resp.pending_open_channels.unwrap_or_default() {
|
for pch in pending_resp.pending_open_channels.unwrap_or_default() {
|
||||||
if let Some(ch) = pch.channel {
|
if let Some(ch) = pch.channel {
|
||||||
let capacity: i64 = ch
|
pending_channels.push(ch.into_channel_info("pending_open", None));
|
||||||
.capacity
|
}
|
||||||
.as_deref()
|
}
|
||||||
.and_then(|s| s.parse().ok())
|
for wch in pending_resp.waiting_close_channels.unwrap_or_default() {
|
||||||
.unwrap_or(0);
|
if let Some(ch) = wch.channel {
|
||||||
let local: i64 = ch
|
pending_channels.push(ch.into_channel_info("closing", wch.closing_txid));
|
||||||
.local_balance
|
}
|
||||||
.as_deref()
|
}
|
||||||
.and_then(|s| s.parse().ok())
|
for fch in pending_resp
|
||||||
.unwrap_or(0);
|
.pending_force_closing_channels
|
||||||
let remote: i64 = ch
|
.unwrap_or_default()
|
||||||
.remote_balance
|
{
|
||||||
.as_deref()
|
if let Some(ch) = fch.channel {
|
||||||
.and_then(|s| s.parse().ok())
|
pending_channels.push(ch.into_channel_info("force_closing", fch.closing_txid));
|
||||||
.unwrap_or(0);
|
|
||||||
pending_channels.push(ChannelInfo {
|
|
||||||
chan_id: String::new(),
|
|
||||||
remote_pubkey: ch.remote_node_pub.unwrap_or_default(),
|
|
||||||
capacity,
|
|
||||||
local_balance: local,
|
|
||||||
remote_balance: remote,
|
|
||||||
active: false,
|
|
||||||
status: "pending_open".into(),
|
|
||||||
channel_point: ch.channel_point.unwrap_or_default(),
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -349,6 +403,46 @@ impl RpcHandler {
|
|||||||
Ok(body)
|
Ok(body)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
pub(in crate::api::rpc) async fn handle_lnd_closedchannels(&self) -> Result<serde_json::Value> {
|
||||||
|
let (client, macaroon_hex) = self.lnd_client().await?;
|
||||||
|
|
||||||
|
let resp: LndClosedChannelsResponse = client
|
||||||
|
.get(format!("{LND_REST_BASE_URL}/v1/channels/closed"))
|
||||||
|
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.context("LND REST connection failed")?
|
||||||
|
.json()
|
||||||
|
.await
|
||||||
|
.context("Failed to parse LND closed channels response")?;
|
||||||
|
|
||||||
|
let channels: Vec<ClosedChannelInfo> = resp
|
||||||
|
.channels
|
||||||
|
.unwrap_or_default()
|
||||||
|
.into_iter()
|
||||||
|
.map(|ch| ClosedChannelInfo {
|
||||||
|
chan_id: ch.chan_id.unwrap_or_default(),
|
||||||
|
remote_pubkey: ch.remote_pubkey.unwrap_or_default(),
|
||||||
|
capacity: ch
|
||||||
|
.capacity
|
||||||
|
.as_deref()
|
||||||
|
.and_then(|s| s.parse().ok())
|
||||||
|
.unwrap_or(0),
|
||||||
|
settled_balance: ch
|
||||||
|
.settled_balance
|
||||||
|
.as_deref()
|
||||||
|
.and_then(|s| s.parse().ok())
|
||||||
|
.unwrap_or(0),
|
||||||
|
close_type: ch.close_type.unwrap_or_default(),
|
||||||
|
closing_tx_hash: ch.closing_tx_hash.unwrap_or_default(),
|
||||||
|
channel_point: ch.channel_point.unwrap_or_default(),
|
||||||
|
close_height: ch.close_height.unwrap_or(0),
|
||||||
|
})
|
||||||
|
.collect();
|
||||||
|
|
||||||
|
Ok(serde_json::json!({ "channels": channels }))
|
||||||
|
}
|
||||||
|
|
||||||
pub(in crate::api::rpc) async fn handle_lnd_closechannel(
|
pub(in crate::api::rpc) async fn handle_lnd_closechannel(
|
||||||
&self,
|
&self,
|
||||||
params: Option<serde_json::Value>,
|
params: Option<serde_json::Value>,
|
||||||
@ -389,27 +483,35 @@ impl RpcHandler {
|
|||||||
"Closing Lightning channel"
|
"Closing Lightning channel"
|
||||||
);
|
);
|
||||||
|
|
||||||
let (client, macaroon_hex) = self.lnd_client().await?;
|
let (_, macaroon_hex) = self.lnd_client().await?;
|
||||||
|
|
||||||
|
// The close endpoint is server-streaming: LND holds the connection
|
||||||
|
// open and emits updates until the closing tx CONFIRMS on-chain
|
||||||
|
// (potentially hours). Reading the whole body hangs the RPC even
|
||||||
|
// though the close already went through, and the shared lnd_client's
|
||||||
|
// 15s total timeout would abort the stream mid-read. Use a dedicated
|
||||||
|
// client and return as soon as the first streamed update arrives.
|
||||||
|
let client = reqwest::Client::builder()
|
||||||
|
.no_proxy()
|
||||||
|
.connect_timeout(std::time::Duration::from_secs(10))
|
||||||
|
.danger_accept_invalid_certs(true)
|
||||||
|
.build()
|
||||||
|
.context("Failed to create streaming HTTP client")?;
|
||||||
|
|
||||||
let url = format!(
|
let url = format!(
|
||||||
"{LND_REST_BASE_URL}/v1/channels/{}/{}?force={}",
|
"{LND_REST_BASE_URL}/v1/channels/{}/{}?force={}",
|
||||||
parts[0], parts[1], force
|
parts[0], parts[1], force
|
||||||
);
|
);
|
||||||
|
|
||||||
let resp = client
|
let mut resp = client
|
||||||
.delete(&url)
|
.delete(&url)
|
||||||
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
.context("Failed to close channel")?;
|
.context("Failed to close channel")?;
|
||||||
|
|
||||||
let status = resp.status();
|
if !resp.status().is_success() {
|
||||||
let body: serde_json::Value = resp
|
let body: serde_json::Value = resp.json().await.unwrap_or_default();
|
||||||
.json()
|
|
||||||
.await
|
|
||||||
.context("Failed to parse close channel response")?;
|
|
||||||
|
|
||||||
if !status.is_success() {
|
|
||||||
let msg = body
|
let msg = body
|
||||||
.get("message")
|
.get("message")
|
||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
@ -417,6 +519,56 @@ impl RpcHandler {
|
|||||||
return Err(anyhow::anyhow!("Failed to close channel: {}", msg));
|
return Err(anyhow::anyhow!("Failed to close channel: {}", msg));
|
||||||
}
|
}
|
||||||
|
|
||||||
Ok(serde_json::json!({ "success": true }))
|
// First streamed line is {"result":{"close_pending":…}} on success or
|
||||||
|
// {"error":…} — the stream reports errors in-band after a 200.
|
||||||
|
let mut buf: Vec<u8> = Vec::new();
|
||||||
|
let first_update = tokio::time::timeout(std::time::Duration::from_secs(25), async {
|
||||||
|
while let Some(chunk) = resp.chunk().await? {
|
||||||
|
buf.extend_from_slice(&chunk);
|
||||||
|
let line = match buf.iter().position(|&b| b == b'\n') {
|
||||||
|
Some(pos) => &buf[..pos],
|
||||||
|
None => &buf[..],
|
||||||
|
};
|
||||||
|
if let Ok(v) = serde_json::from_slice::<serde_json::Value>(line) {
|
||||||
|
return Ok::<_, anyhow::Error>(Some(v));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
Ok(None)
|
||||||
|
})
|
||||||
|
.await;
|
||||||
|
|
||||||
|
match first_update {
|
||||||
|
Ok(Ok(Some(update))) => {
|
||||||
|
if let Some(err) = update.get("error") {
|
||||||
|
let msg = err
|
||||||
|
.get("message")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.unwrap_or("Unknown error");
|
||||||
|
return Err(anyhow::anyhow!("Failed to close channel: {}", msg));
|
||||||
|
}
|
||||||
|
// txid arrives base64-encoded in internal byte order; flip it
|
||||||
|
// into the display order explorers use.
|
||||||
|
use base64::Engine as _;
|
||||||
|
let closing_txid = update
|
||||||
|
.pointer("/result/close_pending/txid")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.and_then(|b64| base64::engine::general_purpose::STANDARD.decode(b64).ok())
|
||||||
|
.map(|mut bytes| {
|
||||||
|
bytes.reverse();
|
||||||
|
hex::encode(bytes)
|
||||||
|
})
|
||||||
|
.unwrap_or_default();
|
||||||
|
info!(channel_point, closing_txid, "Channel close initiated");
|
||||||
|
Ok(serde_json::json!({ "success": true, "closing_txid": closing_txid }))
|
||||||
|
}
|
||||||
|
Ok(Ok(None)) => Err(anyhow::anyhow!(
|
||||||
|
"LND ended the close stream without an update — check the channel list"
|
||||||
|
)),
|
||||||
|
Ok(Err(e)) => Err(e).context("Failed reading close channel response"),
|
||||||
|
// No update inside the window: the close is almost certainly still
|
||||||
|
// negotiating with the peer — report initiated, the channel list
|
||||||
|
// will show it under Closing.
|
||||||
|
Err(_) => Ok(serde_json::json!({ "success": true, "closing_txid": "" })),
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -36,6 +36,33 @@ impl RpcHandler {
|
|||||||
|
|
||||||
let (client, macaroon_hex) = self.lnd_client().await?;
|
let (client, macaroon_hex) = self.lnd_client().await?;
|
||||||
|
|
||||||
|
// Decode the invoice up front (fast, local) so we know its payment
|
||||||
|
// hash BEFORE handing it to LND. If the payment outlives our wait
|
||||||
|
// below, the hash is what lets the UI keep tracking it instead of
|
||||||
|
// declaring a false failure. Best-effort: a decode hiccup must not
|
||||||
|
// block the payment itself.
|
||||||
|
let (decoded_hash, decoded_amt) = match client
|
||||||
|
.get(format!("{LND_REST_BASE_URL}/v1/payreq/{payment_request}"))
|
||||||
|
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Ok(r) => match r.json::<serde_json::Value>().await {
|
||||||
|
Ok(d) => (
|
||||||
|
d.get("payment_hash")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.unwrap_or("")
|
||||||
|
.to_string(),
|
||||||
|
d.get("num_satoshis")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.and_then(|s| s.parse::<i64>().ok())
|
||||||
|
.unwrap_or(0),
|
||||||
|
),
|
||||||
|
Err(_) => (String::new(), 0),
|
||||||
|
},
|
||||||
|
Err(_) => (String::new(), 0),
|
||||||
|
};
|
||||||
|
|
||||||
let mut pay_body = serde_json::json!({
|
let mut pay_body = serde_json::json!({
|
||||||
"payment_request": payment_request,
|
"payment_request": payment_request,
|
||||||
});
|
});
|
||||||
@ -43,13 +70,46 @@ impl RpcHandler {
|
|||||||
pay_body["amt"] = serde_json::json!(amt.to_string());
|
pay_body["amt"] = serde_json::json!(amt.to_string());
|
||||||
}
|
}
|
||||||
|
|
||||||
let resp = client
|
// `/v1/channels/transactions` is SYNCHRONOUS: it blocks until the
|
||||||
|
// payment settles or definitively fails, and multi-hop routing with
|
||||||
|
// retries routinely takes longer than the shared client's 15s budget.
|
||||||
|
// That 15s abort used to surface as "Payment failed" while LND kept
|
||||||
|
// paying in the background — the payment then succeeded and appeared
|
||||||
|
// in history a minute later. Wait up to 120s on a dedicated client,
|
||||||
|
// and treat a post-connect timeout as IN FLIGHT (status: pending),
|
||||||
|
// never as failure — only LND may declare a payment failed.
|
||||||
|
let pay_client = reqwest::Client::builder()
|
||||||
|
.no_proxy()
|
||||||
|
.connect_timeout(std::time::Duration::from_secs(10))
|
||||||
|
.timeout(std::time::Duration::from_secs(120))
|
||||||
|
.danger_accept_invalid_certs(true)
|
||||||
|
.build()
|
||||||
|
.context("Failed to create HTTP client")?;
|
||||||
|
|
||||||
|
let resp = match pay_client
|
||||||
.post(format!("{LND_REST_BASE_URL}/v1/channels/transactions"))
|
.post(format!("{LND_REST_BASE_URL}/v1/channels/transactions"))
|
||||||
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
||||||
.json(&pay_body)
|
.json(&pay_body)
|
||||||
.send()
|
.send()
|
||||||
.await
|
.await
|
||||||
.context("Failed to pay invoice")?;
|
{
|
||||||
|
Ok(r) => r,
|
||||||
|
Err(e) if e.is_connect() => {
|
||||||
|
// Never reached LND — nothing was sent; this IS a hard error.
|
||||||
|
return Err(anyhow::anyhow!("Could not reach LND to pay: {e}"));
|
||||||
|
}
|
||||||
|
Err(_) => {
|
||||||
|
// Timed out (or lost the connection) AFTER the payment was
|
||||||
|
// handed to LND — it may well still succeed. Report pending
|
||||||
|
// with the hash so the caller can poll lnd.paymentstatus.
|
||||||
|
info!("payinvoice wait elapsed; payment still in flight");
|
||||||
|
return Ok(serde_json::json!({
|
||||||
|
"status": "pending",
|
||||||
|
"payment_hash": decoded_hash,
|
||||||
|
"amount_sats": decoded_amt,
|
||||||
|
}));
|
||||||
|
}
|
||||||
|
};
|
||||||
|
|
||||||
let status = resp.status();
|
let status = resp.status();
|
||||||
let body: serde_json::Value = resp
|
let body: serde_json::Value = resp
|
||||||
@ -86,20 +146,105 @@ impl RpcHandler {
|
|||||||
.and_then(|r| r.get("total_amt"))
|
.and_then(|r| r.get("total_amt"))
|
||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
.and_then(|s| s.parse::<i64>().ok())
|
.and_then(|s| s.parse::<i64>().ok())
|
||||||
.unwrap_or(0);
|
.unwrap_or(decoded_amt);
|
||||||
|
|
||||||
let payment_hash = body
|
let payment_hash = body
|
||||||
.get("payment_hash")
|
.get("payment_hash")
|
||||||
.and_then(|v| v.as_str())
|
.and_then(|v| v.as_str())
|
||||||
.unwrap_or("")
|
.filter(|s| !s.is_empty())
|
||||||
.to_string();
|
.map(|s| s.to_string())
|
||||||
|
.unwrap_or(decoded_hash);
|
||||||
|
|
||||||
Ok(serde_json::json!({
|
Ok(serde_json::json!({
|
||||||
|
"status": "succeeded",
|
||||||
"payment_hash": payment_hash,
|
"payment_hash": payment_hash,
|
||||||
"amount_sats": amount_sat,
|
"amount_sats": amount_sat,
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Status of an outgoing Lightning payment by hex payment hash. Lets the
|
||||||
|
/// UI resolve a payinvoice that outlived its synchronous wait (`status:
|
||||||
|
/// "pending"`) to a real terminal state instead of guessing.
|
||||||
|
pub(in crate::api::rpc) async fn handle_lnd_paymentstatus(
|
||||||
|
&self,
|
||||||
|
params: Option<serde_json::Value>,
|
||||||
|
) -> Result<serde_json::Value> {
|
||||||
|
let params = params.unwrap_or_default();
|
||||||
|
let payment_hash = params
|
||||||
|
.get("payment_hash")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.ok_or_else(|| anyhow::anyhow!("Missing 'payment_hash' parameter"))?;
|
||||||
|
if payment_hash.len() != 64 || !payment_hash.chars().all(|c| c.is_ascii_hexdigit()) {
|
||||||
|
return Err(anyhow::anyhow!("Invalid payment hash"));
|
||||||
|
}
|
||||||
|
|
||||||
|
let (client, macaroon_hex) = self.lnd_client().await?;
|
||||||
|
let resp = client
|
||||||
|
.get(format!(
|
||||||
|
"{LND_REST_BASE_URL}/v1/payments?include_incomplete=true&max_payments=100&reversed=true"
|
||||||
|
))
|
||||||
|
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.context("LND REST connection failed")?;
|
||||||
|
let body: serde_json::Value = resp
|
||||||
|
.json()
|
||||||
|
.await
|
||||||
|
.context("Failed to parse payments response")?;
|
||||||
|
|
||||||
|
let hash_lower = payment_hash.to_lowercase();
|
||||||
|
let found = body
|
||||||
|
.get("payments")
|
||||||
|
.and_then(|v| v.as_array())
|
||||||
|
.and_then(|arr| {
|
||||||
|
arr.iter().find(|p| {
|
||||||
|
p.get("payment_hash").and_then(|v| v.as_str())
|
||||||
|
== Some(hash_lower.as_str())
|
||||||
|
})
|
||||||
|
});
|
||||||
|
|
||||||
|
let Some(p) = found else {
|
||||||
|
// Not in the latest window — either very old or LND never saw it.
|
||||||
|
return Ok(serde_json::json!({ "status": "unknown" }));
|
||||||
|
};
|
||||||
|
|
||||||
|
let lnd_status = p.get("status").and_then(|v| v.as_str()).unwrap_or("");
|
||||||
|
let status = match lnd_status {
|
||||||
|
"SUCCEEDED" => "succeeded",
|
||||||
|
"FAILED" => "failed",
|
||||||
|
_ => "in_flight",
|
||||||
|
};
|
||||||
|
let failure_reason = match p
|
||||||
|
.get("failure_reason")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.unwrap_or("")
|
||||||
|
{
|
||||||
|
"FAILURE_REASON_NO_ROUTE" => "No route to the recipient",
|
||||||
|
"FAILURE_REASON_INSUFFICIENT_BALANCE" => "Insufficient channel balance",
|
||||||
|
"FAILURE_REASON_TIMEOUT" => "Payment timed out in the network",
|
||||||
|
"FAILURE_REASON_INCORRECT_PAYMENT_DETAILS" => {
|
||||||
|
"Recipient rejected the payment (wrong details or expired invoice)"
|
||||||
|
}
|
||||||
|
"FAILURE_REASON_ERROR" => "Payment failed",
|
||||||
|
_ => "",
|
||||||
|
};
|
||||||
|
|
||||||
|
fn amt(p: &serde_json::Value, key: &str) -> i64 {
|
||||||
|
p.get(key)
|
||||||
|
.and_then(|f| f.as_str())
|
||||||
|
.and_then(|s| s.parse().ok())
|
||||||
|
.or_else(|| p.get(key).and_then(|f| f.as_i64()))
|
||||||
|
.unwrap_or(0)
|
||||||
|
}
|
||||||
|
|
||||||
|
Ok(serde_json::json!({
|
||||||
|
"status": status,
|
||||||
|
"failure_reason": failure_reason,
|
||||||
|
"amount_sats": amt(p, "value_sat"),
|
||||||
|
"fee_sats": amt(p, "fee_sat"),
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
/// List on-chain transactions from LND.
|
/// List on-chain transactions from LND.
|
||||||
/// Returns all transactions, with incoming (amount > 0) flagged.
|
/// Returns all transactions, with incoming (amount > 0) flagged.
|
||||||
pub(in crate::api::rpc) async fn handle_lnd_gettransactions(
|
pub(in crate::api::rpc) async fn handle_lnd_gettransactions(
|
||||||
|
|||||||
@ -124,16 +124,41 @@ impl RpcHandler {
|
|||||||
return Err(anyhow::anyhow!("Invalid Bitcoin address format"));
|
return Err(anyhow::anyhow!("Invalid Bitcoin address format"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Fee control: either a confirmation target or an explicit fee rate
|
||||||
|
let target_conf = params.get("target_conf").and_then(|v| v.as_i64());
|
||||||
|
let sat_per_vbyte = params.get("sat_per_vbyte").and_then(|v| v.as_i64());
|
||||||
|
if target_conf.is_some() && sat_per_vbyte.is_some() {
|
||||||
|
return Err(anyhow::anyhow!(
|
||||||
|
"Invalid fee parameters: specify either target_conf or sat_per_vbyte, not both"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
if let Some(tc) = target_conf {
|
||||||
|
if !(1..=1008).contains(&tc) {
|
||||||
|
return Err(anyhow::anyhow!(
|
||||||
|
"Invalid target_conf: must be between 1 and 1008 blocks"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if let Some(rate) = sat_per_vbyte {
|
||||||
|
if !(1..=5000).contains(&rate) {
|
||||||
|
return Err(anyhow::anyhow!(
|
||||||
|
"Invalid sat_per_vbyte: must be between 1 and 5000"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
info!(
|
info!(
|
||||||
addr = addr,
|
addr = addr,
|
||||||
amount = amount,
|
amount = amount,
|
||||||
send_all = send_all,
|
send_all = send_all,
|
||||||
|
target_conf = target_conf,
|
||||||
|
sat_per_vbyte = sat_per_vbyte,
|
||||||
"Sending on-chain Bitcoin"
|
"Sending on-chain Bitcoin"
|
||||||
);
|
);
|
||||||
|
|
||||||
let (client, macaroon_hex) = self.lnd_client().await?;
|
let (client, macaroon_hex) = self.lnd_client().await?;
|
||||||
|
|
||||||
let send_body = match amount {
|
let mut send_body = match amount {
|
||||||
Some(amount) => serde_json::json!({
|
Some(amount) => serde_json::json!({
|
||||||
"addr": addr,
|
"addr": addr,
|
||||||
"amount": amount.to_string(),
|
"amount": amount.to_string(),
|
||||||
@ -143,6 +168,13 @@ impl RpcHandler {
|
|||||||
"send_all": true,
|
"send_all": true,
|
||||||
}),
|
}),
|
||||||
};
|
};
|
||||||
|
if let Some(tc) = target_conf {
|
||||||
|
send_body["target_conf"] = serde_json::json!(tc);
|
||||||
|
}
|
||||||
|
if let Some(rate) = sat_per_vbyte {
|
||||||
|
// LND REST encodes uint64 as a JSON string
|
||||||
|
send_body["sat_per_vbyte"] = serde_json::json!(rate.to_string());
|
||||||
|
}
|
||||||
|
|
||||||
let resp = client
|
let resp = client
|
||||||
.post(format!("{LND_REST_BASE_URL}/v1/transactions"))
|
.post(format!("{LND_REST_BASE_URL}/v1/transactions"))
|
||||||
@ -171,6 +203,82 @@ impl RpcHandler {
|
|||||||
Ok(serde_json::json!({ "txid": txid }))
|
Ok(serde_json::json!({ "txid": txid }))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Estimate the on-chain fee for sending `amount` sats to `addr` at a
|
||||||
|
/// confirmation target. Returns `{ fee_sat, sat_per_vbyte }` so the send
|
||||||
|
/// UI can show the cost of each preset before the user confirms.
|
||||||
|
pub(in crate::api::rpc) async fn handle_lnd_estimatefee(
|
||||||
|
&self,
|
||||||
|
params: Option<serde_json::Value>,
|
||||||
|
) -> Result<serde_json::Value> {
|
||||||
|
let params = params.unwrap_or_default();
|
||||||
|
let addr = params
|
||||||
|
.get("addr")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.ok_or_else(|| anyhow::anyhow!("Missing 'addr' parameter"))?;
|
||||||
|
if addr.len() < 14 || addr.len() > 90 || !addr.chars().all(|c| c.is_ascii_alphanumeric()) {
|
||||||
|
return Err(anyhow::anyhow!("Invalid Bitcoin address format"));
|
||||||
|
}
|
||||||
|
let amount = params
|
||||||
|
.get("amount")
|
||||||
|
.and_then(|v| v.as_i64())
|
||||||
|
.ok_or_else(|| anyhow::anyhow!("Missing 'amount' parameter (sats)"))?;
|
||||||
|
if !(546..=21_000_000 * 100_000_000).contains(&amount) {
|
||||||
|
return Err(anyhow::anyhow!("Invalid amount"));
|
||||||
|
}
|
||||||
|
let target_conf = params
|
||||||
|
.get("target_conf")
|
||||||
|
.and_then(|v| v.as_i64())
|
||||||
|
.unwrap_or(6);
|
||||||
|
if !(1..=1008).contains(&target_conf) {
|
||||||
|
return Err(anyhow::anyhow!(
|
||||||
|
"Invalid target_conf: must be between 1 and 1008 blocks"
|
||||||
|
));
|
||||||
|
}
|
||||||
|
|
||||||
|
let (client, macaroon_hex) = self.lnd_client().await?;
|
||||||
|
|
||||||
|
let resp = client
|
||||||
|
.get(format!("{LND_REST_BASE_URL}/v1/transactions/fee"))
|
||||||
|
.query(&[
|
||||||
|
(format!("AddrToAmount[{addr}]"), amount.to_string()),
|
||||||
|
("target_conf".to_string(), target_conf.to_string()),
|
||||||
|
])
|
||||||
|
.header("Grpc-Metadata-macaroon", &macaroon_hex)
|
||||||
|
.send()
|
||||||
|
.await
|
||||||
|
.context("Failed to estimate fee")?;
|
||||||
|
|
||||||
|
let status = resp.status();
|
||||||
|
let body: serde_json::Value = resp
|
||||||
|
.json()
|
||||||
|
.await
|
||||||
|
.context("Failed to parse fee estimate response")?;
|
||||||
|
|
||||||
|
if !status.is_success() {
|
||||||
|
let msg = body
|
||||||
|
.get("message")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.unwrap_or("Unknown error");
|
||||||
|
return Err(anyhow::anyhow!("Failed to estimate fee: {}", msg));
|
||||||
|
}
|
||||||
|
|
||||||
|
// LND REST encodes int64 as JSON strings
|
||||||
|
let fee_sat = body
|
||||||
|
.get("fee_sat")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.and_then(|s| s.parse::<i64>().ok())
|
||||||
|
.unwrap_or(0);
|
||||||
|
let sat_per_vbyte = body
|
||||||
|
.get("sat_per_vbyte")
|
||||||
|
.and_then(|v| v.as_str())
|
||||||
|
.and_then(|s| s.parse::<i64>().ok())
|
||||||
|
.unwrap_or(0);
|
||||||
|
Ok(serde_json::json!({
|
||||||
|
"fee_sat": fee_sat,
|
||||||
|
"sat_per_vbyte": sat_per_vbyte,
|
||||||
|
}))
|
||||||
|
}
|
||||||
|
|
||||||
/// Create a Lightning invoice.
|
/// Create a Lightning invoice.
|
||||||
/// Create a Lightning invoice and return `(bolt11, payment_hash_hex)`.
|
/// Create a Lightning invoice and return `(bolt11, payment_hash_hex)`.
|
||||||
///
|
///
|
||||||
|
|||||||
@ -820,6 +820,7 @@ impl RpcHandler {
|
|||||||
crate::fips::dial::PeerRequest::new(fips_npub.as_deref(), &onion_bare, &path)
|
crate::fips::dial::PeerRequest::new(fips_npub.as_deref(), &onion_bare, &path)
|
||||||
.service(crate::settings::transport::PeerService::MeshFileSharing)
|
.service(crate::settings::transport::PeerService::MeshFileSharing)
|
||||||
.timeout(std::time::Duration::from_secs(120))
|
.timeout(std::time::Duration::from_secs(120))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(8))
|
||||||
.send_get()
|
.send_get()
|
||||||
.await
|
.await
|
||||||
.map_err(|e| anyhow::anyhow!("Fetch failed: {}", e))?;
|
.map_err(|e| anyhow::anyhow!("Fetch failed: {}", e))?;
|
||||||
|
|||||||
@ -556,8 +556,8 @@ impl RpcHandler {
|
|||||||
.is_some(),
|
.is_some(),
|
||||||
None => false,
|
None => false,
|
||||||
};
|
};
|
||||||
let totp_enabled = !is_token_login
|
let totp_enabled =
|
||||||
&& self.auth_manager.is_totp_enabled().await.unwrap_or(false);
|
!is_token_login && self.auth_manager.is_totp_enabled().await.unwrap_or(false);
|
||||||
if totp_enabled {
|
if totp_enabled {
|
||||||
let password = login_params
|
let password = login_params
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|||||||
@ -2324,17 +2324,28 @@ async fn cleanup_start_conflict(package_id: &str, stderr: &str) -> bool {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn cleanup_stale_pasta_port(port: &str) {
|
async fn cleanup_stale_pasta_port(port: &str) {
|
||||||
|
// NEVER kill our own process. The daemon holds catalog app ports over
|
||||||
|
// IPv6 (the mesh app-port relay), so a blunt `fuser -k <port>/tcp` would
|
||||||
|
// terminate archipelago itself mid-install — installs failed and apps
|
||||||
|
// vanished on framework-pt 2026-07-27. Kill every listener on the port
|
||||||
|
// EXCEPT our PID (and our process group), leaving the relay/daemon alive.
|
||||||
|
let self_pid = std::process::id();
|
||||||
let kill_listener = format!(
|
let kill_listener = format!(
|
||||||
"ss -ltnp 'sport = :{}' 2>/dev/null | sed -n 's/.*pid=\\([0-9]*\\).*/\\1/p' | xargs -r kill 2>/dev/null || true",
|
"ss -ltnp 'sport = :{port}' 2>/dev/null | sed -n 's/.*pid=\\([0-9]*\\).*/\\1/p' | \
|
||||||
port
|
while read p; do [ \"$p\" = \"{self_pid}\" ] || kill \"$p\" 2>/dev/null; done || true",
|
||||||
);
|
);
|
||||||
let _ = tokio::process::Command::new("sh")
|
let _ = tokio::process::Command::new("sh")
|
||||||
.args(["-c", &kill_listener])
|
.args(["-c", &kill_listener])
|
||||||
.output()
|
.output()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
let _ = tokio::process::Command::new("sudo")
|
// sudo fuser -k, but exclude our own PID: fuser prints the PIDs holding
|
||||||
.args(["fuser", "-k", &format!("{}/tcp", port)])
|
// the port; kill each except self. (`fuser -k` has no exclusion flag.)
|
||||||
|
let fuser_kill = format!(
|
||||||
|
"for p in $(sudo fuser {port}/tcp 2>/dev/null); do [ \"$p\" = \"{self_pid}\" ] || sudo kill \"$p\" 2>/dev/null; done || true",
|
||||||
|
);
|
||||||
|
let _ = tokio::process::Command::new("sh")
|
||||||
|
.args(["-c", &fuser_kill])
|
||||||
.output()
|
.output()
|
||||||
.await;
|
.await;
|
||||||
|
|
||||||
|
|||||||
@ -766,7 +766,11 @@ async fn find_satellite(port: u16) -> Option<String> {
|
|||||||
if self_ips.contains(&ip) {
|
if self_ips.contains(&ip) {
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
set.spawn(async move { tcp_alive(&ip.to_string(), port, 500).await.then(|| ip.to_string()) });
|
set.spawn(async move {
|
||||||
|
tcp_alive(&ip.to_string(), port, 500)
|
||||||
|
.await
|
||||||
|
.then(|| ip.to_string())
|
||||||
|
});
|
||||||
}
|
}
|
||||||
while let Some(res) = set.join_next().await {
|
while let Some(res) = set.join_next().await {
|
||||||
if let Ok(Some(ip)) = res {
|
if let Ok(Some(ip)) = res {
|
||||||
|
|||||||
@ -56,12 +56,12 @@ pub(in crate::api::rpc) async fn save_pending_seed_encrypted(
|
|||||||
Ok(true)
|
Ok(true)
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Best-effort: install fips.yaml + start archipelago-fips.service after the
|
/// Best-effort: install fips.yaml + start the available FIPS systemd unit after
|
||||||
/// seed onboarding has written the fips_key to disk. Runs in a detached task
|
/// seed onboarding has written the fips_key to disk. Runs in a detached task so
|
||||||
/// so the user-facing RPC returns immediately — the systemctl calls can take
|
/// the user-facing RPC returns immediately — the systemctl calls can take a few
|
||||||
/// a few seconds the first time on slow hardware. Any failure is logged but
|
/// seconds the first time on slow hardware. Any failure is logged but does not
|
||||||
/// does not break onboarding; the user can still hit fips.install manually
|
/// break onboarding; the user can still hit fips.install manually from the
|
||||||
/// from the dashboard as an escape hatch.
|
/// dashboard as an escape hatch.
|
||||||
fn spawn_post_onboarding_fips_activate(data_dir: std::path::PathBuf) {
|
fn spawn_post_onboarding_fips_activate(data_dir: std::path::PathBuf) {
|
||||||
tokio::spawn(async move {
|
tokio::spawn(async move {
|
||||||
let identity_dir = data_dir.join("identity");
|
let identity_dir = data_dir.join("identity");
|
||||||
@ -78,11 +78,12 @@ fn spawn_post_onboarding_fips_activate(data_dir: std::path::PathBuf) {
|
|||||||
tracing::warn!("post-onboarding fips config install failed: {}", e);
|
tracing::warn!("post-onboarding fips config install failed: {}", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if let Err(e) = crate::fips::service::activate(crate::fips::SERVICE_UNIT).await {
|
let unit = crate::fips::service::activation_unit().await;
|
||||||
tracing::warn!("post-onboarding archipelago-fips activate failed: {}", e);
|
if let Err(e) = crate::fips::service::activate(unit).await {
|
||||||
|
tracing::warn!("post-onboarding FIPS activate failed via {}: {}", unit, e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tracing::info!("archipelago-fips auto-activated post-onboarding");
|
tracing::info!("FIPS auto-activated post-onboarding via {}", unit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -138,8 +139,8 @@ impl RpcHandler {
|
|||||||
// Initialize identity index at 0.
|
// Initialize identity index at 0.
|
||||||
crate::seed::save_identity_index(&self.config.data_dir, 0).await?;
|
crate::seed::save_identity_index(&self.config.data_dir, 0).await?;
|
||||||
|
|
||||||
// fips_key is now on disk — auto-activate archipelago-fips so the
|
// fips_key is now on disk — auto-activate FIPS so the user doesn't
|
||||||
// user doesn't have to hit an "Activate" button. Detached task;
|
// have to hit a manual Start button. Detached task;
|
||||||
// the onboarding RPC returns immediately.
|
// the onboarding RPC returns immediately.
|
||||||
spawn_post_onboarding_fips_activate(self.config.data_dir.clone());
|
spawn_post_onboarding_fips_activate(self.config.data_dir.clone());
|
||||||
|
|
||||||
|
|||||||
@ -498,7 +498,8 @@ pub(super) async fn notify_federation_peers_address_change(
|
|||||||
"/rpc/v1",
|
"/rpc/v1",
|
||||||
)
|
)
|
||||||
.service(crate::settings::transport::PeerService::Peers)
|
.service(crate::settings::transport::PeerService::Peers)
|
||||||
.timeout(std::time::Duration::from_secs(30));
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6));
|
||||||
match req.send_json(&payload).await {
|
match req.send_json(&payload).await {
|
||||||
Ok((_, transport)) => {
|
Ok((_, transport)) => {
|
||||||
info!(peer_did = %peer.did, transport = %transport, "Notified peer of address change")
|
info!(peer_did = %peer.did, transport = %transport, "Notified peer of address change")
|
||||||
|
|||||||
@ -848,11 +848,17 @@ pub async fn ensure_audio_stack() {
|
|||||||
{
|
{
|
||||||
Ok(s) if s.success() => info!("audio: PipeWire stack installed"),
|
Ok(s) if s.success() => info!("audio: PipeWire stack installed"),
|
||||||
Ok(s) => {
|
Ok(s) => {
|
||||||
warn!("audio: package install exited with {} — will retry next start", s);
|
warn!(
|
||||||
|
"audio: package install exited with {} — will retry next start",
|
||||||
|
s
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("audio: package install failed: {:#} — will retry next start", e);
|
warn!(
|
||||||
|
"audio: package install failed: {:#} — will retry next start",
|
||||||
|
e
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -878,12 +884,23 @@ pub async fn ensure_audio_stack() {
|
|||||||
}
|
}
|
||||||
if unit_was_missing {
|
if unit_was_missing {
|
||||||
// First install on this node — bring it up now and on every boot.
|
// First install on this node — bring it up now and on every boot.
|
||||||
let _ = host_sudo(&["systemctl", "enable", "--now", "archipelago-audio-router.service"]).await;
|
let _ = host_sudo(&[
|
||||||
|
"systemctl",
|
||||||
|
"enable",
|
||||||
|
"--now",
|
||||||
|
"archipelago-audio-router.service",
|
||||||
|
])
|
||||||
|
.await;
|
||||||
info!("audio: router installed and enabled (HDMI routing + ELD heal)");
|
info!("audio: router installed and enabled (HDMI routing + ELD heal)");
|
||||||
} else if script_changed || unit_changed {
|
} else if script_changed || unit_changed {
|
||||||
// Content update: restart only if it's running — never re-enable a
|
// Content update: restart only if it's running — never re-enable a
|
||||||
// unit an operator deliberately disabled.
|
// unit an operator deliberately disabled.
|
||||||
let _ = host_sudo(&["systemctl", "try-restart", "archipelago-audio-router.service"]).await;
|
let _ = host_sudo(&[
|
||||||
|
"systemctl",
|
||||||
|
"try-restart",
|
||||||
|
"archipelago-audio-router.service",
|
||||||
|
])
|
||||||
|
.await;
|
||||||
info!("audio: router updated");
|
info!("audio: router updated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -911,10 +928,21 @@ pub async fn ensure_gamepad_keys() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
if unit_was_missing {
|
if unit_was_missing {
|
||||||
let _ = host_sudo(&["systemctl", "enable", "--now", "archipelago-gamepad-keys.service"]).await;
|
let _ = host_sudo(&[
|
||||||
|
"systemctl",
|
||||||
|
"enable",
|
||||||
|
"--now",
|
||||||
|
"archipelago-gamepad-keys.service",
|
||||||
|
])
|
||||||
|
.await;
|
||||||
info!("gamepad: bridge installed and enabled (TV controller input)");
|
info!("gamepad: bridge installed and enabled (TV controller input)");
|
||||||
} else if script_changed || unit_changed {
|
} else if script_changed || unit_changed {
|
||||||
let _ = host_sudo(&["systemctl", "try-restart", "archipelago-gamepad-keys.service"]).await;
|
let _ = host_sudo(&[
|
||||||
|
"systemctl",
|
||||||
|
"try-restart",
|
||||||
|
"archipelago-gamepad-keys.service",
|
||||||
|
])
|
||||||
|
.await;
|
||||||
info!("gamepad: bridge updated");
|
info!("gamepad: bridge updated");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -994,10 +1022,10 @@ async fn patch_nginx_conf(path: &str) -> Result<bool> {
|
|||||||
// Companion mesh access: phones reach this node over FIPS at its fips0
|
// Companion mesh access: phones reach this node over FIPS at its fips0
|
||||||
// ULA (http://[fdxx:…]). Configs shipped before 2026-07-23 listened on
|
// ULA (http://[fdxx:…]). Configs shipped before 2026-07-23 listened on
|
||||||
// IPv4 only, so the ULA could never connect — nothing answered [::]:80.
|
// IPv4 only, so the ULA could never connect — nothing answered [::]:80.
|
||||||
let missing_v6_http = content.contains("listen 80 default_server;")
|
let missing_v6_http =
|
||||||
&& !content.contains("listen [::]:80");
|
content.contains("listen 80 default_server;") && !content.contains("listen [::]:80");
|
||||||
let missing_v6_https = content.contains("listen 443 ssl default_server;")
|
let missing_v6_https =
|
||||||
&& !content.contains("listen [::]:443");
|
content.contains("listen 443 ssl default_server;") && !content.contains("listen [::]:443");
|
||||||
if !missing_app_catalog
|
if !missing_app_catalog
|
||||||
&& !missing_bitcoin_status
|
&& !missing_bitcoin_status
|
||||||
&& !missing_lnd_proxy
|
&& !missing_lnd_proxy
|
||||||
|
|||||||
@ -111,8 +111,7 @@ impl BootReconciler {
|
|||||||
let mut failure_rounds: u32 = 0;
|
let mut failure_rounds: u32 = 0;
|
||||||
loop {
|
loop {
|
||||||
let installed = orchestrator.manifest_ids().await;
|
let installed = orchestrator.manifest_ids().await;
|
||||||
let failures =
|
let failures = crate::container::companion::reconcile(&installed).await;
|
||||||
crate::container::companion::reconcile(&installed).await;
|
|
||||||
for (companion, err) in &failures {
|
for (companion, err) in &failures {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
companion = %companion,
|
companion = %companion,
|
||||||
|
|||||||
@ -248,10 +248,17 @@ impl QuadletUnit {
|
|||||||
} else {
|
} else {
|
||||||
proto.as_str()
|
proto.as_str()
|
||||||
};
|
};
|
||||||
// Keep the rendered directive byte-identical for unbound
|
// Unbound publishes are pinned to 0.0.0.0: rootlessport's
|
||||||
// ports so existing units don't read as drifted.
|
// wildcard bind claims [::] too but BLACK-HOLES inbound v6
|
||||||
|
// (accepts, forwards nothing — "empty response" from the
|
||||||
|
// mesh, confirmed 2026-07-26). Pinning v4 frees the port's
|
||||||
|
// v6 side for the daemon's mesh relay (app_port_v6_relay_loop),
|
||||||
|
// which forwards to the v4 loopback listener that works.
|
||||||
|
// NOTE: this changes the rendered directive for unbound
|
||||||
|
// ports on purpose — the one-time drift/recreate at upgrade
|
||||||
|
// is the deploy vehicle for the fix.
|
||||||
if bind.is_empty() {
|
if bind.is_empty() {
|
||||||
let _ = writeln!(s, "PublishPort={host}:{container}/{p}");
|
let _ = writeln!(s, "PublishPort=0.0.0.0:{host}:{container}/{p}");
|
||||||
} else {
|
} else {
|
||||||
let _ = writeln!(s, "PublishPort={bind}:{host}:{container}/{p}");
|
let _ = writeln!(s, "PublishPort={bind}:{host}:{container}/{p}");
|
||||||
}
|
}
|
||||||
@ -1018,7 +1025,7 @@ mod tests {
|
|||||||
u.network = NetworkMode::Bridge("archy-net".into());
|
u.network = NetworkMode::Bridge("archy-net".into());
|
||||||
u.ports = vec![(3000, 3000, "tcp".into(), String::new())];
|
u.ports = vec![(3000, 3000, "tcp".into(), String::new())];
|
||||||
let s = u.render();
|
let s = u.render();
|
||||||
assert!(s.contains("PublishPort=3000:3000/tcp"));
|
assert!(s.contains("PublishPort=0.0.0.0:3000:3000/tcp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1167,8 +1174,8 @@ mod tests {
|
|||||||
let s = u.render();
|
let s = u.render();
|
||||||
assert!(s.contains("PublishPort=127.0.0.1:8332:8332/tcp"));
|
assert!(s.contains("PublishPort=127.0.0.1:8332:8332/tcp"));
|
||||||
assert!(s.contains("PublishPort=10.89.0.1:8332:8332/tcp"));
|
assert!(s.contains("PublishPort=10.89.0.1:8332:8332/tcp"));
|
||||||
assert!(s.contains("PublishPort=8333:8333/tcp"));
|
assert!(s.contains("PublishPort=0.0.0.0:8333:8333/tcp"));
|
||||||
assert!(!s.contains("PublishPort=8332:8332/tcp"));
|
assert!(!s.contains("PublishPort=0.0.0.0:8332:8332/tcp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
@ -1200,8 +1207,8 @@ mod tests {
|
|||||||
..QuadletUnit::default()
|
..QuadletUnit::default()
|
||||||
};
|
};
|
||||||
let s = u.render();
|
let s = u.render();
|
||||||
assert!(s.contains("PublishPort=8332:8332/tcp"));
|
assert!(s.contains("PublishPort=0.0.0.0:8332:8332/tcp"));
|
||||||
assert!(s.contains("PublishPort=8333:8333/tcp"));
|
assert!(s.contains("PublishPort=0.0.0.0:8333:8333/tcp"));
|
||||||
assert!(s.contains("Environment=BITCOIN_RPC_USER=archipelago"));
|
assert!(s.contains("Environment=BITCOIN_RPC_USER=archipelago"));
|
||||||
assert!(s.contains("Environment=BITCOIN_RPC_PASS=secret"));
|
assert!(s.contains("Environment=BITCOIN_RPC_PASS=secret"));
|
||||||
assert!(s.contains("Environment=\"RELAY_NAME=Archipelago Nostr Relay\""));
|
assert!(s.contains("Environment=\"RELAY_NAME=Archipelago Nostr Relay\""));
|
||||||
@ -1317,7 +1324,7 @@ app:
|
|||||||
let m = AppManifest::parse(yaml).expect("manifest must parse");
|
let m = AppManifest::parse(yaml).expect("manifest must parse");
|
||||||
let s = QuadletUnit::from_manifest(&m, "searxng").render();
|
let s = QuadletUnit::from_manifest(&m, "searxng").render();
|
||||||
|
|
||||||
assert!(s.contains("PublishPort=8888:8080/tcp"));
|
assert!(s.contains("PublishPort=0.0.0.0:8888:8080/tcp"));
|
||||||
assert!(!s.contains("Network=host"));
|
assert!(!s.contains("Network=host"));
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1746,7 +1753,7 @@ app:
|
|||||||
assert!(body.contains("Network=archy-net"));
|
assert!(body.contains("Network=archy-net"));
|
||||||
assert!(body.contains("NetworkAlias=lnd"));
|
assert!(body.contains("NetworkAlias=lnd"));
|
||||||
assert!(body.contains("PodmanArgs=--network-alias=lnd"));
|
assert!(body.contains("PodmanArgs=--network-alias=lnd"));
|
||||||
assert!(body.contains("PublishPort=10009:10009/tcp"));
|
assert!(body.contains("PublishPort=0.0.0.0:10009:10009/tcp"));
|
||||||
assert!(body.contains("Volume=/var/lib/archipelago/lnd:/root/.lnd:Z"));
|
assert!(body.contains("Volume=/var/lib/archipelago/lnd:/root/.lnd:Z"));
|
||||||
assert!(body.contains("Environment=LND_NETWORK=mainnet"));
|
assert!(body.contains("Environment=LND_NETWORK=mainnet"));
|
||||||
assert!(body.contains("PodmanArgs=--memory=1024m"));
|
assert!(body.contains("PodmanArgs=--memory=1024m"));
|
||||||
|
|||||||
@ -90,15 +90,13 @@ pub fn archy_anchor() -> SeedAnchor {
|
|||||||
pub fn fips_network_anchors() -> Vec<SeedAnchor> {
|
pub fn fips_network_anchors() -> Vec<SeedAnchor> {
|
||||||
vec![
|
vec![
|
||||||
SeedAnchor {
|
SeedAnchor {
|
||||||
npub: "npub10yffd020a4ag8zcy75f9pruq3rnghvvhd5hphl9s62zgp35s560qrksp9u"
|
npub: "npub10yffd020a4ag8zcy75f9pruq3rnghvvhd5hphl9s62zgp35s560qrksp9u".to_string(),
|
||||||
.to_string(),
|
|
||||||
address: "23.182.128.74:443".to_string(),
|
address: "23.182.128.74:443".to_string(),
|
||||||
transport: "tcp".to_string(),
|
transport: "tcp".to_string(),
|
||||||
label: "FIPS network anchor (join.fips.network)".to_string(),
|
label: "FIPS network anchor (join.fips.network)".to_string(),
|
||||||
},
|
},
|
||||||
SeedAnchor {
|
SeedAnchor {
|
||||||
npub: "npub1qmc3cvfz0yu2hx96nq3gp55zdan2qclealn7xshgr448d3nh6lks7zel98"
|
npub: "npub1qmc3cvfz0yu2hx96nq3gp55zdan2qclealn7xshgr448d3nh6lks7zel98".to_string(),
|
||||||
.to_string(),
|
|
||||||
address: "217.77.8.91:443".to_string(),
|
address: "217.77.8.91:443".to_string(),
|
||||||
transport: "tcp".to_string(),
|
transport: "tcp".to_string(),
|
||||||
label: "FIPS network anchor (join.fips.network)".to_string(),
|
label: "FIPS network anchor (join.fips.network)".to_string(),
|
||||||
@ -158,7 +156,24 @@ pub async fn load(data_dir: &Path) -> Result<Vec<SeedAnchor>> {
|
|||||||
.with_context(|| format!("read {}", path.display()))?;
|
.with_context(|| format!("read {}", path.display()))?;
|
||||||
let anchors: Vec<SeedAnchor> =
|
let anchors: Vec<SeedAnchor> =
|
||||||
serde_json::from_slice(&bytes).with_context(|| format!("parse {}", path.display()))?;
|
serde_json::from_slice(&bytes).with_context(|| format!("parse {}", path.display()))?;
|
||||||
Ok(anchors)
|
Ok(repair_legacy_anchor_set(anchors))
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Add the newer redundant public TCP anchors to legacy files that only carry
|
||||||
|
/// the Archipelago-operated vps2 anchor. A deliberately custom/private anchor
|
||||||
|
/// list remains authoritative; this only repairs the exact stale shape shipped
|
||||||
|
/// before the join.fips.network anchors became defaults.
|
||||||
|
fn repair_legacy_anchor_set(mut anchors: Vec<SeedAnchor>) -> Vec<SeedAnchor> {
|
||||||
|
let has_archy = anchors.iter().any(|a| a.npub == ARCHY_ANCHOR_NPUB);
|
||||||
|
let has_fips_network = fips_network_anchors()
|
||||||
|
.iter()
|
||||||
|
.any(|default| anchors.iter().any(|a| a.npub == default.npub));
|
||||||
|
if has_archy && !has_fips_network {
|
||||||
|
for anchor in fips_network_anchors() {
|
||||||
|
anchors.push(anchor);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
anchors
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Persist the list. Overwrites atomically via write-then-rename so a
|
/// Persist the list. Overwrites atomically via write-then-rename so a
|
||||||
@ -275,12 +290,12 @@ pub struct ApplyResult {
|
|||||||
|
|
||||||
/// FIPS UDP transport port (matches `transports.udp.bind_addr` in the generated
|
/// FIPS UDP transport port (matches `transports.udp.bind_addr` in the generated
|
||||||
/// `fips.yaml`). Direct peer links dial this, NOT the HTTP/LAN messaging port.
|
/// `fips.yaml`). Direct peer links dial this, NOT the HTTP/LAN messaging port.
|
||||||
const FIPS_UDP_PORT: u16 = 8668;
|
const FIPS_UDP_PORT: u16 = crate::fips::PUBLISHED_UDP_PORT;
|
||||||
|
|
||||||
/// Build transient seed-anchor entries that dial LAN-discovered federation peers
|
/// Build transient seed-anchor entries that dial LAN-discovered federation peers
|
||||||
/// directly over their FIPS UDP transport. For each peer the registry knows both
|
/// directly over their FIPS UDP transport. For each peer the registry knows both
|
||||||
/// a LAN socket address AND a FIPS npub for, point a `udp` anchor at
|
/// a LAN socket address AND a FIPS npub for, point a `udp` anchor at
|
||||||
/// `<lan-ip>:8668`. This lets co-located federation nodes form a DIRECT FIPS link
|
/// `<lan-ip>:<FIPS_UDP_PORT>`. This lets co-located federation nodes form a DIRECT FIPS link
|
||||||
/// instead of depending on the global anchor's spanning tree to route between
|
/// instead of depending on the global anchor's spanning tree to route between
|
||||||
/// them (the cause of every dial falling back to Tor when the anchor link flaps).
|
/// them (the cause of every dial falling back to Tor when the anchor link flaps).
|
||||||
///
|
///
|
||||||
@ -340,6 +355,30 @@ mod tests {
|
|||||||
assert!(got.iter().all(|a| a.transport == "tcp"));
|
assert!(got.iter().all(|a| a.transport == "tcp"));
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn load_repairs_legacy_archy_only_anchor_file() {
|
||||||
|
let dir = tempfile::tempdir().unwrap();
|
||||||
|
save(dir.path(), &[archy_anchor()]).await.unwrap();
|
||||||
|
|
||||||
|
let got = load(dir.path()).await.unwrap();
|
||||||
|
assert!(got.iter().any(|a| a.npub == ARCHY_ANCHOR_NPUB));
|
||||||
|
for anchor in fips_network_anchors() {
|
||||||
|
assert!(got.iter().any(|a| a.npub == anchor.npub));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn load_keeps_private_anchor_file_authoritative() {
|
||||||
|
let dir = tempfile::tempdir().unwrap();
|
||||||
|
let private = mk("npub1private");
|
||||||
|
save(dir.path(), std::slice::from_ref(&private))
|
||||||
|
.await
|
||||||
|
.unwrap();
|
||||||
|
|
||||||
|
let got = load(dir.path()).await.unwrap();
|
||||||
|
assert_eq!(got, vec![private]);
|
||||||
|
}
|
||||||
|
|
||||||
#[tokio::test]
|
#[tokio::test]
|
||||||
async fn removing_one_default_persists_and_keeps_the_other() {
|
async fn removing_one_default_persists_and_keeps_the_other() {
|
||||||
// Editing the anchor list (here removing one default) makes the file
|
// Editing the anchor list (here removing one default) makes the file
|
||||||
@ -409,4 +448,39 @@ mod tests {
|
|||||||
assert_eq!(a.transport, "udp");
|
assert_eq!(a.transport, "udp");
|
||||||
assert_eq!(a.label, "");
|
assert_eq!(a.label, "");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn lan_fips_anchor_port_matches_daemon_bind() {
|
||||||
|
// Drift guard: direct LAN anchors must dial the UDP port the
|
||||||
|
// generated fips.yaml actually binds. These were out of sync for
|
||||||
|
// months (anchors dialed 8668, the daemon bound 2121), making the
|
||||||
|
// whole direct-peering feature dial a dead port.
|
||||||
|
let yaml = crate::fips::config::render_config_yaml();
|
||||||
|
assert!(
|
||||||
|
yaml.contains(&format!("0.0.0.0:{FIPS_UDP_PORT}")),
|
||||||
|
"lan_fips_anchors dials :{FIPS_UDP_PORT} but the daemon config binds elsewhere"
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn lan_fips_anchors_builds_direct_entry() {
|
||||||
|
let peer = crate::transport::PeerRecord {
|
||||||
|
did: "did:key:zpeer".to_string(),
|
||||||
|
lan_address: Some("192.168.63.198:5678".to_string()),
|
||||||
|
fips_npub: Some("npub1peer".to_string()),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
let out = lan_fips_anchors(&[peer]);
|
||||||
|
assert_eq!(out.len(), 1);
|
||||||
|
assert_eq!(out[0].address, format!("192.168.63.198:{FIPS_UDP_PORT}"));
|
||||||
|
assert_eq!(out[0].transport, "udp");
|
||||||
|
|
||||||
|
// Peers missing either the LAN address or the npub produce nothing.
|
||||||
|
let no_npub = crate::transport::PeerRecord {
|
||||||
|
did: "did:key:zother".to_string(),
|
||||||
|
lan_address: Some("192.168.63.199:5678".to_string()),
|
||||||
|
..Default::default()
|
||||||
|
};
|
||||||
|
assert!(lan_fips_anchors(&[no_npub]).is_empty());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
44
core/archipelago/src/fips/app_ports.rs
Normal file
44
core/archipelago/src/fips/app_ports.rs
Normal file
@ -0,0 +1,44 @@
|
|||||||
|
//! Generated by scripts/generate-app-catalog.py. Do not edit manually.
|
||||||
|
//!
|
||||||
|
//! Catalog app launch ports (the web UIs the companion opens by direct
|
||||||
|
//! port). Used to write the fips0 firewall allowance drop-in so app UIs
|
||||||
|
//! are reachable over the mesh; ports of apps that aren't installed have
|
||||||
|
//! no listener, so allowing them is inert.
|
||||||
|
|
||||||
|
pub const APP_LAUNCH_PORTS: &[u16] = &[
|
||||||
|
2283,
|
||||||
|
2342,
|
||||||
|
3000,
|
||||||
|
3001,
|
||||||
|
3002,
|
||||||
|
4080,
|
||||||
|
5180,
|
||||||
|
7778,
|
||||||
|
8080,
|
||||||
|
8081,
|
||||||
|
8082,
|
||||||
|
8083,
|
||||||
|
8084,
|
||||||
|
8085,
|
||||||
|
8087,
|
||||||
|
8088,
|
||||||
|
8089,
|
||||||
|
8090,
|
||||||
|
8096,
|
||||||
|
8123,
|
||||||
|
8175,
|
||||||
|
8176,
|
||||||
|
8240,
|
||||||
|
8334,
|
||||||
|
8888,
|
||||||
|
8999,
|
||||||
|
9000,
|
||||||
|
9100,
|
||||||
|
10380,
|
||||||
|
11434,
|
||||||
|
18081,
|
||||||
|
18083,
|
||||||
|
23000,
|
||||||
|
32838,
|
||||||
|
50002,
|
||||||
|
];
|
||||||
@ -48,6 +48,30 @@ pub struct FipsConfig {
|
|||||||
pub struct NodeSection {
|
pub struct NodeSection {
|
||||||
pub identity: IdentitySection,
|
pub identity: IdentitySection,
|
||||||
pub discovery: DiscoverySection,
|
pub discovery: DiscoverySection,
|
||||||
|
pub retry: RetrySection,
|
||||||
|
pub rate_limit: RateLimitSection,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Fast-reconnect profile (`node.retry.*`). Upstream defaults (5s base
|
||||||
|
/// doubling to 300s) are tuned for stable always-on links; a node redialing
|
||||||
|
/// a recycled anchor sat off-mesh for ~90s. Field names verified live on
|
||||||
|
/// 2026-07-24: a daemon restarted with these keys in fips.yaml and peered.
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct RetrySection {
|
||||||
|
pub base_interval_secs: u64,
|
||||||
|
pub max_backoff_secs: u64,
|
||||||
|
pub max_retries: u32,
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Session-handshake resend pacing (`node.rate_limit.*`). Stock 1s x2.0
|
||||||
|
/// gaps out to 8-16s between resends exactly when a route has just
|
||||||
|
/// appeared; 400ms x1.5 keeps continuous coverage through the connect
|
||||||
|
/// window (phone measured session-after-route: 225ms).
|
||||||
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
|
pub struct RateLimitSection {
|
||||||
|
pub handshake_resend_interval_ms: u64,
|
||||||
|
pub handshake_resend_backoff: f64,
|
||||||
|
pub handshake_max_resends: u32,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
@ -60,6 +84,14 @@ pub struct IdentitySection {
|
|||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize)]
|
||||||
pub struct DiscoverySection {
|
pub struct DiscoverySection {
|
||||||
|
/// Lookup completion timeout. Lookups fired while the tree position is
|
||||||
|
/// still settling are doomed; failing them fast (5s, not 10s) lets the
|
||||||
|
/// 1s-backoff retry find the route the moment it exists.
|
||||||
|
pub timeout_secs: u64,
|
||||||
|
pub backoff_base_secs: u64,
|
||||||
|
pub backoff_max_secs: u64,
|
||||||
|
pub retry_interval_secs: u64,
|
||||||
|
pub max_attempts: u8,
|
||||||
pub lan: LanDiscoverySection,
|
pub lan: LanDiscoverySection,
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -123,8 +155,23 @@ impl Default for FipsConfig {
|
|||||||
node: NodeSection {
|
node: NodeSection {
|
||||||
identity: IdentitySection { persistent: true },
|
identity: IdentitySection { persistent: true },
|
||||||
discovery: DiscoverySection {
|
discovery: DiscoverySection {
|
||||||
|
timeout_secs: 5,
|
||||||
|
backoff_base_secs: 1,
|
||||||
|
backoff_max_secs: 30,
|
||||||
|
retry_interval_secs: 2,
|
||||||
|
max_attempts: 3,
|
||||||
lan: LanDiscoverySection { enabled: true },
|
lan: LanDiscoverySection { enabled: true },
|
||||||
},
|
},
|
||||||
|
retry: RetrySection {
|
||||||
|
base_interval_secs: 1,
|
||||||
|
max_backoff_secs: 30,
|
||||||
|
max_retries: 30,
|
||||||
|
},
|
||||||
|
rate_limit: RateLimitSection {
|
||||||
|
handshake_resend_interval_ms: 400,
|
||||||
|
handshake_resend_backoff: 1.5,
|
||||||
|
handshake_max_resends: 10,
|
||||||
|
},
|
||||||
},
|
},
|
||||||
tun: TunSection {
|
tun: TunSection {
|
||||||
enabled: true,
|
enabled: true,
|
||||||
@ -186,6 +233,75 @@ pub async fn install(identity_dir: &Path) -> Result<()> {
|
|||||||
let _ = tokio::fs::remove_file(&stage).await;
|
let _ = tokio::fs::remove_file(&stage).await;
|
||||||
install_result?;
|
install_result?;
|
||||||
|
|
||||||
|
// The release-hardening firewall (/etc/fips/fips.nft, provisioned
|
||||||
|
// out-of-band) default-denies inbound on fips0 — without an explicit
|
||||||
|
// allowance the node's web UI is unreachable over the mesh (phones got
|
||||||
|
// RST on :80 with a healthy session; root-caused 2026-07-26 on
|
||||||
|
// framework-pt). Ship the allowance as a fips.d drop-in on every
|
||||||
|
// install/upgrade so no node ever regresses to a UI-less mesh.
|
||||||
|
sudo_install_dir("/etc/fips/fips.d").await?;
|
||||||
|
// PEER_PORT (5679) carries ALL federation sync, cloud browse/download,
|
||||||
|
// mesh envelopes, DWN and invoices. It was missing from this allowlist
|
||||||
|
// while the comment claimed "web UI + peer API" — so every hardened
|
||||||
|
// node silently dropped peers' FIPS dials at the firewall and the whole
|
||||||
|
// fleet fell back to Tor (root-caused live 2026-07-27: 28k drops on
|
||||||
|
// .198's counter; :5679 answered in 0.35s once the rule was inserted).
|
||||||
|
let dropin = format!(
|
||||||
|
"# Written by archipelago on every daemon config install.\n\
|
||||||
|
# Allows the web UI + peer API through the fips0\n\
|
||||||
|
# default-deny inbound baseline (fips.nft).\n\
|
||||||
|
tcp dport 80 accept\n\
|
||||||
|
tcp dport 8443 accept\n\
|
||||||
|
tcp dport {peer_port} accept\n",
|
||||||
|
peer_port = crate::fips::dial::PEER_PORT
|
||||||
|
);
|
||||||
|
let nft_stage = std::env::temp_dir().join(format!("fips-webui-{}.nft", std::process::id()));
|
||||||
|
tokio::fs::write(&nft_stage, dropin)
|
||||||
|
.await
|
||||||
|
.context("Failed to stage web-ui nft drop-in")?;
|
||||||
|
let nft_install = sudo_install_file(&nft_stage, "/etc/fips/fips.d/80-web-ui.nft", "0644").await;
|
||||||
|
let _ = tokio::fs::remove_file(&nft_stage).await;
|
||||||
|
nft_install?;
|
||||||
|
|
||||||
|
// App launch ports: the companion opens catalog apps by direct port
|
||||||
|
// over the mesh. Ports of apps that aren't installed have no listener,
|
||||||
|
// so the allowance is inert until an app exists to answer.
|
||||||
|
let port_list = super::app_ports::APP_LAUNCH_PORTS
|
||||||
|
.iter()
|
||||||
|
.map(|p| p.to_string())
|
||||||
|
.collect::<Vec<_>>()
|
||||||
|
.join(", ");
|
||||||
|
let app_dropin = format!(
|
||||||
|
"# Written by archipelago on every daemon config install.\n\
|
||||||
|
# Catalog app launch ports (web UIs) allowed through the fips0\n\
|
||||||
|
# default-deny inbound baseline. Service/RPC ports stay closed.\n\
|
||||||
|
tcp dport {{ {port_list} }} accept\n"
|
||||||
|
);
|
||||||
|
let app_stage = std::env::temp_dir().join(format!("fips-appports-{}.nft", std::process::id()));
|
||||||
|
tokio::fs::write(&app_stage, app_dropin)
|
||||||
|
.await
|
||||||
|
.context("Failed to stage app-ports nft drop-in")?;
|
||||||
|
let app_install =
|
||||||
|
sudo_install_file(&app_stage, "/etc/fips/fips.d/85-app-ports.nft", "0644").await;
|
||||||
|
let _ = tokio::fs::remove_file(&app_stage).await;
|
||||||
|
app_install?;
|
||||||
|
// Make the allowance live immediately; a no-op error when the
|
||||||
|
// hardening baseline isn't installed on this node yet.
|
||||||
|
if tokio::fs::try_exists("/etc/fips/fips.nft").await.unwrap_or(false) {
|
||||||
|
match Command::new("sudo")
|
||||||
|
.args(["nft", "-f", "/etc/fips/fips.nft"])
|
||||||
|
.output()
|
||||||
|
.await
|
||||||
|
{
|
||||||
|
Ok(out) if !out.status.success() => tracing::warn!(
|
||||||
|
"nft reload after web-ui drop-in failed: {}",
|
||||||
|
String::from_utf8_lossy(&out.stderr).trim()
|
||||||
|
),
|
||||||
|
Err(e) => tracing::warn!("nft reload after web-ui drop-in failed: {e}"),
|
||||||
|
_ => {}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
sudo_install_file(&src_key, DAEMON_KEY_PATH, "0600").await?;
|
sudo_install_file(&src_key, DAEMON_KEY_PATH, "0600").await?;
|
||||||
// Heal a legacy fips_key.pub that was written as bech32 npub text
|
// Heal a legacy fips_key.pub that was written as bech32 npub text
|
||||||
// (pre-fix identity::write_fips_key_from_seed did this). Upstream
|
// (pre-fix identity::write_fips_key_from_seed did this). Upstream
|
||||||
@ -318,8 +434,21 @@ node:
|
|||||||
identity:
|
identity:
|
||||||
persistent: true
|
persistent: true
|
||||||
discovery:
|
discovery:
|
||||||
|
timeout_secs: 5
|
||||||
|
backoff_base_secs: 1
|
||||||
|
backoff_max_secs: 30
|
||||||
|
retry_interval_secs: 2
|
||||||
|
max_attempts: 3
|
||||||
lan:
|
lan:
|
||||||
enabled: true
|
enabled: true
|
||||||
|
retry:
|
||||||
|
base_interval_secs: 1
|
||||||
|
max_backoff_secs: 30
|
||||||
|
max_retries: 30
|
||||||
|
rate_limit:
|
||||||
|
handshake_resend_interval_ms: 400
|
||||||
|
handshake_resend_backoff: 1.5
|
||||||
|
handshake_max_resends: 10
|
||||||
tun:
|
tun:
|
||||||
enabled: true
|
enabled: true
|
||||||
name: fips0
|
name: fips0
|
||||||
|
|||||||
@ -447,14 +447,26 @@ impl<'a> PeerRequest<'a> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let url = format!("{}{}", base, self.path);
|
let url = format!("{}{}", base, self.path);
|
||||||
let c = client_with_timeout(self.fips_attempt_timeout());
|
let budget = self.fips_attempt_timeout();
|
||||||
|
// With an explicit fast-fail cap, halve the per-attempt client
|
||||||
|
// timeout so the one-retry path in send_with_retry fits inside the
|
||||||
|
// budget instead of silently doubling it ("fips_timeout(6s)" used
|
||||||
|
// to really mean ~12.6s). Without one (long streaming downloads),
|
||||||
|
// keep the full budget per attempt — the client timeout also
|
||||||
|
// governs body streaming and must not truncate a real transfer.
|
||||||
|
let per_attempt = if self.fips_timeout.is_some() {
|
||||||
|
budget / 2
|
||||||
|
} else {
|
||||||
|
budget
|
||||||
|
};
|
||||||
|
let c = client_with_timeout(per_attempt);
|
||||||
let mut rb = c.post(&url).json(body);
|
let mut rb = c.post(&url).json(body);
|
||||||
for (k, v) in &self.headers {
|
for (k, v) in &self.headers {
|
||||||
rb = rb.header(*k, v);
|
rb = rb.header(*k, v);
|
||||||
}
|
}
|
||||||
match send_with_retry(rb).await {
|
match tokio::time::timeout(budget, send_with_retry(rb)).await {
|
||||||
Ok(r) => Ok(Some(r)),
|
Ok(Ok(r)) => Ok(Some(r)),
|
||||||
Err(e) => {
|
Ok(Err(e)) => {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"FIPS POST {} failed after retry: {}, falling back to Tor",
|
"FIPS POST {} failed after retry: {}, falling back to Tor",
|
||||||
url,
|
url,
|
||||||
@ -462,6 +474,14 @@ impl<'a> PeerRequest<'a> {
|
|||||||
);
|
);
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
Err(_) => {
|
||||||
|
tracing::debug!(
|
||||||
|
"FIPS POST {} exceeded attempt budget {:?}, falling back to Tor",
|
||||||
|
url,
|
||||||
|
budget
|
||||||
|
);
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -480,14 +500,22 @@ impl<'a> PeerRequest<'a> {
|
|||||||
}
|
}
|
||||||
};
|
};
|
||||||
let url = format!("{}{}", base, self.path);
|
let url = format!("{}{}", base, self.path);
|
||||||
let c = client_with_timeout(self.fips_attempt_timeout());
|
let budget = self.fips_attempt_timeout();
|
||||||
|
// Same budget discipline as the POST path: halve per attempt only
|
||||||
|
// under an explicit fast-fail cap; hard-cap the retry sequence.
|
||||||
|
let per_attempt = if self.fips_timeout.is_some() {
|
||||||
|
budget / 2
|
||||||
|
} else {
|
||||||
|
budget
|
||||||
|
};
|
||||||
|
let c = client_with_timeout(per_attempt);
|
||||||
let mut rb = c.get(&url);
|
let mut rb = c.get(&url);
|
||||||
for (k, v) in &self.headers {
|
for (k, v) in &self.headers {
|
||||||
rb = rb.header(*k, v);
|
rb = rb.header(*k, v);
|
||||||
}
|
}
|
||||||
match send_with_retry(rb).await {
|
match tokio::time::timeout(budget, send_with_retry(rb)).await {
|
||||||
Ok(r) => Ok(Some(r)),
|
Ok(Ok(r)) => Ok(Some(r)),
|
||||||
Err(e) => {
|
Ok(Err(e)) => {
|
||||||
tracing::debug!(
|
tracing::debug!(
|
||||||
"FIPS GET {} failed after retry: {}, falling back to Tor",
|
"FIPS GET {} failed after retry: {}, falling back to Tor",
|
||||||
url,
|
url,
|
||||||
@ -495,6 +523,14 @@ impl<'a> PeerRequest<'a> {
|
|||||||
);
|
);
|
||||||
Ok(None)
|
Ok(None)
|
||||||
}
|
}
|
||||||
|
Err(_) => {
|
||||||
|
tracing::debug!(
|
||||||
|
"FIPS GET {} exceeded attempt budget {:?}, falling back to Tor",
|
||||||
|
url,
|
||||||
|
budget
|
||||||
|
);
|
||||||
|
Ok(None)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@ -26,6 +26,7 @@
|
|||||||
#![allow(dead_code)]
|
#![allow(dead_code)]
|
||||||
|
|
||||||
pub mod anchors;
|
pub mod anchors;
|
||||||
|
pub mod app_ports;
|
||||||
pub mod config;
|
pub mod config;
|
||||||
pub mod dial;
|
pub mod dial;
|
||||||
pub mod iface;
|
pub mod iface;
|
||||||
@ -53,7 +54,8 @@ pub async fn ensure_activated(data_dir: &std::path::Path) {
|
|||||||
tracing::warn!("FIPS auto-activate: config install failed: {:#}", e);
|
tracing::warn!("FIPS auto-activate: config install failed: {:#}", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if let Err(e) = service::activate(SERVICE_UNIT).await {
|
let unit = service::activation_unit().await;
|
||||||
|
if let Err(e) = service::activate(unit).await {
|
||||||
tracing::warn!("FIPS auto-activate: service activate failed: {:#}", e);
|
tracing::warn!("FIPS auto-activate: service activate failed: {:#}", e);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|||||||
@ -32,6 +32,16 @@ pub async fn unit_state(unit: &str) -> String {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Whether systemd knows about `unit`.
|
||||||
|
pub async fn unit_exists(unit: &str) -> bool {
|
||||||
|
Command::new("systemctl")
|
||||||
|
.args(["cat", unit])
|
||||||
|
.output()
|
||||||
|
.await
|
||||||
|
.map(|out| out.status.success())
|
||||||
|
.unwrap_or(false)
|
||||||
|
}
|
||||||
|
|
||||||
/// Whether the `fips` debian package is installed on the host.
|
/// Whether the `fips` debian package is installed on the host.
|
||||||
pub async fn package_installed() -> bool {
|
pub async fn package_installed() -> bool {
|
||||||
// dpkg-query -W -f='${Status}' fips → "install ok installed" when present.
|
// dpkg-query -W -f='${Status}' fips → "install ok installed" when present.
|
||||||
@ -81,6 +91,7 @@ async fn sudo_systemctl(verb: &str, unit: &str) -> Result<()> {
|
|||||||
/// Unmask + start + enable the FIPS service. Idempotent — safe to call
|
/// Unmask + start + enable the FIPS service. Idempotent — safe to call
|
||||||
/// on every backend startup once the key is on disk.
|
/// on every backend startup once the key is on disk.
|
||||||
pub async fn activate(unit: &str) -> Result<()> {
|
pub async fn activate(unit: &str) -> Result<()> {
|
||||||
|
kill_stale_daemons().await?;
|
||||||
// Order matters: unmask before enable/start, otherwise enable fails
|
// Order matters: unmask before enable/start, otherwise enable fails
|
||||||
// on a masked unit.
|
// on a masked unit.
|
||||||
sudo_systemctl("unmask", unit).await?;
|
sudo_systemctl("unmask", unit).await?;
|
||||||
@ -94,20 +105,64 @@ pub async fn stop(unit: &str) -> Result<()> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub async fn restart(unit: &str) -> Result<()> {
|
pub async fn restart(unit: &str) -> Result<()> {
|
||||||
|
kill_stale_daemons().await?;
|
||||||
sudo_systemctl("restart", unit).await
|
sudo_systemctl("restart", unit).await
|
||||||
}
|
}
|
||||||
|
|
||||||
/// Resolve which systemd unit is actually supervising the fips daemon
|
/// Kill orphaned `fips` processes not owned by either known systemd unit.
|
||||||
/// on this host. Nodes installed from the archipelago ISO run
|
///
|
||||||
/// `archipelago-fips.service`; nodes that were apt-installed (or had
|
/// Field failure, 2026-07-24: a stale daemon survived outside systemd and kept
|
||||||
/// fips running before archipelago took over) may only have the
|
/// `0.0.0.0:8443` bound. The supervised daemon then started UDP-only, so every
|
||||||
/// upstream `fips.service`. Restart/Reconnect must operate on whichever
|
/// TCP seed-anchor connect failed with "no operational transport" and phones
|
||||||
/// one is running, otherwise the UI button is a silent no-op.
|
/// on 5G could not discover the node. We keep the cleanup narrow: preserve the
|
||||||
|
/// MainPID of both units and terminate only extra `pgrep -x fips` matches.
|
||||||
|
pub async fn kill_stale_daemons() -> Result<()> {
|
||||||
|
let script = format!(
|
||||||
|
r#"keep="$(systemctl show -p MainPID --value {managed} 2>/dev/null; systemctl show -p MainPID --value {upstream} 2>/dev/null)"
|
||||||
|
for pid in $(pgrep -x fips 2>/dev/null || true); do
|
||||||
|
case " $keep " in
|
||||||
|
*" $pid "*) ;;
|
||||||
|
*) kill "$pid" 2>/dev/null || true ;;
|
||||||
|
esac
|
||||||
|
done
|
||||||
|
"#,
|
||||||
|
managed = super::SERVICE_UNIT,
|
||||||
|
upstream = super::UPSTREAM_SERVICE_UNIT,
|
||||||
|
);
|
||||||
|
let out = Command::new("sudo")
|
||||||
|
.args(["sh", "-c", &script])
|
||||||
|
.output()
|
||||||
|
.await
|
||||||
|
.context("sudo stale fips cleanup failed to launch")?;
|
||||||
|
if !out.status.success() {
|
||||||
|
let stderr = String::from_utf8_lossy(&out.stderr).trim().to_string();
|
||||||
|
anyhow::bail!("stale fips cleanup failed: {}", stderr);
|
||||||
|
}
|
||||||
|
Ok(())
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Resolve which systemd unit should be started when FIPS is inactive.
|
||||||
|
/// Newer Archipelago images may ship `archipelago-fips.service`; nodes with
|
||||||
|
/// the upstream Debian package may only have `fips.service`. Activation must
|
||||||
|
/// choose a unit systemd can actually load, otherwise the dashboard repeatedly
|
||||||
|
/// offers an "Activate" action that can never succeed.
|
||||||
|
pub async fn activation_unit() -> &'static str {
|
||||||
|
if unit_exists(super::SERVICE_UNIT).await {
|
||||||
|
return super::SERVICE_UNIT;
|
||||||
|
}
|
||||||
|
if unit_exists(super::UPSTREAM_SERVICE_UNIT).await {
|
||||||
|
return super::UPSTREAM_SERVICE_UNIT;
|
||||||
|
}
|
||||||
|
super::SERVICE_UNIT
|
||||||
|
}
|
||||||
|
|
||||||
|
/// Resolve which systemd unit is actually supervising the fips daemon on this
|
||||||
|
/// host. Restart/Reconnect must operate on whichever one is running, otherwise
|
||||||
|
/// the UI button is a silent no-op.
|
||||||
///
|
///
|
||||||
/// Returns the archipelago-managed unit name if it's active,
|
/// Returns the archipelago-managed unit name if it's active,
|
||||||
/// else the upstream unit name if that's active,
|
/// else the upstream unit name if that's active,
|
||||||
/// else the archipelago-managed name as a default (so activate() can
|
/// else a startable activation unit.
|
||||||
/// bring it up).
|
|
||||||
pub async fn active_unit() -> &'static str {
|
pub async fn active_unit() -> &'static str {
|
||||||
if unit_state(super::SERVICE_UNIT).await == "active" {
|
if unit_state(super::SERVICE_UNIT).await == "active" {
|
||||||
return super::SERVICE_UNIT;
|
return super::SERVICE_UNIT;
|
||||||
@ -115,7 +170,7 @@ pub async fn active_unit() -> &'static str {
|
|||||||
if unit_state(super::UPSTREAM_SERVICE_UNIT).await == "active" {
|
if unit_state(super::UPSTREAM_SERVICE_UNIT).await == "active" {
|
||||||
return super::UPSTREAM_SERVICE_UNIT;
|
return super::UPSTREAM_SERVICE_UNIT;
|
||||||
}
|
}
|
||||||
super::SERVICE_UNIT
|
activation_unit().await
|
||||||
}
|
}
|
||||||
|
|
||||||
pub async fn mask(unit: &str) -> Result<()> {
|
pub async fn mask(unit: &str) -> Result<()> {
|
||||||
@ -214,4 +269,10 @@ mod tests {
|
|||||||
// Must not panic regardless of host state.
|
// Must not panic regardless of host state.
|
||||||
let _ = package_installed().await;
|
let _ = package_installed().await;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
#[tokio::test]
|
||||||
|
async fn test_unit_exists_is_bool() {
|
||||||
|
// Must not panic regardless of host state.
|
||||||
|
let _ = unit_exists("archipelago-bogus-test.service").await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -34,7 +34,6 @@ mod bitcoin_rpc;
|
|||||||
mod bitcoin_status;
|
mod bitcoin_status;
|
||||||
mod blobs;
|
mod blobs;
|
||||||
mod bootstrap;
|
mod bootstrap;
|
||||||
mod mesh_ports;
|
|
||||||
mod ceremony;
|
mod ceremony;
|
||||||
mod config;
|
mod config;
|
||||||
mod constants;
|
mod constants;
|
||||||
@ -57,6 +56,7 @@ mod identity;
|
|||||||
mod identity_manager;
|
mod identity_manager;
|
||||||
mod marketplace;
|
mod marketplace;
|
||||||
mod mesh;
|
mod mesh;
|
||||||
|
mod mesh_ports;
|
||||||
mod monitoring;
|
mod monitoring;
|
||||||
mod names;
|
mod names;
|
||||||
mod network;
|
mod network;
|
||||||
@ -199,6 +199,26 @@ async fn main() -> Result<()> {
|
|||||||
// Now mark this instance as running so the next startup can detect a crash.
|
// Now mark this instance as running so the next startup can detect a crash.
|
||||||
crash_recovery::write_pid_marker(&config.data_dir).await?;
|
crash_recovery::write_pid_marker(&config.data_dir).await?;
|
||||||
|
|
||||||
|
// Signal READY *before* the heavy synchronous boot recovery below. On a
|
||||||
|
// node with many stacks that recovery takes minutes, and the unit sat in
|
||||||
|
// `activating` the whole time — so anything that touched the service in
|
||||||
|
// that window (a superseding start/restart, a start-timeout) killed a
|
||||||
|
// half-started instance, which then exited 0 and (under the old
|
||||||
|
// Restart=on-failure) never came back: "server starting up" forever,
|
||||||
|
// reproduced on framework-pt installing apps on 2026-07-26. The daemon's
|
||||||
|
// real work (recovery, reconcile, listener) continues after READY; being
|
||||||
|
// "active" early is honest — the process is up and doing its job.
|
||||||
|
let _ = sd_notify::notify(false, &[sd_notify::NotifyState::Ready]);
|
||||||
|
// Watchdog pings must run DURING the long recovery too, or a slow boot
|
||||||
|
// trips WatchdogSec. Spawn the keepalive here rather than after serve().
|
||||||
|
tokio::spawn(async {
|
||||||
|
let mut interval = tokio::time::interval(std::time::Duration::from_secs(120));
|
||||||
|
loop {
|
||||||
|
interval.tick().await;
|
||||||
|
let _ = sd_notify::notify(false, &[sd_notify::NotifyState::Watchdog]);
|
||||||
|
}
|
||||||
|
});
|
||||||
|
|
||||||
// Run crash recovery before starting the manifest reconciler. Both paths
|
// Run crash recovery before starting the manifest reconciler. Both paths
|
||||||
// mutate Podman; running them concurrently can corrupt transient runtime
|
// mutate Podman; running them concurrently can corrupt transient runtime
|
||||||
// state and leave netavark/conmon unable to start containers.
|
// state and leave netavark/conmon unable to start containers.
|
||||||
@ -479,16 +499,9 @@ async fn main() -> Result<()> {
|
|||||||
|
|
||||||
// Notify systemd that we're ready (Type=notify)
|
// Notify systemd that we're ready (Type=notify)
|
||||||
// Note: first param `false` keeps NOTIFY_SOCKET so watchdog pings work
|
// Note: first param `false` keeps NOTIFY_SOCKET so watchdog pings work
|
||||||
let _ = sd_notify::notify(false, &[sd_notify::NotifyState::Ready]);
|
// READY + watchdog keepalive were already signalled/spawned earlier
|
||||||
|
// (before boot recovery) so the unit reaches `active` in seconds instead
|
||||||
// Spawn systemd watchdog ping (WatchdogSec=300, ping every 120s)
|
// of sitting in `activating` through a minutes-long recovery.
|
||||||
tokio::spawn(async {
|
|
||||||
let mut interval = tokio::time::interval(std::time::Duration::from_secs(120));
|
|
||||||
loop {
|
|
||||||
interval.tick().await;
|
|
||||||
let _ = sd_notify::notify(false, &[sd_notify::NotifyState::Watchdog]);
|
|
||||||
}
|
|
||||||
});
|
|
||||||
|
|
||||||
// Graceful shutdown: wait for SIGTERM or SIGINT
|
// Graceful shutdown: wait for SIGTERM or SIGINT
|
||||||
let mut sigterm = signal::unix::signal(signal::unix::SignalKind::terminate())
|
let mut sigterm = signal::unix::signal(signal::unix::SignalKind::terminate())
|
||||||
|
|||||||
@ -87,6 +87,18 @@ const RECONNECT_DELAY_INIT: Duration = Duration::from_secs(5);
|
|||||||
/// Maximum reconnect delay (cap for exponential backoff).
|
/// Maximum reconnect delay (cap for exponential backoff).
|
||||||
const RECONNECT_DELAY_MAX: Duration = Duration::from_secs(60);
|
const RECONNECT_DELAY_MAX: Duration = Duration::from_secs(60);
|
||||||
|
|
||||||
|
/// Minimum time a session must run before we trust it enough to reset
|
||||||
|
/// backoff to the minimum. Without this gate, a device that connects then
|
||||||
|
/// fails again within a couple of seconds (e.g. mid-boot-loop) never backs
|
||||||
|
/// off — every retry immediately re-opens the port, which toggles DTR/RTS
|
||||||
|
/// (resets many ESP32 boards' MCU on native-USB and CP2102/CH340
|
||||||
|
/// auto-reset-circuit boards alike), turning a device that's merely
|
||||||
|
/// unstable into a self-sustaining boot loop that outlasts whatever
|
||||||
|
/// triggered the original instability. Confirmed live 2026-07-23: a Heltec
|
||||||
|
/// V3 stuck retrying every ~5-15s for 5+ minutes after a failed firmware
|
||||||
|
/// flash left it in a marginal state.
|
||||||
|
const STABLE_SESSION_THRESHOLD: Duration = Duration::from_secs(20);
|
||||||
|
|
||||||
/// Number of consecutive write failures before we consider the device dead
|
/// Number of consecutive write failures before we consider the device dead
|
||||||
/// and trigger a reconnection cycle.
|
/// and trigger a reconnection cycle.
|
||||||
const MAX_CONSECUTIVE_WRITE_FAILURES: u32 = 3;
|
const MAX_CONSECUTIVE_WRITE_FAILURES: u32 = 3;
|
||||||
@ -438,7 +450,10 @@ impl MeshState {
|
|||||||
let persisted: PersistedMessages = match serde_json::from_slice(&bytes) {
|
let persisted: PersistedMessages = match serde_json::from_slice(&bytes) {
|
||||||
Ok(p) => p,
|
Ok(p) => p,
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
warn!("mesh: parsing {} failed (skipping restore): {e}", path.display());
|
warn!(
|
||||||
|
"mesh: parsing {} failed (skipping restore): {e}",
|
||||||
|
path.display()
|
||||||
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
@ -454,7 +469,10 @@ impl MeshState {
|
|||||||
*id = max_id + 1;
|
*id = max_id + 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
info!("mesh: restored {count} persisted messages (next id {})", max_id + 1);
|
info!(
|
||||||
|
"mesh: restored {count} persisted messages (next id {})",
|
||||||
|
max_id + 1
|
||||||
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -498,7 +516,11 @@ pub fn spawn_message_persister(state: Arc<MeshState>) {
|
|||||||
warn!("mesh: chmod {} failed: {e}", tmp.display());
|
warn!("mesh: chmod {} failed: {e}", tmp.display());
|
||||||
}
|
}
|
||||||
if let Err(e) = tokio::fs::rename(&tmp, &path).await {
|
if let Err(e) = tokio::fs::rename(&tmp, &path).await {
|
||||||
warn!("mesh: renaming {} -> {} failed: {e}", tmp.display(), path.display());
|
warn!(
|
||||||
|
"mesh: renaming {} -> {} failed: {e}",
|
||||||
|
tmp.display(),
|
||||||
|
path.display()
|
||||||
|
);
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
last_written = Some(json);
|
last_written = Some(json);
|
||||||
@ -550,6 +572,7 @@ pub fn spawn_mesh_listener(
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
let session_start = std::time::Instant::now();
|
||||||
match session::run_mesh_session(
|
match session::run_mesh_session(
|
||||||
&state,
|
&state,
|
||||||
&data_dir,
|
&data_dir,
|
||||||
@ -572,13 +595,14 @@ pub fn spawn_mesh_listener(
|
|||||||
{
|
{
|
||||||
Ok(()) => {
|
Ok(()) => {
|
||||||
info!("Mesh session ended cleanly");
|
info!("Mesh session ended cleanly");
|
||||||
// Session was established before ending — reset backoff
|
// Only trust a session that actually ran for a while —
|
||||||
reconnect_delay = RECONNECT_DELAY_INIT;
|
// see STABLE_SESSION_THRESHOLD's doc comment.
|
||||||
|
if session_start.elapsed() >= STABLE_SESSION_THRESHOLD {
|
||||||
|
reconnect_delay = RECONNECT_DELAY_INIT;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Err(e) => {
|
Err(e) => {
|
||||||
// Check if session was ever connected (vs failed to open)
|
if session_start.elapsed() >= STABLE_SESSION_THRESHOLD {
|
||||||
let was_connected = state.status.read().await.device_connected;
|
|
||||||
if was_connected {
|
|
||||||
reconnect_delay = RECONNECT_DELAY_INIT;
|
reconnect_delay = RECONNECT_DELAY_INIT;
|
||||||
}
|
}
|
||||||
error!("Mesh session error: {} (retry in {:?})", e, reconnect_delay);
|
error!("Mesh session error: {} (retry in {:?})", e, reconnect_delay);
|
||||||
|
|||||||
@ -269,10 +269,23 @@ async fn auto_detect_and_open(
|
|||||||
our_ed_pubkey_hex: &str,
|
our_ed_pubkey_hex: &str,
|
||||||
our_x25519_pubkey_hex: &str,
|
our_x25519_pubkey_hex: &str,
|
||||||
device_kind: Option<DeviceType>,
|
device_kind: Option<DeviceType>,
|
||||||
|
skip_path: Option<&str>,
|
||||||
) -> Result<(String, MeshRadioDevice, DeviceInfo)> {
|
) -> Result<(String, MeshRadioDevice, DeviceInfo)> {
|
||||||
let paths = super::super::serial::detect_serial_devices().await;
|
let mut paths = super::super::serial::detect_serial_devices().await;
|
||||||
|
// When falling back from a just-failed preferred path, don't probe that
|
||||||
|
// same device again in the same cycle — every open() toggles DTR/RTS,
|
||||||
|
// which resets ESP32-family boards, and back-to-back re-probes are what
|
||||||
|
// keeps a mid-boot board from ever finishing its boot.
|
||||||
|
if let Some(skip) = skip_path {
|
||||||
|
let canon = |p: &str| std::fs::canonicalize(p).unwrap_or_else(|_| p.into());
|
||||||
|
let skip_canon = canon(skip);
|
||||||
|
paths.retain(|p| canon(p) != skip_canon);
|
||||||
|
}
|
||||||
if paths.is_empty() {
|
if paths.is_empty() {
|
||||||
anyhow::bail!("No serial devices found in /dev");
|
anyhow::bail!(match skip_path {
|
||||||
|
Some(skip) => format!("No serial devices found in /dev besides {skip}, which was already probed this cycle"),
|
||||||
|
None => "No serial devices found in /dev".to_string(),
|
||||||
|
});
|
||||||
}
|
}
|
||||||
for path in &paths {
|
for path in &paths {
|
||||||
debug!(path = %path, "Probing for mesh radio device");
|
debug!(path = %path, "Probing for mesh radio device");
|
||||||
@ -359,6 +372,16 @@ pub struct DeviceProbe {
|
|||||||
pub max_contacts: Option<u16>,
|
pub max_contacts: Option<u16>,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Serializes serial-port open sequences between the listener's session
|
||||||
|
/// opens and the RPC probe (`mesh.probe-device`). Linux happily double-opens
|
||||||
|
/// a tty, and two concurrent handshakes corrupt each other into silence —
|
||||||
|
/// observed live on .116 (2026-07-26): the kiosk browser's hot-swap
|
||||||
|
/// auto-probe collided with the listener's cycle on every backoff window, so
|
||||||
|
/// neither ever succeeded, and each collision's open() DTR/RTS-reset the
|
||||||
|
/// board again. The probe's retry-across-idle-gaps heuristic (5f01ec31)
|
||||||
|
/// narrowed but could not close the race; this closes it.
|
||||||
|
static PORT_OPEN_LOCK: tokio::sync::Mutex<()> = tokio::sync::Mutex::const_new(());
|
||||||
|
|
||||||
/// Probe a serial port for a mesh radio WITHOUT provisioning it: identify the
|
/// Probe a serial port for a mesh radio WITHOUT provisioning it: identify the
|
||||||
/// firmware (same strict Reticulum→Meshcore→Meshtastic order as auto-detect,
|
/// firmware (same strict Reticulum→Meshcore→Meshtastic order as auto-detect,
|
||||||
/// for the same RNode-wedging reason) and read what's currently configured on
|
/// for the same RNode-wedging reason) and read what's currently configured on
|
||||||
@ -366,11 +389,10 @@ pub struct DeviceProbe {
|
|||||||
/// loop can pick the device up afterwards. Reticulum uses the bare KISS
|
/// loop can pick the device up afterwards. Reticulum uses the bare KISS
|
||||||
/// DETECT probe — no daemon spawn just to identify a stick.
|
/// DETECT probe — no daemon spawn just to identify a stick.
|
||||||
pub(crate) async fn probe_device(path: &str) -> Result<DeviceProbe> {
|
pub(crate) async fn probe_device(path: &str) -> Result<DeviceProbe> {
|
||||||
// The listener's reconnect loop may hold this port for ~10s of every
|
// Retries kept even with PORT_OPEN_LOCK closing the double-open race:
|
||||||
// backoff cycle, and Linux happily double-opens a tty — two concurrent
|
// the board may still be mid-boot from a previous open's DTR/RTS reset,
|
||||||
// handshakes corrupt each other into silence (observed on framework-pt:
|
// and a later attempt after a quiet gap can succeed where the first
|
||||||
// every firmware "failed" while the listener was mid-cycle). Retry across
|
// couldn't.
|
||||||
// the listener's idle gaps instead of failing on first collision.
|
|
||||||
let mut last_err = None;
|
let mut last_err = None;
|
||||||
for attempt in 0..3u32 {
|
for attempt in 0..3u32 {
|
||||||
if attempt > 0 {
|
if attempt > 0 {
|
||||||
@ -385,6 +407,7 @@ pub(crate) async fn probe_device(path: &str) -> Result<DeviceProbe> {
|
|||||||
}
|
}
|
||||||
|
|
||||||
async fn probe_device_once(path: &str) -> Result<DeviceProbe> {
|
async fn probe_device_once(path: &str) -> Result<DeviceProbe> {
|
||||||
|
let _port_guard = PORT_OPEN_LOCK.lock().await;
|
||||||
if super::super::reticulum::probe_rnode(path).await.is_ok() {
|
if super::super::reticulum::probe_rnode(path).await.is_ok() {
|
||||||
return Ok(DeviceProbe {
|
return Ok(DeviceProbe {
|
||||||
path: path.to_string(),
|
path: path.to_string(),
|
||||||
@ -963,6 +986,11 @@ pub(super) async fn run_mesh_session(
|
|||||||
// set, otherwise try the preferred serial path, falling back to
|
// set, otherwise try the preferred serial path, falling back to
|
||||||
// auto-detect. TCP mode is additive/dev-only; it never changes behavior
|
// auto-detect. TCP mode is additive/dev-only; it never changes behavior
|
||||||
// for existing serial/RNode deployments where `reticulum_tcp` is None.
|
// for existing serial/RNode deployments where `reticulum_tcp` is None.
|
||||||
|
//
|
||||||
|
// The whole open sequence runs under PORT_OPEN_LOCK so an RPC probe
|
||||||
|
// can't interleave its own handshakes on the same tty (see the lock's
|
||||||
|
// doc comment). Held only until the device is opened, then released.
|
||||||
|
let port_guard = PORT_OPEN_LOCK.lock().await;
|
||||||
let (device_path, mut device, device_info) = if let Some(tcp_cfg) = &reticulum_tcp {
|
let (device_path, mut device, device_info) = if let Some(tcp_cfg) = &reticulum_tcp {
|
||||||
open_reticulum_tcp(tcp_cfg, data_dir, our_ed_pubkey_hex, our_x25519_pubkey_hex).await?
|
open_reticulum_tcp(tcp_cfg, data_dir, our_ed_pubkey_hex, our_x25519_pubkey_hex).await?
|
||||||
} else if let Some(path) = preferred_path {
|
} else if let Some(path) = preferred_path {
|
||||||
@ -986,6 +1014,7 @@ pub(super) async fn run_mesh_session(
|
|||||||
our_ed_pubkey_hex,
|
our_ed_pubkey_hex,
|
||||||
our_x25519_pubkey_hex,
|
our_x25519_pubkey_hex,
|
||||||
device_kind,
|
device_kind,
|
||||||
|
Some(path),
|
||||||
)
|
)
|
||||||
.await?
|
.await?
|
||||||
}
|
}
|
||||||
@ -996,9 +1025,11 @@ pub(super) async fn run_mesh_session(
|
|||||||
our_ed_pubkey_hex,
|
our_ed_pubkey_hex,
|
||||||
our_x25519_pubkey_hex,
|
our_x25519_pubkey_hex,
|
||||||
device_kind,
|
device_kind,
|
||||||
|
None,
|
||||||
)
|
)
|
||||||
.await?
|
.await?
|
||||||
};
|
};
|
||||||
|
drop(port_guard);
|
||||||
|
|
||||||
// Update status
|
// Update status
|
||||||
{
|
{
|
||||||
|
|||||||
@ -191,10 +191,13 @@ impl MeshtasticDevice {
|
|||||||
.current_modem_preset
|
.current_modem_preset
|
||||||
.and_then(modem_preset_name)
|
.and_then(modem_preset_name)
|
||||||
.map(str::to_string),
|
.map(str::to_string),
|
||||||
primary_channel: self
|
primary_channel: self.current_primary_channel.as_ref().map(|(name, _)| {
|
||||||
.current_primary_channel
|
if name.is_empty() {
|
||||||
.as_ref()
|
"(default public)".to_string()
|
||||||
.map(|(name, _)| if name.is_empty() { "(default public)".to_string() } else { name.clone() }),
|
} else {
|
||||||
|
name.clone()
|
||||||
|
}
|
||||||
|
}),
|
||||||
secondary_channel: self
|
secondary_channel: self
|
||||||
.current_secondary_channel
|
.current_secondary_channel
|
||||||
.as_ref()
|
.as_ref()
|
||||||
@ -214,11 +217,20 @@ impl MeshtasticDevice {
|
|||||||
path
|
path
|
||||||
))?;
|
))?;
|
||||||
// See probe_rnode() in reticulum.rs for why: ESP32-S3 native-USB
|
// See probe_rnode() in reticulum.rs for why: ESP32-S3 native-USB
|
||||||
// boards reset on a DTR/RTS transition, so deassert both and settle
|
// boards (and CP2102/CH340-bridged boards wired for Arduino-style
|
||||||
// before the handshake below.
|
// auto-reset) reset on a DTR/RTS transition, so deassert both and
|
||||||
|
// settle before the handshake below. 300ms is nowhere near a real
|
||||||
|
// firmware boot time (LoRa radio init alone can take longer) —
|
||||||
|
// confirmed live 2026-07-23: with every one of Reticulum/Meshcore/
|
||||||
|
// Meshtastic's open() doing this same reset, a single auto-detect
|
||||||
|
// cycle trying multiple protocols in sequence kept re-resetting the
|
||||||
|
// board before it ever finished booting from the PREVIOUS attempt's
|
||||||
|
// reset, on both a Heltec V3 and V4, regardless of firmware family —
|
||||||
|
// a self-sustaining "never finishes booting" loop with a boot-time
|
||||||
|
// root cause hiding behind what looked like a per-protocol failure.
|
||||||
let _ = port.set_dtr(false);
|
let _ = port.set_dtr(false);
|
||||||
let _ = port.set_rts(false);
|
let _ = port.set_rts(false);
|
||||||
tokio::time::sleep(Duration::from_millis(300)).await;
|
tokio::time::sleep(Duration::from_millis(2000)).await;
|
||||||
info!(path = %path, baud = BAUD_RATE, "Opened Meshtastic serial port");
|
info!(path = %path, baud = BAUD_RATE, "Opened Meshtastic serial port");
|
||||||
|
|
||||||
Ok(Self {
|
Ok(Self {
|
||||||
|
|||||||
@ -38,6 +38,14 @@ use tokio::sync::watch;
|
|||||||
use tracing::{error, info, warn};
|
use tracing::{error, info, warn};
|
||||||
|
|
||||||
const MESH_CONFIG_FILE: &str = "mesh-config.json";
|
const MESH_CONFIG_FILE: &str = "mesh-config.json";
|
||||||
|
|
||||||
|
/// How long `MeshService::stop()` waits for the listener task to notice its
|
||||||
|
/// shutdown signal and exit gracefully before force-aborting it. See
|
||||||
|
/// `stop()`'s doc comment for the real incident this guards against: without
|
||||||
|
/// a hard abort fallback, a slow-to-notice listener could be left running
|
||||||
|
/// forever, orphaned, racing a later independently-started listener on the
|
||||||
|
/// same serial port.
|
||||||
|
const LISTENER_SHUTDOWN_TIMEOUT: Duration = Duration::from_secs(15);
|
||||||
const MESH_IGNORED_RADIO_FILE: &str = "mesh-ignored-radio-contacts.json";
|
const MESH_IGNORED_RADIO_FILE: &str = "mesh-ignored-radio-contacts.json";
|
||||||
const MESH_CONTACTS_FILE: &str = "mesh-contacts.json";
|
const MESH_CONTACTS_FILE: &str = "mesh-contacts.json";
|
||||||
|
|
||||||
@ -967,8 +975,36 @@ impl MeshService {
|
|||||||
if let Some(tx) = self.shutdown_tx.take() {
|
if let Some(tx) = self.shutdown_tx.take() {
|
||||||
let _ = tx.send(true);
|
let _ = tx.send(true);
|
||||||
}
|
}
|
||||||
if let Some(handle) = self.listener_handle.take() {
|
if let Some(mut handle) = self.listener_handle.take() {
|
||||||
let _ = handle.await;
|
// Bounded wait for graceful shutdown, with a hard abort as
|
||||||
|
// fallback — confirmed live 2026-07-23: a caller-side timeout
|
||||||
|
// wrapping stop() (mesh::flash's STOP_LISTENER_TIMEOUT) cancelled
|
||||||
|
// this await when the listener was slow to notice its shutdown
|
||||||
|
// signal (mid multi-candidate probe), but `.take()` above had
|
||||||
|
// already cleared `listener_handle` to None — so MeshService
|
||||||
|
// believed it was stopped while the task kept running, orphaned
|
||||||
|
// (dropping a JoinHandle does not abort the task it points to).
|
||||||
|
// A later start() then spawned a second, fully independent
|
||||||
|
// listener session racing the orphaned one on the same serial
|
||||||
|
// port — neither could ever get a clean response, so every
|
||||||
|
// mesh.configure/probe against that device failed indefinitely
|
||||||
|
// even though the device itself was fine.
|
||||||
|
//
|
||||||
|
// Awaiting `&mut handle` (not `handle` by value) is what makes
|
||||||
|
// the fallback possible: the Future is polled through the
|
||||||
|
// reference, so if the timeout fires, this task's own `handle`
|
||||||
|
// binding is still ours to call `.abort()` on afterward —
|
||||||
|
// unlike moving `handle` into the timeout future outright, which
|
||||||
|
// would drop (and thus orphan) it on timeout with nothing left
|
||||||
|
// to abort.
|
||||||
|
if tokio::time::timeout(LISTENER_SHUTDOWN_TIMEOUT, &mut handle)
|
||||||
|
.await
|
||||||
|
.is_err()
|
||||||
|
{
|
||||||
|
warn!("Mesh listener did not shut down gracefully in time — aborting it");
|
||||||
|
handle.abort();
|
||||||
|
let _ = handle.await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
if let Some(handle) = self.deadman_handle.take() {
|
if let Some(handle) = self.deadman_handle.take() {
|
||||||
handle.abort();
|
handle.abort();
|
||||||
@ -1027,8 +1063,18 @@ impl MeshService {
|
|||||||
/// with the reconnect loop (whichever loses just retries).
|
/// with the reconnect loop (whichever loses just retries).
|
||||||
pub async fn probe_device(&self, path: &str) -> Result<listener::DeviceProbe> {
|
pub async fn probe_device(&self, path: &str) -> Result<listener::DeviceProbe> {
|
||||||
let status = self.state.status.read().await;
|
let status = self.state.status.read().await;
|
||||||
if status.device_connected && status.device_path.as_deref() == Some(path) {
|
if status.device_connected {
|
||||||
anyhow::bail!("{path} is the active mesh radio — already connected");
|
if let Some(active) = status.device_path.as_deref() {
|
||||||
|
// Compare canonical paths: /dev/mesh-radio is a symlink to the
|
||||||
|
// ttyUSB*/ttyACM* node, and a probe through the alias would
|
||||||
|
// still open the very tty the live session is holding.
|
||||||
|
let canon = |p: &str| {
|
||||||
|
std::fs::canonicalize(p).unwrap_or_else(|_| std::path::PathBuf::from(p))
|
||||||
|
};
|
||||||
|
if canon(active) == canon(path) {
|
||||||
|
anyhow::bail!("{path} is the active mesh radio — already connected");
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
drop(status);
|
drop(status);
|
||||||
listener::probe_device(path).await
|
listener::probe_device(path).await
|
||||||
|
|||||||
@ -58,11 +58,20 @@ impl MeshcoreDevice {
|
|||||||
path
|
path
|
||||||
))?;
|
))?;
|
||||||
// See probe_rnode() in reticulum.rs for why: ESP32-S3 native-USB
|
// See probe_rnode() in reticulum.rs for why: ESP32-S3 native-USB
|
||||||
// boards reset on a DTR/RTS transition, so deassert both and settle
|
// boards (and CP2102/CH340-bridged boards wired for Arduino-style
|
||||||
// before the handshake below.
|
// auto-reset) reset on a DTR/RTS transition, so deassert both and
|
||||||
|
// settle before the handshake below. 300ms is nowhere near a real
|
||||||
|
// firmware boot time (LoRa radio init alone can take longer) —
|
||||||
|
// confirmed live 2026-07-23: with every one of Reticulum/Meshcore/
|
||||||
|
// Meshtastic's open() doing this same reset, a single auto-detect
|
||||||
|
// cycle trying multiple protocols in sequence kept re-resetting the
|
||||||
|
// board before it ever finished booting from the PREVIOUS attempt's
|
||||||
|
// reset, on both a Heltec V3 and V4, regardless of firmware family —
|
||||||
|
// a self-sustaining "never finishes booting" loop with a boot-time
|
||||||
|
// root cause hiding behind what looked like a per-protocol failure.
|
||||||
let _ = port.set_dtr(false);
|
let _ = port.set_dtr(false);
|
||||||
let _ = port.set_rts(false);
|
let _ = port.set_rts(false);
|
||||||
tokio::time::sleep(Duration::from_millis(300)).await;
|
tokio::time::sleep(Duration::from_millis(2000)).await;
|
||||||
|
|
||||||
info!(path = %path, baud = BAUD_RATE, "Opened serial port");
|
info!(path = %path, baud = BAUD_RATE, "Opened serial port");
|
||||||
|
|
||||||
@ -547,14 +556,30 @@ fn likely_non_mesh_serial_device(path: &str) -> bool {
|
|||||||
|
|
||||||
/// Scan for serial devices that could be Meshcore radios.
|
/// Scan for serial devices that could be Meshcore radios.
|
||||||
/// Returns paths to existing serial device files.
|
/// Returns paths to existing serial device files.
|
||||||
|
///
|
||||||
|
/// Candidates are deduplicated by canonical path: /dev/mesh-radio is a udev
|
||||||
|
/// symlink to a ttyUSB*/ttyACM* node that is ALSO in the candidate list, so
|
||||||
|
/// without this one physical board shows up (and gets probed, and gets its
|
||||||
|
/// DTR/RTS reset toggled) twice per cycle. The first candidate wins, which
|
||||||
|
/// keeps the stable /dev/mesh-radio name when the symlink exists.
|
||||||
pub async fn detect_serial_devices() -> Vec<String> {
|
pub async fn detect_serial_devices() -> Vec<String> {
|
||||||
let mut devices = Vec::new();
|
let mut devices = Vec::new();
|
||||||
|
let mut seen_canonical: Vec<std::path::PathBuf> = Vec::new();
|
||||||
for path in SERIAL_CANDIDATES {
|
for path in SERIAL_CANDIDATES {
|
||||||
if tokio::fs::metadata(path).await.is_ok() {
|
if tokio::fs::metadata(path).await.is_ok() {
|
||||||
if likely_non_mesh_serial_device(path) {
|
if likely_non_mesh_serial_device(path) {
|
||||||
debug!(path = %path, "Skipping known non-mesh serial device");
|
debug!(path = %path, "Skipping known non-mesh serial device");
|
||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
let canonical = tokio::fs::canonicalize(path)
|
||||||
|
.await
|
||||||
|
.unwrap_or_else(|_| std::path::PathBuf::from(path));
|
||||||
|
if seen_canonical.contains(&canonical) {
|
||||||
|
debug!(path = %path, canonical = %canonical.display(),
|
||||||
|
"Skipping alias of an already-detected serial device");
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
seen_canonical.push(canonical);
|
||||||
devices.push(path.to_string());
|
devices.push(path.to_string());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -110,8 +110,8 @@ async fn listening_ports(path: &str, addr_hex_len: usize) -> Result<HashSet<u16>
|
|||||||
/// A v6-only listener on [::]:port forwarding each connection to 127.0.0.1:port.
|
/// A v6-only listener on [::]:port forwarding each connection to 127.0.0.1:port.
|
||||||
fn spawn_forwarder(port: u16) -> Result<JoinHandle<()>> {
|
fn spawn_forwarder(port: u16) -> Result<JoinHandle<()>> {
|
||||||
use socket2::{Domain, Protocol, Socket, Type};
|
use socket2::{Domain, Protocol, Socket, Type};
|
||||||
let socket = Socket::new(Domain::IPV6, Type::STREAM, Some(Protocol::TCP))
|
let socket =
|
||||||
.context("create v6 socket")?;
|
Socket::new(Domain::IPV6, Type::STREAM, Some(Protocol::TCP)).context("create v6 socket")?;
|
||||||
// v6only so we coexist with the app's own 0.0.0.0:<port> bind.
|
// v6only so we coexist with the app's own 0.0.0.0:<port> bind.
|
||||||
socket.set_only_v6(true).context("set v6only")?;
|
socket.set_only_v6(true).context("set v6only")?;
|
||||||
socket.set_reuse_address(true).ok();
|
socket.set_reuse_address(true).ok();
|
||||||
@ -119,8 +119,8 @@ fn spawn_forwarder(port: u16) -> Result<JoinHandle<()>> {
|
|||||||
let addr = SocketAddrV6::new(Ipv6Addr::UNSPECIFIED, port, 0, 0);
|
let addr = SocketAddrV6::new(Ipv6Addr::UNSPECIFIED, port, 0, 0);
|
||||||
socket.bind(&addr.into()).context("bind [::]")?;
|
socket.bind(&addr.into()).context("bind [::]")?;
|
||||||
socket.listen(128).context("listen")?;
|
socket.listen(128).context("listen")?;
|
||||||
let listener = tokio::net::TcpListener::from_std(socket.into())
|
let listener =
|
||||||
.context("register with tokio")?;
|
tokio::net::TcpListener::from_std(socket.into()).context("register with tokio")?;
|
||||||
|
|
||||||
Ok(tokio::spawn(async move {
|
Ok(tokio::spawn(async move {
|
||||||
loop {
|
loop {
|
||||||
|
|||||||
@ -186,6 +186,7 @@ async fn sync_single_peer(
|
|||||||
let (health_resp, _) = PeerRequest::new(fips_npub, onion, "/dwn/health")
|
let (health_resp, _) = PeerRequest::new(fips_npub, onion, "/dwn/health")
|
||||||
.service(crate::settings::transport::PeerService::Federation)
|
.service(crate::settings::transport::PeerService::Federation)
|
||||||
.timeout(std::time::Duration::from_secs(30))
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6))
|
||||||
.send_get()
|
.send_get()
|
||||||
.await
|
.await
|
||||||
.context("Peer DWN unreachable")?;
|
.context("Peer DWN unreachable")?;
|
||||||
@ -211,6 +212,7 @@ async fn sync_single_peer(
|
|||||||
let (pull_res, _) = PeerRequest::new(fips_npub, onion, "/dwn")
|
let (pull_res, _) = PeerRequest::new(fips_npub, onion, "/dwn")
|
||||||
.service(crate::settings::transport::PeerService::Federation)
|
.service(crate::settings::transport::PeerService::Federation)
|
||||||
.timeout(std::time::Duration::from_secs(30))
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6))
|
||||||
.send_json(&pull_body)
|
.send_json(&pull_body)
|
||||||
.await
|
.await
|
||||||
.context("Failed to query peer DWN")?;
|
.context("Failed to query peer DWN")?;
|
||||||
@ -269,6 +271,7 @@ async fn sync_single_peer(
|
|||||||
match PeerRequest::new(fips_npub, onion, "/dwn")
|
match PeerRequest::new(fips_npub, onion, "/dwn")
|
||||||
.service(crate::settings::transport::PeerService::Federation)
|
.service(crate::settings::transport::PeerService::Federation)
|
||||||
.timeout(std::time::Duration::from_secs(30))
|
.timeout(std::time::Duration::from_secs(30))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(6))
|
||||||
.send_json(&push_body)
|
.send_json(&push_body)
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
|
|||||||
@ -374,6 +374,7 @@ pub async fn send_to_peer(
|
|||||||
crate::fips::dial::PeerRequest::new(fips_npub, onion, "/archipelago/node-message")
|
crate::fips::dial::PeerRequest::new(fips_npub, onion, "/archipelago/node-message")
|
||||||
.service(crate::settings::transport::PeerService::Messaging)
|
.service(crate::settings::transport::PeerService::Messaging)
|
||||||
.timeout(std::time::Duration::from_secs(60))
|
.timeout(std::time::Duration::from_secs(60))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(8))
|
||||||
.send_json(&body)
|
.send_json(&body)
|
||||||
.await
|
.await
|
||||||
.map_err(|e| {
|
.map_err(|e| {
|
||||||
@ -410,6 +411,7 @@ pub async fn check_peer_reachable(onion: &str, fips_npub: Option<&str>) -> Resul
|
|||||||
// circuit that hasn't answered /health in 12s is "offline" for UI
|
// circuit that hasn't answered /health in 12s is "offline" for UI
|
||||||
// purposes; the old 30s made the Connected Nodes probes crawl.
|
// purposes; the old 30s made the Connected Nodes probes crawl.
|
||||||
.timeout(std::time::Duration::from_secs(12))
|
.timeout(std::time::Duration::from_secs(12))
|
||||||
|
.fips_timeout(std::time::Duration::from_secs(4))
|
||||||
.send_get()
|
.send_get()
|
||||||
.await
|
.await
|
||||||
{
|
{
|
||||||
|
|||||||
@ -433,8 +433,18 @@ impl Server {
|
|||||||
),
|
),
|
||||||
));
|
));
|
||||||
|
|
||||||
// LAN transport (mDNS discovery)
|
// LAN transport (mDNS discovery). Advertise our FIPS npub in
|
||||||
let mut lan = crate::transport::lan::LanTransport::new(&did, &pubkey_hex, 5678);
|
// the TXT record so co-located peers can form a direct FIPS
|
||||||
|
// link (see `lan_fips_anchors`).
|
||||||
|
let local_fips_npub = crate::identity::fips_npub(&data_dir.join("identity"))
|
||||||
|
.await
|
||||||
|
.unwrap_or(None);
|
||||||
|
let mut lan = crate::transport::lan::LanTransport::new(
|
||||||
|
&did,
|
||||||
|
&pubkey_hex,
|
||||||
|
5678,
|
||||||
|
local_fips_npub,
|
||||||
|
);
|
||||||
match lan.start(registry.clone()) {
|
match lan.start(registry.clone()) {
|
||||||
Ok(()) => info!("📡 LAN transport (mDNS) started"),
|
Ok(()) => info!("📡 LAN transport (mDNS) started"),
|
||||||
Err(e) => debug!("LAN transport init (non-fatal): {}", e),
|
Err(e) => debug!("LAN transport init (non-fatal): {}", e),
|
||||||
@ -753,12 +763,25 @@ impl Server {
|
|||||||
// (often flaky) global anchor's spanning tree to route to each
|
// (often flaky) global anchor's spanning tree to route to each
|
||||||
// other. For every peer the registry knows both a LAN address
|
// other. For every peer the registry knows both a LAN address
|
||||||
// AND a FIPS npub for, dial it on its FIPS UDP transport port
|
// AND a FIPS npub for, dial it on its FIPS UDP transport port
|
||||||
// (8668) at its LAN IP. This is FIPS's own transport over the
|
// at its LAN IP. This is FIPS's own transport over the
|
||||||
// LAN — NOT Tailscale, NOT the HTTP/LAN messaging port. Pure
|
// LAN — NOT Tailscale, NOT the HTTP/LAN messaging port. Pure
|
||||||
// FIPS. `fipsctl connect` is idempotent, so re-applying every
|
// FIPS. `fipsctl connect` is idempotent, so re-applying every
|
||||||
// tick just keeps the direct link warm; unknown/remote peers
|
// tick just keeps the direct link warm; unknown/remote peers
|
||||||
// (no LAN address) are left to the anchor as before.
|
// (no LAN address) are left to the anchor as before.
|
||||||
if let Some(reg) = fips_peer_registry.as_ref() {
|
if let Some(reg) = fips_peer_registry.as_ref() {
|
||||||
|
// Hydrate FIPS npubs into the registry from federation
|
||||||
|
// storage (did-keyed). Peers discovered before the mDNS
|
||||||
|
// TXT `fips` key existed — or running builds that don't
|
||||||
|
// advertise it yet — would otherwise never satisfy the
|
||||||
|
// `fips_npub` requirement in lan_fips_anchors(), leaving
|
||||||
|
// direct LAN peering a no-op.
|
||||||
|
if let Ok(nodes) = crate::federation::load_nodes(&data_dir).await {
|
||||||
|
for n in &nodes {
|
||||||
|
if let Some(npub) = n.fips_npub.as_deref() {
|
||||||
|
reg.set_fips_npub(&n.did, npub).await;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
let direct = crate::fips::anchors::lan_fips_anchors(®.all_peers().await);
|
let direct = crate::fips::anchors::lan_fips_anchors(®.all_peers().await);
|
||||||
if !direct.is_empty() {
|
if !direct.is_empty() {
|
||||||
let _ = crate::fips::anchors::apply(&direct).await;
|
let _ = crate::fips::anchors::apply(&direct).await;
|
||||||
@ -891,7 +914,7 @@ impl Server {
|
|||||||
// Post-onboarding auto-activation for archipelago-fips. Runs once
|
// Post-onboarding auto-activation for archipelago-fips. Runs once
|
||||||
// at startup: if fips_key is on disk, install /etc/fips/fips.yaml
|
// at startup: if fips_key is on disk, install /etc/fips/fips.yaml
|
||||||
// (schema-refreshed) and start the service. This removes the
|
// (schema-refreshed) and start the service. This removes the
|
||||||
// need for a user-facing "Activate" button — the node comes up
|
// need for a user-facing manual Start button — the node comes up
|
||||||
// with FIPS running whenever the seed has been onboarded. Also
|
// with FIPS running whenever the seed has been onboarded. Also
|
||||||
// self-heals legacy raw-byte fips.key files (load_fips_keys
|
// self-heals legacy raw-byte fips.key files (load_fips_keys
|
||||||
// rewrites them as bech32 nsec the first time they're read).
|
// rewrites them as bech32 nsec the first time they're read).
|
||||||
@ -940,14 +963,16 @@ impl Server {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if let Err(e) = crate::fips::service::activate(crate::fips::SERVICE_UNIT).await {
|
let unit = crate::fips::service::activation_unit().await;
|
||||||
|
if let Err(e) = crate::fips::service::activate(unit).await {
|
||||||
tracing::warn!(
|
tracing::warn!(
|
||||||
"archipelago-fips activate failed on startup: {} — user can retry via fips.install RPC",
|
"FIPS activate failed on startup via {}: {} — user can retry via fips.install RPC",
|
||||||
|
unit,
|
||||||
e
|
e
|
||||||
);
|
);
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
tracing::info!("archipelago-fips auto-activated on startup");
|
tracing::info!("FIPS auto-activated on startup via {}", unit);
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -988,8 +1013,55 @@ impl Server {
|
|||||||
main_addr,
|
main_addr,
|
||||||
));
|
));
|
||||||
|
|
||||||
|
// The mesh is IPv6-only: a phone reaching the node over its fips0
|
||||||
|
// ULA lands on port 80 over v6, where a 0.0.0.0 listener never
|
||||||
|
// answers — the UI was structurally unreachable over the mesh
|
||||||
|
// (RST -> ERR_CONNECTION_ABORTED, confirmed 2026-07-26: v4:80 = 200,
|
||||||
|
// v6:80 = refused). Mirror an IPv4-any main listener with a
|
||||||
|
// V6ONLY [::] socket on the same port — v6-only so it coexists
|
||||||
|
// with the v4 listener regardless of net.ipv6.bindv6only.
|
||||||
|
let v4_any_port = match main_addr {
|
||||||
|
SocketAddr::V4(v4) if v4.ip().is_unspecified() => Some(v4.port()),
|
||||||
|
_ => None,
|
||||||
|
};
|
||||||
|
let v6_task = if let Some(port) = v4_any_port {
|
||||||
|
let v6_addr =
|
||||||
|
SocketAddr::new(std::net::IpAddr::V6(std::net::Ipv6Addr::UNSPECIFIED), port);
|
||||||
|
match bind_v6_only(v6_addr) {
|
||||||
|
Ok(listener) => {
|
||||||
|
info!("IPv6 web listener bound {} (mesh ULA reachable)", v6_addr);
|
||||||
|
Some(tokio::spawn(accept_loop(
|
||||||
|
self.api_handler.clone(),
|
||||||
|
listener,
|
||||||
|
active_connections.clone(),
|
||||||
|
false, // same semantics as the main listener
|
||||||
|
tx.subscribe(),
|
||||||
|
v6_addr,
|
||||||
|
)))
|
||||||
|
}
|
||||||
|
Err(e) => {
|
||||||
|
warn!(
|
||||||
|
"IPv6 web listener bind {} failed: {} — UI stays v4-only",
|
||||||
|
v6_addr, e
|
||||||
|
);
|
||||||
|
None
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
None
|
||||||
|
};
|
||||||
|
|
||||||
// Peer listener: late-binding so we don't need an archipelago
|
// Peer listener: late-binding so we don't need an archipelago
|
||||||
// restart when fips0 comes up after onboarding.
|
// restart when fips0 comes up after onboarding.
|
||||||
|
// App UIs over the mesh: rootless podman's port forwarder binds
|
||||||
|
// IPv4 only for most apps, so a phone dialing [ULA]:8123 got
|
||||||
|
// nothing even with the firewall open (HA/FileBrowser/Gitea/
|
||||||
|
// Portainer/Pine all v4-only on 2026-07-26; a few bind [::]
|
||||||
|
// themselves). Bridge each catalog launch port on the fips0 ULA
|
||||||
|
// only. Binding wildcard [::]:port reserves the same host ports
|
||||||
|
// Podman needs and can restart-loop apps that publish those ports.
|
||||||
|
let relay_task = tokio::spawn(app_port_v6_relay_loop(tx.subscribe()));
|
||||||
|
|
||||||
let peer_task = tokio::spawn(peer_late_bind_loop(
|
let peer_task = tokio::spawn(peer_late_bind_loop(
|
||||||
self.api_handler.clone(),
|
self.api_handler.clone(),
|
||||||
active_connections.clone(),
|
active_connections.clone(),
|
||||||
@ -1012,6 +1084,10 @@ impl Server {
|
|||||||
}
|
}
|
||||||
|
|
||||||
let _ = main_task.await;
|
let _ = main_task.await;
|
||||||
|
if let Some(t) = v6_task {
|
||||||
|
let _ = t.await;
|
||||||
|
}
|
||||||
|
relay_task.abort();
|
||||||
let _ = peer_task.await;
|
let _ = peer_task.await;
|
||||||
|
|
||||||
info!("Shutdown complete");
|
info!("Shutdown complete");
|
||||||
@ -1019,6 +1095,100 @@ impl Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// Bind a V6ONLY `[::]` TCP listener. V6ONLY is set explicitly so the
|
||||||
|
/// socket never claims the IPv4 side (which the main listener owns) —
|
||||||
|
/// without it, Linux hosts with `net.ipv6.bindv6only=0` would fail with
|
||||||
|
/// EADDRINUSE.
|
||||||
|
fn bind_v6_only(addr: SocketAddr) -> std::io::Result<tokio::net::TcpListener> {
|
||||||
|
let socket = socket2::Socket::new(
|
||||||
|
socket2::Domain::IPV6,
|
||||||
|
socket2::Type::STREAM,
|
||||||
|
Some(socket2::Protocol::TCP),
|
||||||
|
)?;
|
||||||
|
socket.set_only_v6(true)?;
|
||||||
|
socket.set_reuse_address(true)?;
|
||||||
|
socket.set_nonblocking(true)?;
|
||||||
|
socket.bind(&addr.into())?;
|
||||||
|
socket.listen(1024)?;
|
||||||
|
tokio::net::TcpListener::from_std(socket.into())
|
||||||
|
}
|
||||||
|
|
||||||
|
fn fips_app_relay_addr(ip: std::net::Ipv6Addr, port: u16) -> SocketAddr {
|
||||||
|
SocketAddr::new(std::net::IpAddr::V6(ip), port)
|
||||||
|
}
|
||||||
|
|
||||||
|
/// IPv6→IPv4 relay for catalog app launch ports (see the spawn site for
|
||||||
|
/// why). Rescans every 60s so ports of freshly installed apps get bridged
|
||||||
|
/// without a daemon restart. Each relay binds to the fips0 ULA only and
|
||||||
|
/// forwards raw TCP to the same port on IPv4 loopback.
|
||||||
|
async fn app_port_v6_relay_loop(mut shutdown_rx: tokio::sync::watch::Receiver<bool>) {
|
||||||
|
use std::collections::HashSet;
|
||||||
|
let mut bridged: HashSet<u16> = HashSet::new();
|
||||||
|
let mut interval = tokio::time::interval(std::time::Duration::from_secs(60));
|
||||||
|
interval.set_missed_tick_behavior(tokio::time::MissedTickBehavior::Delay);
|
||||||
|
loop {
|
||||||
|
tokio::select! {
|
||||||
|
_ = interval.tick() => {
|
||||||
|
let Some(fips_ip) = crate::fips::iface::fips0_ula() else { continue };
|
||||||
|
for &port in crate::fips::app_ports::APP_LAUNCH_PORTS {
|
||||||
|
if bridged.contains(&port) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
// ONLY bridge a port that a running app already answers on
|
||||||
|
// over IPv4. Binding [::]:port for an app that isn't
|
||||||
|
// installed is actively harmful: it makes that app's
|
||||||
|
// later install hit "address already in use", and the
|
||||||
|
// install's port-free step (`fuser -k <port>/tcp`) then
|
||||||
|
// kills THIS daemon, which holds the port — the exact
|
||||||
|
// cause of installs failing + apps vanishing on
|
||||||
|
// framework-pt 2026-07-27. No v4 listener → skip; the
|
||||||
|
// next rescan picks it up once the app is up.
|
||||||
|
let v4_up = tokio::time::timeout(
|
||||||
|
std::time::Duration::from_millis(300),
|
||||||
|
tokio::net::TcpStream::connect(("127.0.0.1", port)),
|
||||||
|
)
|
||||||
|
.await
|
||||||
|
.ok()
|
||||||
|
.and_then(|r| r.ok())
|
||||||
|
.is_some();
|
||||||
|
if !v4_up {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
let addr = fips_app_relay_addr(fips_ip, port);
|
||||||
|
// EADDRINUSE = fipsd or another process already answers
|
||||||
|
// on this mesh address/port, so stay out of the way.
|
||||||
|
let Ok(listener) = bind_v6_only(addr) else { continue };
|
||||||
|
bridged.insert(port);
|
||||||
|
debug!("v6 relay bridging [{fips_ip}]:{port} -> 127.0.0.1:{port}");
|
||||||
|
let mut rx = shutdown_rx.clone();
|
||||||
|
tokio::spawn(async move {
|
||||||
|
loop {
|
||||||
|
tokio::select! {
|
||||||
|
accepted = listener.accept() => {
|
||||||
|
let Ok((mut inbound, _)) = accepted else { break };
|
||||||
|
tokio::spawn(async move {
|
||||||
|
let Ok(mut outbound) = tokio::net::TcpStream::connect(
|
||||||
|
("127.0.0.1", port),
|
||||||
|
)
|
||||||
|
.await else { return };
|
||||||
|
let _ = tokio::io::copy_bidirectional(
|
||||||
|
&mut inbound,
|
||||||
|
&mut outbound,
|
||||||
|
)
|
||||||
|
.await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
_ = rx.changed() => break,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
_ = shutdown_rx.changed() => return,
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// Poll every 30s for `fips0`'s ULA; when it appears, bind the peer
|
/// Poll every 30s for `fips0`'s ULA; when it appears, bind the peer
|
||||||
/// listener and run the normal accept loop. If the bind fails (port
|
/// listener and run the normal accept loop. If the bind fails (port
|
||||||
/// already taken, permissions), log and keep retrying. Returns on
|
/// already taken, permissions), log and keep retrying. Returns on
|
||||||
@ -1094,6 +1264,12 @@ pub fn is_peer_allowed_path(path: &str) -> bool {
|
|||||||
)
|
)
|
||||||
// Prefix-matched content endpoints (peer file browse + fetch)
|
// Prefix-matched content endpoints (peer file browse + fetch)
|
||||||
|| path.starts_with("/content/")
|
|| path.starts_with("/content/")
|
||||||
|
// Mesh file sharing — blob fetch by CID, signature-gated in the
|
||||||
|
// handler. Absent from this list it 404'd over FIPS and the feature
|
||||||
|
// was 100% Tor by construction.
|
||||||
|
|| path.starts_with("/blob/")
|
||||||
|
// DWN sync — /dwn/health is step 1 of every sync; same story.
|
||||||
|
|| path.starts_with("/dwn/")
|
||||||
}
|
}
|
||||||
|
|
||||||
async fn accept_loop(
|
async fn accept_loop(
|
||||||
@ -1797,10 +1973,25 @@ mod merge_tests {
|
|||||||
);
|
);
|
||||||
assert!(is_peer_allowed_path("/rpc/v1"));
|
assert!(is_peer_allowed_path("/rpc/v1"));
|
||||||
assert!(is_peer_allowed_path("/health"));
|
assert!(is_peer_allowed_path("/health"));
|
||||||
|
// Mesh blob fetch + DWN sync — both were missing from the allowlist,
|
||||||
|
// which made them deterministically 404 over FIPS and therefore
|
||||||
|
// 100% Tor by construction.
|
||||||
|
assert!(is_peer_allowed_path("/blob/abc123"), "blob fetch by CID");
|
||||||
|
assert!(is_peer_allowed_path("/dwn/health"), "DWN sync step 1");
|
||||||
// Not on the allow-list → rejected (no broad surface over the mesh).
|
// Not on the allow-list → rejected (no broad surface over the mesh).
|
||||||
assert!(!is_peer_allowed_path("/contention"), "must not prefix-leak");
|
assert!(!is_peer_allowed_path("/contention"), "must not prefix-leak");
|
||||||
assert!(!is_peer_allowed_path("/"));
|
assert!(!is_peer_allowed_path("/"));
|
||||||
assert!(!is_peer_allowed_path("/rpc/v2"));
|
assert!(!is_peer_allowed_path("/rpc/v2"));
|
||||||
|
assert!(!is_peer_allowed_path("/blobber"), "must not prefix-leak");
|
||||||
|
assert!(!is_peer_allowed_path("/dwnx"), "must not prefix-leak");
|
||||||
|
}
|
||||||
|
|
||||||
|
#[test]
|
||||||
|
fn app_relay_binds_to_fips_ula_not_wildcard() {
|
||||||
|
let ula = "fd12:3456:789a::1".parse().unwrap();
|
||||||
|
let addr = fips_app_relay_addr(ula, 8083);
|
||||||
|
assert_eq!(addr.ip(), std::net::IpAddr::V6(ula));
|
||||||
|
assert_eq!(addr.port(), 8083);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|||||||
@ -24,17 +24,27 @@ pub struct LanTransport {
|
|||||||
our_did: String,
|
our_did: String,
|
||||||
our_pubkey_hex: String,
|
our_pubkey_hex: String,
|
||||||
our_port: u16,
|
our_port: u16,
|
||||||
|
/// This node's FIPS npub, advertised in the mDNS TXT record so
|
||||||
|
/// co-located peers can form a direct FIPS link (`lan_fips_anchors`)
|
||||||
|
/// without waiting for federation storage to sync.
|
||||||
|
our_fips_npub: Option<String>,
|
||||||
daemon: Option<ServiceDaemon>,
|
daemon: Option<ServiceDaemon>,
|
||||||
available: AtomicBool,
|
available: AtomicBool,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl LanTransport {
|
impl LanTransport {
|
||||||
/// Create a new LAN transport. Does not start discovery yet.
|
/// Create a new LAN transport. Does not start discovery yet.
|
||||||
pub fn new(our_did: &str, our_pubkey_hex: &str, port: u16) -> Self {
|
pub fn new(
|
||||||
|
our_did: &str,
|
||||||
|
our_pubkey_hex: &str,
|
||||||
|
port: u16,
|
||||||
|
our_fips_npub: Option<String>,
|
||||||
|
) -> Self {
|
||||||
Self {
|
Self {
|
||||||
our_did: our_did.to_string(),
|
our_did: our_did.to_string(),
|
||||||
our_pubkey_hex: our_pubkey_hex.to_string(),
|
our_pubkey_hex: our_pubkey_hex.to_string(),
|
||||||
our_port: port,
|
our_port: port,
|
||||||
|
our_fips_npub,
|
||||||
daemon: None,
|
daemon: None,
|
||||||
available: AtomicBool::new(false),
|
available: AtomicBool::new(false),
|
||||||
}
|
}
|
||||||
@ -47,11 +57,14 @@ impl LanTransport {
|
|||||||
|
|
||||||
// Advertise our service
|
// Advertise our service
|
||||||
let hostname = format!("archy-{}.local.", &self.our_pubkey_hex[..8]);
|
let hostname = format!("archy-{}.local.", &self.our_pubkey_hex[..8]);
|
||||||
let properties = vec![
|
let mut properties = vec![
|
||||||
("did".to_string(), self.our_did.clone()),
|
("did".to_string(), self.our_did.clone()),
|
||||||
("pubkey".to_string(), self.our_pubkey_hex.clone()),
|
("pubkey".to_string(), self.our_pubkey_hex.clone()),
|
||||||
("version".to_string(), "0.1.0".to_string()),
|
("version".to_string(), "0.1.0".to_string()),
|
||||||
];
|
];
|
||||||
|
if let Some(npub) = &self.our_fips_npub {
|
||||||
|
properties.push(("fips".to_string(), npub.clone()));
|
||||||
|
}
|
||||||
|
|
||||||
let service_info = ServiceInfo::new(
|
let service_info = ServiceInfo::new(
|
||||||
SERVICE_TYPE,
|
SERVICE_TYPE,
|
||||||
@ -93,6 +106,11 @@ impl LanTransport {
|
|||||||
.map(|v| v.val_str().to_string());
|
.map(|v| v.val_str().to_string());
|
||||||
let addresses = info.get_addresses();
|
let addresses = info.get_addresses();
|
||||||
|
|
||||||
|
let fips_npub = info
|
||||||
|
.get_properties()
|
||||||
|
.get("fips")
|
||||||
|
.map(|v| v.val_str().to_string());
|
||||||
|
|
||||||
if let (Some(did), Some(pubkey)) = (did, pubkey) {
|
if let (Some(did), Some(pubkey)) = (did, pubkey) {
|
||||||
if let Some(scoped_ip) = addresses.iter().next() {
|
if let Some(scoped_ip) = addresses.iter().next() {
|
||||||
let ip: std::net::IpAddr = match scoped_ip.to_string().parse() {
|
let ip: std::net::IpAddr = match scoped_ip.to_string().parse() {
|
||||||
@ -106,6 +124,9 @@ impl LanTransport {
|
|||||||
.await;
|
.await;
|
||||||
registry_clone.set_lan_address(&did, socket_addr).await;
|
registry_clone.set_lan_address(&did, socket_addr).await;
|
||||||
registry_clone.set_name(&did, info.get_fullname()).await;
|
registry_clone.set_name(&did, info.get_fullname()).await;
|
||||||
|
if let Some(npub) = fips_npub.as_deref() {
|
||||||
|
registry_clone.set_fips_npub(&did, npub).await;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@ -106,7 +106,7 @@ pub enum PeerSource {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/// Unified peer record with per-transport capabilities.
|
/// Unified peer record with per-transport capabilities.
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize)]
|
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
|
||||||
pub struct PeerRecord {
|
pub struct PeerRecord {
|
||||||
pub did: String,
|
pub did: String,
|
||||||
pub pubkey_hex: String,
|
pub pubkey_hex: String,
|
||||||
|
|||||||
@ -1868,13 +1868,38 @@ pub async fn apply_update(data_dir: &Path) -> Result<()> {
|
|||||||
// UI before systemd kills us. --no-block makes sure systemctl doesn't
|
// UI before systemd kills us. --no-block makes sure systemctl doesn't
|
||||||
// try to wait for the current service (us) to exit cleanly before
|
// try to wait for the current service (us) to exit cleanly before
|
||||||
// starting the new process — it would deadlock otherwise.
|
// starting the new process — it would deadlock otherwise.
|
||||||
tokio::spawn(async {
|
// PID1-owned timer transient: submit NOW (synchronously, while we are
|
||||||
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
// definitely alive), fire in 2s from systemd itself. The old approach —
|
||||||
// systemctl talks to PID 1 over D-Bus — doesn't need the host
|
// tokio sleep + `systemd-run --wait -- systemctl --no-block restart` —
|
||||||
// mount namespace, but routing through host_sudo keeps the
|
// ran as a child of the process being stopped; on v1.7.114->115 the
|
||||||
// apply flow's sudo calls uniform.
|
// stop landed but the start never fired and the node sat dead all
|
||||||
let _ = host_sudo(&["systemctl", "--no-block", "restart", "archipelago"]).await;
|
// night. A timer unit owned by PID1 cannot be killed by our own death,
|
||||||
});
|
// and Restart=always on the unit is the second net.
|
||||||
|
let submitted = tokio::process::Command::new("sudo")
|
||||||
|
.args([
|
||||||
|
"systemd-run",
|
||||||
|
"--collect",
|
||||||
|
"--on-active=2",
|
||||||
|
"--timer-property=AccuracySec=100ms",
|
||||||
|
"--",
|
||||||
|
"systemctl",
|
||||||
|
"restart",
|
||||||
|
"archipelago",
|
||||||
|
])
|
||||||
|
.status()
|
||||||
|
.await;
|
||||||
|
match submitted {
|
||||||
|
Ok(st) if st.success() => {}
|
||||||
|
other => {
|
||||||
|
tracing::warn!(
|
||||||
|
"detached restart submission failed ({other:?}) — falling back to in-process restart"
|
||||||
|
);
|
||||||
|
tokio::spawn(async {
|
||||||
|
tokio::time::sleep(std::time::Duration::from_secs(2)).await;
|
||||||
|
let _ = host_sudo(&["systemctl", "--no-block", "restart", "archipelago"]).await;
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|||||||
@ -632,11 +632,30 @@ pub async fn send_token_at(data_dir: &Path, mint_url: &str, amount_sats: u64) ->
|
|||||||
// Mark original proofs as spent
|
// Mark original proofs as spent
|
||||||
wallet.mark_spent(&indices);
|
wallet.mark_spent(&indices);
|
||||||
|
|
||||||
// Separate send proofs from change proofs
|
// Separate send proofs from change proofs BY COUNT, not membership:
|
||||||
let (send, change): (Vec<_>, Vec<_>) = swap_result
|
// partition(contains) put EVERY proof whose denomination appeared in
|
||||||
.new_proofs
|
// send_denoms into the token — when change shared a denomination with
|
||||||
.into_iter()
|
// the send (worst case: spending from a proof worth exactly 2× the
|
||||||
.partition(|p| send_denoms.contains(&p.amount));
|
// amount, send [n] + change [n]), the change proofs rode along and the
|
||||||
|
// receiver was credited double. Consume exactly one proof per needed
|
||||||
|
// send denomination; everything else is change.
|
||||||
|
let mut send_needed = send_denoms.clone();
|
||||||
|
let mut send: Vec<Proof> = Vec::new();
|
||||||
|
let mut change: Vec<Proof> = Vec::new();
|
||||||
|
for p in swap_result.new_proofs {
|
||||||
|
if let Some(pos) = send_needed.iter().position(|&d| d == p.amount) {
|
||||||
|
send_needed.swap_remove(pos);
|
||||||
|
send.push(p);
|
||||||
|
} else {
|
||||||
|
change.push(p);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if !send_needed.is_empty() {
|
||||||
|
anyhow::bail!(
|
||||||
|
"Mint swap returned incomplete send denominations (missing {:?})",
|
||||||
|
send_needed
|
||||||
|
);
|
||||||
|
}
|
||||||
|
|
||||||
// Add change proofs back to wallet
|
// Add change proofs back to wallet
|
||||||
if !change.is_empty() {
|
if !change.is_empty() {
|
||||||
|
|||||||
9
demo/content/README.md
Normal file
9
demo/content/README.md
Normal file
@ -0,0 +1,9 @@
|
|||||||
|
# Demo Content Provenance
|
||||||
|
|
||||||
|
All media in `demo/content/` and `demo/peer-media/` — music tracks, photos,
|
||||||
|
book covers, posters, and documents — are original works created and owned by
|
||||||
|
the Archipelago project author (Dorian), included here as demo content and
|
||||||
|
released with the project under the repository MIT license.
|
||||||
|
|
||||||
|
None of this content is sourced from third-party stock libraries or
|
||||||
|
commercial catalogs.
|
||||||
300
docs/FIPS-UPTIME-AND-UI-STATE-PLAN.md
Normal file
300
docs/FIPS-UPTIME-AND-UI-STATE-PLAN.md
Normal file
@ -0,0 +1,300 @@
|
|||||||
|
# FIPS near-100% uptime + optimistic UI state — implementation plan
|
||||||
|
|
||||||
|
**Date:** 2026-07-27. **Status:** researched + root-caused live on the fleet; ready to
|
||||||
|
implement for the next release. Two workstreams: (A) make node↔node FIPS transport
|
||||||
|
succeed whenever a FIPS path physically exists, (B) stop the UI reloading everything
|
||||||
|
on every navigation (optimistic/cached cards, stale-while-revalidate) while keeping
|
||||||
|
data fresh.
|
||||||
|
|
||||||
|
**Honesty note on "100%":** if a node's network blackholes every anchor (the .116
|
||||||
|
WiFi case, `docs/HANDOFF-2026-07-20-fips-peer-files.md:117-133`), Tor fallback is
|
||||||
|
*correct*. The achievable target is: **FIPS wins whenever a FIPS path exists, and
|
||||||
|
fallback frequency is measured in-product so regressions are visible.** Today several
|
||||||
|
paths are 0% FIPS *by construction* regardless of network health — that's the bug.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Part A — why Cloud/FIPS "commonly falls back to Tor": ranked root causes
|
||||||
|
|
||||||
|
All verified live on 2026-07-27 (.116 local, .198, .228, Framework PT, x250s) plus a
|
||||||
|
full code audit of `core/archipelago/src/{fips,transport,federation,server.rs}`.
|
||||||
|
|
||||||
|
### RC0 — 🔥 The hardening firewall drops the peer-API port on every hardened node (PROVEN)
|
||||||
|
|
||||||
|
The fips0 default-deny baseline (`/etc/fips/fips.nft`) is opened by archipelago's
|
||||||
|
drop-in `80-web-ui.nft` (`fips/config.rs:236-255`) for **80 + 8443 + app ports only**.
|
||||||
|
The peer-API listener — which carries *all* federation sync, cloud browse/download,
|
||||||
|
mesh envelopes, DWN, invoices — is **`PEER_PORT = 5679`** (`fips/dial.rs:35`).
|
||||||
|
**5679 is not in the allowlist.** The drop-in's own comment claims "web UI + peer
|
||||||
|
API" but the peer API port was never added.
|
||||||
|
|
||||||
|
Live proof (2026-07-27):
|
||||||
|
- .116 nft chain: 5,965 dropped packets; .198: **28,670 dropped packets** — that's
|
||||||
|
peers' FIPS dials dying at the firewall.
|
||||||
|
- .198 → .116 `GET :5679/health`: **timeout (6s)** before; **HTTP 200 in 0.35s**
|
||||||
|
after `nft insert rule inet fips inbound iifname fips0 tcp dport 5679 accept`.
|
||||||
|
Same result in reverse direction (200 in 0.64s).
|
||||||
|
- Explains the exact fleet split in `federation/nodes.json`: hardened-baseline nodes
|
||||||
|
(Framework PT, .198, .228, x250-dev, x250-mad2) = `last_transport: tor`;
|
||||||
|
non-hardened nodes (Austin Sapien, X250-Beta, X250-PA) answer :5679 (404 from the
|
||||||
|
path allowlist = listener reachable) = `last_transport: fips`.
|
||||||
|
- Every dial to a hardened peer pays the 8s FIPS connect timeout
|
||||||
|
(`dial.rs:114`) ×2 (retry, `dial.rs:128-140`) → then Tor. That's the "Cloud takes
|
||||||
|
forever / shows Tor" experience.
|
||||||
|
|
||||||
|
**Fix (one line + reload):** add `tcp dport 5679 accept` to the drop-in in
|
||||||
|
`fips/config.rs` (use a constant shared with `dial.rs::PEER_PORT`, not a literal).
|
||||||
|
The drop-in reinstalls on every daemon config install, so it heals fleet-wide on OTA.
|
||||||
|
⚠️ Transient manual rules were inserted on .116 and .198 during diagnosis (2026-07-27)
|
||||||
|
— they vanish on the next `nft -f /etc/fips/fips.nft` reload or reboot; the code fix
|
||||||
|
makes them permanent.
|
||||||
|
|
||||||
|
### RC1 — .228 (Shorty's) runs fips 0.3.0-dev; the 0.4.1 fleet can't reach it
|
||||||
|
|
||||||
|
.228's daemon: `0.3.0-dev (rev 34e00b9f6e)`, both anchor links "connected", but its
|
||||||
|
ULA is 100% unreachable from 0.4.1 nodes (ping loss 100%). FIPS wire format is not
|
||||||
|
stable across revs (`docs/HANDOFF-2026-07-23-companion-apk-deploy.md:78`). Everything
|
||||||
|
to/from .228 rides Tor no matter what else we fix.
|
||||||
|
|
||||||
|
**Fix:** fleet fips-version audit + upgrade to v0.4.1 everywhere (in-product updater
|
||||||
|
exists: `fips/update.rs`; .deb path per `reference_vps2_fips_anchor`). Add a version
|
||||||
|
check to `fips.status` and surface a "peer daemon outdated" warning.
|
||||||
|
|
||||||
|
### RC2 — Direct LAN/endpoint peering is dead code + wrong port + stale seed anchors
|
||||||
|
|
||||||
|
Without direct links, all peer traffic hairpins through the vps2 anchor spanning
|
||||||
|
tree (observed: .116→.198 cold RTT 1.5–3.5s on the same LAN; also the wedged-anchor
|
||||||
|
latency-rot incident, `HANDOFF-2026-07-23:141-160`).
|
||||||
|
|
||||||
|
- **G1 — `lan_fips_anchors()` has never run.** It needs `PeerRecord.fips_npub`, but
|
||||||
|
`PeerRegistry::set_fips_npub` (`transport/mod.rs:302`) has **zero callers** — mDNS
|
||||||
|
TXT records only carry `did`/`pubkey`/`version` (`transport/lan.rs:50-54`). So the
|
||||||
|
"co-located peers form a direct link" feature (`anchors.rs:294-305`,
|
||||||
|
`server.rs:761-766`) is a fleet-wide no-op.
|
||||||
|
- **G2 — wrong UDP port.** `anchors.rs:293` dials `8668`, but the generated
|
||||||
|
fips.yaml binds UDP **2121** (`fips/config.rs:187`, `fips/mod.rs:130`). Even if G1
|
||||||
|
ran, it would dial a dead port. `.116`'s live `seed-anchors.json` still carries
|
||||||
|
`.198@192.168.1.198:8668` — **stale IP (LAN renumbered to 192.168.63.x) AND dead
|
||||||
|
port**; both manual entries are useless today.
|
||||||
|
- No Tailscale/alternate endpoint fallback when LAN is unreachable (the .116↔.198
|
||||||
|
fix of 2026-07-20 was hand-applied per-node config, never productized).
|
||||||
|
|
||||||
|
**Fix:** (a) `FIPS_UDP_PORT` → `crate::fips::PUBLISHED_UDP_PORT` + drift-guard test;
|
||||||
|
(b) hydrate `fips_npub` into the registry from federation storage (did-keyed join) so
|
||||||
|
`lan_fips_anchors` goes live with no wire change; (c) advertise the npub in the mDNS
|
||||||
|
TXT + `set_fips_npub` on resolve as the proper fix; (d) teach the LAN-anchor tick to
|
||||||
|
also try a peer's Tailscale/last-known-good endpoint when LAN fails (reviewed change
|
||||||
|
— this area got handoffs wrong twice, per memory).
|
||||||
|
|
||||||
|
### RC3 — No fast-fail on the hottest call sites; retry silently doubles every budget
|
||||||
|
|
||||||
|
- `content.browse-peer` — **the Cloud page** — has NO `fips_timeout`
|
||||||
|
(`api/rpc/content.rs:363-366`): a cold FIPS path burns up to ~16.6s (8s connect +
|
||||||
|
600ms + 8s retry) before Tor even starts, against a UI deadline of 30s
|
||||||
|
(`Cloud.vue:720`) — and the frontend then retries ×3. Users see errors, not
|
||||||
|
fallback. 12 call sites total lack `fips_timeout` (browse/download/preview-peer,
|
||||||
|
`/blob`, DWN, node_message, rotation notifies).
|
||||||
|
- `dial.rs:128-140` runs 2 full-budget attempts, so `fips_timeout(6s)` really means
|
||||||
|
~12.6s everywhere.
|
||||||
|
|
||||||
|
**Fix:** wrap `send_with_retry` in a single `tokio::time::timeout(fips_attempt_timeout())`
|
||||||
|
(call sites `dial.rs:455`, `dial.rs:488`; halve per-attempt client timeout), then add
|
||||||
|
`.fips_timeout(...)`: `content.rs:366` (6s), `content.rs:281` (8s), `content.rs:1139`
|
||||||
|
(6s), `typed_messages.rs:822` (8s), `dwn_sync.rs:188/213/272` (6s),
|
||||||
|
`node_message.rs:376` (8s), `node_message.rs:412` (4s), `tor/mod.rs:501` (6s),
|
||||||
|
`federation/handlers.rs:869` (6s). **Skip the three 900s streaming downloads**
|
||||||
|
(`content.rs:552/870/1061`, `proxy.rs:236`) — `dial.rs:311-319` documents why; the
|
||||||
|
retry-budget wrap covers their connect phase.
|
||||||
|
|
||||||
|
### RC4 — Two features are 100% Tor by construction (allowlist 404)
|
||||||
|
|
||||||
|
The peer listener path allowlist (`server.rs:1219-1239`) omits `/blob/<cid>` (mesh
|
||||||
|
file sharing, `typed_messages.rs:813-822`) and `/dwn/health` (step 1 of DWN sync,
|
||||||
|
`dwn_sync.rs:186`) → deterministic 404 over FIPS (`dial.rs:44-46` treats 404 as
|
||||||
|
fall-back) → deterministic Tor, after paying the full FIPS cost. Both endpoints are
|
||||||
|
already cryptographically gated, so they meet the allowlist's stated criterion.
|
||||||
|
|
||||||
|
**Fix:** add `|| path.starts_with("/blob/") || path.starts_with("/dwn/")`; extend the
|
||||||
|
existing test block at `server.rs:1935-1945` (assert `/blob/abc` + `/dwn/health`
|
||||||
|
allowed, `/blobber` + `/dwnx` denied).
|
||||||
|
|
||||||
|
### RC5 — Inbound listener can't heal; anchor flap = 5-minute Tor window; probe overhead
|
||||||
|
|
||||||
|
- `peer_late_bind_loop` returns after first successful bind (`server.rs:1203`) and
|
||||||
|
`accept_loop` `continue`s on errors forever (`server.rs:1249-1258`): a fips0
|
||||||
|
teardown/re-key leaves the node inbound-dead until process restart → **every peer**
|
||||||
|
falls back to Tor against it.
|
||||||
|
- Nothing reacts to anchor-link drops: anchors re-apply only on the 300s tick
|
||||||
|
(`server.rs:731`); worst-case 5min Tor-only after a flap (the historic "link dead
|
||||||
|
timeout 30s" flapping made this chronic).
|
||||||
|
- `is_service_active()` spawns up to 2 `systemctl` per FIPS attempt *and* per peer
|
||||||
|
per 25s warm tick (`dial.rs:284-294`); `warm_path` skips peers without
|
||||||
|
`fips_npub` in federation storage (`fips/mod.rs:88-95`); `anchors::apply` is
|
||||||
|
serial with unbounded subprocess waits (`anchors.rs:234-283`).
|
||||||
|
|
||||||
|
**Fix:** rebindable listener; a ~25s connectivity watcher (reuse
|
||||||
|
`service::peer_connectivity_summary`, `fips/service.rs:178-207`) that re-applies
|
||||||
|
anchors immediately on a connected→disconnected edge with bounded backoff; 10s TTL
|
||||||
|
cache for `is_service_active` (mirror `transport/fips.rs:24-107`); warm the union of
|
||||||
|
federation+registry peers; make `apply()` concurrent with per-connect timeouts.
|
||||||
|
|
||||||
|
### RC6 — Zero observability: fallbacks are invisible, so "uptime" is unfalsifiable
|
||||||
|
|
||||||
|
Fallbacks log at `debug!` only (`dial.rs:458,491`); no counters; `last_transport` is
|
||||||
|
written by only 7 of ~20 call sites and **never read** to influence anything
|
||||||
|
(`storage.rs:120-147`). The parallel `TransportRouter` system can't even see FIPS
|
||||||
|
(`FipsTransport` is never constructed — `server.rs:422-442` registers Tor/Mesh/LAN
|
||||||
|
only).
|
||||||
|
|
||||||
|
**Fix:** per-reason fallback counters (F1 no-npub / F2 service-inactive / F3
|
||||||
|
DNS-fail / F4 connect-fail / F5 404 / F6 5xx) surfaced in `fips.status` + `info!`
|
||||||
|
logs with a `reason` field; call `record_peer_transport` from all peer-dial sites;
|
||||||
|
UI: per-peer transport badge on Cloud (the response already carries `transport` —
|
||||||
|
`content.rs:392-400` — Cloud.vue currently throws it away at `:716-721`).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Part A — execution phases
|
||||||
|
|
||||||
|
### Phase A0 — fleet triage (no release needed; do first, validates everything)
|
||||||
|
1. Fleet audit: `fipsctl --version` + `nft list table inet fips` + `ss -tlnp | grep 5679`
|
||||||
|
on every node (roster: `reference_test_deploy_roster`).
|
||||||
|
2. Transient `nft insert rule inet fips inbound iifname fips0 tcp dport 5679 accept`
|
||||||
|
on hardened nodes (already done on .116 + .198, 2026-07-27) — instant fleet-wide
|
||||||
|
FIPS recovery while the code fix rides the OTA.
|
||||||
|
3. Upgrade .228 (and any other 0.3.x) fips daemon to v0.4.1.
|
||||||
|
4. Regenerate/clean stale `seed-anchors.json` on .116 (dead 192.168.1.x + :8668 entries).
|
||||||
|
5. Baseline measurement: for each node pair, `content.browse-peer` time + transport.
|
||||||
|
|
||||||
|
### Phase A1 — P0 code (one commit, mechanical, offline-testable)
|
||||||
|
1. **nft drop-in: open 5679** — `fips/config.rs` (share the constant with
|
||||||
|
`dial.rs::PEER_PORT`). ← RC0
|
||||||
|
2. **Allowlist `/blob/`, `/dwn/`** — `server.rs:1219-1239` + tests. ← RC4
|
||||||
|
3. **`FIPS_UDP_PORT` = `PUBLISHED_UDP_PORT` (2121)** — `anchors.rs:293` + drift-guard
|
||||||
|
test against `render_config_yaml()`. ← RC2-G2
|
||||||
|
4. **Un-deaden `lan_fips_anchors`** — hydrate `fips_npub` from federation storage in
|
||||||
|
`server.rs:761-766`; then mDNS TXT `fips` key + `set_fips_npub`
|
||||||
|
(`transport/lan.rs:50-54`, `lan.rs:96-108`, `LanTransport::new` 4th arg via
|
||||||
|
`crate::identity::fips_npub(&data_dir.join("identity"))`). ← RC2-G1
|
||||||
|
5. **Retry-budget wrap + `fips_timeout` on 12 call sites** (list in RC3). ← RC3
|
||||||
|
Verify: `cd core && cargo test -p archipelago` — watch `test_rendered_yaml_exact_snapshot`
|
||||||
|
(`config.rs:419`) + `test_render_is_deterministic` (`config.rs:476`); item 3 must
|
||||||
|
not change rendered output.
|
||||||
|
|
||||||
|
### Phase A2 — telemetry BEFORE tuning (second commit)
|
||||||
|
6. Fallback counters by reason + `fips.status` exposure + `info!` reason logs;
|
||||||
|
`record_peer_transport` from all sites. ← RC6 (gives the baseline that makes A3
|
||||||
|
measurable and "100%" falsifiable)
|
||||||
|
|
||||||
|
### Phase A3 — resilience (third commit, measured against A2 baseline)
|
||||||
|
7. `is_service_active` 10s TTL cache; warm-path union + `warm_path_unchecked`.
|
||||||
|
8. Link-state watcher → immediate anchor re-apply on drop (replaces waiting for the
|
||||||
|
300s tick); concurrent `apply()` with subprocess timeouts.
|
||||||
|
9. Rebindable peer listener (`server.rs:1203`, `1249-1258`).
|
||||||
|
10. (Reviewed, separate PR) endpoint-fallback for direct peering: LAN → Tailscale →
|
||||||
|
last-known-good, npub-keyed. Mesh-routing area — needs careful review per memory.
|
||||||
|
|
||||||
|
### Phase A4 — verification gate (on nodes, before tag)
|
||||||
|
- On .116/.198/framework-pt/.228: `content.browse-peer` to every peer must return
|
||||||
|
`transport: "fips"` with sub-second latency (LAN pairs) / <3s (WAN), 20/20 calls.
|
||||||
|
- Kill the fips daemon on one node → calls fall back to Tor gracefully within the
|
||||||
|
fast-fail budget (<8s), UI shows partial results, no errors.
|
||||||
|
- Restart daemon → FIPS recovers within one watcher tick (~25s), verified in
|
||||||
|
`fips.status` counters.
|
||||||
|
- Flap the anchor link (drop vps2 route) → direct LAN pairs keep FIPS via their
|
||||||
|
direct link (G1 fix proof).
|
||||||
|
- Add these as `tests/multinode/` cases per `docs/multinode-testing-plan.md`; also
|
||||||
|
fix the known `node_rpc()` missing `--max-time` (tracker item).
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Part B — optimistic loading + state management (frontend)
|
||||||
|
|
||||||
|
Full audit: Pinia exists but pages fetch-on-mount with `loading=true` spinners;
|
||||||
|
`Dashboard.vue:89` keys the router-view by `route.path`, so **every navigation
|
||||||
|
unmounts and refetches everything**; no KeepAlive/onActivated anywhere; no dedup,
|
||||||
|
no abort, no SWR layer. Four hand-rolled cache implementations already exist and
|
||||||
|
prove the pattern (`useFleetData.ts:198-231` sessionStorage hydrate;
|
||||||
|
`homeStatus.ts` sticky-ready loadState; `Home.vue:591-621` wallet localStorage
|
||||||
|
snapshot; `curatedApps.ts:21-77` TTL cache). `SkeletonCard.vue` exists, imported by
|
||||||
|
zero files.
|
||||||
|
|
||||||
|
### B1 — one shared primitive: `useCachedResource` composable + `resources` Pinia store
|
||||||
|
Semantics (generalize `homeStatus.ts` + `useFleetData.ts`):
|
||||||
|
- Keyed resource: `{ data, loadState: idle|loading|ready|error|refreshing, fetchedAt, error }`.
|
||||||
|
- **Hydrate synchronously** from memory (Pinia, survives navigation) → sessionStorage
|
||||||
|
snapshot (survives reload) → then revalidate in background.
|
||||||
|
- Sticky-ready: once `ready`, never regress to `loading`
|
||||||
|
(`loadState = loadState==='ready' ? 'ready' : 'loading'` — the `homeStatus.ts:80` idiom);
|
||||||
|
keep-last-known-value on error with a stale badge (age from `fetchedAt`).
|
||||||
|
- TTL per resource; `revalidateOnFocus` + on WS push (debounced, the
|
||||||
|
`Home.vue:539-542` pattern); explicit `invalidate(key)` for mutations.
|
||||||
|
- Optimistic mutation helper: apply → RPC → rollback on error (generalize
|
||||||
|
`TransportPrefsCard.vue:112-127`).
|
||||||
|
|
||||||
|
### B2 — rpc-client upgrades (`src/api/rpc-client.ts`)
|
||||||
|
- `AbortSignal` in `RPCOptions` (today the AbortController at `:87` is timeout-only)
|
||||||
|
→ abort-on-unmount for fan-outs.
|
||||||
|
- In-flight dedup keyed `method+JSON(params)` — collapses duplicate concurrent calls.
|
||||||
|
- Per-call `maxRetries` override; set `maxRetries: 1` for `content.browse-peer` /
|
||||||
|
`preview-peer` (retry×3 on a 30s timeout is why one slow peer = 90s spinner).
|
||||||
|
|
||||||
|
### B3 — Cloud page conversion (worst offender, the marquee win)
|
||||||
|
- Move `sectionCounts`, `peerNodes`, `myFiles`, `peerFiles`, `paidItems` out of
|
||||||
|
`Cloud.vue` component state (`:403,:476,:582,:689,:427`) into the cached store —
|
||||||
|
instant render on revisit, background refresh.
|
||||||
|
- **Incremental per-peer fan-in**: render each peer's card as its
|
||||||
|
`content.browse-peer` resolves (today `Promise.allSettled` at `:708-747` blocks on
|
||||||
|
the slowest peer). Per-peer states: cached/fresh/loading/unreachable.
|
||||||
|
- **Surface `transport` per peer** (already in the response, discarded at `:716-721`):
|
||||||
|
FIPS/Tor badge + latency — this is also the fleet-wide FIPS-uptime dashboard the
|
||||||
|
user asked for, for free.
|
||||||
|
- Skeleton cards (revive `SkeletonCard.vue`, copy `FileGrid.vue:3-19` shimmer) instead
|
||||||
|
of spinners for counts/folders/peer grids.
|
||||||
|
- Stop `CloudFolder.vue:307-319` calling `cloudStore.reset()` on every folder entry —
|
||||||
|
cache per-path listings, navigate renders cache + revalidates.
|
||||||
|
- `PeerFiles.vue`: persist catalog + preview cache in the store; cap the
|
||||||
|
`preview-peer` fan-out (`:832-841`, currently unbounded) with a small concurrency
|
||||||
|
queue + abort-on-unmount.
|
||||||
|
|
||||||
|
### B4 — roll out to remaining offenders (in audit order)
|
||||||
|
PeerFiles → Web5 wallet/ecash/LND slices → Monitoring → Lightning channels
|
||||||
|
(`LightningChannelsPanel.vue:650`) → Federation (already has `{showLoader:false}` —
|
||||||
|
just adopt the store) → Server → Credentials/OpenWrtGateway/ContainerApps.
|
||||||
|
`Apps.vue`/`Marketplace.vue`/`Fleet.vue` are already good; don't touch.
|
||||||
|
|
||||||
|
### B5 — freshness via the existing push channel
|
||||||
|
`/ws/db` firehose + `sync.ts` JSON-patch already exist. Wire `useCachedResource`
|
||||||
|
revalidation to relevant WS pushes (debounced 800ms), keep the 30s staleness
|
||||||
|
reconciliation as backstop. No new backend needed for v1; a per-topic subscribe can
|
||||||
|
come later.
|
||||||
|
|
||||||
|
### Part B verification (on nodes)
|
||||||
|
- Navigate Cloud → Apps → Cloud: peer files render instantly from cache (0 spinner),
|
||||||
|
refresh indicator while revalidating, updated data lands without layout jump.
|
||||||
|
- One unreachable peer: its card shows stale/unreachable state; other peers render
|
||||||
|
immediately (no 30s all-or-nothing).
|
||||||
|
- Kill backend mid-view: stale data stays visible with age badge; recovery
|
||||||
|
revalidates automatically.
|
||||||
|
- Hard reload: sessionStorage hydrate paints before first RPC completes.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Sequencing for the next release
|
||||||
|
|
||||||
|
1. **A0 now** (fleet triage + transient nft rules + .228 daemon upgrade + baseline).
|
||||||
|
2. **A1 + A2** land together (P0 fixes + telemetry) → deploy to .116/.198 →
|
||||||
|
Phase A4 checks on the pair → framework-pt → full fleet.
|
||||||
|
3. **B1 + B2 + B3** (composable + rpc-client + Cloud) in parallel with A-testing —
|
||||||
|
frontend-only, verifiable against .116 dev (`reference_neode_ui_dev_testing`).
|
||||||
|
4. **A3** after telemetry baseline exists; **B4/B5** ride the same or next OTA.
|
||||||
|
5. Gate: Phase A4 checklist green + Part B verification on-device + existing
|
||||||
|
single-node gate stays green → tag/OTA per ship ritual.
|
||||||
|
|
||||||
|
## Success criteria
|
||||||
|
- `content.browse-peer` transport = fips for ≥99% of calls between healthy 0.4.1
|
||||||
|
nodes over 24h (measured by the new counters), Tor reserved for genuinely
|
||||||
|
FIPS-unreachable peers (.116-WiFi-class networks).
|
||||||
|
- Cloud revisit paints in <100ms from cache; fresh data within one revalidate.
|
||||||
|
- Fallback counters visible in `fips.status` so regressions are caught on the
|
||||||
|
dashboard, not by users.
|
||||||
108
docs/LICENSE-COMPLIANCE-AUDIT.md
Normal file
108
docs/LICENSE-COMPLIANCE-AUDIT.md
Normal file
@ -0,0 +1,108 @@
|
|||||||
|
# License Compliance Audit — Open-Source Release
|
||||||
|
|
||||||
|
Audit date: 2026-07-22. Scope: entire repo (core Rust workspace, neode-ui, apps/*, Android companion, image-recipe ISO, docker/, app-catalog, reticulum-daemon, demo/) plus the external FIPS source and registry-mirrored images.
|
||||||
|
|
||||||
|
**Verdict:** the dependency graph is almost entirely permissive (MIT/Apache/BSD) and compatible with a free open-source release. But the repo is not releasable as-is: it has **no license of its own**, one **LGPL Rust dependency**, several **non-redistributable committed assets** (proprietary fonts, unknown-rights media), and **missing attribution machinery**. Everything below is ordered by severity.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## STATUS UPDATE — 2026-07-23
|
||||||
|
|
||||||
|
**DONE:**
|
||||||
|
- MIT adopted. Root `LICENSE` + `NOTICE` added; `license = "MIT"` in all 5 workspace crates (archy-fips-core already had it); `"license": "MIT"` (+ `"private": true`) in all 4 package.json files.
|
||||||
|
- Deleted: `Courier_New/`, `Benton_Sans/`, `Redacted/` fonts; `wireguard.apk`; `atob.s9pk`; obsolete `test-install.sh` (all git-rm'd; also removed from `web/dist`).
|
||||||
|
- Media provenance resolved: all demo music/photos/posters, UI sfx, backgrounds, and intro video are the author's original work — recorded in `demo/content/README.md` and `NOTICE`.
|
||||||
|
- Meshtastic device artwork attributed (`mesh-devices/ATTRIBUTION.md` + NOTICE); icon attribution added (`assets/icon/ATTRIBUTION.md`: game-icons.net CC BY 3.0, pixelarticons MIT).
|
||||||
|
- Reticulum decision: include + disclose (NOTICE states the Reticulum License restrictions and that it applies only to the optional daemon).
|
||||||
|
- indeedhub: deferred — partnership in place; license the submodule before/at public release.
|
||||||
|
- License inventories generated: `core/THIRD-PARTY-LICENSES.md` (649 crates) and `neode-ui/THIRD-PARTY-LICENSES.md` (runtime deps + fonts + vendored).
|
||||||
|
|
||||||
|
**REMAINING (code changes, awaiting review — see sections below for detail):**
|
||||||
|
1. Replace `zbase32` (LGPL-3.0+) with `z32` or original impl — §2.
|
||||||
|
2. Swap `redis:7.4.8` → Valkey in `scripts/image-versions.sh` and deploys — §3.
|
||||||
|
3. Delete dead StartOS-derived crates `core/{js-engine,container-init,models,helpers}` — §4.
|
||||||
|
4. Attribution build integration: cargo-about in CI → ship full license texts in ISO; vite/rollup license plugin (or UI licenses page) for the web bundle; Android OSS-licenses screen — §5.
|
||||||
|
5. Release-checklist items: per-release Debian source pointer (snapshot.debian.org), catalog `license`/`sourceUrl` fields, restrict ISO image bundling to the audited list — §6.
|
||||||
|
6. Before repo goes public: purge deleted fonts/APKs from git history (`git filter-repo`), and verify game-icons author credit.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## 1. BLOCKER — the project has no license
|
||||||
|
|
||||||
|
There is no `LICENSE`/`COPYING` file anywhere in the repo. No crate in `core/` declares a `license` field; none of the four `package.json` files do either (and the three `apps/*` packages aren't even `private: true`). Until fixed, the code is "all rights reserved" — publicly visible, but legally not open source and not usable by anyone.
|
||||||
|
|
||||||
|
**Do:**
|
||||||
|
- [ ] Choose a license. **Recommendation: MIT** — the Bitcoin-ecosystem norm (Bitcoin Core, LND are MIT), maximally compatible with everything found in the graph. (Alternatives: Apache-2.0 adds a patent grant; GPLv3 if copyleft is desired — nothing in the deps prevents any of these.)
|
||||||
|
- [ ] Add `LICENSE` at repo root with the year and copyright holder.
|
||||||
|
- [ ] Add `license = "MIT"` to all five workspace member `Cargo.toml`s (archipelago, container, openwrt, performance, security) and `Android/rust/archy-fips-core` (declares MIT but ships no license file — add one).
|
||||||
|
- [ ] Add `"license": "MIT"` to `neode-ui/package.json` and `apps/{morphos-server,router,did-wallet}/package.json`.
|
||||||
|
|
||||||
|
## 2. BLOCKER — copyleft dependency that must be replaced
|
||||||
|
|
||||||
|
- [ ] **`zbase32 0.1.2` — LGPL-3.0+** — the only hard copyleft blocker in all 649 resolved Rust crates. Direct dep of `archipelago`, used in `core/archipelago/src/network/did_dht.rs` for did:dht z-base-32 encoding. LGPL statically linked into a Rust binary requires shipping relinkable objects/source — impractical. **Replace with the MIT `z32` crate** or a ~30-line original alphabet-substitution implementation.
|
||||||
|
|
||||||
|
No GPL, AGPL, SSPL, or unlicensed crates exist anywhere else in the Rust graph. (`r-efi` and `self_cell` list LGPL/GPL only as options in OR-expressions — elect MIT/Apache, no action.)
|
||||||
|
|
||||||
|
## 3. BLOCKER — committed files we may not redistribute
|
||||||
|
|
||||||
|
Remove from git (and **purge from history** before the repo goes public — they're in past commits):
|
||||||
|
|
||||||
|
- [ ] `neode-ui/public/assets/fonts/Courier_New/` — Monotype proprietary font, no license, **unused in CSS**. Delete.
|
||||||
|
- [ ] `neode-ui/public/assets/fonts/Benton_Sans/BentonSans-Regular.otf` — commercial Font Bureau typeface, no license, unused. Delete.
|
||||||
|
- [ ] `neode-ui/public/packages/wireguard.apk` (17 MB) — official WireGuard Android APK containing GPL-2.0 `libwg` components; redistribution triggers GPL source-offer. **Unreferenced since the FIPS migration** — delete.
|
||||||
|
- [ ] `neode-ui/public/packages/atob.s9pk` (24 MB) — Start9 service package, unknown license, referenced only by a test script. Delete.
|
||||||
|
- [ ] `demo/content/music/` (18 full tracks, ~150 MB) and `demo/peer-media/` (17 photos/book covers/film posters) — no recorded rights. If they're your own/AI-generated work, document that in a `demo/content/README`; otherwise remove.
|
||||||
|
- [ ] `neode-ui/public/assets/video/video-intro.mp4`, `Kratter.MP3`, photographic `bg-*.jpg` backgrounds, UI/arcade sound effects in `assets/audio/` — same: document provenance (user-made per project convention) or replace. `welcome-noderunner.mp3` is ElevenLabs TTS — their commercial-use terms allow this on paid plans; note it.
|
||||||
|
- [ ] **Registry: `redis:7.4.8`** (`scripts/image-versions.sh` `REDIS_IMAGE`) — Redis ≥ 7.4 is RSALv2/SSPLv1, **not open source**; re-hosting it on your registry is redistribution under a restricted license. **Switch to Valkey** (BSD-3, already mirrored) everywhere.
|
||||||
|
|
||||||
|
## 4. VERIFY — unknown/third-party provenance
|
||||||
|
|
||||||
|
- [ ] **`neode-ui/public/assets/img/mesh-devices/` (36 SVGs)** — almost certainly Meshtastic project device artwork (meshtastic/web is GPL-3.0). Confirm source; either replace with original art or comply with the upstream license + attribution.
|
||||||
|
- [ ] **`neode-ui/public/assets/icon/`** — `barbarian.svg`, `batteries.svg` match game-icons.net (**CC BY 3.0 — visible attribution required**); pixel-style icons match pixelarticons (MIT). Confirm and add attribution, or replace.
|
||||||
|
- [ ] `Redacted/redacted.regular.ttf` — upstream is SIL OFL 1.1 but no license file is shipped. Add `OFL.txt` or delete (unused).
|
||||||
|
- [ ] **indeedhub** — submodule (private gitea) not checked out; no known license, yet `indeedhub{,-api,-ffmpeg}:1.0.0` images are distributed via registry/ISO. `indeedhub-ffmpeg` implies a bundled FFmpeg (LGPL/GPL → source-offer obligations). Must license the project and audit the ffmpeg build before public release.
|
||||||
|
- [ ] `minmoto/fmcd` v0.8.0 and `ark-bitcoin/bark` (barkd) — binaries redistributed in your images; verify upstream licenses (bark claims Apache-2.0/MIT dual) and include their notices.
|
||||||
|
- [ ] **Start9/StartOS heritage** — `core/{js-engine,container-init,models,helpers}` are StartOS-derived (embassy paths, s9pk handling). start-os is MIT → attribution required if kept. **Better: delete these four crates** — they are not workspace members, cannot compile (broken `../../patch-db` path dep), and carry an unpinned `yajrc = "*"` git dep on a moving branch. Deleting removes both the attribution question and dead code.
|
||||||
|
- [ ] **Reticulum (RNS 1.3.5 + LXMF)** — verified: custom "Reticulum License" — MIT-style **plus field-of-use restrictions** (no systems designed to harm humans; no AI/ML training-dataset use). Redistribution is permitted, so shipping the PyInstaller `archy-reticulum-daemon` binary is fine **if** the license text is included with it — but the OS cannot claim to be 100 % OSI-open-source while bundling it. Options: include + disclose (recommended, matches "plan for decentralization" honesty), or make the daemon an optional download.
|
||||||
|
|
||||||
|
## 5. REQUIRED — attribution / notice machinery (currently absent)
|
||||||
|
|
||||||
|
Nearly every permissive license (MIT/BSD/ISC/Apache) requires reproducing copyright + license text **in distributed binaries** — and right now every distribution channel strips them:
|
||||||
|
|
||||||
|
- [ ] **Rust binaries** (649 crates, ~85 % MIT/Apache dual): generate `THIRD-PARTY-LICENSES` with `cargo-about` (or `cargo-license`) in CI; ship it in the ISO at e.g. `/usr/share/doc/archipelago/`. Include **ring's three license files** (LICENSE, LICENSE-BoringSSL, LICENSE-other-bits) and note the system OpenSSL (Apache-2.0) linked via `ssh2`.
|
||||||
|
- [ ] **Web bundle**: Vite/esbuild strips all `@license` comments from `web/dist`. Add `rollup-plugin-license`/`vite-plugin-license` to emit a third-party attribution file, or add an "Open-source licenses" page in the UI. Runtime deps needing notices: vue/vue-router/pinia/vue-i18n (MIT), d3 (ISC), leaflet (BSD-2), dompurify (elect Apache-2.0 of its MPL/Apache dual), fuse.js (Apache-2.0), qrcode/qr-scanner/qrloop/buffer/fast-json-patch (MIT).
|
||||||
|
- [ ] **Android APK**: `packaging.excludes` strips `META-INF` license texts and there is no licenses screen. Add an OSS-licenses screen or bundled `licenses.txt` covering AndroidX/Compose/OkHttp/ZXing (Apache-2.0), **fips © 2026 Johnathan Corgan (MIT — the core of the VPN feature)**, tokio/tracing (MIT), subtle (BSD-3), tun (WTFPL — permissive, just list it), secp256k1 family (CC0). Generate the Rust side from the committed `Cargo.lock` with cargo-about.
|
||||||
|
- [ ] **AIUI demo bundle** (`demo/aiui/` — committed minified build): bundles Mermaid, Cytoscape, KaTeX, D3, Lodash, Workbox (all MIT/BSD). Add a `THIRD-PARTY-LICENSES` file next to it (or rebuild with a license plugin).
|
||||||
|
- [ ] Keep the intact MIT headers in the two vendored `qrcode.js` copies (docker/lnd-ui, docker/electrs-ui) — already compliant, don't minify them.
|
||||||
|
- [ ] Fonts kept: Montserrat (OFL.txt present ✓), Open Sans (Apache LICENSE.txt present ✓) — keep license files adjacent to the font files in dist.
|
||||||
|
|
||||||
|
## 6. REQUIRED — distribution-level obligations (ISO & registry)
|
||||||
|
|
||||||
|
The ISO redistributes a full Debian (trixie) system plus ~29 container image tarballs; the private registry re-hosts upstream images. Re-hosting = redistribution, same obligations as bundling.
|
||||||
|
|
||||||
|
- [ ] **GPL source offer for the ISO** — kernel, GRUB, busybox/live-boot, coreutils, nftables, cryptsetup, wireguard-tools, SYSLINUX `isohdpfx.bin`, etc. Easiest compliance: keep `/usr/share/doc/*/copyright` (the build already does ✓) **and** publish, per release, either a mirror of the exact Debian source packages (`apt-get source` snapshot / snapshot.debian.org pointer) or a written offer in the docs. Add this to the release checklist.
|
||||||
|
- [ ] **AGPLv3 images redistributed** (mempool, Grafana, Vaultwarden, SearXNG, PhotoPrism, Nextcloud, Immich, CryptPad, MinIO): AGPL compliance = make corresponding source available. You ship a **modified** mempool-frontend (`docker/mempool-frontend` entrypoint patch) — the patch is in-repo, so compliance is met once the repo is public; state this in docs. For unmodified images, link upstream sources in the app catalog.
|
||||||
|
- [ ] **GPLv2/GPLv3 images** (MariaDB, Jellyfin, AdGuard Home, strfry): unmodified redistribution → provide license text + upstream source links (a `license` + `sourceUrl` field per `app-catalog/catalog.json` entry solves this catalog-wide).
|
||||||
|
- [ ] **Non-free firmware** (firmware-realtek/iwlwifi/misc/linux-nonfree, intel/amd microcode): redistributable but proprietary — disclose in docs ("includes non-free firmware for hardware support"), like Debian's own non-free-firmware ISOs do.
|
||||||
|
- [ ] The ISO build's live-server image capture (`podman save` of whatever matches on the dev server) is a compliance hazard — bundle only from the audited image list.
|
||||||
|
- [ ] FIPS daemon (jmcorgan/fips v0.4.1, MIT ✓) and nostr-rs-relay binary (MIT ✓): include their license texts in the notices bundle.
|
||||||
|
|
||||||
|
## 7. Housekeeping (supports compliance)
|
||||||
|
|
||||||
|
- [ ] Add lockfiles + pinned versions in `apps/*` (currently floating `^` ranges, violating the project's own pinning rule) — reproducibility is also what makes license audits stay true.
|
||||||
|
- [ ] `Android` fips dep is pinned to a personal fork rev (`9qeklajc/fips-native@46494a74`) — mirror or vendor it so outside contributors can build.
|
||||||
|
- [ ] Move `@types/dompurify` to devDeps; refresh stale `neode-ui/node_modules`.
|
||||||
|
- [ ] Add a `NOTICE` file at root naming: fips (Johnathan Corgan, MIT), Start9 start-os (if any derived code remains), Kazuhiko Arase qrcode.js, font licenses, icon attributions.
|
||||||
|
- [ ] Consider CI license gating: `cargo-deny` (Rust) + `license-checker` (npm) with an allowlist, so new copyleft deps are caught at PR time.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Quick reference: what's already clean
|
||||||
|
|
||||||
|
- All 649 Rust crates except `zbase32`: permissive or dual-licensed.
|
||||||
|
- All 833 npm packages in neode-ui: no GPL/AGPL anywhere; only dev-tool LGPL (sharp's libvips, never distributed).
|
||||||
|
- Android Gradle deps: 100 % Apache-2.0, all pinned, no Play Services/telemetry.
|
||||||
|
- FIPS mesh: MIT (© 2026 Johnathan Corgan) — keep notice.
|
||||||
|
- js-engine binds deno_core (MIT) as a crate, nothing vendored — moot if dead crates are deleted.
|
||||||
|
- reticulum-daemon Python is original code; obligations attach only to the PyInstaller binary (see §4).
|
||||||
|
- Bitcoin Core/Knots, LND, BTCPay, Electrs, Fedimint, core-lightning, Gitea, Home Assistant, Tailscale, Portainer, Uptime-Kuma, filebrowser, ollama, penpot: MIT/Apache/BSD/Zlib/MPL — link + notice is enough.
|
||||||
288
docs/OPEN-SOURCE-READINESS-PLAN.md
Normal file
288
docs/OPEN-SOURCE-READINESS-PLAN.md
Normal file
@ -0,0 +1,288 @@
|
|||||||
|
# Open-Source Readiness Plan — Archipelago public launch
|
||||||
|
|
||||||
|
> Working plan, 2026-07-27. Source of truth for the pre-open-source cleanup.
|
||||||
|
> A second agent is working the same goal concurrently — before executing any phase,
|
||||||
|
> diff against `git log` since `7e8d3314` and skip/merge what's already done.
|
||||||
|
> (Session plan file: `~/.claude/plans/resilient-moseying-reef.md`.)
|
||||||
|
|
||||||
|
## Context
|
||||||
|
|
||||||
|
The repo goes public in a few days, targeting bitcoin/bitcoin-level polish. Three deep
|
||||||
|
exploration passes (docs/structure, code health, secrets sweep) found the repo is
|
||||||
|
fundamentally strong — README, `apps/` manifest examples, ADRs, the bats lifecycle gate,
|
||||||
|
1,104 Rust tests — but has hard blockers: **two live Anthropic API keys committed in
|
||||||
|
tracked files**, node passwords in 7 tracked files, no LICENSE (README links a 404),
|
||||||
|
5.5 GB `.git` (re-committed 27 MB APKs), ~290 hardcoded references to the private Gitea
|
||||||
|
registry `146.59.87.168:3000` that make every app image unpullable for outsiders, and
|
||||||
|
~28 internal AI-session/tracker docs mixed into `docs/`.
|
||||||
|
|
||||||
|
**Decisions made by the user:**
|
||||||
|
1. **Fresh-history publish** — new public repo with a clean initial commit; private repo keeps full history.
|
||||||
|
2. **Registry: domain + parameterize** — real domain in front of the existing registry; host configurable everywhere.
|
||||||
|
3. **Deep code cleanup** — orphan crates, dead_code lifts, clippy trims, legacy fallback deletion (sequenced, cut-line-friendly).
|
||||||
|
4. **Internal docs: sanitize and keep public** — scrub creds/IPs/hostnames but publish plans/trackers for transparency.
|
||||||
|
|
||||||
|
**Invariant throughout:** the single-node production gate (`tests/lifecycle/run-gate.sh`)
|
||||||
|
is GREEN and must stay green. Re-run after any orchestrator/lifecycle change (Phase E
|
||||||
|
especially). All cargo verification uses `--all-features` to match CI. Stage by explicit
|
||||||
|
path, never `git add -A` (shared tree).
|
||||||
|
|
||||||
|
## Current local pass status
|
||||||
|
|
||||||
|
This branch is replayed on top of `origin/main` as `public-prelaunch`.
|
||||||
|
|
||||||
|
Completed locally in this pass:
|
||||||
|
|
||||||
|
- Redacted the two tracked Anthropic API key literals from
|
||||||
|
`scripts/setup-aiui-server.sh` and
|
||||||
|
`image-recipe/_archived/build-auto-installer-iso.sh`.
|
||||||
|
- Removed `Android/app/debug.keystore` and `core/.env.production` from the
|
||||||
|
source tree; copies were preserved in
|
||||||
|
`~/Desktop/archipelago-sensitive-backup-2026-07-27/`.
|
||||||
|
- Reworked `scripts/audit-secrets.sh` to scan tracked source more aggressively
|
||||||
|
and to catch non-example env files and credential file patterns.
|
||||||
|
- Reworked `scripts/validate-app-manifest.sh` so the current `app:` manifest
|
||||||
|
schema can be audited without a Python `PyYAML` dependency.
|
||||||
|
- Updated root/community docs, CI, PR template, app developer notes, and
|
||||||
|
container/deployment docs toward public contributor expectations.
|
||||||
|
- Fixed native FIPS activation fallback: nodes that have the packaged
|
||||||
|
`fips.service` but not `archipelago-fips.service` now start the available
|
||||||
|
unit instead of repeatedly failing activation against a missing unit. This
|
||||||
|
now covers startup, supervisor self-heal, manual dashboard start/reconnect,
|
||||||
|
and post-onboarding activation. The UI now labels the action as `Start`
|
||||||
|
instead of making native FIPS look like an installable app.
|
||||||
|
- Fixed the FIPS app-port relay design so it binds relays to the node's FIPS
|
||||||
|
ULA instead of wildcard `[::]`, avoiding collisions with Podman-published app
|
||||||
|
ports such as FileBrowser `8083` and Botfights `9100`.
|
||||||
|
- Added `docs/nostr-git-source-hosting.md`, a NIP-34/ngit/GRASP source hosting
|
||||||
|
plan using a Bitcoin Core-style maintainer model: public review and easy
|
||||||
|
forks, with canonical merge rights held by a small signed maintainer set.
|
||||||
|
|
||||||
|
Verified locally:
|
||||||
|
|
||||||
|
- `./scripts/audit-secrets.sh` passes.
|
||||||
|
- Full `apps/*/manifest.yml` repository audit passes with warnings only.
|
||||||
|
- `bash -n` passes for the edited shell scripts.
|
||||||
|
- Targeted FIPS dashboard vitest passes.
|
||||||
|
- Targeted Rust tests for FIPS service unit detection and FIPS app relay
|
||||||
|
address selection pass.
|
||||||
|
|
||||||
|
Verified on a Linux Archipelago verification node:
|
||||||
|
|
||||||
|
- Native FIPS was restored by starting the already-installed packaged
|
||||||
|
`fips.service`; the daemon became active and joined the FIPS tree.
|
||||||
|
- Correct local lifecycle API endpoint is HTTP, not HTTPS
|
||||||
|
(`ARCHY_HOST=127.0.0.1 ARCHY_SCHEME=http`).
|
||||||
|
- Read-only lifecycle run progressed past login and confirmed required
|
||||||
|
containers, Bitcoin RPC, ElectrumX TCP, and manifest port-drift checks, but
|
||||||
|
did not complete cleanly: `botfights` and `filebrowser` remained in
|
||||||
|
`restarting` longer than the matrix window, and the LND `lncli getinfo`
|
||||||
|
probe hung. Do not run the destructive gate until those live-node issues are
|
||||||
|
understood.
|
||||||
|
- After the node updated to `1.7.116-alpha`, `botfights`, `filebrowser`, and
|
||||||
|
`lnd` were active/running and ports `8083`/`9100` were held by Podman's
|
||||||
|
`rootlessport` as expected. The packaged `fips.service` remained installed
|
||||||
|
and enabled but inactive, so the native FIPS service fallback should still
|
||||||
|
ship before the public launch.
|
||||||
|
|
||||||
|
Still required before public publish:
|
||||||
|
|
||||||
|
- Rotate/revoke compromised credentials listed in Phase 0.
|
||||||
|
- Finish Phase 1 password/node/token sanitization beyond the two API keys.
|
||||||
|
- Publish from fresh history after the sanitized tree is final.
|
||||||
|
- Run full Rust, frontend, Android, and lifecycle gate verification.
|
||||||
|
- Resolve the live-node lifecycle blockers above, then rerun the read-only
|
||||||
|
suite followed by the destructive gate only on an approved verification node.
|
||||||
|
- Decide the canonical Archipelago maintainer npub and merge-maintainer npub
|
||||||
|
list before publishing the Nostr Git source-hosting workflow.
|
||||||
|
|
||||||
|
---
|
||||||
|
|
||||||
|
## Phase 0 — Credential rotation (immediate, independent of the repo)
|
||||||
|
|
||||||
|
Treat all of these as already compromised; rotate even though we're doing fresh-history:
|
||||||
|
|
||||||
|
- **Anthropic API key #1**: `image-recipe/_archived/build-auto-installer-iso.sh:2837` (the "intentional alpha" ISO key). Revoke + reissue; move the live key OUT of source into a build-time secret/env (`ISO_ANTHROPIC_API_KEY`), keep the alpha-baking behavior if desired but never the literal in git.
|
||||||
|
- **Anthropic API key #2**: `scripts/setup-aiui-server.sh:28` — a *different* live key, not covered by the documented alpha exception. Revoke; parameterize the script.
|
||||||
|
- **The shared node SSH/sudo/UI password** (two variants) — in 7 tracked files + 24+ commits. Rotate fleet-wide (user task).
|
||||||
|
- **Gitea `ai` account password + 2 Gitea tokens** — embedded in `.git/config` remote URLs (not tracked, but leaks in any directory copy/tarball). Rotate; switch remotes to credential-helper storage instead of URL-embedded creds.
|
||||||
|
|
||||||
|
## Phase 1 — Secrets & sanitization of tracked files
|
||||||
|
|
||||||
|
1. Strip the password/credential lines from the 7 files:
|
||||||
|
`docs/PRODUCTION-MASTER-PLAN.md` (lines ~428–429, 454–457, 483, 521–528, 886 — the fleet cred table),
|
||||||
|
`docs/archive/SESSION-1.8.0-OTA-PROGRESS.md`, `docs/archive/HANDOVER-2026-07-02-iso-feedback.md`,
|
||||||
|
`docs/bitcoin-version-bulletproof-rollout.md`, `tests/production-quality/TRACKER.md`,
|
||||||
|
`tests/multinode/meshtastic.sh:26`, `neode-ui/test-openwrt.mjs:4` (→ env var).
|
||||||
|
2. `.gitea/workflows/post-install-tests.yml` — remove `sshpass -p '…'` + default target IP; use secrets/vars.
|
||||||
|
3. Sanitize infra identifiers repo-wide (in the *sanitize-and-keep* docs and scripts):
|
||||||
|
replace Tailscale IPs (17 unique, 14 files), LAN IPs (`192.168.1.x`, 93 files), hostnames
|
||||||
|
(`tx1138`, `shorty-s`, `archy-x250`, `archy-dev-pa`) with placeholders like `<node-a>` /
|
||||||
|
`NODE_IP`. Key script targets: `scripts/deploy-config-defaults.sh`, `scripts/deploy-tailscale.sh`,
|
||||||
|
`docs/operations-runbook.md` (opens with real node IPs), `docs/developer-guide.md`, `docs/api-reference.md`, `docs/hotfix-process.md`.
|
||||||
|
4. Fix the audit tool that let this happen: `scripts/audit-secrets.sh:28` — remove `\.md$` and
|
||||||
|
bare `test` from ALLOW_PATTERNS; add `sk-ant-` and password-table patterns; scan all
|
||||||
|
tracked files not just `*.env`. Run it clean as a Phase-1 exit check.
|
||||||
|
5. `.gitignore` additions: `.claude/`, `*.key`, `*.pem`, `id_rsa*`, `*.sqlite`, `*.db`
|
||||||
|
(`.claude/settings.local.json` with creds is currently only ignored by a machine-global rule).
|
||||||
|
6. Product-security note to raise (not fix now): `password123` is a shipped default (auth.rs, en.json, user-walkthrough) — file a public issue for forced first-run password change if not already enforced.
|
||||||
|
|
||||||
|
## Phase 2 — Repo restructure: deletions, binaries, layout
|
||||||
|
|
||||||
|
Delete (each its own commit):
|
||||||
|
- `loop/` (AI overnight harness w/ node SSH lines), `.agents/`, `.codex`, `.githooks/pre-push`
|
||||||
|
(the hook that re-commits the 27 MB APK — root cause of the 5.5 GB history).
|
||||||
|
- `indeedhub/` submodule + `.gitmodules` entry (points at private HTTP Gitea, breaks `--recursive`
|
||||||
|
clones); `indeedhub-demo/` (single Dockerfile — merge or drop).
|
||||||
|
- `RELEASE-NOTES-v1.0.0.md` (superseded by CHANGELOG), `neode-ui/docs/GAMEPAD-NAV-MAP.md` (duplicate of `docs/GAMEPAD-NAV.md`).
|
||||||
|
- Stray generated HTML: `docs/container-architecture.html` (311 KB), `docs/archive/architecture-review.html`, `docs/archive/lora-functionality.html`.
|
||||||
|
- `Android/local.properties` from tracking (local absolute path); remove `Android/app/debug.keystore` (standard practice).
|
||||||
|
|
||||||
|
Move out of git (→ release assets on the Releases page, referenced by URL):
|
||||||
|
- `neode-ui/public/packages/archipelago-companion.apk` (27 MB), `wireguard.apk` (17 MB), `atob.s9pk` (23 MB).
|
||||||
|
- `Android/archipelago-0.3.0-debug.apk.zip` (16 MB, stale).
|
||||||
|
- `demo/content/music/*` + heavy `demo/aiui/assets` (~261 MB, third-party/unclear-licence media — MUST not ship publicly regardless of size).
|
||||||
|
- `neode-ui/dev-dist/` (generated Workbox output) → gitignore.
|
||||||
|
|
||||||
|
Rename/fix the naming lie: `image-recipe/_archived/` contains the *production* ISO builder
|
||||||
|
(`build-auto-installer-iso.sh`, referenced by `.gitea/workflows/build-iso.yml`). Move live
|
||||||
|
files up into `image-recipe/`, delete the genuinely archived rest.
|
||||||
|
|
||||||
|
## Phase 3 — Registry domain + parameterization (functional blocker)
|
||||||
|
|
||||||
|
Infra (user assists: DNS + TLS):
|
||||||
|
- Put a domain (e.g. `registry.archipelago-os.org` / `git.archipelago-os.org`) with HTTPS in
|
||||||
|
front of the existing Gitea on vps2. OTA download URLs move from plain HTTP to HTTPS.
|
||||||
|
|
||||||
|
Repo changes:
|
||||||
|
- Introduce a single source of truth for the registry host (e.g. `REGISTRY_HOST` in
|
||||||
|
`scripts/lib/` + a default in the orchestrator config). Replace `146.59.87.168:3000` in:
|
||||||
|
all 56 `apps/*/manifest.yml`, `app-catalog/catalog.json`, `releases/manifest.json`,
|
||||||
|
`release-manifest.json`, the 11 scripts (`self-update.sh`, `create-release.sh`,
|
||||||
|
`generate-app-catalog.sh`, `validate-app-manifest.sh`, `first-boot-containers.sh`, …),
|
||||||
|
both `demo-images.yml` workflows, `demo-deploy/.env.example`, and the Android sources
|
||||||
|
(`FipsPreferences.kt`, `PartyScreen.kt`).
|
||||||
|
- Because the catalog is signed: regenerate + re-sign + republish the app catalog after the
|
||||||
|
manifest host change (catalog-overlay supremacy — disk edits don't apply otherwise).
|
||||||
|
Signing needs the user's mnemonic → schedule one ceremony after manifests are final.
|
||||||
|
- Verify: fresh machine with no LAN/tailnet access can `podman pull` one app image via the
|
||||||
|
domain and the gate node still installs apps after the re-signed catalog lands.
|
||||||
|
|
||||||
|
## Phase 4 — Documentation overhaul
|
||||||
|
|
||||||
|
### 4a. Community/legal files (missing today)
|
||||||
|
- `LICENSE` — MIT (matches existing README badge). Add `[workspace.package] license` +
|
||||||
|
`license.workspace = true` in the 5 member Cargo.tomls (also see Phase A4).
|
||||||
|
- `SECURITY.md` — disclosure address, PGP key, supported-versions; cite the March 2026 audit (`docs/archive/security-code-audit-2026-03.md`).
|
||||||
|
- `CODE_OF_CONDUCT.md` — Contributor Covenant (CONTRIBUTING.md already links to it, 404 today).
|
||||||
|
- `CONTRIBUTING.md` edits: Gitea→GitHub fork flow, remove private deploy instructions, absorb
|
||||||
|
the public-worthy CLAUDE.md invariants (rootless podman, manifest-driven, secrets model,
|
||||||
|
non-destructive migrations), versioning policy note for the `-alpha` scheme.
|
||||||
|
- `CLAUDE.md` — rewrite: keep invariants/build-verify (public-worthy), remove status banner,
|
||||||
|
node numbers, `gitea-ai` push mechanics, MEMORY references (those move to private notes).
|
||||||
|
|
||||||
|
### 4b. New developer docs (the three real gaps for app developers)
|
||||||
|
1. **`docs/quadlet-compilation.md`** — how a manifest becomes a Quadlet/systemd unit: naming,
|
||||||
|
`systemctl --user` lifecycle, where units land, how to inspect/debug one. (Source:
|
||||||
|
`core/archipelago/src/container/quadlet*.rs`, prod_orchestrator.)
|
||||||
|
2. **`docs/container-lifecycle.md`** — the 30 s level-triggered reconciler, install/adopt/
|
||||||
|
restart/uninstall state machine, health checks, crash recovery. (Replaces the plan-shaped
|
||||||
|
`docs/bulletproof-containers.md` as the current description; salvage its content.)
|
||||||
|
3. **`docs/secrets.md`** — `generated_secrets` declaration → materialisation by
|
||||||
|
`container::secrets` (0600, rootless) → injection; what developers must never do.
|
||||||
|
- Also: make every example in `docs/app-developer-guide.md` + `apps/*/manifest.yml` copy-paste
|
||||||
|
work against the new public registry host; add an end-to-end "write your first app" walkthrough
|
||||||
|
that a stranger can follow with only the public repo + an Archipelago node.
|
||||||
|
|
||||||
|
### 4c. Sanitize-and-keep internal docs (user's transparency choice)
|
||||||
|
- Keep, after Phase-1 scrubbing: `docs/PRODUCTION-MASTER-PLAN.md`, `docs/UNIFIED-TASK-TRACKER.md`,
|
||||||
|
`docs/1.8.0-RELEASE-HARDENING-PLAN.md`, `docs/RETICULUM-TRANSPORT-PROGRESS.md`, HANDOFF-*, test
|
||||||
|
plans, `docs/archive/*` — but **move all session/handoff/tracker material under
|
||||||
|
`docs/history/`** (extending the existing honest `docs/archive/README.md` pattern) so the
|
||||||
|
top-level `docs/` reads as current reference only. Add a banner to each: "historical working
|
||||||
|
document, sanitized; not maintained."
|
||||||
|
- Remove dangling agent-memory references in tracked docs (`docs/bulletproof-containers.md`,
|
||||||
|
`docs/RETICULUM-TRANSPORT-PROGRESS.md`, `docs/registry-manifest-design.md`,
|
||||||
|
`docs/bitcoin-multi-version-design.md` progress block).
|
||||||
|
- De-status the 14 design docs (strip "Status/RESUME POINT" headers into a one-line status
|
||||||
|
field; e.g. `docs/APP-PACKAGING-MIGRATION-PLAN.md` → public app-platform design doc).
|
||||||
|
- Extract North-Star narrative from PRODUCTION-MASTER-PLAN into `docs/ROADMAP.md`; extract
|
||||||
|
the "run the gate ON the node" philosophy from `docs/multinode-testing-plan.md` into
|
||||||
|
`tests/lifecycle/TESTING.md`.
|
||||||
|
- Add `docs/README.md` index (bitcoin/bitcoin `doc/` style): Getting started / Architecture /
|
||||||
|
App development / Operations / Design docs (ADRs) / History.
|
||||||
|
- README fixes: LICENSE link becomes real, Documentation table repointed at the reorganized
|
||||||
|
docs, remove "Deploy to a Test Node" private-LAN section, point Contributing at
|
||||||
|
CONTRIBUTING.md only.
|
||||||
|
|
||||||
|
## Phase 5 — Deep code cleanup (ordered zero-risk → highest-risk; cut-line after any commit)
|
||||||
|
|
||||||
|
### A. Zero-risk deletions & metadata (S each, own commits)
|
||||||
|
- **A1** Delete orphan non-compiling StartOS crates: `core/models`, `core/helpers`,
|
||||||
|
`core/js-engine` (incl. 2 committed `JS_SNAPSHOT.*.bin`), `core/container-init` (~4,100 LOC,
|
||||||
|
zero references). Verify: `cargo build --workspace && cargo test --all-features`.
|
||||||
|
- **A2** Delete unreferenced Vue components: `neode-ui/src/components/{AppSwitcher,EmptyState,SkeletonCard}.vue`. Verify: `npm run type-check && npm run build`.
|
||||||
|
- **A3** Fix `.gitignore` lockfile lines (7: `Cargo.lock`, 15: `package-lock.json`) — lockfiles are intentionally tracked; the rules are misleading and swallow future lockfiles.
|
||||||
|
- **A4** LICENSE + Cargo license fields (see 4a). Verify with `cargo metadata`.
|
||||||
|
- **A5** `core/rust-toolchain.toml` pinning `1.95.0`; align `.github/workflows/ci.yml` (remove explicit `toolchain: stable` input so the file wins). Upgrades become deliberate PRs.
|
||||||
|
- **A6** `core/rustfmt.toml` codifying **defaults only** (`edition = "2021"` + comment) — do NOT add style options days before launch (whole-tree reformat churn). Verify `cargo fmt --all -- --check` yields no diff.
|
||||||
|
|
||||||
|
### B. CI guards (zero runtime risk)
|
||||||
|
- **B1** Enable vitest in CI: run `cd neode-ui && npm run test` locally; fix trivial failures, `.skip`+issue flaky ones; add step to the frontend job. Playwright → tracked issue only (needs browsers + mock backend orchestration).
|
||||||
|
- **B2** Raw podman/systemctl **ratchet, not migration**: the 132 raw `Command::new("podman"/"systemctl")` sites use subcommands the `core/container/src/podman_client.rs` wrapper doesn't expose (network/inspect/ps/port), 43 sites are in gate-critical `install.rs`, and the prod path intentionally uses Quadlet+systemctl. Add `scripts/ci/raw-podman-ratchet.sh` (count vs committed baseline, fail on increase) as a CI step + tracked issue for wrapper API design.
|
||||||
|
|
||||||
|
### C. Clippy suppression trim (`core/archipelago/src/main.rs:8-18`, per-lint commits)
|
||||||
|
- Remove cheaply: `assertions_on_constants`, `drop_non_drop`, `wildcard_in_or_patterns`, `doc_lazy_continuation`, `enum_variant_names` (targeted allows on serde enums — never rename wire variants).
|
||||||
|
- Own careful commit: `unused_io_amount` — a **correctness** lint; fix sites with `read_exact`/`write_all` or documented targeted allows (`mesh/serial.rs:456,496` has raw partial reads; serial framing may be intentional). Full test suite + gate after.
|
||||||
|
- Keep crate-wide with justifying comment: `too_many_arguments`, `type_complexity`; attempt `ptr_arg` (`&Vec<T>`→`&[T]`, mechanical) if time allows — first to cut.
|
||||||
|
- Verify each: `cargo clippy --all-targets --all-features -- -D warnings && cargo test --all-features`.
|
||||||
|
|
||||||
|
### D. dead_code lift — Tiers 1–2 pre-launch, Tier 3 → commented allows + issues
|
||||||
|
Per-module procedure (one file per commit): remove `#![allow(dead_code)]` → `cargo check
|
||||||
|
--all-targets --all-features` → triage each warning: (a) genuinely dead → delete;
|
||||||
|
(b) future-feature/protocol-mandated → targeted `#[allow(dead_code)] // TODO(#NNN): …`;
|
||||||
|
(c) missing wiring → keep + targeted allow + issue (don't fix wiring in this workstream) →
|
||||||
|
clippy `-D warnings` + tests → commit.
|
||||||
|
- **Tier 1 (small/leaf, S each):** `swarm/seed_advert.rs`, `transport/{mesh_transport,lan,chunking,delta}.rs`, `mesh/{crypto,alerts,types,outbox}.rs`, `streaming/mod.rs`, `wallet/mod.rs`.
|
||||||
|
- **Tier 2 (M each):** `fips/{mod,iface,dial}.rs` (41 external refs → little residual deadness), `mesh/{x3dh,ratchet,steganography,message_types}.rs` — for crypto files bias to (b) with roadmap comments (unused crypto attracts auditor noise; every kept item needs its why).
|
||||||
|
- **Tier 3 (defer, riskiest):** `mesh/{mod,reticulum,protocol,serial,bitcoin_relay}.rs`, `transport/mod.rs` — change each blanket allow to `#![allow(dead_code)] // Hardware-mesh surface partially wired; triage tracked in #NNN`.
|
||||||
|
- Optional S/M win: move `prod_orchestrator.rs`'s 5,034-line `#[cfg(test)]` module to a sibling file via `#[path]` (pure move, halves the 6,291-line file).
|
||||||
|
|
||||||
|
### E. stacks.rs legacy fallbacks (highest risk — LAST, evidence-gated)
|
||||||
|
Legacy installers for immich/btcpay/mempool/indeedhub (`core/archipelago/src/api/rpc/package/stacks.rs:838/1047/1267/1498`, ~1,000 LOC with hardcoded registry IPs) fire only on "unknown app_id, zero members installed", logging `INSTALL ORCH SKIP` (stacks.rs:673). Netbird already uses the hard-error replacement (stacks.rs:1898-1920).
|
||||||
|
1. Run the full gate on the node; grep install logs for `INSTALL ORCH SKIP`.
|
||||||
|
2. Zero SKIPs → replace each legacy body with the netbird-style hard error (keep orchestrator call + `adopt_stack_if_exists`; satisfies migrations-never-destroy-data). Re-run gate; any red → revert + issue.
|
||||||
|
3. Any SKIP → don't delete; issue: "deploy manifests fleet-wide, then delete legacy installers".
|
||||||
|
|
||||||
|
### Explicitly deferred → public tracked issues at launch
|
||||||
|
PodmanClient API extension + call-site migration; god-module splits (`install.rs`, `update.rs`, `mesh/mod.rs`); Playwright in CI; Tier-3 dead_code triage; `password123` default hardening.
|
||||||
|
|
||||||
|
## Phase 6 — Fresh-history publish
|
||||||
|
|
||||||
|
1. Freeze: all phases merged on internal `main`, gate green, catalog re-signed.
|
||||||
|
2. Build the public tree: `git archive`-style export of HEAD (never copy `.git/` — it holds
|
||||||
|
credentialed remotes) → new repo, single initial commit ("Initial public release, vX.Y.Z"),
|
||||||
|
optionally preserving CHANGELOG.md as the human-readable history.
|
||||||
|
3. Pre-publish gate on the export: `scripts/audit-secrets.sh` (fixed version) clean; grep-zero for
|
||||||
|
`sk-ant-`, rotated-password strings, `146.59.87.168`, tailnet `100.` IPs, `192.168.1.`,
|
||||||
|
internal hostnames; `du -sh .git` sanity (< ~100 MB); fresh `git clone` + `cd core && cargo build`
|
||||||
|
+ `cd neode-ui && npm ci && npm run build` on a clean machine/container; one app image pull
|
||||||
|
from the public domain.
|
||||||
|
4. Publish to GitHub; enable issue templates (already present in `.github/`); file the deferred-work
|
||||||
|
issues (from Phase 5's issue list) as the initial public issue set — honest and gives contributors entry points.
|
||||||
|
5. Internal repo remains the private full-history remote; decide sync direction post-launch
|
||||||
|
(recommend: public repo becomes canonical, private keeps only ops/infra notes).
|
||||||
|
|
||||||
|
## Verification (end-to-end)
|
||||||
|
|
||||||
|
- `tests/lifecycle/run-gate.sh` green on the node after Phases 3 + 5E (and after any lifecycle-touching commit).
|
||||||
|
- CI green on every phase commit: `cargo fmt --check`, `clippy -D warnings`, `cargo test --all-features`, frontend type-check + build + (new) vitest.
|
||||||
|
- Phase-6 clean-machine clone/build/pull test is the final acceptance test — it simulates the first outside developer.
|
||||||
|
- Docs acceptance: a reader following `docs/app-developer-guide.md` + the new quadlet/lifecycle/secrets docs can build and install an app manifest without any private infra.
|
||||||
|
|
||||||
|
## Sequencing / cut-line
|
||||||
|
|
||||||
|
Order: 0 → 1 → 2 → (3 ∥ 4) → 5 (A→E) → 6. Phases 0–2 are non-negotiable security; Phase 3 is the
|
||||||
|
functional blocker; Phase 4 is the developer-experience payload; Phase 5 can be cut after any
|
||||||
|
commit (minimum viable: A1–A6, B1–B2, unused_io_amount fix); Phase 6 last. If the timeline
|
||||||
|
compresses, Tier-2 dead_code and Phase E move to public issues — everything else holds.
|
||||||
@ -15,6 +15,26 @@ those are marked ✅ below with the commit that did it, so we stop re-litigating
|
|||||||
|
|
||||||
## Tier 0 — Quick / mechanical, no blockers
|
## Tier 0 — Quick / mechanical, no blockers
|
||||||
|
|
||||||
|
- [ ] **Ship the lightning payment false-failure fix in the next release** (fixed
|
||||||
|
on main 2026-07-27, needs OTA). Slow multi-hop payments (>15s) surfaced as
|
||||||
|
"Payment failed" while LND settled them in the background — the shared LND
|
||||||
|
REST client's 15s timeout aborted the synchronous `/v1/channels/transactions`
|
||||||
|
wait. Now: payinvoice decodes the invoice first for its payment hash, waits
|
||||||
|
up to 120s on a dedicated client, returns `status: "pending"` (never a
|
||||||
|
failure) on timeout, and the new `lnd.paymentstatus` RPC + frontend
|
||||||
|
`payLightningInvoice()` helper poll to a real terminal state (all 5 UI call
|
||||||
|
sites migrated). Verify on Framework PT with a real multi-hop payment.
|
||||||
|
- [ ] **Show the app version on the companion mobile-app banner in the app store
|
||||||
|
and on its install/pairing modal** (user request 2026-07-27) — so it's
|
||||||
|
obvious at a glance whether the node is serving the latest APK build.
|
||||||
|
- [ ] **Optimise the companion QR scan — quicker + better** (user request
|
||||||
|
2026-07-27; deferred to a later session on purpose). The pairing/scan QR
|
||||||
|
flow works (user-verified on-device 2026-07-27) but should get faster and
|
||||||
|
smoother: quicker camera start + decode (scan resolution/framerate,
|
||||||
|
continuous autofocus), more forgiving in low light / at an angle, and
|
||||||
|
snappier feedback once the code locks. Touch the native-scan path from
|
||||||
|
PR #104 and the in-app scan modal together so both benefit.
|
||||||
|
|
||||||
- [ ] **Update `tests/lifecycle/TESTING.md`'s stale Release Gates checklist** (lines
|
- [ ] **Update `tests/lifecycle/TESTING.md`'s stale Release Gates checklist** (lines
|
||||||
289–296) — several boxes are unchecked but actually true now:
|
289–296) — several boxes are unchecked but actually true now:
|
||||||
- #1 bitcoin-stops: covered by `tests/lifecycle/bats/bitcoin-knots.bats` stop/restart
|
- #1 bitcoin-stops: covered by `tests/lifecycle/bats/bitcoin-knots.bats` stop/restart
|
||||||
|
|||||||
@ -162,7 +162,8 @@ All endpoints use JSON-RPC over HTTP POST to `/rpc/v1`.
|
|||||||
| `lnd.openchannel` | `{ pubkey: string, amount: number }` | `{ funding_txid: string }` | Yes |
|
| `lnd.openchannel` | `{ pubkey: string, amount: number }` | `{ funding_txid: string }` | Yes |
|
||||||
| `lnd.closechannel` | `{ channel_point: string }` | `{ closing_txid: string }` | Yes |
|
| `lnd.closechannel` | `{ channel_point: string }` | `{ closing_txid: string }` | Yes |
|
||||||
| `lnd.newaddress` | — | `{ address: string }` | Yes |
|
| `lnd.newaddress` | — | `{ address: string }` | Yes |
|
||||||
| `lnd.sendcoins` | `{ addr: string, amount: number }` | `{ txid: string }` | Yes |
|
| `lnd.sendcoins` | `{ addr: string, amount?: number, send_all?: bool, target_conf?: number, sat_per_vbyte?: number }` | `{ txid: string }` | Yes |
|
||||||
|
| `lnd.estimatefee` | `{ addr: string, amount: number, target_conf?: number }` | `{ fee_sat: number, sat_per_vbyte: number }` | Yes |
|
||||||
| `lnd.createinvoice` | `{ amount: number, memo?: string }` | `{ payment_request: string }` | Yes |
|
| `lnd.createinvoice` | `{ amount: number, memo?: string }` | `{ payment_request: string }` | Yes |
|
||||||
| `lnd.payinvoice` | `{ payment_request: string }` | `{ preimage: string }` | Yes |
|
| `lnd.payinvoice` | `{ payment_request: string }` | `{ preimage: string }` | Yes |
|
||||||
| `lnd.create-psbt` | `{ outputs: object, ... }` | `{ psbt: string }` | Yes |
|
| `lnd.create-psbt` | `{ outputs: object, ... }` | `{ psbt: string }` | Yes |
|
||||||
|
|||||||
@ -146,7 +146,7 @@ app:
|
|||||||
path: /health
|
path: /health
|
||||||
interfaces:
|
interfaces:
|
||||||
main:
|
main:
|
||||||
type: web
|
type: ui
|
||||||
port: 8090
|
port: 8090
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|||||||
@ -74,9 +74,10 @@ archy/
|
|||||||
|
|
||||||
### Prerequisites
|
### Prerequisites
|
||||||
|
|
||||||
- **macOS** (development machine): Node.js 20+, npm
|
- Node.js 20+ and npm for frontend development.
|
||||||
- **Linux server** (`192.168.1.228`): Rust toolchain, Podman, Nginx, Debian 13
|
- Rust stable for backend development.
|
||||||
- SSH key: `~/.ssh/archipelago-deploy`
|
- Linux with Podman, systemd, and Nginx for host integration work.
|
||||||
|
- Debian 13 is the target runtime for release validation.
|
||||||
|
|
||||||
### Local Frontend Development
|
### Local Frontend Development
|
||||||
|
|
||||||
@ -86,17 +87,18 @@ npm install
|
|||||||
npm start # Vite dev server on :8100, mock backend on :5959
|
npm start # Vite dev server on :8100, mock backend on :5959
|
||||||
```
|
```
|
||||||
|
|
||||||
The dev server at `http://localhost:8100` uses a mock backend. Login with `password123`.
|
The dev server at `http://localhost:8100` uses a mock backend.
|
||||||
|
|
||||||
### Deploying Changes
|
### Deploying Changes
|
||||||
|
|
||||||
**Never build Rust on macOS.** The deploy script rsyncs source to the Linux server and builds there.
|
Release and host-integration builds should run on Linux. The deploy script rsyncs
|
||||||
|
source to a configured Linux target and builds there.
|
||||||
|
|
||||||
```bash
|
```bash
|
||||||
# Deploy to live server (builds backend + frontend, restarts services)
|
# Deploy to the configured primary target (builds backend + frontend, restarts services)
|
||||||
./scripts/deploy-to-target.sh --live
|
./scripts/deploy-to-target.sh --live
|
||||||
|
|
||||||
# Deploy to both servers
|
# Deploy to both configured targets
|
||||||
./scripts/deploy-to-target.sh --both
|
./scripts/deploy-to-target.sh --both
|
||||||
```
|
```
|
||||||
|
|
||||||
@ -114,14 +116,16 @@ The deploy script:
|
|||||||
# Frontend tests
|
# Frontend tests
|
||||||
cd neode-ui && npm test
|
cd neode-ui && npm test
|
||||||
|
|
||||||
# Backend tests (on dev server via SSH)
|
# Backend tests
|
||||||
ssh -i ~/.ssh/archipelago-deploy archipelago@192.168.1.228 \
|
cd core && cargo test --all-features
|
||||||
"cd ~/archy/core && cargo test --all-features"
|
|
||||||
|
|
||||||
# Both
|
# Both
|
||||||
./scripts/run-tests.sh
|
./scripts/run-tests.sh
|
||||||
```
|
```
|
||||||
|
|
||||||
|
`scripts/run-tests.sh` can run backend tests on a Linux target when
|
||||||
|
`ARCHIPELAGO_SSH_HOST` and `ARCHIPELAGO_SSH_KEY` are set.
|
||||||
|
|
||||||
## Adding a New RPC Endpoint
|
## Adding a New RPC Endpoint
|
||||||
|
|
||||||
### 1. Create the Handler
|
### 1. Create the Handler
|
||||||
@ -200,7 +204,7 @@ async myAction(params: { name: string }): Promise<{ ok: boolean; result: string
|
|||||||
|
|
||||||
```bash
|
```bash
|
||||||
./scripts/deploy-to-target.sh --live
|
./scripts/deploy-to-target.sh --live
|
||||||
curl -X POST http://192.168.1.228/rpc/v1 \
|
curl -X POST http://<node-host>/rpc/v1 \
|
||||||
-H "Content-Type: application/json" \
|
-H "Content-Type: application/json" \
|
||||||
-b "archipelago_session=YOUR_SESSION" \
|
-b "archipelago_session=YOUR_SESSION" \
|
||||||
-d '{"method":"mymodule.action","params":{"name":"test"}}'
|
-d '{"method":"mymodule.action","params":{"name":"test"}}'
|
||||||
@ -309,5 +313,5 @@ mod tests {
|
|||||||
2. Make changes following the standards above
|
2. Make changes following the standards above
|
||||||
3. Test locally: `cd neode-ui && npm test`
|
3. Test locally: `cd neode-ui && npm test`
|
||||||
4. Deploy to dev server: `./scripts/deploy-to-target.sh --live`
|
4. Deploy to dev server: `./scripts/deploy-to-target.sh --live`
|
||||||
5. Verify at `http://192.168.1.228`
|
5. Verify on your configured development target
|
||||||
6. Commit with conventional format: `feat: add my feature`
|
6. Commit with conventional format: `feat: add my feature`
|
||||||
|
|||||||
252
docs/nostr-git-source-hosting.md
Normal file
252
docs/nostr-git-source-hosting.md
Normal file
@ -0,0 +1,252 @@
|
|||||||
|
# Nostr Git Source Hosting Plan
|
||||||
|
|
||||||
|
This plan describes how Archipelago can publish and accept contributions to its
|
||||||
|
source code through `ngit`, NIP-34, and GRASP while keeping the developer
|
||||||
|
experience inside Archipelago.
|
||||||
|
|
||||||
|
## Goals
|
||||||
|
|
||||||
|
- Publish Archipelago source from a sanitized, fresh-history repository.
|
||||||
|
- Make the in-app registry the primary onboarding path for contributors.
|
||||||
|
- Let contributors clone, branch, push PR branches, open PRs, and discuss issues
|
||||||
|
with a Nostr identity from their Archipelago node.
|
||||||
|
- Follow the Bitcoin Core development model: broad public review and easy forks,
|
||||||
|
with canonical merge authority held by a small maintainer set.
|
||||||
|
- Give contributors full read, fork, and proposal rights, but no direct merge
|
||||||
|
rights on the canonical repository.
|
||||||
|
- Keep the official maintainer identity and merge authority separate from user
|
||||||
|
node identities.
|
||||||
|
|
||||||
|
## Current Building Blocks
|
||||||
|
|
||||||
|
Archipelago already has most of the primitives needed for this:
|
||||||
|
|
||||||
|
- App manifests and the app registry already install developer tooling as
|
||||||
|
rootless Podman apps.
|
||||||
|
- The `gitea` app provides a conventional fallback Git UI and package registry.
|
||||||
|
- The app launcher already exposes a consent-gated NIP-07 bridge for launched
|
||||||
|
apps using `getPublicKey`, `signEvent`, NIP-04, and NIP-44 requests.
|
||||||
|
- The backend exposes node and identity Nostr signing RPC methods.
|
||||||
|
- FIPS gives nodes a stable mesh identity and private transport path, but repo
|
||||||
|
announcements and PRs should remain NIP-34 compatible on normal Nostr relays.
|
||||||
|
- DWN protocol registration exists and can be used later for local contribution
|
||||||
|
metadata/cache, but should not be required for the first public workflow.
|
||||||
|
|
||||||
|
## Protocol Basis
|
||||||
|
|
||||||
|
Use existing Nostr Git conventions rather than inventing an Archipelago-only
|
||||||
|
protocol:
|
||||||
|
|
||||||
|
- NIP-34 repository announcement events identify repositories with kind `30617`.
|
||||||
|
- NIP-34 repository state events publish branch/tag refs with kind `30618`.
|
||||||
|
- NIP-34 patches, pull requests, PR updates, issues, and status events use kinds
|
||||||
|
`1617`, `1618`, `1619`, `1621`, and `1630`-`1633`.
|
||||||
|
- `ngit` provides the `git-remote-nostr` helper for `nostr://` clone URLs and PR
|
||||||
|
branches.
|
||||||
|
- GRASP servers provide Git Smart HTTP storage while Nostr events remain the
|
||||||
|
authority for repository identity, refs, PRs, issues, and maintainer state.
|
||||||
|
|
||||||
|
Primary references:
|
||||||
|
|
||||||
|
- https://nips.nostr.com/34
|
||||||
|
- https://docs.rs/crate/ngit/latest/source/README.md
|
||||||
|
- https://ngit.dev/grasp/
|
||||||
|
|
||||||
|
## Recommended Architecture
|
||||||
|
|
||||||
|
### Apps
|
||||||
|
|
||||||
|
Create two first-party apps:
|
||||||
|
|
||||||
|
- `ngit`: CLI/runtime package containing `ngit` and `git-remote-nostr`.
|
||||||
|
- `archipelago-source`: web UI for cloning Archipelago source, viewing NIP-34
|
||||||
|
issues/PRs, opening branches, and submitting PR events.
|
||||||
|
|
||||||
|
The `archipelago-source` app should depend on `ngit`. It can also recommend
|
||||||
|
Gitea for users who want a conventional local web Git UI, but Gitea should not
|
||||||
|
be the source of truth for public contribution permissions.
|
||||||
|
|
||||||
|
### Contributor Onboarding
|
||||||
|
|
||||||
|
When the user installs `archipelago-source` from the registry:
|
||||||
|
|
||||||
|
1. Show a modal before first launch: "Contribute to Archipelago".
|
||||||
|
2. Explain that the app will use their Archipelago Nostr identity to clone and
|
||||||
|
sign contribution events.
|
||||||
|
3. Display the maintainer repository announcement, clone URL, maintainer npub,
|
||||||
|
and relay/GRASP endpoints.
|
||||||
|
4. Ask for consent to:
|
||||||
|
- fetch repository metadata from configured relays,
|
||||||
|
- clone source through `nostr://`,
|
||||||
|
- create local branches,
|
||||||
|
- sign NIP-34 issue/PR/comment events,
|
||||||
|
- push PR branches to approved GRASP servers.
|
||||||
|
5. Store approval per app origin, identity id, repository id, and relay set.
|
||||||
|
|
||||||
|
This should build on the existing NIP-07 app-launcher bridge, but use a more
|
||||||
|
specific permission scope than the generic sign-event approval.
|
||||||
|
|
||||||
|
### Identity And Permissions
|
||||||
|
|
||||||
|
Use four identity classes:
|
||||||
|
|
||||||
|
- `archipelago-maintainer`: an offline or tightly controlled Nostr key that
|
||||||
|
signs the canonical kind `30617` repo announcement and status/merge events.
|
||||||
|
- `archipelago-merge-maintainer`: one of the small set of maintainer npubs
|
||||||
|
allowed to advance canonical refs and publish valid merged/applied status.
|
||||||
|
- `archipelago-build`: release automation key for signed release artifacts and
|
||||||
|
CI status events. It must not have merge authority.
|
||||||
|
- `contributor`: user node or app-specific identity used for PRs, issues, and
|
||||||
|
comments.
|
||||||
|
|
||||||
|
Contributor rights:
|
||||||
|
|
||||||
|
- Clone the repository.
|
||||||
|
- Open issues.
|
||||||
|
- Push proposal branches using `pr/<npub>/<short-topic>` or `pr/<event-id>`.
|
||||||
|
- Publish NIP-34 PR/update/comment events.
|
||||||
|
- Rebase and update their own PR branch.
|
||||||
|
- Run local validation and attach status evidence.
|
||||||
|
|
||||||
|
Contributor restrictions:
|
||||||
|
|
||||||
|
- Cannot update `refs/heads/main` or release branches in canonical state.
|
||||||
|
- Cannot publish maintainer-valid merge/applied status.
|
||||||
|
- Cannot alter the canonical repository announcement.
|
||||||
|
- Cannot publish release catalog signatures.
|
||||||
|
|
||||||
|
Maintainer rights:
|
||||||
|
|
||||||
|
- Publish/update the canonical repo announcement.
|
||||||
|
- Publish canonical `refs/heads/main` state.
|
||||||
|
- Mark PRs merged/closed/draft via NIP-34 status events.
|
||||||
|
- Sign release tags and catalog updates.
|
||||||
|
|
||||||
|
Fork rights:
|
||||||
|
|
||||||
|
- Any contributor can create their own NIP-34 kind `30617` repository
|
||||||
|
announcement for a fork.
|
||||||
|
- Fork announcements should use the NIP-34 `u` tag to point back to the
|
||||||
|
canonical `archy` repository.
|
||||||
|
- The source app should make forking a first-class path: "Fork on Nostr", clone
|
||||||
|
the fork locally, push branches to the contributor's GRASP list, and open PRs
|
||||||
|
back to canonical Archipelago when they want review.
|
||||||
|
- Forks can have their own maintainer npubs, relays, policies, and release
|
||||||
|
cadence, but the app should clearly label them as forks unless signed by the
|
||||||
|
canonical maintainer set.
|
||||||
|
|
||||||
|
The GRASP server policy should enforce this by accepting pushes to maintainer
|
||||||
|
refs only when backed by signed maintainer state, while allowing contributor PR
|
||||||
|
refs from their own npubs.
|
||||||
|
|
||||||
|
## Repository Layout
|
||||||
|
|
||||||
|
Canonical repo announcement:
|
||||||
|
|
||||||
|
- repo id: `archy`
|
||||||
|
- display name: `Archipelago`
|
||||||
|
- clone URLs:
|
||||||
|
- `nostr://<maintainer-npub>/<relay-hint>/archy`
|
||||||
|
- `https://<grasp-host>/<maintainer-npub>/archy.git`
|
||||||
|
- relays:
|
||||||
|
- Archipelago-operated relay
|
||||||
|
- at least two public Nostr relays that support the event load
|
||||||
|
- GRASP servers:
|
||||||
|
- Archipelago-operated GRASP instance
|
||||||
|
- one public GRASP-compatible mirror
|
||||||
|
|
||||||
|
Keep the existing HTTP Git remote as a mirror during launch. The docs can
|
||||||
|
present `nostr://` as the preferred contribution path once the workflow is
|
||||||
|
proven.
|
||||||
|
|
||||||
|
## UI Requirements
|
||||||
|
|
||||||
|
The source app should provide:
|
||||||
|
|
||||||
|
- A first-run contribution modal with a real Archipelago source graphic, not a
|
||||||
|
generic text-only dialog.
|
||||||
|
- Current clone status and local path.
|
||||||
|
- Branch list, changed files, commit form, and push/open-PR flow.
|
||||||
|
- PR inbox, issue list, maintainer status, and relay health.
|
||||||
|
- Explicit identity indicator showing which npub will sign events.
|
||||||
|
- A merge rights indicator that clearly says contributors can propose changes
|
||||||
|
but cannot merge them.
|
||||||
|
- A fork flow that creates a user-owned NIP-34 repo announcement and remote,
|
||||||
|
then offers "Open PR to Archipelago" from any fork branch.
|
||||||
|
- Maintainer badges based only on pinned canonical maintainer npubs, not relay
|
||||||
|
metadata or server-side account names.
|
||||||
|
- Links to container docs, deployment docs, manifest spec, and open-source
|
||||||
|
readiness tasks.
|
||||||
|
|
||||||
|
## Backend Work
|
||||||
|
|
||||||
|
Add an RPC module for source contribution workflow:
|
||||||
|
|
||||||
|
- `source.repo-info`: returns canonical announcement, clone URL, relay set,
|
||||||
|
maintainer npubs, and local clone state.
|
||||||
|
- `source.ensure-ngit`: verifies the `ngit` app/runtime is installed.
|
||||||
|
- `source.clone`: clones or updates the local source checkout.
|
||||||
|
- `source.status`: returns branch, dirty files, ahead/behind, and PR state.
|
||||||
|
- `source.commit`: creates a local commit from selected files.
|
||||||
|
- `source.fork`: creates a contributor-owned NIP-34 fork announcement and local
|
||||||
|
remote.
|
||||||
|
- `source.open-pr`: pushes a PR branch and publishes a kind `1618` event.
|
||||||
|
- `source.update-pr`: updates the branch and publishes kind `1619`.
|
||||||
|
- `source.issue`: publishes a kind `1621` event.
|
||||||
|
|
||||||
|
Backend must shell out through a narrow command wrapper, never arbitrary user
|
||||||
|
commands. The wrapper should set an isolated working tree under
|
||||||
|
`/var/lib/archipelago/source/archy`, run as the Archipelago service user, and
|
||||||
|
deny operations outside that path.
|
||||||
|
|
||||||
|
## Security Model
|
||||||
|
|
||||||
|
- Never expose maintainer private keys to an Archipelago node.
|
||||||
|
- Prefer app-specific contributor identities over the node's default identity.
|
||||||
|
- Require per-action consent for first PR push, issue creation, and signing any
|
||||||
|
event that tags the canonical repository.
|
||||||
|
- Pin the canonical maintainer npub in the app manifest and backend config.
|
||||||
|
- Keep the canonical merge-maintainer allow list signed by the
|
||||||
|
`archipelago-maintainer` key; never infer merge rights from GRASP server
|
||||||
|
accounts.
|
||||||
|
- Verify the canonical kind `30617` event signature before displaying clone
|
||||||
|
instructions.
|
||||||
|
- Treat GRASP servers as untrusted storage; verify Git refs against signed
|
||||||
|
Nostr state.
|
||||||
|
- Do not use destructive git operations from the UI without an explicit modal.
|
||||||
|
- Store local clones and generated patches outside app container writable roots
|
||||||
|
unless the user exports them.
|
||||||
|
|
||||||
|
## MVP
|
||||||
|
|
||||||
|
1. Package `ngit` as a first-party app.
|
||||||
|
2. Stand up one Archipelago-operated GRASP server and one Nostr relay.
|
||||||
|
3. Publish sanitized fresh-history `archy` through `ngit init`.
|
||||||
|
4. Add a simple `archipelago-source` app that clones source and links out to the
|
||||||
|
preferred Nostr Git browser.
|
||||||
|
5. Add app-launcher consent scopes for repository-specific NIP-34 signing.
|
||||||
|
6. Allow issues and PR branch submission from contributor npubs.
|
||||||
|
7. Add a one-click fork flow that publishes a contributor-owned fork
|
||||||
|
announcement referencing canonical Archipelago.
|
||||||
|
8. Keep maintainer merge/status publication manual.
|
||||||
|
|
||||||
|
## Later
|
||||||
|
|
||||||
|
- Native PR review UI with file diffs and inline comments.
|
||||||
|
- CI status events signed by the build identity.
|
||||||
|
- FIPS-first source sync between trusted Archipelago nodes.
|
||||||
|
- Private prerelease repositories using NIP-42 allow lists and/or protected
|
||||||
|
events if the ecosystem support is mature enough.
|
||||||
|
- Multi-maintainer policy with threshold signatures or explicit maintainer-list
|
||||||
|
rotation events.
|
||||||
|
|
||||||
|
## Open Questions
|
||||||
|
|
||||||
|
- Which maintainer npub should become canonical for `archy`?
|
||||||
|
- Should contributor identities be node-default or app-specific by default?
|
||||||
|
- Which GRASP implementation should be deployed first: `ngit-grasp` or another
|
||||||
|
NIP-34/GRASP-compatible relay?
|
||||||
|
- Should the source app include a full web Git UI in v1, or launch Gitea/ngit
|
||||||
|
browser links for review while keeping signing/submission native?
|
||||||
|
- What exact license and contribution certificate should contributors accept
|
||||||
|
before submitting PR events?
|
||||||
@ -2834,7 +2834,7 @@ After=network.target
|
|||||||
|
|
||||||
[Service]
|
[Service]
|
||||||
Type=simple
|
Type=simple
|
||||||
Environment=ANTHROPIC_API_KEY=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
|
Environment=ANTHROPIC_API_KEY=
|
||||||
ExecStart=/usr/bin/python3 /opt/archipelago/claude-api-proxy.py
|
ExecStart=/usr/bin/python3 /opt/archipelago/claude-api-proxy.py
|
||||||
Restart=always
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
|
|||||||
@ -83,7 +83,7 @@ QEMU_ARGS=(
|
|||||||
|
|
||||||
# Display mode
|
# Display mode
|
||||||
if [ "$NOGRAPHIC" = true ]; then
|
if [ "$NOGRAPHIC" = true ]; then
|
||||||
QEMU_ARGS+=(-nographic -append "console=ttyS0")
|
QEMU_ARGS+=(-display none)
|
||||||
else
|
else
|
||||||
QEMU_ARGS+=(-vga virtio -display default)
|
QEMU_ARGS+=(-vga virtio -display default)
|
||||||
fi
|
fi
|
||||||
|
|||||||
@ -31,7 +31,13 @@ ExecStartPre=+/bin/bash -c 'mkdir -p /var/lib/archipelago && chown archipelago:a
|
|||||||
# "-" so a missing/failed guard can never block the service itself.
|
# "-" so a missing/failed guard can never block the service itself.
|
||||||
ExecStartPre=+-/opt/archipelago/scripts/ota-crash-guard.sh
|
ExecStartPre=+-/opt/archipelago/scripts/ota-crash-guard.sh
|
||||||
ExecStart=/usr/local/bin/archipelago
|
ExecStart=/usr/local/bin/archipelago
|
||||||
Restart=on-failure
|
# always (not on-failure): the OTA restart path once stopped the daemon
|
||||||
|
# cleanly and the queued start never fired (framework-pt, v1.7.114->115,
|
||||||
|
# 2026-07-26) — the node sat dead all night behind "server starting up".
|
||||||
|
# Restart=always self-heals any lost start job; an explicit
|
||||||
|
# `systemctl stop` is still honored (systemd never auto-restarts after
|
||||||
|
# a manual stop).
|
||||||
|
Restart=always
|
||||||
RestartSec=5
|
RestartSec=5
|
||||||
WatchdogSec=300
|
WatchdogSec=300
|
||||||
TimeoutStartSec=300
|
TimeoutStartSec=300
|
||||||
|
|||||||
39
neode-ui/THIRD-PARTY-LICENSES.md
Normal file
39
neode-ui/THIRD-PARTY-LICENSES.md
Normal file
@ -0,0 +1,39 @@
|
|||||||
|
# Third-Party Licenses — neode-ui (web frontend)
|
||||||
|
|
||||||
|
Runtime dependencies bundled into the distributed web UI. Verified 2026-07-23.
|
||||||
|
Dev-only tooling (Vite, Playwright, TypeScript, etc.) is not distributed and
|
||||||
|
is not listed here. Note: the production bundler strips license header
|
||||||
|
comments, so this file (and the fonts' adjacent license files) constitute the
|
||||||
|
attribution shipped with the bundle; a build-time license-aggregation step is
|
||||||
|
planned (see docs/LICENSE-COMPLIANCE-AUDIT.md).
|
||||||
|
|
||||||
|
| Package | Version | License |
|
||||||
|
|---|---|---|
|
||||||
|
| vue | 3.5.x | MIT |
|
||||||
|
| vue-router | 4.6.x | MIT |
|
||||||
|
| vue-i18n | 11.3.x | MIT |
|
||||||
|
| pinia | 3.0.x | MIT |
|
||||||
|
| d3 | 7.9.x | ISC |
|
||||||
|
| leaflet | 1.9.x | BSD-2-Clause |
|
||||||
|
| @vue-leaflet/vue-leaflet | 0.10.x | MIT |
|
||||||
|
| dompurify | 3.4.x | MPL-2.0 OR Apache-2.0 (used under Apache-2.0) |
|
||||||
|
| buffer | 6.0.x | MIT |
|
||||||
|
| fast-json-patch | 3.1.x | MIT |
|
||||||
|
| fuse.js | 7.1.x | Apache-2.0 |
|
||||||
|
| qrcode | 1.5.x | MIT |
|
||||||
|
| qr-scanner | 1.4.x | MIT |
|
||||||
|
| qrloop | 1.4.x | MIT |
|
||||||
|
|
||||||
|
## Fonts
|
||||||
|
|
||||||
|
| Font | License | License file |
|
||||||
|
|---|---|---|
|
||||||
|
| Montserrat | SIL OFL 1.1 | public/assets/fonts/Montserrat/OFL.txt |
|
||||||
|
| Open Sans | Apache-2.0 | public/assets/fonts/Open_Sans/LICENSE.txt |
|
||||||
|
|
||||||
|
## Vendored
|
||||||
|
|
||||||
|
- `public/assets/icon/` — see ATTRIBUTION.md in that directory
|
||||||
|
(game-icons.net CC BY 3.0; pixelarticons MIT).
|
||||||
|
- `public/assets/img/mesh-devices/` — Meshtastic project artwork, GPL-3.0;
|
||||||
|
see ATTRIBUTION.md in that directory.
|
||||||
@ -3453,12 +3453,26 @@ app.post('/rpc/v1', (req, res) => {
|
|||||||
{ chan_id: '840921088114689', remote_pubkey: '03abcdef12345678901234567890123456789012345678901234567890abcdef12', capacity: 2000000, local_balance: 1200000, remote_balance: 800000, active: true, status: 'active', channel_point: randomHex(32) + ':1', peer_alias: 'WalletOfSatoshi' },
|
{ chan_id: '840921088114689', remote_pubkey: '03abcdef12345678901234567890123456789012345678901234567890abcdef12', capacity: 2000000, local_balance: 1200000, remote_balance: 800000, active: true, status: 'active', channel_point: randomHex(32) + ':1', peer_alias: 'WalletOfSatoshi' },
|
||||||
{ chan_id: '840921088114690', remote_pubkey: '02fedcba98765432109876543210987654321098765432109876543210fedcba98', capacity: 10000000, local_balance: 4500000, remote_balance: 5500000, active: true, status: 'active', channel_point: randomHex(32) + ':0', peer_alias: 'Voltage' },
|
{ chan_id: '840921088114690', remote_pubkey: '02fedcba98765432109876543210987654321098765432109876543210fedcba98', capacity: 10000000, local_balance: 4500000, remote_balance: 5500000, active: true, status: 'active', channel_point: randomHex(32) + ':0', peer_alias: 'Voltage' },
|
||||||
{ chan_id: '840921088114691', remote_pubkey: '03456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123', capacity: 3000000, local_balance: 100000, remote_balance: 2900000, active: false, status: 'inactive', channel_point: randomHex(32) + ':0', peer_alias: 'Kraken' },
|
{ chan_id: '840921088114691', remote_pubkey: '03456789abcdef0123456789abcdef0123456789abcdef0123456789abcdef0123', capacity: 3000000, local_balance: 100000, remote_balance: 2900000, active: false, status: 'inactive', channel_point: randomHex(32) + ':0', peer_alias: 'Kraken' },
|
||||||
|
{ chan_id: '', remote_pubkey: '028d98b9969fbed53784a36617eb489a59ab6dc9b9d77fcdca9ff55307cd98e3c4', capacity: 500000, local_balance: 500000, remote_balance: 0, active: false, status: 'pending_open', channel_point: randomHex(32) + ':0', peer_alias: 'ACINQ' },
|
||||||
|
{ chan_id: '', remote_pubkey: '02c16cca44562b590dd279c942200bdccfd4f990c3a69fad620c10ef2f8228eaff', capacity: 800000, local_balance: 350000, remote_balance: 450000, active: false, status: 'closing', channel_point: randomHex(32) + ':0', closing_txid: randomHex(32), peer_alias: 'Bitrefill' },
|
||||||
]
|
]
|
||||||
return res.json({
|
return res.json({
|
||||||
result: {
|
result: {
|
||||||
channels,
|
channels,
|
||||||
total_outbound: channels.reduce((s, c) => s + c.local_balance, 0),
|
// Totals sum open channels only, matching the real backend.
|
||||||
total_inbound: channels.reduce((s, c) => s + c.remote_balance, 0),
|
total_outbound: channels.filter(c => ['active', 'inactive'].includes(c.status)).reduce((s, c) => s + c.local_balance, 0),
|
||||||
|
total_inbound: channels.filter(c => ['active', 'inactive'].includes(c.status)).reduce((s, c) => s + c.remote_balance, 0),
|
||||||
|
},
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
|
case 'lnd.closedchannels': {
|
||||||
|
return res.json({
|
||||||
|
result: {
|
||||||
|
channels: [
|
||||||
|
{ chan_id: '840921088110001', remote_pubkey: '03864ef025fde8fb587d989186ce6a4a186895ee44a926bfc370e2c366597a3f8f', capacity: 1000000, settled_balance: 612000, close_type: 'COOPERATIVE_CLOSE', closing_tx_hash: randomHex(32), channel_point: randomHex(32) + ':0', close_height: 903112 },
|
||||||
|
{ chan_id: '840921088110002', remote_pubkey: '0298f6074a454a1f5345cb2a7c6f9fce206cd0bf675d177cdbf0ca7508dd28852f', capacity: 250000, settled_balance: 0, close_type: 'REMOTE_FORCE_CLOSE', closing_tx_hash: randomHex(32), channel_point: randomHex(32) + ':1', close_height: 897540 },
|
||||||
|
],
|
||||||
},
|
},
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
@ -3518,6 +3532,13 @@ app.post('/rpc/v1', (req, res) => {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
case 'lnd.estimatefee': {
|
||||||
|
// ~141 vB P2WPKH spend at a rate that scales with urgency
|
||||||
|
const target = params?.target_conf || 6
|
||||||
|
const rate = target <= 1 ? 22 : target <= 6 ? 8 : 2
|
||||||
|
return res.json({ result: { fee_sat: rate * 141, sat_per_vbyte: rate } })
|
||||||
|
}
|
||||||
|
|
||||||
case 'lnd.decodepayreq': {
|
case 'lnd.decodepayreq': {
|
||||||
return res.json({
|
return res.json({
|
||||||
result: {
|
result: {
|
||||||
|
|||||||
60
neode-ui/package-lock.json
generated
60
neode-ui/package-lock.json
generated
@ -1,13 +1,14 @@
|
|||||||
{
|
{
|
||||||
"name": "neode-ui",
|
"name": "neode-ui",
|
||||||
"version": "1.7.111-alpha",
|
"version": "1.7.115-alpha",
|
||||||
"lockfileVersion": 3,
|
"lockfileVersion": 3,
|
||||||
"requires": true,
|
"requires": true,
|
||||||
"packages": {
|
"packages": {
|
||||||
"": {
|
"": {
|
||||||
"name": "neode-ui",
|
"name": "neode-ui",
|
||||||
"version": "1.7.111-alpha",
|
"version": "1.7.115-alpha",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@scure/bip39": "^2.2.0",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
@ -149,6 +150,7 @@
|
|||||||
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
|
"integrity": "sha512-CGOfOJqWjg2qW/Mb6zNsDm+u5vFQ8DxXfbM09z69p5Z6+mE1ikP2jUXw+j42Pf1XTYED2Rni5f95npYeuwMDQA==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@babel/code-frame": "^7.29.0",
|
"@babel/code-frame": "^7.29.0",
|
||||||
"@babel/generator": "^7.29.0",
|
"@babel/generator": "^7.29.0",
|
||||||
@ -1810,6 +1812,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
},
|
},
|
||||||
@ -1833,6 +1836,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=18"
|
"node": ">=18"
|
||||||
}
|
}
|
||||||
@ -2882,6 +2886,18 @@
|
|||||||
"url": "https://opencollective.com/js-sdsl"
|
"url": "https://opencollective.com/js-sdsl"
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"node_modules/@noble/hashes": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-IYqDGiTXab6FniAgnSdZwgWbomxpy9FtYvLKs7wCUs2a8RkITG+DFGO1DM9cr+E3/RgADRpFjrKVaJ1z6sjtEg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"engines": {
|
||||||
|
"node": ">= 20.19.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@nodelib/fs.scandir": {
|
"node_modules/@nodelib/fs.scandir": {
|
||||||
"version": "2.1.5",
|
"version": "2.1.5",
|
||||||
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
"resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.5.tgz",
|
||||||
@ -3538,6 +3554,28 @@
|
|||||||
"win32"
|
"win32"
|
||||||
]
|
]
|
||||||
},
|
},
|
||||||
|
"node_modules/@scure/base": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@scure/base/-/base-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-b8XEupJibegiXV+tDUseI8oLQc8ei3d/4Jkb2RpbHh3MfE054ov3uIz2dhFkB3FI8iwYkEh0gGCApkrYggkPNg==",
|
||||||
|
"license": "MIT",
|
||||||
|
"funding": {
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"node_modules/@scure/bip39": {
|
||||||
|
"version": "2.2.0",
|
||||||
|
"resolved": "https://registry.npmjs.org/@scure/bip39/-/bip39-2.2.0.tgz",
|
||||||
|
"integrity": "sha512-T/Bj/YvYMNkIPq6EENO6/rcs2e7qTNuyoUXf0KBFDmp0ZDu0H2X4Lq6yC3i0c8PcWkov5EbW+yQZZbdMmk154A==",
|
||||||
|
"license": "MIT",
|
||||||
|
"dependencies": {
|
||||||
|
"@noble/hashes": "2.2.0",
|
||||||
|
"@scure/base": "2.2.0"
|
||||||
|
},
|
||||||
|
"funding": {
|
||||||
|
"url": "https://paulmillr.com/funding/"
|
||||||
|
}
|
||||||
|
},
|
||||||
"node_modules/@trickfilm400/rollup-plugin-off-main-thread": {
|
"node_modules/@trickfilm400/rollup-plugin-off-main-thread": {
|
||||||
"version": "3.0.0-pre1",
|
"version": "3.0.0-pre1",
|
||||||
"resolved": "https://registry.npmjs.org/@trickfilm400/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-3.0.0-pre1.tgz",
|
"resolved": "https://registry.npmjs.org/@trickfilm400/rollup-plugin-off-main-thread/-/rollup-plugin-off-main-thread-3.0.0-pre1.tgz",
|
||||||
@ -3885,6 +3923,7 @@
|
|||||||
"integrity": "sha512-TbAd9DaPGSnzp6QvtYngntMZgcRk+igFELwR2N99XZn7RXUdKgsXMR+28bUO0rPsWp8MIu/f47luLIQuSLYv/w==",
|
"integrity": "sha512-TbAd9DaPGSnzp6QvtYngntMZgcRk+igFELwR2N99XZn7RXUdKgsXMR+28bUO0rPsWp8MIu/f47luLIQuSLYv/w==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/geojson": "*"
|
"@types/geojson": "*"
|
||||||
}
|
}
|
||||||
@ -3934,6 +3973,7 @@
|
|||||||
"integrity": "sha512-MCbrb508JZHqe7bUibmZj/lyojdhLRnfkmyXnkrCM2zVrjTgL89U8UEfInpKTvPeTnxsw2hmyZxnhsdNR6yhwg==",
|
"integrity": "sha512-MCbrb508JZHqe7bUibmZj/lyojdhLRnfkmyXnkrCM2zVrjTgL89U8UEfInpKTvPeTnxsw2hmyZxnhsdNR6yhwg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cac": "^6.7.14",
|
"cac": "^6.7.14",
|
||||||
"colorette": "^2.0.20",
|
"colorette": "^2.0.20",
|
||||||
@ -4434,6 +4474,7 @@
|
|||||||
"integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
|
"integrity": "sha512-PlXPeEWMXMZ7sPYOHqmDyCJzcfNrUr3fGNKtezX14ykXOEIvyK81d+qydx89KY5O71FKMPaQ2vBfBFI5NHR63A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"fast-deep-equal": "^3.1.3",
|
"fast-deep-equal": "^3.1.3",
|
||||||
"fast-uri": "^3.0.1",
|
"fast-uri": "^3.0.1",
|
||||||
@ -4919,6 +4960,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"baseline-browser-mapping": "^2.9.0",
|
"baseline-browser-mapping": "^2.9.0",
|
||||||
"caniuse-lite": "^1.0.30001759",
|
"caniuse-lite": "^1.0.30001759",
|
||||||
@ -5937,6 +5979,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
"resolved": "https://registry.npmjs.org/d3-selection/-/d3-selection-3.0.0.tgz",
|
||||||
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
"integrity": "sha512-fmTRWbNMmsmWq6xJV8D19U/gw/bwrHfNXxrIN+HfZgnzqTHp9jOmKMhsTUjXOJnZOdZY9Q28y4yebKzqDKlxlQ==",
|
||||||
"license": "ISC",
|
"license": "ISC",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
}
|
}
|
||||||
@ -8129,6 +8172,7 @@
|
|||||||
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
|
"integrity": "sha512-/imKNG4EbWNrVjoNC/1H5/9GFy+tqjGBHCaSsN+P2RnPqjsLmv6UD3Ej+Kj8nBWaRAwyk7kK5ZUc+OEatnTR3A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"jiti": "bin/jiti.js"
|
"jiti": "bin/jiti.js"
|
||||||
}
|
}
|
||||||
@ -8178,6 +8222,7 @@
|
|||||||
"integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==",
|
"integrity": "sha512-8i7LzZj7BF8uplX+ZyOlIz86V6TAsSs+np6m1kpW9u0JWi4z/1t+FzcK1aek+ybTnAC4KhBL4uXCNT0wcUIeCw==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"cssstyle": "^4.1.0",
|
"cssstyle": "^4.1.0",
|
||||||
"data-urls": "^5.0.0",
|
"data-urls": "^5.0.0",
|
||||||
@ -8280,7 +8325,8 @@
|
|||||||
"version": "1.9.4",
|
"version": "1.9.4",
|
||||||
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
|
"resolved": "https://registry.npmjs.org/leaflet/-/leaflet-1.9.4.tgz",
|
||||||
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",
|
"integrity": "sha512-nxS1ynzJOmOlHp+iL3FyWqK89GtNL8U8rvlMOsQdTTssxZwCXh8N2NB3GDQOL+YR3XnWyZAxwQixURb+FA74PA==",
|
||||||
"license": "BSD-2-Clause"
|
"license": "BSD-2-Clause",
|
||||||
|
"peer": true
|
||||||
},
|
},
|
||||||
"node_modules/leven": {
|
"node_modules/leven": {
|
||||||
"version": "3.1.0",
|
"version": "3.1.0",
|
||||||
@ -9036,6 +9082,7 @@
|
|||||||
}
|
}
|
||||||
],
|
],
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"nanoid": "^3.3.11",
|
"nanoid": "^3.3.11",
|
||||||
"picocolors": "^1.1.1",
|
"picocolors": "^1.1.1",
|
||||||
@ -9697,6 +9744,7 @@
|
|||||||
"integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==",
|
"integrity": "sha512-2oMpl67a3zCH9H79LeMcbDhXW/UmWG/y2zuqnF2jQq5uq9TbM9TVyXvA4+t+ne2IIkBdrLpAaRQAvo7YI/Yyeg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/estree": "1.0.8"
|
"@types/estree": "1.0.8"
|
||||||
},
|
},
|
||||||
@ -10952,6 +11000,7 @@
|
|||||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@ -11207,6 +11256,7 @@
|
|||||||
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
"integrity": "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw==",
|
||||||
"devOptional": true,
|
"devOptional": true,
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
|
"peer": true,
|
||||||
"bin": {
|
"bin": {
|
||||||
"tsc": "bin/tsc",
|
"tsc": "bin/tsc",
|
||||||
"tsserver": "bin/tsserver"
|
"tsserver": "bin/tsserver"
|
||||||
@ -11448,6 +11498,7 @@
|
|||||||
"integrity": "sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==",
|
"integrity": "sha512-Bby3NOsna2jsjfLVOHKes8sGwgl4TT0E6vvpYgnAYDIF/tie7MRaFthmKuHx1NSXjiTueXH3do80FMQgvEktRg==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"esbuild": "^0.27.0",
|
"esbuild": "^0.27.0",
|
||||||
"fdir": "^6.5.0",
|
"fdir": "^6.5.0",
|
||||||
@ -11610,6 +11661,7 @@
|
|||||||
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
"integrity": "sha512-QP88BAKvMam/3NxH6vj2o21R6MjxZUAd6nlwAS/pnGvN9IVLocLHxGYIzFhg6fUQ+5th6P4dv4eW9jX3DSIj7A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"engines": {
|
"engines": {
|
||||||
"node": ">=12"
|
"node": ">=12"
|
||||||
},
|
},
|
||||||
@ -11623,6 +11675,7 @@
|
|||||||
"integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
|
"integrity": "sha512-LUCP5ev3GURDysTWiP47wRRUpLKMOfPh+yKTx3kVIEiu5KOMeqzpnYNsKyOoVrULivR8tLcks4+lga33Whn90A==",
|
||||||
"dev": true,
|
"dev": true,
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@types/chai": "^5.2.2",
|
"@types/chai": "^5.2.2",
|
||||||
"@vitest/expect": "3.2.4",
|
"@vitest/expect": "3.2.4",
|
||||||
@ -11715,6 +11768,7 @@
|
|||||||
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.30.tgz",
|
"resolved": "https://registry.npmjs.org/vue/-/vue-3.5.30.tgz",
|
||||||
"integrity": "sha512-hTHLc6VNZyzzEH/l7PFGjpcTvUgiaPK5mdLkbjrTeWSRcEfxFrv56g/XckIYlE9ckuobsdwqd5mk2g1sBkMewg==",
|
"integrity": "sha512-hTHLc6VNZyzzEH/l7PFGjpcTvUgiaPK5mdLkbjrTeWSRcEfxFrv56g/XckIYlE9ckuobsdwqd5mk2g1sBkMewg==",
|
||||||
"license": "MIT",
|
"license": "MIT",
|
||||||
|
"peer": true,
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"@vue/compiler-dom": "3.5.30",
|
"@vue/compiler-dom": "3.5.30",
|
||||||
"@vue/compiler-sfc": "3.5.30",
|
"@vue/compiler-sfc": "3.5.30",
|
||||||
|
|||||||
@ -1,7 +1,7 @@
|
|||||||
{
|
{
|
||||||
"name": "neode-ui",
|
"name": "neode-ui",
|
||||||
"private": true,
|
"private": true,
|
||||||
"version": "1.7.111-alpha",
|
"version": "1.7.116-alpha",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "./start-dev.sh",
|
"start": "./start-dev.sh",
|
||||||
@ -24,6 +24,7 @@
|
|||||||
"generate-welcome-speech": "node scripts/generate-welcome-speech.js"
|
"generate-welcome-speech": "node scripts/generate-welcome-speech.js"
|
||||||
},
|
},
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
|
"@scure/bip39": "^2.2.0",
|
||||||
"@types/dompurify": "^3.0.5",
|
"@types/dompurify": "^3.0.5",
|
||||||
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
"@vue-leaflet/vue-leaflet": "^0.10.1",
|
||||||
"buffer": "^6.0.3",
|
"buffer": "^6.0.3",
|
||||||
|
|||||||
11
neode-ui/public/assets/icon/ATTRIBUTION.md
Normal file
11
neode-ui/public/assets/icon/ATTRIBUTION.md
Normal file
@ -0,0 +1,11 @@
|
|||||||
|
# Icon Attribution
|
||||||
|
|
||||||
|
- `barbarian.svg`, `batteries.svg` — from **game-icons.net**
|
||||||
|
(https://game-icons.net), by Lorc, Delapouite & contributors,
|
||||||
|
licensed under CC BY 3.0 (https://creativecommons.org/licenses/by/3.0/).
|
||||||
|
- Pixel-style icons (`save.svg`, `paint-bucket.svg`, `fill-half.svg`,
|
||||||
|
`cloud-moon.svg`, `debug-off.svg`, `cloud-done.svg`) — from
|
||||||
|
**pixelarticons** by Gerrit Halfmann (https://github.com/halfmage/pixelarticons),
|
||||||
|
MIT License.
|
||||||
|
- All other icons are original Archipelago artwork (MIT, see repository
|
||||||
|
LICENSE).
|
||||||
13
neode-ui/public/assets/img/mesh-devices/ATTRIBUTION.md
Normal file
13
neode-ui/public/assets/img/mesh-devices/ATTRIBUTION.md
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
# Device Artwork Attribution
|
||||||
|
|
||||||
|
The device illustrations in this directory are from the
|
||||||
|
**Meshtastic® project** — https://meshtastic.org
|
||||||
|
(https://github.com/meshtastic), © Meshtastic contributors,
|
||||||
|
licensed under GPL-3.0.
|
||||||
|
|
||||||
|
Meshtastic® is a registered trademark of Meshtastic LLC, used here solely to
|
||||||
|
identify compatible hardware. No endorsement by the Meshtastic project is
|
||||||
|
implied.
|
||||||
|
|
||||||
|
Any modifications to these images made for Archipelago are likewise available
|
||||||
|
under GPL-3.0 as part of this public repository.
|
||||||
Binary file not shown.
@ -400,6 +400,76 @@ class RPCClient {
|
|||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Pay a Lightning invoice and resolve it to a REAL terminal state.
|
||||||
|
*
|
||||||
|
* The backend waits up to 120s on LND's synchronous pay endpoint; if the
|
||||||
|
* payment is still routing after that it answers `status: "pending"` with
|
||||||
|
* the payment hash instead of an error. This helper then polls
|
||||||
|
* lnd.paymentstatus until LND itself reports succeeded/failed, so callers
|
||||||
|
* never show "failed" for a payment that is merely slow — the bug where a
|
||||||
|
* settling payment was declared failed and then appeared in history a
|
||||||
|
* minute later. Returns `pending` only if the payment is STILL in flight
|
||||||
|
* after the polling window (rare; caller should say "still settling",
|
||||||
|
* not "failed"). */
|
||||||
|
async payLightningInvoice(params: {
|
||||||
|
payment_request: string
|
||||||
|
amount_sats?: number
|
||||||
|
}): Promise<{
|
||||||
|
status: 'succeeded' | 'failed' | 'pending'
|
||||||
|
payment_hash: string
|
||||||
|
amount_sats: number
|
||||||
|
failure_reason?: string
|
||||||
|
}> {
|
||||||
|
const res = await this.call<{
|
||||||
|
status?: string
|
||||||
|
payment_hash?: string
|
||||||
|
amount_sats?: number
|
||||||
|
}>({
|
||||||
|
method: 'lnd.payinvoice',
|
||||||
|
params,
|
||||||
|
// Above the backend's 120s wait so the backend always answers first.
|
||||||
|
timeout: 130000,
|
||||||
|
})
|
||||||
|
|
||||||
|
const hash = res.payment_hash || ''
|
||||||
|
const amount = res.amount_sats || 0
|
||||||
|
// Older backends have no status field — a plain response was a success.
|
||||||
|
if (res.status !== 'pending') {
|
||||||
|
return { status: 'succeeded', payment_hash: hash, amount_sats: amount }
|
||||||
|
}
|
||||||
|
if (!hash) return { status: 'pending', payment_hash: '', amount_sats: amount }
|
||||||
|
|
||||||
|
// Poll to a terminal state: every 3s for up to 2 minutes.
|
||||||
|
for (let i = 0; i < 40; i++) {
|
||||||
|
await new Promise((r) => setTimeout(r, 3000))
|
||||||
|
try {
|
||||||
|
const st = await this.call<{
|
||||||
|
status: string
|
||||||
|
failure_reason?: string
|
||||||
|
amount_sats?: number
|
||||||
|
}>({
|
||||||
|
method: 'lnd.paymentstatus',
|
||||||
|
params: { payment_hash: hash },
|
||||||
|
timeout: 15000,
|
||||||
|
})
|
||||||
|
if (st.status === 'succeeded') {
|
||||||
|
return { status: 'succeeded', payment_hash: hash, amount_sats: st.amount_sats || amount }
|
||||||
|
}
|
||||||
|
if (st.status === 'failed') {
|
||||||
|
return {
|
||||||
|
status: 'failed',
|
||||||
|
payment_hash: hash,
|
||||||
|
amount_sats: amount,
|
||||||
|
failure_reason: st.failure_reason || 'Payment failed',
|
||||||
|
}
|
||||||
|
}
|
||||||
|
} catch {
|
||||||
|
// Transient poll error — keep trying; only LND decides failure.
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return { status: 'pending', payment_hash: hash, amount_sats: amount }
|
||||||
|
}
|
||||||
|
|
||||||
async publishNostrIdentity(): Promise<{ event_id: string; success: number; failed: number }> {
|
async publishNostrIdentity(): Promise<{ event_id: string; success: number; failed: number }> {
|
||||||
return this.call({
|
return this.call({
|
||||||
method: 'node.nostr-publish',
|
method: 'node.nostr-publish',
|
||||||
|
|||||||
@ -525,10 +525,10 @@ async function approvePayment() {
|
|||||||
receipt = { method: 'ecash', token: res.token, amount_sats: res.amount_sats }
|
receipt = { method: 'ecash', token: res.token, amount_sats: res.amount_sats }
|
||||||
} else if (method === 'lightning') {
|
} else if (method === 'lightning') {
|
||||||
if (pay.invoice) {
|
if (pay.invoice) {
|
||||||
const res = await rpcClient.call<{ payment_hash: string; amount_sats: number }>({
|
// Tracked to a real terminal state — slow routing is not a failure.
|
||||||
method: 'lnd.payinvoice',
|
const res = await rpcClient.payLightningInvoice({ payment_request: pay.invoice })
|
||||||
params: { payment_request: pay.invoice },
|
if (res.status === 'failed') throw new Error(res.failure_reason || 'Payment failed')
|
||||||
})
|
if (res.status === 'pending') throw new Error('Payment is still settling — check your wallet transactions before retrying.')
|
||||||
receipt = { method: 'lightning', payment_hash: res.payment_hash, amount_sats: res.amount_sats }
|
receipt = { method: 'lightning', payment_hash: res.payment_hash, amount_sats: res.amount_sats }
|
||||||
} else {
|
} else {
|
||||||
// Create and immediately return an invoice for the requester to display
|
// Create and immediately return an invoice for the requester to display
|
||||||
|
|||||||
@ -150,7 +150,7 @@ const STORAGE_KEY = 'neode_companion_intro_seen'
|
|||||||
// exposes the release-server address.
|
// exposes the release-server address.
|
||||||
const DEFAULT_DOWNLOAD_URL = IS_DEMO
|
const DEFAULT_DOWNLOAD_URL = IS_DEMO
|
||||||
? `${window.location.origin}/packages/archipelago-companion.apk`
|
? `${window.location.origin}/packages/archipelago-companion.apk`
|
||||||
: 'http://146.59.87.168:3000/lfg2025/archy/raw/branch/main/neode-ui/public/packages/archipelago-companion.apk'
|
: 'http://146.59.87.168:2100/packages/archipelago-companion.apk'
|
||||||
|
|
||||||
// Deep-link scheme the companion app registers; carries the server entry the
|
// Deep-link scheme the companion app registers; carries the server entry the
|
||||||
// app should create (see docs/companion-pairing-qr.md for the contract).
|
// app should create (see docs/companion-pairing-qr.md for the contract).
|
||||||
@ -267,12 +267,20 @@ function isTailnetIp(host: string): boolean {
|
|||||||
* - a tailnet 100.x address (operator browsing over Tailscale — a scanned
|
* - a tailnet 100.x address (operator browsing over Tailscale — a scanned
|
||||||
* QR carried one of these on 2026-07-22 and the companion sat there
|
* QR carried one of these on 2026-07-22 and the companion sat there
|
||||||
* dialing an IP the phone had no route to)
|
* dialing an IP the phone had no route to)
|
||||||
|
* - a .fips name or mesh ULA (operator browsing over the mesh — a scanned
|
||||||
|
* QR carried npub….fips as fhost on 2026-07-24; Android's system DNS
|
||||||
|
* can't resolve .fips, so the phone's direct dial died and first
|
||||||
|
* connect crawled through anchor discovery instead of the LAN)
|
||||||
*/
|
*/
|
||||||
async function resolveServerUrl(): Promise<string> {
|
async function resolveServerUrl(): Promise<string> {
|
||||||
if (IS_DEMO) return DEMO_SERVER_URL
|
if (IS_DEMO) return DEMO_SERVER_URL
|
||||||
const { hostname, origin } = window.location
|
const { hostname, origin } = window.location
|
||||||
const phoneUnreachable =
|
const phoneUnreachable =
|
||||||
hostname === 'localhost' || hostname === '127.0.0.1' || isTailnetIp(hostname)
|
hostname === 'localhost' ||
|
||||||
|
hostname === '127.0.0.1' ||
|
||||||
|
isTailnetIp(hostname) ||
|
||||||
|
hostname.endsWith('.fips') ||
|
||||||
|
hostname.includes(':') // IPv6 literal — the node's mesh ULA
|
||||||
if (!phoneUnreachable) return origin
|
if (!phoneUnreachable) return origin
|
||||||
try {
|
try {
|
||||||
const res = await rpcClient.call<{ mdns_hostname?: string; lan_ip?: string | null }>({
|
const res = await rpcClient.call<{ mdns_hostname?: string; lan_ip?: string | null }>({
|
||||||
|
|||||||
@ -75,7 +75,7 @@
|
|||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- No Channels -->
|
<!-- No Channels -->
|
||||||
<div v-else-if="channels.length === 0" key="empty" class="glass-card p-8 text-center">
|
<div v-else-if="channels.length === 0 && closedChannels.length === 0" key="empty" class="glass-card p-8 text-center">
|
||||||
<svg class="w-16 h-16 text-white/20 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
<svg class="w-16 h-16 text-white/20 mx-auto mb-4" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M13 10V3L4 14h7v7l9-11h-7z" />
|
||||||
</svg>
|
</svg>
|
||||||
@ -85,6 +85,23 @@
|
|||||||
|
|
||||||
<!-- Channel List -->
|
<!-- Channel List -->
|
||||||
<div v-else key="channels" class="space-y-3">
|
<div v-else key="channels" class="space-y-3">
|
||||||
|
<!-- Status tabs -->
|
||||||
|
<div class="flex gap-1 p-1 bg-white/5 rounded-lg">
|
||||||
|
<button
|
||||||
|
v-for="tab in tabs"
|
||||||
|
:key="tab.key"
|
||||||
|
@click="activeTab = tab.key"
|
||||||
|
class="flex-1 px-2 py-1.5 rounded text-xs font-medium transition-colors flex items-center justify-center gap-1.5"
|
||||||
|
:class="activeTab === tab.key ? 'bg-white/15 text-white' : 'text-white/50 hover:text-white/80'"
|
||||||
|
>
|
||||||
|
{{ tab.label }}
|
||||||
|
<span
|
||||||
|
class="px-1.5 py-0.5 rounded-full text-[10px] leading-none"
|
||||||
|
:class="activeTab === tab.key ? 'bg-white/15 text-white/80' : 'bg-white/10 text-white/40'"
|
||||||
|
>{{ tab.count }}</span>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="loading" class="p-2 text-center text-white/45 text-xs flex items-center justify-center gap-2">
|
<div v-if="loading" class="p-2 text-center text-white/45 text-xs flex items-center justify-center gap-2">
|
||||||
<svg class="animate-spin h-3.5 w-3.5" fill="none" viewBox="0 0 24 24">
|
<svg class="animate-spin h-3.5 w-3.5" fill="none" viewBox="0 0 24 24">
|
||||||
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
<circle class="opacity-25" cx="12" cy="12" r="10" stroke="currentColor" stroke-width="4"></circle>
|
||||||
@ -96,7 +113,7 @@
|
|||||||
{{ error }}
|
{{ error }}
|
||||||
</div>
|
</div>
|
||||||
<div
|
<div
|
||||||
v-for="ch in channels"
|
v-for="ch in filteredChannels"
|
||||||
:key="ch.chan_id || ch.channel_point"
|
:key="ch.chan_id || ch.channel_point"
|
||||||
class="glass-card p-4"
|
class="glass-card p-4"
|
||||||
:class="{ 'bg-white/5': compact }"
|
:class="{ 'bg-white/5': compact }"
|
||||||
@ -109,12 +126,14 @@
|
|||||||
'bg-green-400': channelStatus(ch) === 'active',
|
'bg-green-400': channelStatus(ch) === 'active',
|
||||||
'bg-yellow-400': channelStatus(ch) === 'pending_open',
|
'bg-yellow-400': channelStatus(ch) === 'pending_open',
|
||||||
'bg-red-400': channelStatus(ch) === 'inactive',
|
'bg-red-400': channelStatus(ch) === 'inactive',
|
||||||
|
'bg-gray-400': channelStatus(ch) === 'closing',
|
||||||
|
'bg-gray-500': channelStatus(ch) === 'force_closing',
|
||||||
}"
|
}"
|
||||||
></span>
|
></span>
|
||||||
<span class="text-white/80 text-sm font-medium capitalize">{{ channelStatus(ch).replace('_', ' ') }}</span>
|
<span class="text-white/80 text-sm font-medium capitalize">{{ channelStatus(ch).replace('_', ' ') }}</span>
|
||||||
</div>
|
</div>
|
||||||
<button
|
<button
|
||||||
v-if="channelStatus(ch) !== 'pending_open'"
|
v-if="!['pending_open', 'closing', 'force_closing'].includes(channelStatus(ch))"
|
||||||
@click="confirmClose(ch)"
|
@click="confirmClose(ch)"
|
||||||
class="text-red-400/70 hover:text-red-400 text-xs transition-colors"
|
class="text-red-400/70 hover:text-red-400 text-xs transition-colors"
|
||||||
>
|
>
|
||||||
@ -148,9 +167,10 @@
|
|||||||
</p>
|
</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<!-- Funding tx -->
|
<!-- Funding / closing tx -->
|
||||||
<div v-if="fundingTxid(ch)" class="flex justify-end">
|
<div v-if="fundingTxid(ch) || ch.closing_txid" class="flex justify-end gap-3">
|
||||||
<button
|
<button
|
||||||
|
v-if="fundingTxid(ch)"
|
||||||
@click="openInMempool(fundingTxid(ch))"
|
@click="openInMempool(fundingTxid(ch))"
|
||||||
class="flex items-center gap-1 text-blue-400/70 hover:text-blue-400 text-xs transition-colors"
|
class="flex items-center gap-1 text-blue-400/70 hover:text-blue-400 text-xs transition-colors"
|
||||||
:title="fundingTxid(ch)"
|
:title="fundingTxid(ch)"
|
||||||
@ -160,8 +180,66 @@
|
|||||||
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
||||||
</svg>
|
</svg>
|
||||||
</button>
|
</button>
|
||||||
|
<button
|
||||||
|
v-if="ch.closing_txid"
|
||||||
|
@click="openInMempool(ch.closing_txid!)"
|
||||||
|
class="flex items-center gap-1 text-orange-400/70 hover:text-orange-400 text-xs transition-colors"
|
||||||
|
:title="ch.closing_txid"
|
||||||
|
>
|
||||||
|
Closing tx in Mempool
|
||||||
|
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Closed channel history (All + Closed tabs) -->
|
||||||
|
<div
|
||||||
|
v-for="ch in filteredClosed"
|
||||||
|
:key="'closed-' + (ch.chan_id || ch.channel_point || ch.closing_tx_hash)"
|
||||||
|
class="glass-card p-4 opacity-75"
|
||||||
|
:class="{ 'bg-white/5': compact }"
|
||||||
|
>
|
||||||
|
<div class="flex items-center justify-between mb-3">
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<span class="w-2 h-2 rounded-full bg-white/30"></span>
|
||||||
|
<span class="text-white/60 text-sm font-medium">Closed</span>
|
||||||
|
<span v-if="closeTypeLabel(ch)" class="text-white/40 text-xs">· {{ closeTypeLabel(ch) }}</span>
|
||||||
|
</div>
|
||||||
|
<span v-if="ch.close_height" class="text-white/35 text-xs">Block {{ ch.close_height.toLocaleString() }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<p class="text-white/40 text-xs font-mono mb-3 truncate" :title="ch.remote_pubkey">
|
||||||
|
{{ ch.remote_pubkey }}
|
||||||
|
</p>
|
||||||
|
|
||||||
|
<div class="flex justify-between text-xs text-white/50 mb-2">
|
||||||
|
<span>Settled: {{ formatSats(ch.settled_balance) }}</span>
|
||||||
|
<span>Capacity: {{ formatSats(ch.capacity) }}</span>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="ch.closing_tx_hash" class="flex justify-end">
|
||||||
|
<button
|
||||||
|
@click="openInMempool(ch.closing_tx_hash)"
|
||||||
|
class="flex items-center gap-1 text-blue-400/70 hover:text-blue-400 text-xs transition-colors"
|
||||||
|
:title="ch.closing_tx_hash"
|
||||||
|
>
|
||||||
|
Closing tx in Mempool
|
||||||
|
<svg class="w-3 h-3" fill="none" stroke="currentColor" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" stroke-width="2" d="M10 6H6a2 2 0 00-2 2v10a2 2 0 002 2h10a2 2 0 002-2v-4M14 4h6m0 0v6m0-6L10 14" />
|
||||||
|
</svg>
|
||||||
|
</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<!-- Per-tab empty state -->
|
||||||
|
<div
|
||||||
|
v-if="filteredChannels.length === 0 && filteredClosed.length === 0"
|
||||||
|
class="glass-card p-6 text-center"
|
||||||
|
>
|
||||||
|
<p class="text-white/50 text-sm">{{ emptyTabMessage }}</p>
|
||||||
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</Transition>
|
</Transition>
|
||||||
|
|
||||||
@ -299,7 +377,7 @@
|
|||||||
</template>
|
</template>
|
||||||
|
|
||||||
<script setup lang="ts">
|
<script setup lang="ts">
|
||||||
import { ref, onMounted } from 'vue'
|
import { ref, computed, onMounted } from 'vue'
|
||||||
import { rpcClient } from '@/api/rpc-client'
|
import { rpcClient } from '@/api/rpc-client'
|
||||||
import { useTxExplorer } from '@/composables/useTxExplorer'
|
import { useTxExplorer } from '@/composables/useTxExplorer'
|
||||||
|
|
||||||
@ -314,6 +392,18 @@ interface Channel {
|
|||||||
active: boolean
|
active: boolean
|
||||||
status?: string
|
status?: string
|
||||||
channel_point?: string
|
channel_point?: string
|
||||||
|
closing_txid?: string
|
||||||
|
}
|
||||||
|
|
||||||
|
interface ClosedChannel {
|
||||||
|
chan_id?: string
|
||||||
|
remote_pubkey: string
|
||||||
|
capacity: number
|
||||||
|
settled_balance: number
|
||||||
|
close_type?: string
|
||||||
|
closing_tx_hash?: string
|
||||||
|
channel_point?: string
|
||||||
|
close_height?: number
|
||||||
}
|
}
|
||||||
|
|
||||||
/** Status with a fallback derived from `active` for backends that omit it */
|
/** Status with a fallback derived from `active` for backends that omit it */
|
||||||
@ -321,6 +411,48 @@ function channelStatus(ch: Channel): string {
|
|||||||
return ch.status ?? (ch.active ? 'active' : 'inactive')
|
return ch.status ?? (ch.active ? 'active' : 'inactive')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
type ChannelTab = 'all' | 'active' | 'pending' | 'closed'
|
||||||
|
const activeTab = ref<ChannelTab>('all')
|
||||||
|
|
||||||
|
/** pending_open, closing and force_closing all live on the Pending tab */
|
||||||
|
function isPendingState(ch: Channel): boolean {
|
||||||
|
return ['pending_open', 'closing', 'force_closing'].includes(channelStatus(ch))
|
||||||
|
}
|
||||||
|
|
||||||
|
const tabs = computed((): { key: ChannelTab; label: string; count: number }[] => [
|
||||||
|
{ key: 'all', label: 'All', count: channels.value.length + closedChannels.value.length },
|
||||||
|
{ key: 'active', label: 'Active', count: channels.value.filter(ch => !isPendingState(ch)).length },
|
||||||
|
{ key: 'pending', label: 'Pending', count: channels.value.filter(isPendingState).length },
|
||||||
|
{ key: 'closed', label: 'Closed', count: closedChannels.value.length },
|
||||||
|
])
|
||||||
|
|
||||||
|
const filteredChannels = computed((): Channel[] => {
|
||||||
|
switch (activeTab.value) {
|
||||||
|
case 'closed': return []
|
||||||
|
case 'active': return channels.value.filter(ch => !isPendingState(ch))
|
||||||
|
case 'pending': return channels.value.filter(isPendingState)
|
||||||
|
default: return channels.value
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
const filteredClosed = computed((): ClosedChannel[] =>
|
||||||
|
activeTab.value === 'all' || activeTab.value === 'closed' ? closedChannels.value : []
|
||||||
|
)
|
||||||
|
|
||||||
|
const emptyTabMessage = computed((): string => {
|
||||||
|
switch (activeTab.value) {
|
||||||
|
case 'active': return 'No open channels.'
|
||||||
|
case 'pending': return 'No pending or closing channels.'
|
||||||
|
case 'closed': return 'No closed channels yet.'
|
||||||
|
default: return 'No channels yet.'
|
||||||
|
}
|
||||||
|
})
|
||||||
|
|
||||||
|
/** "COOPERATIVE_CLOSE" / "cooperative_close" → "cooperative close" */
|
||||||
|
function closeTypeLabel(ch: ClosedChannel): string {
|
||||||
|
return (ch.close_type || '').toLowerCase().replace(/_/g, ' ')
|
||||||
|
}
|
||||||
|
|
||||||
type FeePreset = 'standard' | 'medium' | 'fast' | 'custom'
|
type FeePreset = 'standard' | 'medium' | 'fast' | 'custom'
|
||||||
|
|
||||||
const feePresets: { key: FeePreset; label: string; hint?: string; confTarget?: number }[] = [
|
const feePresets: { key: FeePreset; label: string; hint?: string; confTarget?: number }[] = [
|
||||||
@ -333,6 +465,7 @@ const feePresets: { key: FeePreset; label: string; hint?: string; confTarget?: n
|
|||||||
const loading = ref(true)
|
const loading = ref(true)
|
||||||
const error = ref<string | null>(null)
|
const error = ref<string | null>(null)
|
||||||
const channels = ref<Channel[]>([])
|
const channels = ref<Channel[]>([])
|
||||||
|
const closedChannels = ref<ClosedChannel[]>([])
|
||||||
const summary = ref({ total_inbound: 0, total_outbound: 0 })
|
const summary = ref({ total_inbound: 0, total_outbound: 0 })
|
||||||
|
|
||||||
// Olympus by ZEUS — the LSP node behind the Zeus mobile wallet.
|
// Olympus by ZEUS — the LSP node behind the Zeus mobile wallet.
|
||||||
@ -419,6 +552,17 @@ async function loadChannels() {
|
|||||||
total_inbound: result.total_inbound || 0,
|
total_inbound: result.total_inbound || 0,
|
||||||
total_outbound: result.total_outbound || 0,
|
total_outbound: result.total_outbound || 0,
|
||||||
}
|
}
|
||||||
|
// Closed history is a separate RPC — a failure here keeps the previous
|
||||||
|
// list rather than blanking the main channel view.
|
||||||
|
try {
|
||||||
|
const closed = await rpcClient.call<{ channels: ClosedChannel[] }>({
|
||||||
|
method: 'lnd.closedchannels',
|
||||||
|
timeout: 15000,
|
||||||
|
})
|
||||||
|
closedChannels.value = closed.channels || []
|
||||||
|
} catch {
|
||||||
|
/* keep previous closed list */
|
||||||
|
}
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
error.value = err instanceof Error ? err.message : 'Failed to load channels'
|
error.value = err instanceof Error ? err.message : 'Failed to load channels'
|
||||||
if (!hadChannels) channels.value = []
|
if (!hadChannels) channels.value = []
|
||||||
|
|||||||
124
neode-ui/src/components/SeedRevealPanel.vue
Normal file
124
neode-ui/src/components/SeedRevealPanel.vue
Normal file
@ -0,0 +1,124 @@
|
|||||||
|
<template>
|
||||||
|
<div>
|
||||||
|
<div class="flex gap-1 mb-3 p-1 bg-white/5 rounded-lg">
|
||||||
|
<button
|
||||||
|
v-for="tab in ([{ key: 'words', label: 'Words' }, { key: 'qr', label: 'QR code' }] as const)"
|
||||||
|
:key="tab.key"
|
||||||
|
type="button"
|
||||||
|
@click="seedTab = tab.key"
|
||||||
|
class="flex-1 px-2 py-1.5 rounded text-xs font-medium transition-colors"
|
||||||
|
:class="seedTab === tab.key ? 'bg-white/15 text-white' : 'text-white/50 hover:text-white/80'"
|
||||||
|
>{{ tab.label }}</button>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<template v-if="seedTab === 'words'">
|
||||||
|
<p class="text-sm text-white/60 mb-3">Write these down and store them offline. Tap to {{ hidden ? 'reveal' : 'hide' }}.</p>
|
||||||
|
<div class="relative">
|
||||||
|
<div
|
||||||
|
class="grid grid-cols-2 sm:grid-cols-3 gap-2 p-3 bg-white/5 rounded-lg transition-all select-text"
|
||||||
|
:class="hidden ? 'blur-md' : ''"
|
||||||
|
@click="hidden = !hidden"
|
||||||
|
>
|
||||||
|
<div v-for="(w, i) in words" :key="i" class="flex items-center gap-1.5 text-sm">
|
||||||
|
<span class="text-white/30 text-xs w-5 text-right">{{ i + 1 }}.</span>
|
||||||
|
<span class="text-white font-mono">{{ w }}</span>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<button v-if="hidden" type="button" class="absolute inset-0 flex items-center justify-center text-xs text-white/70 font-medium" @click="hidden = false">Tap to reveal</button>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<template v-else>
|
||||||
|
<p class="text-sm text-white/60 mb-3">
|
||||||
|
{{ aezeed ? 'Scan to copy the words into another device.' : 'Scan into a wallet that imports seeds by QR.' }}
|
||||||
|
Tap to {{ hidden ? 'reveal' : 'hide' }}.
|
||||||
|
</p>
|
||||||
|
<div class="relative">
|
||||||
|
<div
|
||||||
|
class="flex justify-center p-3 bg-white/5 rounded-lg transition-all"
|
||||||
|
:class="hidden ? 'blur-md' : ''"
|
||||||
|
@click="hidden = !hidden"
|
||||||
|
>
|
||||||
|
<canvas ref="qrCanvas" class="rounded-lg bg-white p-2"></canvas>
|
||||||
|
</div>
|
||||||
|
<button v-if="hidden" type="button" class="absolute inset-0 flex items-center justify-center text-xs text-white/70 font-medium" @click="hidden = false">Tap to reveal</button>
|
||||||
|
</div>
|
||||||
|
<div v-if="!aezeed && seedQrAvailable" class="flex justify-center mt-2">
|
||||||
|
<div class="flex p-0.5 bg-white/5 rounded-md">
|
||||||
|
<button
|
||||||
|
v-for="f in ([{ key: 'seedqr', label: 'SeedQR' }, { key: 'text', label: 'Plain text' }] as const)"
|
||||||
|
:key="f.key"
|
||||||
|
type="button"
|
||||||
|
@click="qrFormat = f.key"
|
||||||
|
class="px-2.5 py-1 rounded text-[11px] font-medium transition-colors"
|
||||||
|
:class="qrFormat === f.key ? 'bg-white/15 text-white' : 'text-white/50 hover:text-white/80'"
|
||||||
|
>{{ f.label }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p class="text-xs text-white/40 mt-2">
|
||||||
|
<template v-if="aezeed">
|
||||||
|
The code contains your seed words as plain text — treat it exactly like the words
|
||||||
|
themselves. Note: this is an LND <span class="font-mono">aezeed</span>, not a BIP39
|
||||||
|
phrase — it restores into LND-based wallets (Zeus, Blixt, another Archipelago node),
|
||||||
|
not into hardware wallets like Passport.
|
||||||
|
</template>
|
||||||
|
<template v-else-if="qrFormat === 'seedqr'">
|
||||||
|
SeedQR — scans into Passport, SeedSigner, Keystone and other wallets that import
|
||||||
|
seeds by QR. Treat this code exactly like the words themselves.
|
||||||
|
</template>
|
||||||
|
<template v-else>
|
||||||
|
Plain text words — for wallets that read the phrase as text. Treat this code exactly
|
||||||
|
like the words themselves.
|
||||||
|
</template>
|
||||||
|
</p>
|
||||||
|
</template>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
|
<script setup lang="ts">
|
||||||
|
import { ref, watch, nextTick } from 'vue'
|
||||||
|
|
||||||
|
// Shared seed reveal body: Words / QR code tabs behind a tap-to-reveal blur.
|
||||||
|
// Words are always the first view. For BIP39 seeds the QR defaults to the
|
||||||
|
// SeedQR standard (4-digit wordlist indices — what Passport Prime, SeedSigner,
|
||||||
|
// Keystone etc. import), with a plain-text option. `aezeed` seeds (LND) are
|
||||||
|
// NOT BIP39 and no hardware wallet can import them, so they only ever get the
|
||||||
|
// plain-text QR plus an explanation — SeedQR-encoding one would be dishonest.
|
||||||
|
const props = defineProps<{ words: string[]; aezeed?: boolean }>()
|
||||||
|
|
||||||
|
const seedTab = ref<'words' | 'qr'>('words')
|
||||||
|
const qrFormat = ref<'seedqr' | 'text'>(props.aezeed ? 'text' : 'seedqr')
|
||||||
|
const seedQrAvailable = ref(!props.aezeed)
|
||||||
|
const hidden = ref(true)
|
||||||
|
const qrCanvas = ref<HTMLCanvasElement | null>(null)
|
||||||
|
|
||||||
|
async function renderQr() {
|
||||||
|
await nextTick()
|
||||||
|
if (!qrCanvas.value || props.words.length === 0) return
|
||||||
|
try {
|
||||||
|
let payload = props.words.join(' ')
|
||||||
|
if (!props.aezeed && qrFormat.value === 'seedqr') {
|
||||||
|
const { toSeedQrDigits } = await import('@/utils/seedqr')
|
||||||
|
const digits = await toSeedQrDigits(props.words)
|
||||||
|
if (digits) {
|
||||||
|
payload = digits
|
||||||
|
} else {
|
||||||
|
// Not a BIP39 phrase after all — only plain text is honest.
|
||||||
|
seedQrAvailable.value = false
|
||||||
|
qrFormat.value = 'text'
|
||||||
|
return // the qrFormat watcher re-renders as text
|
||||||
|
}
|
||||||
|
}
|
||||||
|
const QRCode = await import('qrcode')
|
||||||
|
await QRCode.toCanvas(qrCanvas.value, payload, { width: 260, margin: 1 })
|
||||||
|
} catch { /* QR is a convenience — the words remain authoritative */ }
|
||||||
|
}
|
||||||
|
watch(seedTab, (t) => { if (t === 'qr') void renderQr() })
|
||||||
|
watch(qrFormat, () => { if (seedTab.value === 'qr') void renderQr() })
|
||||||
|
watch(() => props.words, () => {
|
||||||
|
seedTab.value = 'words' // fresh reveal always shows words first
|
||||||
|
hidden.value = true
|
||||||
|
seedQrAvailable.value = !props.aezeed
|
||||||
|
qrFormat.value = props.aezeed ? 'text' : 'seedqr'
|
||||||
|
})
|
||||||
|
</script>
|
||||||
@ -1,7 +1,58 @@
|
|||||||
<template>
|
<template>
|
||||||
<BaseModal :show="show" :title="t('web5.sendBitcoinTitle')" max-width="max-w-2xl" content-class="max-h-[90vh] overflow-y-auto" @close="close">
|
<BaseModal :show="show" :title="t('web5.sendBitcoinTitle')" max-width="max-w-2xl" content-class="max-h-[90vh] overflow-y-auto" @close="close">
|
||||||
|
<!-- ============ SUCCESS PANE — the payment's moment, not a footnote ============ -->
|
||||||
|
<template v-if="successInfo">
|
||||||
|
<div class="text-center py-4">
|
||||||
|
<div class="send-success-burst mx-auto mb-6">
|
||||||
|
<span class="burst-ring"></span>
|
||||||
|
<span class="burst-ring burst-ring-2"></span>
|
||||||
|
<span class="burst-ring burst-ring-3"></span>
|
||||||
|
<div class="burst-core">
|
||||||
|
<svg class="w-14 h-14 text-green-400 burst-check" fill="none" stroke="currentColor" stroke-width="3" viewBox="0 0 24 24">
|
||||||
|
<path stroke-linecap="round" stroke-linejoin="round" d="M5 13l4 4L19 7" />
|
||||||
|
</svg>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div v-if="successInfo.amount > 0" class="text-5xl font-black text-green-400 mb-1">
|
||||||
|
{{ successInfo.amount.toLocaleString() }}<span class="text-2xl font-bold text-green-400/70"> sats</span>
|
||||||
|
</div>
|
||||||
|
<div class="text-2xl font-bold tracking-widest text-white mb-1">SENT</div>
|
||||||
|
<p class="text-sm text-white/50 mb-6">{{ successInfo.methodLabel }}</p>
|
||||||
|
|
||||||
|
<div v-if="successInfo.hash || successInfo.txid || successInfo.note" class="p-4 bg-white/5 rounded-xl text-left space-y-4 mb-6">
|
||||||
|
<div v-if="successInfo.hash">
|
||||||
|
<p class="text-xs text-white/50 mb-1">Payment hash</p>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p class="flex-1 text-xs font-mono text-white/80 break-all">{{ successInfo.hash }}</p>
|
||||||
|
<button
|
||||||
|
class="shrink-0 px-2.5 py-1.5 rounded-lg text-xs glass-button"
|
||||||
|
@click="copyDetail(successInfo.hash)"
|
||||||
|
>{{ copiedDetail === successInfo.hash ? 'Copied!' : 'Copy' }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div v-if="successInfo.txid">
|
||||||
|
<p class="text-xs text-white/50 mb-1">Transaction ID</p>
|
||||||
|
<div class="flex items-center gap-2">
|
||||||
|
<p class="flex-1 text-xs font-mono text-white/80 break-all">{{ successInfo.txid }}</p>
|
||||||
|
<button
|
||||||
|
class="shrink-0 px-2.5 py-1.5 rounded-lg text-xs glass-button"
|
||||||
|
@click="copyDetail(successInfo.txid)"
|
||||||
|
>{{ copiedDetail === successInfo.txid ? 'Copied!' : 'Copy' }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<p v-if="successInfo.note" class="text-xs text-white/60">{{ successInfo.note }}</p>
|
||||||
|
</div>
|
||||||
|
|
||||||
|
<div class="flex gap-3">
|
||||||
|
<button @click="sendAnother" class="flex-1 glass-button px-4 py-3 rounded-xl text-sm font-medium">Send another</button>
|
||||||
|
<button @click="close" class="flex-1 glass-button glass-button-warning px-4 py-3 rounded-xl text-sm font-semibold">Done</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</template>
|
||||||
|
|
||||||
<!-- ============ CONFIRM PANE (second step, mirrors the scan flow) ============ -->
|
<!-- ============ CONFIRM PANE (second step, mirrors the scan flow) ============ -->
|
||||||
<template v-if="confirming">
|
<template v-else-if="confirming">
|
||||||
<div class="mb-3 p-3 bg-white/5 rounded-lg">
|
<div class="mb-3 p-3 bg-white/5 rounded-lg">
|
||||||
<div class="flex items-center justify-between mb-2">
|
<div class="flex items-center justify-between mb-2">
|
||||||
<span class="text-xs text-white/50">Method</span>
|
<span class="text-xs text-white/50">Method</span>
|
||||||
@ -27,6 +78,10 @@
|
|||||||
</span>
|
</span>
|
||||||
<span class="text-sm font-medium text-white/80">−{{ confirmAmount.toLocaleString() }} sats</span>
|
<span class="text-sm font-medium text-white/80">−{{ confirmAmount.toLocaleString() }} sats</span>
|
||||||
</div>
|
</div>
|
||||||
|
<div v-if="effectiveMethod === 'onchain'" class="flex items-center justify-between">
|
||||||
|
<span class="text-xs text-white/50">Network fee</span>
|
||||||
|
<span class="text-sm font-medium text-white/80">{{ feeEstimateLabel }}</span>
|
||||||
|
</div>
|
||||||
<div class="flex items-center justify-between">
|
<div class="flex items-center justify-between">
|
||||||
<span class="text-xs text-white/50">Balance after</span>
|
<span class="text-xs text-white/50">Balance after</span>
|
||||||
<span class="text-sm font-medium" :class="insufficient ? 'text-red-400' : 'text-white/80'">
|
<span class="text-sm font-medium" :class="insufficient ? 'text-red-400' : 'text-white/80'">
|
||||||
@ -66,7 +121,19 @@
|
|||||||
|
|
||||||
<div class="mb-3">
|
<div class="mb-3">
|
||||||
<div class="flex items-center justify-between mb-1">
|
<div class="flex items-center justify-between mb-1">
|
||||||
<label class="text-white/60 text-sm">{{ t('sendBitcoin.amountSats') }}</label>
|
<div class="flex items-center gap-2">
|
||||||
|
<label class="text-white/60 text-sm">{{ amountLabel }}</label>
|
||||||
|
<!-- sats/BTC entry toggle (on-chain only) -->
|
||||||
|
<div v-if="sendMethod === 'onchain'" class="flex p-0.5 bg-white/5 rounded-md">
|
||||||
|
<button
|
||||||
|
v-for="u in (['sats', 'btc'] as const)"
|
||||||
|
:key="u"
|
||||||
|
@click="setAmountUnit(u)"
|
||||||
|
class="px-2 py-0.5 rounded text-[11px] font-medium transition-colors"
|
||||||
|
:class="amountUnit === u ? 'bg-white/15 text-white' : 'text-white/50 hover:text-white/80'"
|
||||||
|
>{{ u === 'btc' ? 'BTC' : 'sats' }}</button>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
<span v-if="pastedInvoiceAmount !== null" class="text-[11px] px-2 py-0.5 rounded-full bg-white/10 text-white/50">set by invoice</span>
|
<span v-if="pastedInvoiceAmount !== null" class="text-[11px] px-2 py-0.5 rounded-full bg-white/10 text-white/50">set by invoice</span>
|
||||||
<button
|
<button
|
||||||
v-if="sendMethod === 'onchain'"
|
v-if="sendMethod === 'onchain'"
|
||||||
@ -80,10 +147,11 @@
|
|||||||
</button>
|
</button>
|
||||||
</div>
|
</div>
|
||||||
<input
|
<input
|
||||||
v-model.number="amount"
|
v-model.number="amountEntry"
|
||||||
type="number"
|
type="number"
|
||||||
min="1"
|
:min="amountUnit === 'btc' && sendMethod === 'onchain' ? '0.00000001' : '1'"
|
||||||
:placeholder="sendAll ? '' : pastedInvoiceAmount !== null ? '' : '1000'"
|
:step="amountUnit === 'btc' && sendMethod === 'onchain' ? '0.00000001' : '1'"
|
||||||
|
:placeholder="sendAll ? '' : pastedInvoiceAmount !== null ? '' : amountUnit === 'btc' && sendMethod === 'onchain' ? '0.001' : '1000'"
|
||||||
:disabled="sendAll || pastedInvoiceAmount !== null"
|
:disabled="sendAll || pastedInvoiceAmount !== null"
|
||||||
class="w-full input-glass disabled:opacity-50"
|
class="w-full input-glass disabled:opacity-50"
|
||||||
/>
|
/>
|
||||||
@ -96,6 +164,7 @@
|
|||||||
<p v-else-if="effectiveMethod === 'lightning' && dest.trim()" class="text-xs text-white/50 mt-1">
|
<p v-else-if="effectiveMethod === 'lightning' && dest.trim()" class="text-xs text-white/50 mt-1">
|
||||||
Zero-amount invoice — enter how many sats to pay.
|
Zero-amount invoice — enter how many sats to pay.
|
||||||
</p>
|
</p>
|
||||||
|
<p v-else-if="unitConversionHint" class="text-xs text-white/40 mt-1">{{ unitConversionHint }}</p>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="effectiveMethod !== 'ecash'" class="mb-3">
|
<div v-if="effectiveMethod !== 'ecash'" class="mb-3">
|
||||||
@ -114,6 +183,48 @@
|
|||||||
<textarea v-model="dest" rows="2" :placeholder="effectiveMethod === 'lightning' ? 'lnbc...' : effectiveMethod === 'ark' ? 'tark1… / lnbc… / user@lnaddress' : 'bc1...'" class="w-full input-glass font-mono"></textarea>
|
<textarea v-model="dest" rows="2" :placeholder="effectiveMethod === 'lightning' ? 'lnbc...' : effectiveMethod === 'ark' ? 'tark1… / lnbc… / user@lnaddress' : 'bc1...'" class="w-full input-glass font-mono"></textarea>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
|
<!-- Network fee (on-chain only) -->
|
||||||
|
<div v-if="sendMethod === 'onchain'" class="mb-3">
|
||||||
|
<label class="text-white/60 text-sm block mb-1">Network fee</label>
|
||||||
|
<div class="flex gap-1 p-1 bg-white/5 rounded-lg">
|
||||||
|
<button
|
||||||
|
v-for="preset in onchainFeePresets"
|
||||||
|
:key="preset.key"
|
||||||
|
@click="feePreset = preset.key"
|
||||||
|
class="flex-1 px-2 py-1.5 rounded text-xs font-medium transition-colors"
|
||||||
|
:class="feePreset === preset.key ? 'bg-white/15 text-white' : 'text-white/50 hover:text-white/80'"
|
||||||
|
>{{ preset.label }}</button>
|
||||||
|
</div>
|
||||||
|
<p v-if="feePreset !== 'custom'" class="text-white/40 text-xs mt-1">
|
||||||
|
{{ onchainFeePresets.find(p => p.key === feePreset)?.hint }}
|
||||||
|
</p>
|
||||||
|
<div v-else class="grid grid-cols-2 gap-3 mt-2">
|
||||||
|
<div>
|
||||||
|
<label class="text-white/60 text-xs block mb-1">Target blocks</label>
|
||||||
|
<input
|
||||||
|
v-model.number="customConfTarget"
|
||||||
|
type="number"
|
||||||
|
min="1"
|
||||||
|
max="1008"
|
||||||
|
placeholder="6"
|
||||||
|
class="w-full input-glass"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<div>
|
||||||
|
<label class="text-white/60 text-xs block mb-1">Sats per vByte</label>
|
||||||
|
<input
|
||||||
|
v-model.number="customSatPerVbyte"
|
||||||
|
type="number"
|
||||||
|
min="1"
|
||||||
|
max="5000"
|
||||||
|
placeholder="—"
|
||||||
|
class="w-full input-glass"
|
||||||
|
/>
|
||||||
|
</div>
|
||||||
|
<p class="text-white/40 text-xs col-span-2">Set one — sats per vByte takes precedence when both are set</p>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
|
||||||
<div v-if="ecashToken" class="mb-3 p-2 bg-white/5 rounded-lg">
|
<div v-if="ecashToken" class="mb-3 p-2 bg-white/5 rounded-lg">
|
||||||
<p class="text-white/50 text-xs mb-1">{{ t('sendBitcoin.tokenShareLabel') }}</p>
|
<p class="text-white/50 text-xs mb-1">{{ t('sendBitcoin.tokenShareLabel') }}</p>
|
||||||
<!-- QR so the recipient can scan the token straight off this screen
|
<!-- QR so the recipient can scan the token straight off this screen
|
||||||
@ -125,16 +236,6 @@
|
|||||||
<button @click="copyText(ecashToken)" class="mt-2 text-xs text-orange-400 hover:text-orange-300">{{ t('common.copy') }}</button>
|
<button @click="copyText(ecashToken)" class="mt-2 text-xs text-orange-400 hover:text-orange-300">{{ t('common.copy') }}</button>
|
||||||
</div>
|
</div>
|
||||||
|
|
||||||
<div v-if="resultTxid" class="mb-3 alert-success">
|
|
||||||
<p class="text-xs">{{ t('sendBitcoin.sentTx', { txid: resultTxid }) }}</p>
|
|
||||||
</div>
|
|
||||||
<div v-if="resultHash" class="mb-3 alert-success">
|
|
||||||
<p class="text-xs">{{ t('sendBitcoin.paidHash', { hash: resultHash }) }}</p>
|
|
||||||
</div>
|
|
||||||
<div v-if="resultArk" class="mb-3 alert-success">
|
|
||||||
<p class="text-xs">{{ resultArk }}</p>
|
|
||||||
</div>
|
|
||||||
|
|
||||||
<div v-if="error" class="mb-3 alert-error">{{ error }}</div>
|
<div v-if="error" class="mb-3 alert-error">{{ error }}</div>
|
||||||
|
|
||||||
<div class="flex gap-3">
|
<div class="flex gap-3">
|
||||||
@ -167,13 +268,67 @@ const emit = defineEmits<{ close: []; sent: []; scan: [] }>()
|
|||||||
// 'auto' remains in the type for the effectiveMethod logic but is no longer
|
// 'auto' remains in the type for the effectiveMethod logic but is no longer
|
||||||
// offered as a tab (hidden per operator request 2026-07-22).
|
// offered as a tab (hidden per operator request 2026-07-22).
|
||||||
const sendMethod = ref<'auto' | 'lightning' | 'onchain' | 'ecash' | 'fedimint' | 'ark'>('lightning')
|
const sendMethod = ref<'auto' | 'lightning' | 'onchain' | 'ecash' | 'fedimint' | 'ark'>('lightning')
|
||||||
const amount = ref<number>(0)
|
|
||||||
|
// --- Amount entry with a sats/BTC unit toggle (on-chain). `amountEntry` is
|
||||||
|
// --- what the user types in the chosen unit; `amount` stays the canonical
|
||||||
|
// --- sats value the rest of the flow reads and writes.
|
||||||
|
const amountUnit = ref<'sats' | 'btc'>('sats')
|
||||||
|
const amountEntry = ref<number>(0)
|
||||||
|
const amount = computed<number>({
|
||||||
|
get: () =>
|
||||||
|
amountUnit.value === 'btc'
|
||||||
|
? Math.round((amountEntry.value || 0) * 100_000_000)
|
||||||
|
: Math.floor(amountEntry.value || 0),
|
||||||
|
set: (sats: number) => {
|
||||||
|
amountEntry.value = amountUnit.value === 'btc' ? (sats || 0) / 100_000_000 : sats || 0
|
||||||
|
},
|
||||||
|
})
|
||||||
|
|
||||||
|
/** Switch entry unit, converting whatever is already typed. */
|
||||||
|
function setAmountUnit(unit: 'sats' | 'btc') {
|
||||||
|
if (unit === amountUnit.value) return
|
||||||
|
const sats = amount.value
|
||||||
|
amountUnit.value = unit
|
||||||
|
amount.value = sats
|
||||||
|
}
|
||||||
|
|
||||||
|
// Only the on-chain tab offers BTC entry — leaving it snaps back to sats so
|
||||||
|
// the lightning/ecash flows (and their sats-only hints) stay consistent.
|
||||||
|
watch(sendMethod, (m) => {
|
||||||
|
if (m !== 'onchain' && amountUnit.value !== 'sats') setAmountUnit('sats')
|
||||||
|
})
|
||||||
|
|
||||||
|
const amountLabel = computed(() =>
|
||||||
|
sendMethod.value === 'onchain' && amountUnit.value === 'btc' ? 'Amount (BTC)' : t('sendBitcoin.amountSats')
|
||||||
|
)
|
||||||
|
|
||||||
|
const unitConversionHint = computed(() => {
|
||||||
|
if (sendMethod.value !== 'onchain' || !amountEntry.value) return ''
|
||||||
|
return amountUnit.value === 'btc'
|
||||||
|
? `= ${amount.value.toLocaleString()} sats`
|
||||||
|
: `= ${(amount.value / 100_000_000).toFixed(8).replace(/0+$/, '').replace(/\.$/, '')} BTC`
|
||||||
|
})
|
||||||
|
|
||||||
const dest = ref('')
|
const dest = ref('')
|
||||||
const processing = ref(false)
|
const processing = ref(false)
|
||||||
const error = ref('')
|
const error = ref('')
|
||||||
const resultTxid = ref('')
|
// Set on a completed send — flips the modal to the success pane.
|
||||||
const resultHash = ref('')
|
const successInfo = ref<{
|
||||||
const resultArk = ref('')
|
amount: number
|
||||||
|
methodLabel: string
|
||||||
|
hash?: string
|
||||||
|
txid?: string
|
||||||
|
note?: string
|
||||||
|
} | null>(null)
|
||||||
|
const copiedDetail = ref('')
|
||||||
|
|
||||||
|
function copyDetail(text: string) {
|
||||||
|
navigator.clipboard.writeText(text).catch(() => {})
|
||||||
|
copiedDetail.value = text
|
||||||
|
setTimeout(() => {
|
||||||
|
if (copiedDetail.value === text) copiedDetail.value = ''
|
||||||
|
}, 1500)
|
||||||
|
}
|
||||||
const ecashToken = ref('')
|
const ecashToken = ref('')
|
||||||
|
|
||||||
// "Send all funds" — sweeps the whole on-chain balance (explicit on-chain tab only)
|
// "Send all funds" — sweeps the whole on-chain balance (explicit on-chain tab only)
|
||||||
@ -193,22 +348,78 @@ function toggleSendAll() {
|
|||||||
// Leaving the on-chain tab disarms the sweep so it can never apply elsewhere
|
// Leaving the on-chain tab disarms the sweep so it can never apply elsewhere
|
||||||
watch(sendMethod, (m) => { if (m !== 'onchain') sendAll.value = false })
|
watch(sendMethod, (m) => { if (m !== 'onchain') sendAll.value = false })
|
||||||
|
|
||||||
// Invoice-first lightning UX: a pasted invoice that fixes its amount locks
|
// --- On-chain network fee: presets map to LND confirmation targets; custom
|
||||||
// the amount field (auto-filled, "set by invoice"); zero-amount invoices
|
// --- takes a block target or an explicit sat/vB rate (rate wins).
|
||||||
// leave it editable. Clearing/leaving lightning unlocks again.
|
type OnchainFeePreset = 'fast' | 'standard' | 'slow' | 'custom'
|
||||||
const pastedInvoiceAmount = computed<number | null>(() => {
|
|
||||||
if (effectiveMethod.value !== 'lightning') return null
|
const onchainFeePresets: { key: OnchainFeePreset; label: string; hint?: string; confTarget?: number }[] = [
|
||||||
const d = dest.value.trim()
|
{ key: 'fast', label: 'Fast', hint: 'Targets the next block (~10 minutes)', confTarget: 1 },
|
||||||
if (!d) return null
|
{ key: 'standard', label: 'Standard', hint: 'Confirms within ~6 blocks (about an hour)', confTarget: 6 },
|
||||||
return parseBolt11AmountSats(d.toLowerCase().startsWith('lightning:') ? d.slice(10) : d)
|
{ key: 'slow', label: 'Slow', hint: 'Confirms within ~144 blocks (about a day)', confTarget: 144 },
|
||||||
})
|
{ key: 'custom', label: 'Custom' },
|
||||||
watch(pastedInvoiceAmount, (fixed, prev) => {
|
]
|
||||||
if (fixed !== null) amount.value = fixed
|
|
||||||
// Swapping a fixed-amount invoice for a zero-amount one: don't silently
|
const feePreset = ref<OnchainFeePreset>('standard')
|
||||||
// keep the previous invoice's sats — make the user type the new amount.
|
const customConfTarget = ref<number | null>(null)
|
||||||
else if (prev !== null) amount.value = 0
|
const customSatPerVbyte = ref<number | null>(null)
|
||||||
|
// Resolved at review time so confirm + send use the same params.
|
||||||
|
const resolvedFeeParams = ref<{ target_conf?: number; sat_per_vbyte?: number }>({})
|
||||||
|
|
||||||
|
function onchainFeeParams(): { target_conf?: number; sat_per_vbyte?: number } | null {
|
||||||
|
if (feePreset.value !== 'custom') {
|
||||||
|
return { target_conf: onchainFeePresets.find(p => p.key === feePreset.value)?.confTarget ?? 6 }
|
||||||
|
}
|
||||||
|
const rate = customSatPerVbyte.value
|
||||||
|
const conf = customConfTarget.value
|
||||||
|
if (rate != null && rate !== 0) {
|
||||||
|
if (rate < 1 || rate > 5000) { error.value = 'Sats per vByte must be between 1 and 5000'; return null }
|
||||||
|
return { sat_per_vbyte: Math.floor(rate) }
|
||||||
|
}
|
||||||
|
if (conf != null && conf !== 0) {
|
||||||
|
if (conf < 1 || conf > 1008) { error.value = 'Target blocks must be between 1 and 1008'; return null }
|
||||||
|
return { target_conf: Math.floor(conf) }
|
||||||
|
}
|
||||||
|
error.value = 'Custom fee requires target blocks or sats per vByte'
|
||||||
|
return null
|
||||||
|
}
|
||||||
|
|
||||||
|
// Fee estimate for the confirm pane (best-effort — LND's own estimator).
|
||||||
|
const feeEstimate = ref<{ fee_sat: number; sat_per_vbyte: number } | null>(null)
|
||||||
|
const feeEstimateLoading = ref(false)
|
||||||
|
|
||||||
|
const feeEstimateLabel = computed(() => {
|
||||||
|
if (feeEstimate.value) {
|
||||||
|
return `~${feeEstimate.value.fee_sat.toLocaleString()} sats · ${feeEstimate.value.sat_per_vbyte} sat/vB`
|
||||||
|
}
|
||||||
|
if (resolvedFeeParams.value.sat_per_vbyte) {
|
||||||
|
return `${resolvedFeeParams.value.sat_per_vbyte} sat/vB (custom)`
|
||||||
|
}
|
||||||
|
if (feeEstimateLoading.value) return '…'
|
||||||
|
return isSweep.value ? 'deducted from swept amount' : 'estimated at broadcast'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
async function loadFeeEstimate() {
|
||||||
|
feeEstimate.value = null
|
||||||
|
// Explicit sat/vB shows as-is; sweeps have no fixed amount to estimate on.
|
||||||
|
if (resolvedFeeParams.value.sat_per_vbyte || isSweep.value) return
|
||||||
|
const addr = dest.value.trim()
|
||||||
|
const amt = confirmAmount.value
|
||||||
|
if (!addr || amt < 546) return
|
||||||
|
feeEstimateLoading.value = true
|
||||||
|
try {
|
||||||
|
const res = await rpcClient.call<{ fee_sat: number; sat_per_vbyte: number }>({
|
||||||
|
method: 'lnd.estimatefee',
|
||||||
|
params: { addr, amount: amt, target_conf: resolvedFeeParams.value.target_conf ?? 6 },
|
||||||
|
timeout: 10000,
|
||||||
|
})
|
||||||
|
if (res.fee_sat > 0) feeEstimate.value = res
|
||||||
|
} catch {
|
||||||
|
/* estimate is a preview — the label falls back to prose */
|
||||||
|
} finally {
|
||||||
|
feeEstimateLoading.value = false
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Clipboard read needs a secure context (or the companion bridge); hide the
|
// Clipboard read needs a secure context (or the companion bridge); hide the
|
||||||
// button where it can't work — the textarea still accepts a manual paste.
|
// button where it can't work — the textarea still accepts a manual paste.
|
||||||
const canReadClipboard = typeof navigator !== 'undefined' && !!navigator.clipboard?.readText
|
const canReadClipboard = typeof navigator !== 'undefined' && !!navigator.clipboard?.readText
|
||||||
@ -231,6 +442,25 @@ const effectiveMethod = computed(() => {
|
|||||||
return 'lightning'
|
return 'lightning'
|
||||||
})
|
})
|
||||||
|
|
||||||
|
// Invoice-first lightning UX: a pasted invoice that fixes its amount locks
|
||||||
|
// the amount field (auto-filled, "set by invoice"); zero-amount invoices
|
||||||
|
// leave it editable. Clearing/leaving lightning unlocks again.
|
||||||
|
// MUST come after effectiveMethod: watch() evaluates its source getter at
|
||||||
|
// setup, and reading a const still in its temporal dead zone crashed the
|
||||||
|
// whole modal at mount ("Cannot access 'R' before initialization").
|
||||||
|
const pastedInvoiceAmount = computed<number | null>(() => {
|
||||||
|
if (effectiveMethod.value !== 'lightning') return null
|
||||||
|
const d = dest.value.trim()
|
||||||
|
if (!d) return null
|
||||||
|
return parseBolt11AmountSats(d.toLowerCase().startsWith('lightning:') ? d.slice(10) : d)
|
||||||
|
})
|
||||||
|
watch(pastedInvoiceAmount, (fixed, prev) => {
|
||||||
|
if (fixed !== null) amount.value = fixed
|
||||||
|
// Swapping a fixed-amount invoice for a zero-amount one: don't silently
|
||||||
|
// keep the previous invoice's sats — make the user type the new amount.
|
||||||
|
else if (prev !== null) amount.value = 0
|
||||||
|
})
|
||||||
|
|
||||||
// --- Second-step confirmation (parity with the scan flow): review shows the
|
// --- Second-step confirmation (parity with the scan flow): review shows the
|
||||||
// --- balance reduction before anything is sent or any token is minted.
|
// --- balance reduction before anything is sent or any token is minted.
|
||||||
|
|
||||||
@ -309,20 +539,37 @@ function review() {
|
|||||||
if (!isSweep.value && confirmAmount.value <= 0 && invoiceAmountSats.value === null) {
|
if (!isSweep.value && confirmAmount.value <= 0 && invoiceAmountSats.value === null) {
|
||||||
error.value = t('sendBitcoin.amountSats'); return
|
error.value = t('sendBitcoin.amountSats'); return
|
||||||
}
|
}
|
||||||
|
if (method === 'onchain') {
|
||||||
|
const fee = onchainFeeParams()
|
||||||
|
if (!fee) return
|
||||||
|
resolvedFeeParams.value = fee
|
||||||
|
void loadFeeEstimate()
|
||||||
|
} else {
|
||||||
|
resolvedFeeParams.value = {}
|
||||||
|
feeEstimate.value = null
|
||||||
|
}
|
||||||
void loadConfirmBalance()
|
void loadConfirmBalance()
|
||||||
confirming.value = true
|
confirming.value = true
|
||||||
}
|
}
|
||||||
|
|
||||||
function close() {
|
function close() {
|
||||||
error.value = ''
|
error.value = ''
|
||||||
resultTxid.value = ''
|
|
||||||
resultHash.value = ''
|
|
||||||
resultArk.value = ''
|
|
||||||
ecashToken.value = ''
|
ecashToken.value = ''
|
||||||
confirming.value = false
|
confirming.value = false
|
||||||
|
successInfo.value = null
|
||||||
emit('close')
|
emit('close')
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/** Reset the form for a fresh payment straight from the success screen. */
|
||||||
|
function sendAnother() {
|
||||||
|
successInfo.value = null
|
||||||
|
confirming.value = false
|
||||||
|
dest.value = ''
|
||||||
|
amount.value = 0
|
||||||
|
sendAll.value = false
|
||||||
|
error.value = ''
|
||||||
|
}
|
||||||
|
|
||||||
function copyText(text: string) {
|
function copyText(text: string) {
|
||||||
navigator.clipboard.writeText(text).catch(() => {})
|
navigator.clipboard.writeText(text).catch(() => {})
|
||||||
}
|
}
|
||||||
@ -345,11 +592,9 @@ async function send() {
|
|||||||
processing.value = true
|
processing.value = true
|
||||||
error.value = ''
|
error.value = ''
|
||||||
ecashToken.value = ''
|
ecashToken.value = ''
|
||||||
resultTxid.value = ''
|
|
||||||
resultHash.value = ''
|
|
||||||
resultArk.value = ''
|
|
||||||
|
|
||||||
const method = effectiveMethod.value
|
const method = effectiveMethod.value
|
||||||
|
const paidAmount = confirmAmount.value
|
||||||
try {
|
try {
|
||||||
if (method === 'ark') {
|
if (method === 'ark') {
|
||||||
if (!dest.value.trim()) { error.value = 'Enter an Ark address, invoice or lightning address'; return }
|
if (!dest.value.trim()) { error.value = 'Enter an Ark address, invoice or lightning address'; return }
|
||||||
@ -359,7 +604,7 @@ async function send() {
|
|||||||
// Ark sends can wait on round participation.
|
// Ark sends can wait on round participation.
|
||||||
timeout: 130000,
|
timeout: 130000,
|
||||||
})
|
})
|
||||||
resultArk.value = `Sent ${amount.value.toLocaleString()} sats via Ark`
|
successInfo.value = { amount: paidAmount, methodLabel: 'Sent via Ark', note: 'The transfer settles with the next Ark round.' }
|
||||||
} else if (method === 'ecash') {
|
} else if (method === 'ecash') {
|
||||||
const res = await rpcClient.call<{ token: string }>({
|
const res = await rpcClient.call<{ token: string }>({
|
||||||
method: 'wallet.ecash-send',
|
method: 'wallet.ecash-send',
|
||||||
@ -375,23 +620,38 @@ async function send() {
|
|||||||
ecashToken.value = res.token
|
ecashToken.value = res.token
|
||||||
} else if (method === 'lightning') {
|
} else if (method === 'lightning') {
|
||||||
if (!dest.value.trim()) { error.value = t('web5.pasteInvoice'); return }
|
if (!dest.value.trim()) { error.value = t('web5.pasteInvoice'); return }
|
||||||
const res = await rpcClient.call<{ payment_hash: string }>({
|
// Waits out slow multi-hop routing and only reports failure when LND
|
||||||
method: 'lnd.payinvoice',
|
// itself declares the payment failed — never on a timeout.
|
||||||
params: { payment_request: dest.value.trim() },
|
const res = await rpcClient.payLightningInvoice({ payment_request: dest.value.trim() })
|
||||||
})
|
if (res.status === 'failed') {
|
||||||
resultHash.value = res.payment_hash
|
error.value = res.failure_reason || t('web5.sendFailed')
|
||||||
|
return
|
||||||
|
}
|
||||||
|
successInfo.value = {
|
||||||
|
amount: paidAmount,
|
||||||
|
methodLabel: res.status === 'pending' ? 'Payment in flight' : 'Paid over Lightning',
|
||||||
|
hash: res.payment_hash || undefined,
|
||||||
|
...(res.status === 'pending'
|
||||||
|
? { note: 'This payment is taking longer than usual to settle. It will appear in your transactions once it completes.' }
|
||||||
|
: {}),
|
||||||
|
}
|
||||||
} else {
|
} else {
|
||||||
if (!dest.value.trim()) { error.value = t('web5.enterBitcoinAddress'); return }
|
if (!dest.value.trim()) { error.value = t('web5.enterBitcoinAddress'); return }
|
||||||
const res = await rpcClient.call<{ txid: string }>({
|
const res = await rpcClient.call<{ txid: string }>({
|
||||||
method: 'lnd.sendcoins',
|
method: 'lnd.sendcoins',
|
||||||
params: isSweep.value
|
params: isSweep.value
|
||||||
? { addr: dest.value.trim(), send_all: true }
|
? { addr: dest.value.trim(), send_all: true, ...resolvedFeeParams.value }
|
||||||
: { addr: dest.value.trim(), amount: amount.value },
|
: { addr: dest.value.trim(), amount: amount.value, ...resolvedFeeParams.value },
|
||||||
})
|
})
|
||||||
resultTxid.value = res.txid
|
successInfo.value = {
|
||||||
|
amount: paidAmount,
|
||||||
|
methodLabel: isSweep.value ? 'Swept on-chain' : 'Sent on-chain',
|
||||||
|
txid: res.txid,
|
||||||
|
note: 'On-chain payments confirm over the next blocks.',
|
||||||
|
}
|
||||||
}
|
}
|
||||||
emit('sent')
|
emit('sent')
|
||||||
// Back to the form pane so the success/token panes are visible.
|
// Success pane (or the token pane for ecash mints) takes over the modal.
|
||||||
confirming.value = false
|
confirming.value = false
|
||||||
} catch (err: unknown) {
|
} catch (err: unknown) {
|
||||||
error.value = err instanceof Error ? err.message : t('web5.sendFailed')
|
error.value = err instanceof Error ? err.message : t('web5.sendFailed')
|
||||||
@ -400,3 +660,59 @@ async function send() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
|
<style scoped>
|
||||||
|
/* Success burst — pop-in check inside radiating rings, wallet palette
|
||||||
|
(emerald for the settled payment, one Archipelago-orange ring). */
|
||||||
|
.send-success-burst {
|
||||||
|
position: relative;
|
||||||
|
width: 7rem;
|
||||||
|
height: 7rem;
|
||||||
|
}
|
||||||
|
.burst-core {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
display: flex;
|
||||||
|
align-items: center;
|
||||||
|
justify-content: center;
|
||||||
|
border-radius: 9999px;
|
||||||
|
background: rgba(16, 185, 129, 0.12);
|
||||||
|
box-shadow: 0 0 48px rgba(16, 185, 129, 0.3);
|
||||||
|
animation: burst-pop 0.5s cubic-bezier(0.175, 0.885, 0.32, 1.4) both;
|
||||||
|
}
|
||||||
|
.burst-check {
|
||||||
|
stroke-dasharray: 32;
|
||||||
|
stroke-dashoffset: 32;
|
||||||
|
animation: burst-draw 0.45s ease-out 0.25s forwards;
|
||||||
|
}
|
||||||
|
.burst-ring {
|
||||||
|
position: absolute;
|
||||||
|
inset: 0;
|
||||||
|
border-radius: 9999px;
|
||||||
|
border: 2px solid rgba(16, 185, 129, 0.45);
|
||||||
|
animation: burst-ripple 1.8s ease-out infinite;
|
||||||
|
}
|
||||||
|
.burst-ring-2 {
|
||||||
|
animation-delay: 0.45s;
|
||||||
|
}
|
||||||
|
.burst-ring-3 {
|
||||||
|
animation-delay: 0.9s;
|
||||||
|
border-color: rgba(249, 115, 22, 0.35);
|
||||||
|
}
|
||||||
|
@keyframes burst-pop {
|
||||||
|
from { transform: scale(0.3); opacity: 0; }
|
||||||
|
to { transform: scale(1); opacity: 1; }
|
||||||
|
}
|
||||||
|
@keyframes burst-draw {
|
||||||
|
to { stroke-dashoffset: 0; }
|
||||||
|
}
|
||||||
|
@keyframes burst-ripple {
|
||||||
|
0% { transform: scale(0.7); opacity: 0.9; }
|
||||||
|
100% { transform: scale(2); opacity: 0; }
|
||||||
|
}
|
||||||
|
@media (prefers-reduced-motion: reduce) {
|
||||||
|
.burst-core, .burst-check, .burst-ring { animation: none; }
|
||||||
|
.burst-check { stroke-dashoffset: 0; }
|
||||||
|
.burst-ring { display: none; }
|
||||||
|
}
|
||||||
|
</style>
|
||||||
|
|||||||
@ -701,16 +701,17 @@ async function confirmSend() {
|
|||||||
error.value = ''
|
error.value = ''
|
||||||
try {
|
try {
|
||||||
if (action.value === 'pay-invoice') {
|
if (action.value === 'pay-invoice') {
|
||||||
const params: Record<string, unknown> = { payment_request: dest.value }
|
const params: { payment_request: string; amount_sats?: number } = { payment_request: dest.value }
|
||||||
if (!amountLocked.value && effectiveAmount.value > 0) params.amount_sats = effectiveAmount.value
|
if (!amountLocked.value && effectiveAmount.value > 0) params.amount_sats = effectiveAmount.value
|
||||||
const res = await rpcClient.call<{ payment_hash: string; amount_sats: number }>({
|
// Waits out slow multi-hop routing and only reports failure when LND
|
||||||
method: 'lnd.payinvoice',
|
// itself declares the payment failed — never on a timeout.
|
||||||
params,
|
const res = await rpcClient.payLightningInvoice(params)
|
||||||
timeout: 60000,
|
if (res.status === 'failed') throw new Error(res.failure_reason || 'Payment failed')
|
||||||
})
|
|
||||||
successAmount.value = res.amount_sats || effectiveAmount.value
|
successAmount.value = res.amount_sats || effectiveAmount.value
|
||||||
successVerb.value = 'PAID'
|
successVerb.value = res.status === 'pending' ? 'SENDING' : 'PAID'
|
||||||
successDetail.value = 'Lightning invoice paid'
|
successDetail.value = res.status === 'pending'
|
||||||
|
? 'Payment in flight — it will appear in your transactions once it settles'
|
||||||
|
: 'Lightning invoice paid'
|
||||||
successRef.value = res.payment_hash
|
successRef.value = res.payment_hash
|
||||||
} else if (action.value === 'send-onchain') {
|
} else if (action.value === 'send-onchain') {
|
||||||
const res = await rpcClient.call<{ txid: string }>({
|
const res = await rpcClient.call<{ txid: string }>({
|
||||||
|
|||||||
@ -415,6 +415,7 @@
|
|||||||
"totalEarned": "Total Earned",
|
"totalEarned": "Total Earned",
|
||||||
"monthlyAvg": "Monthly Avg",
|
"monthlyAvg": "Monthly Avg",
|
||||||
"ecashBalance": "Ecash Balance",
|
"ecashBalance": "Ecash Balance",
|
||||||
|
"totalBitcoin": "Total Bitcoin",
|
||||||
"onChain": "On-chain",
|
"onChain": "On-chain",
|
||||||
"lightning": "Lightning",
|
"lightning": "Lightning",
|
||||||
"ecash": "Ecash",
|
"ecash": "Ecash",
|
||||||
|
|||||||
@ -413,6 +413,7 @@
|
|||||||
"totalEarned": "Total ganado",
|
"totalEarned": "Total ganado",
|
||||||
"monthlyAvg": "Promedio mensual",
|
"monthlyAvg": "Promedio mensual",
|
||||||
"ecashBalance": "Saldo Ecash",
|
"ecashBalance": "Saldo Ecash",
|
||||||
|
"totalBitcoin": "Bitcoin total",
|
||||||
"onChain": "On-chain",
|
"onChain": "On-chain",
|
||||||
"lightning": "Lightning",
|
"lightning": "Lightning",
|
||||||
"ecash": "Ecash",
|
"ecash": "Ecash",
|
||||||
|
|||||||
21
neode-ui/src/utils/seedqr.ts
Normal file
21
neode-ui/src/utils/seedqr.ts
Normal file
@ -0,0 +1,21 @@
|
|||||||
|
/**
|
||||||
|
* SeedQR encoding (SeedSigner standard, supported by Passport/Passport Prime,
|
||||||
|
* SeedSigner, Keystone, Nunchuk, Sparrow, …): each BIP39 word becomes its
|
||||||
|
* zero-padded 4-digit wordlist index (0000–2047), concatenated into one
|
||||||
|
* digit stream and rendered as a numeric-mode QR. A 24-word seed is 96
|
||||||
|
* digits. Spec: github.com/SeedSigner/seedsigner/blob/main/docs/seed_qr
|
||||||
|
*
|
||||||
|
* Only valid for real BIP39 mnemonics — LND's aezeed shares the wordlist but
|
||||||
|
* is NOT BIP39, and hardware wallets cannot import it; never SeedQR-encode it.
|
||||||
|
*/
|
||||||
|
export async function toSeedQrDigits(words: string[]): Promise<string | null> {
|
||||||
|
if (words.length === 0) return null
|
||||||
|
const { wordlist } = await import('@scure/bip39/wordlists/english.js')
|
||||||
|
const digits: string[] = []
|
||||||
|
for (const raw of words) {
|
||||||
|
const idx = wordlist.indexOf(raw.trim().toLowerCase())
|
||||||
|
if (idx < 0) return null // not a BIP39 word — caller falls back to text
|
||||||
|
digits.push(idx.toString().padStart(4, '0'))
|
||||||
|
}
|
||||||
|
return digits.join('')
|
||||||
|
}
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Loading…
x
Reference in New Issue
Block a user