Fix Tauri builds: navigate API, unused imports, build config

This commit is contained in:
Brandon Schneider 2026-05-04 19:21:57 -05:00
parent 670b3601bb
commit 8ef651131d
7 changed files with 260 additions and 10 deletions

View file

@ -3,7 +3,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::{Manager, WebviewUrl};
use tauri::Manager;
#[tokio::main(flavor = "multi_thread", worker_threads = 4)]
async fn main() {
@ -23,9 +23,7 @@ async fn main() {
});
let window = app.get_webview_window("main").unwrap();
window.navigate(WebviewUrl::External(
"https://linear.app".parse().unwrap(),
));
window.navigate("https://linear.app".parse().unwrap());
Ok(())
})
.run(tauri::generate_context!())

View file

@ -5,7 +5,9 @@
"identifier": "com.allaunthefox.linear-native",
"build": {
"frontendDist": "./",
"devUrl": "https://linear.app"
"devUrl": "https://linear.app",
"beforeBuildCommand": "",
"beforeDevCommand": ""
},
"app": {
"withGlobalTauri": false,

View file

@ -3,7 +3,7 @@
#![cfg_attr(not(debug_assertions), windows_subsystem = "windows")]
use tauri::{Manager, WebviewUrl};
use tauri::Manager;
#[tokio::main(flavor = "multi_thread", worker_threads = 4)]
async fn main() {
@ -23,9 +23,7 @@ async fn main() {
});
let window = app.get_webview_window("main").unwrap();
window.navigate(WebviewUrl::External(
"https://www.notion.so".parse().unwrap(),
));
window.navigate("https://www.notion.so".parse().unwrap());
Ok(())
})
.run(tauri::generate_context!())

View file

@ -5,7 +5,9 @@
"identifier": "com.allaunthefox.notion-native",
"build": {
"frontendDist": "./",
"devUrl": "https://www.notion.so"
"devUrl": "https://www.notion.so",
"beforeBuildCommand": "",
"beforeDevCommand": ""
},
"app": {
"withGlobalTauri": false,

120
scripts/clean-tailscale-refs.sh Executable file
View file

@ -0,0 +1,120 @@
#!/usr/bin/env bash
set -euo pipefail
# clean-tailscale-refs.sh
# Removes stale Tailscale node references from the repo.
# Run this AFTER clearing the tailnet.
REPO_ROOT="/home/allaun/CascadeProjects/Research-Stack"
cd "$REPO_ROOT"
echo "=========================================="
echo " Clean Tailscale References"
echo "=========================================="
echo ""
# --- 1. Backup .git/config ---
if [[ -f .git/config ]]; then
cp .git/config .git/config.backup.$(date +%Y%m%d_%H%M%S)
echo "[1/6] Backed up .git/config"
fi
# --- 2. Remove Tailscale LFS entries from .git/config ---
# These point to old nodes that no longer exist on the tailnet.
echo "[2/6] Removing Tailscale LFS entries from .git/config..."
git config --local --remove-section 'lfs.https://100.111.192.47/home/judge-gcp-20260330/git-mirrors/research-stack.git/info/lfs' 2>/dev/null || true
git config --local --remove-section 'lfs.https://100.85.1.50/var/git-mirrors/research-stack.git/info/lfs' 2>/dev/null || true
git config --local --remove-section 'lfs.https://100.103.54.58/home/svc-tardy/git-mirrors/research-stack.git/info/lfs' 2>/dev/null || true
git config --local --remove-section 'lfs.http://100.127.111.7:3000/sovereign/research-stack.git/info/lfs' 2>/dev/null || true
# --- 3. Remove i2p aliases from .git/config ---
echo "[3/6] Removing i2p aliases from .git/config..."
git config --local --remove-section 'alias' 2>/dev/null || true
# --- 4. Remove forgejo branch merge-base refs from .git/config ---
echo "[4/6] Removing stale forgejo branch merge-base refs..."
python3 << 'PYEOF'
import re
with open('.git/config', 'r') as f:
content = f.read()
# Remove any vscode-merge-base line that references forgejo
lines = content.splitlines()
filtered = []
for line in lines:
if 'vscode-merge-base' in line and 'forgejo' in line:
continue
filtered.append(line)
new_content = '\n'.join(filtered) + '\n'
# Also remove forgejo remote section if it exists (it shouldn't, but just in case)
new_content = re.sub(
r'\[remote "forgejo"\][^\[]*',
'',
new_content
)
with open('.git/config', 'w') as f:
f.write(new_content)
PYEOF
# --- 5. Update .claude/settings.local.json ---
# Remove Bash permissions that reference old tailscale IPs or node names.
echo "[5/6] Cleaning .claude/settings.local.json..."
python3 << 'PYEOF'
import json
with open('.claude/settings.local.json', 'r') as f:
data = json.load(f)
old_perms = data.get('permissions', {}).get('allow', [])
new_perms = []
skip_patterns = [
'100.111.192.47',
'100.110.117.19',
'100.127.111.7',
'architect',
'netcup',
'judge',
]
for p in old_perms:
if any(sp in p for sp in skip_patterns):
continue
new_perms.append(p)
data['permissions']['allow'] = new_perms
with open('.claude/settings.local.json', 'w') as f:
json.dump(data, f, indent=2)
f.write('\n')
PYEOF
# --- 6. Update code files ---
echo "[6/6] Updating code files..."
# 5-Applications/scripts/server.js — comment out architect ping
if [[ -f 5-Applications/scripts/server.js ]]; then
sed -i 's|exec("ping -c 1 -W 2 100.127.111.7"|// exec("ping -c 1 -W 2 100.127.111.7" // STALE: architect node removed|g' 5-Applications/scripts/server.js 2>/dev/null || true
fi
# 5-Applications/scripts/all_device_signal_topology.py — update qfox reference
if [[ -f 5-Applications/scripts/all_device_signal_topology.py ]]; then
sed -i 's|"network_node_qfox"|"network_node_primary"|g' 5-Applications/scripts/all_device_signal_topology.py 2>/dev/null || true
sed -i 's|Network Node (qfox - primary node)|Network Node (Node-00001 - primary node)|g' 5-Applications/scripts/all_device_signal_topology.py 2>/dev/null || true
fi
echo ""
echo "=========================================="
echo "Done. Stale references cleaned."
echo ""
echo "Review changes with:"
echo " git diff .git/config"
echo " git diff .claude/settings.local.json"
echo " git diff 5-Applications/scripts/"
echo ""
echo "If satisfied, commit with:"
echo " git add -A && git commit -m 'chore: remove stale tailscale node references'"

View file

@ -0,0 +1,72 @@
#!/usr/bin/env bash
set -euo pipefail
# remove-tailnet-nodes-api.sh
# Batch-removes all old Tailscale nodes via API.
# Usage: ./scripts/remove-tailnet-nodes-api.sh <TS_API_KEY>
API_KEY="${1:-}"
if [[ -z "$API_KEY" ]]; then
echo "Usage: $0 <TS_API_KEY>"
echo "Get your API key at: https://login.tailscale.com/admin/settings/keys"
exit 1
fi
TAILNET=$(tailscale status --json 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('MagicDNSSuffix','unknown'))")
if [[ "$TAILNET" == "unknown" ]]; then
echo "Could not determine tailnet. Are you logged into Tailscale?"
exit 1
fi
# Nodes to remove (all except Node-00001 which is the current re-authed node)
OLD_NODES=(
"architect"
"desktop-0u2ceal"
"foxtop"
"ip-172-31-25-81"
"judge"
"laptop-1"
"netcup-router"
"racknerd-510bd9c"
"racknerd-atl"
"qfox"
"QFox"
)
echo "Tailnet: $TAILNET"
echo "Removing old nodes via API..."
echo ""
# Fetch all devices
DEVICES_JSON=$(curl -sS \
-H "Authorization: Bearer $API_KEY" \
"https://api.tailscale.com/api/v2/tailnet/-/devices")
# Extract device IDs for old nodes
for node in "${OLD_NODES[@]}"; do
DEVICE_ID=$(echo "$DEVICES_JSON" | python3 -c "
import sys, json
devices = json.load(sys.stdin).get('devices', [])
for d in devices:
if d.get('name', '').split('.')[0] == '$node':
print(d.get('id'))
break
")
if [[ -n "$DEVICE_ID" ]]; then
echo "Removing $node (ID: $DEVICE_ID)..."
HTTP_STATUS=$(curl -sS -o /dev/null -w "%{http_code}" \
-X DELETE \
-H "Authorization: Bearer $API_KEY" \
"https://api.tailscale.com/api/v2/device/$DEVICE_ID")
if [[ "$HTTP_STATUS" == "200" || "$HTTP_STATUS" == "204" ]]; then
echo " OK (HTTP $HTTP_STATUS)"
else
echo " FAILED (HTTP $HTTP_STATUS)"
fi
else
echo "$node: not found (already removed?)"
fi
done
echo ""
echo "Done. Verify at: https://login.tailscale.com/admin/machines"

58
scripts/reset-tailnet.sh Executable file
View file

@ -0,0 +1,58 @@
#!/usr/bin/env bash
set -euo pipefail
# reset-tailnet.sh
# Clears all Tailscale nodes and re-authenticates current node as Node-00001
CURRENT_HOSTNAME=$(tailscale status --json 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('Self',{}).get('HostName','unknown'))")
TAILNET=$(tailscale status --json 2>/dev/null | python3 -c "import sys,json; print(json.load(sys.stdin).get('MagicDNSSuffix','unknown'))")
echo "=========================================="
echo " Tailnet Reset Tool"
echo "=========================================="
echo "Current node: $CURRENT_HOSTNAME"
echo "Tailnet: $TAILNET"
echo ""
# Step 1: Logout current node
echo "[1/2] Logging out current node ($CURRENT_HOSTNAME)..."
sudo tailscale logout
echo "Done. Node removed from tailnet."
echo ""
# Step 2: Re-auth as Node-00001
echo "[2/2] Re-authenticating as Node-00001..."
echo "You will see an auth URL. Open it in your browser to complete login."
echo ""
sudo tailscale up --hostname=Node-00001 --ssh --accept-routes
echo ""
echo "=========================================="
echo "Current node re-authenticated as Node-00001"
echo ""
tailscale status
echo ""
echo "=========================================="
echo "NEXT STEPS: Remove remaining nodes"
echo "=========================================="
echo ""
echo "The other 9 nodes must be removed via the Tailscale admin console"
echo "or API since they are not reachable from this machine."
echo ""
echo "Option A: Manual removal (recommended)"
echo " 1. Go to: https://login.tailscale.com/admin/machines"
echo " 2. Select each old node and click 'Remove...'"
echo " 3. Old nodes: architect, desktop-0u2ceal, foxtop, ip-172-31-25-81,"
echo " judge, laptop-1, netcup-router, racknerd-510bd9c, racknerd-atl"
echo ""
echo "Option B: API removal (batch)"
echo " 1. Get an API key: https://login.tailscale.com/admin/settings/keys"
echo " 2. Run: ./scripts/remove-tailnet-nodes-api.sh <YOUR_API_KEY>"
echo ""
echo "Option C: SSH into active nodes and logout"
echo " ssh judge 'sudo tailscale logout'"
echo " ssh netcup-router 'sudo tailscale logout'"
echo " ssh ip-172-31-25-81 'sudo tailscale logout'"
echo ""
echo "After clearing all nodes, run: ./scripts/clean-tailscale-refs.sh"
echo "to remove stale Tailscale references from this repo."