updated radicle

This commit is contained in:
Mark Randall Havens 2025-05-31 01:25:49 -05:00
parent 3a40577af9
commit bb60ad27f4
3 changed files with 102 additions and 227 deletions

View file

@ -1,68 +1,22 @@
# 🔗 Radicle Repository Link
# 🔗 Radicle Project Link Metadata
- **Project Name**: `git-sigil`
- **Project ID**: ``
- **Peer ID**: ``
- **Local Repo Path**: `/root/fieldcraft/git-sigil`
- **Default Branch**: `master`
- **Timestamp**: `2025-05-31 01:09:13`
- **Public Gateway URL**: [https://app.radicle.network/](https://app.radicle.network/)
- **Public Seed Node**: `kairos-seed.thefoldwithin.earth`
**Project:** git-sigil
**Peer ID:**
**Project ID:**
---
## 🌐 Gateway Access URLs
- Garden: https://app.radicle.xyz/nodes/seed.radicle.garden/rad:
- Kairos: https://app.radicle.xyz/nodes/kairos-seed.thefoldwithin.earth/rad:
- Raw: https://app.radicle.network/
## 📦 Commit Info
## 🔍 Commit Metadata
- Commit: 3a40577af93415f0620863d77f80114c807f2b1b
- Branch: master
- Timestamp: 2025-05-31T01:19:28-05:00
- SHA256 (tree): 81803a250d4cff50e5eb7cdd474278975c6ae0b1
- **Last Commit SHA**: `9ca959ba0bce6c6b5c03b39871dd90d3476b8b8e`
- **Commit Message**: `revised radicle to add public server`
- **Commit Author**: `Mark Randall Havens <mark.r.havens@gmail.com>`
- **Commit Date**: `Sat May 31 01:08:56 2025 -0500`
---
## 📊 Repo Status
- **Total Commits**: `53`
- **Tracked Files**: `34`
- **Uncommitted Changes**: `Yes`
- **Latest Tag**: `None`
---
## 🧽 Environment
- **Host Machine**: `samson`
- **Current User**: `root`
- **Time Zone**: `CDT`
- **Script Version**: `v1.2`
---
## 🧬 Hardware & OS Fingerprint
- **OS Name**: `Linux`
- **OS Version**: `Ubuntu 24.04.1 LTS`
- **Kernel Version**: `6.6.87.1-microsoft-standard-WSL2`
- **Architecture**: `x86_64`
- **Running in Docker**: `No`
- **Running in WSL**: `Yes`
- **Virtual Machine**: `wsl`
- **System Uptime**: `up 2 days, 6 hours, 30 minutes`
- **MAC Address**: `00:15:5d:57:40:f0`
- **Local IP**: `172.28.107.95`
- **CPU Model**: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz`
- **Total RAM (GB)**: `23.44`
---
## 🌐 Radicle Network Info
- **Connected Servers**:
```
Unavailable
```
- **Public Gateway URL**: [https://app.radicle.network/](https://app.radicle.network/)
---
_Auto-generated by `gitfield-radicle` push script._
## 💻 Platform Metadata
- User: root
- Hostname: samson
- OS: Linux samson 6.6.87.1-microsoft-standard-WSL2 #1 SMP PREEMPT_DYNAMIC Mon Apr 21 17:08:54 UTC 2025 x86_64 x86_64 x86_64 GNU/Linux
- Working Dir: /root/fieldcraft/git-sigil

View file

@ -1 +1 @@
a5fca5dba4f1050e8f6778e6e1aa7c862a7dbbd7
3a40577af93415f0620863d77f80114c807f2b1b

View file

@ -1,179 +1,100 @@
#!/bin/bash
set -euo pipefail
IFS=$'\n\t'
# ╭───────────────────────────────╮
# │ Config & Paths │
# ╰───────────────────────────────╯
PROJECT_NAME=$(basename "$(pwd)")
DEFAULT_NAME="Mark Randall Havens"
DEFAULT_EMAIL="mark.r.havens@gmail.com"
# ── Configuration ────────────────────────────────────────────────
REPO_NAME="git-sigil"
REMOTE_LABEL="radicle"
WORKING_DIR="$(pwd)"
METADATA_FILE=".radicle-link.md"
SCRIPT_VERSION="v1.0"
RAD_HOME="$HOME/.radicle"
RAD_BIN="$RAD_HOME/bin/rad"
RAD_KEYS="$RAD_HOME/keys.json"
RAD_BACKUP=".radicle-backup/keys.json"
RAD_PATH_LINE='export PATH="$HOME/.radicle/bin:$PATH"'
PROFILE_FILE="$HOME/.bashrc"
PUSH_STATE_FILE=".radicle-push-state"
RAD_SEED="kairos-seed.thefoldwithin.earth"
# ── Step 1: Detect Environment ───────────────────────────────────
USER_NAME="$(whoami)"
HOST_NAME="$(hostname)"
OS_INFO="$(uname -a)"
IS_WSL=$(grep -i microsoft /proc/version &>/dev/null && echo "Yes" || echo "No")
IS_DOCKER=$(grep -qa 'docker' /proc/1/cgroup && echo "Yes" || echo "No")
ARCHITECTURE="$(uname -m)"
IP_ADDR=$(hostname -I | awk '{print $1}')
MAC_ADDR=$(ip link | awk '/ether/ {print $2}' | head -n 1)
UPTIME="$(uptime -p | sed 's/up //')"
CPU_MODEL=$(lscpu | grep 'Model name' | sed 's/Model name:[ \t]*//')
TOTAL_RAM=$(free -g | awk '/^Mem:/ {print $2}')
# ╭───────────────────────────────╮
# │ Logging Utils │
# ╰───────────────────────────────╯
info() { echo -e "\e[1;34m[INFO]\e[0m $*"; }
warn() { echo -e "\e[1;33m[WARN]\e[0m $*"; }
error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; }
# ── Step 2: Initialize & Push ────────────────────────────────────
rad init --name "$REPO_NAME" --description "Radicle link for $REPO_NAME"
rad push
# ╭───────────────────────────────╮
# │ Git + Tools Precheck │
# ╰───────────────────────────────╯
info "Checking Git..."
command -v git >/dev/null || {
info "Installing Git..."
sudo apt update && sudo apt install -y git || error "Failed to install Git"
}
info "Git version: $(git --version)"
PROJECT_ID=$(rad self | grep "Project ID" | awk '{print $NF}')
PEER_ID=$(rad self | grep "Peer ID" | awk '{print $NF}')
COMMIT_SHA=$(git rev-parse HEAD)
TREE_SHA=$(git rev-parse HEAD^{tree})
TIMESTAMP=$(date -Is)
NAME=$(git config --global user.name || true)
EMAIL=$(git config --global user.email || true)
[[ -z "$NAME" || -z "$EMAIL" ]] && {
info "Setting Git identity..."
git config --global user.name "$DEFAULT_NAME"
git config --global user.email "$DEFAULT_EMAIL"
}
info "Git identity: $(git config --global user.name) <$(git config --global user.email)>"
# ── Step 3: Add Custom Seed Node ─────────────────────────────────
rad node config set seeds "[\"kairos-seed.thefoldwithin.earth:8776\"]"
# ╭───────────────────────────────╮
# │ Radicle CLI Setup │
# ╰───────────────────────────────╯
if [ ! -x "$RAD_BIN" ]; then
info "Installing Radicle CLI..."
sudo apt install -y curl jq unzip || error "Missing dependencies"
curl -sSf https://radicle.xyz/install | sh || error "Radicle install failed"
fi
# ── Step 4: Form Gateway URLs ────────────────────────────────────
GARDEN_URL="https://app.radicle.xyz/nodes/seed.radicle.garden/rad:${PROJECT_ID}"
KAIROS_URL="https://app.radicle.xyz/nodes/kairos-seed.thefoldwithin.earth/rad:${PROJECT_ID}"
RAW_URL="https://app.radicle.network/rad:${PROJECT_ID}"
export PATH="$HOME/.radicle/bin:$PATH"
if ! grep -Fxq "$RAD_PATH_LINE" "$PROFILE_FILE"; then
echo "$RAD_PATH_LINE" >> "$PROFILE_FILE"
info "→ Added PATH to $PROFILE_FILE"
warn "→ Run 'source $PROFILE_FILE' to make Radicle CLI persistent"
fi
command -v rad >/dev/null || error "Radicle CLI still unavailable. Try restarting terminal."
info "Radicle CLI ready: $(rad --version)"
# ╭────────────────────────────────────────────────────╮
# │ Restore or Create Radicle Identity & Backup │
# ╰────────────────────────────────────────────────────╯
mkdir -p "$(dirname "$RAD_BACKUP")"
if [ ! -f "$RAD_KEYS" ]; then
if [ -f "$RAD_BACKUP" ]; then
info "Restoring Radicle identity from backup..."
cp "$RAD_BACKUP" "$RAD_KEYS" || error "Failed to restore identity"
else
info "Creating new Radicle identity..."
rad auth || error "Identity creation failed"
cp "$RAD_KEYS" "$RAD_BACKUP" || warn "Backup of identity failed"
fi
else
info "Radicle identity already exists."
fi
# ╭───────────────────────────────╮
# │ Add Custom Seed Node Config │
# ╰───────────────────────────────╯
rad node config set seeds ["$RAD_SEED"] || warn "Failed to set seed node"
info "Added seed node to config: $RAD_SEED"
# ╭───────────────────────────────╮
# │ Start Rad Node │
# ╰───────────────────────────────╯
pgrep -f "rad node start" >/dev/null || {
info "Starting Radicle node..."
nohup rad node start > /dev/null 2>&1 &
sleep 3
}
# ╭───────────────────────────────╮
# │ Git Repo Initialization │
# ╰───────────────────────────────╯
if [ ! -d .git ]; then
git init
git add . || warn "Nothing to add"
git commit -m "Initial commit" || warn "Nothing to commit"
else
info "Git repo already initialized."
fi
# ╭───────────────────────────────╮
# │ Radicle Project Registration│
# ╰───────────────────────────────╯
if ! rad projects | grep -q "$PROJECT_NAME"; then
info "Registering Radicle project '$PROJECT_NAME'..."
rad init --name "$PROJECT_NAME" --description "Radicle sovereign repo for $PROJECT_NAME" || warn "Repo may already exist"
else
info "Project '$PROJECT_NAME' already registered."
fi
# ╭───────────────────────────────╮
# │ Push Current Commit Logic │
# ╰───────────────────────────────╯
CURRENT_BRANCH=$(git symbolic-ref --short HEAD)
CURRENT_COMMIT=$(git rev-parse HEAD)
LAST_PUSHED_COMMIT=$(cat "$PUSH_STATE_FILE" 2>/dev/null || echo "none")
if [[ "$CURRENT_COMMIT" == "$LAST_PUSHED_COMMIT" ]]; then
info "✓ Already pushed commit: $CURRENT_COMMIT"
else
info "Pushing commit '$CURRENT_COMMIT' on branch '$CURRENT_BRANCH'..."
if git push rad "$CURRENT_BRANCH"; then
echo "$CURRENT_COMMIT" > "$PUSH_STATE_FILE"
info "✓ Pushed to Radicle successfully"
else
warn "Push may have failed — check 'rad sync status'"
fi
fi
# ╭───────────────────────────────╮
# │ Final Output Block │
# ╰───────────────────────────────╯
PROJECT_ID=$(rad self | grep 'Project ID' | awk '{print $NF}' || true)
PEER_ID=$(rad self | grep 'Peer ID' | awk '{print $NF}' || true)
[[ -n "$PROJECT_ID" ]] && info "✓ Project ID: $PROJECT_ID"
[[ -n "$PEER_ID" ]] && info "→ Peer ID: $PEER_ID (Share to connect)"
info "🌐 Gateway Access URLs:"
echo "→ Garden Gateway: https://app.radicle.xyz/nodes/seed.radicle.garden/rad:$PROJECT_ID"
echo "→ Kairos Gateway: https://app.radicle.xyz/nodes/$RAD_SEED/rad:$PROJECT_ID"
echo "→ Raw Gateway: https://app.radicle.network/$PROJECT_ID"
# ╭───────────────────────────────╮
# │ Metadata Markdown │
# ╰───────────────────────────────╯
cat <<EOF > .radicle-link.md
# ── Step 5: Write Metadata ───────────────────────────────────────
cat > "$METADATA_FILE" <<EOF
# 🔗 Radicle Project Link Metadata
**Project:** $PROJECT_NAME
**Peer ID:** $PEER_ID
**Project ID:** $PROJECT_ID
- **Repo Name**: \`$REPO_NAME\`
- **Peer ID**: \`$PEER_ID\`
- **Project ID**: \`$PROJECT_ID\`
- **Local Path**: \`$WORKING_DIR\`
- **Remote Label**: \`$REMOTE_LABEL\`
- **Default Branch**: \`master\`
- **Script Version**: \`$SCRIPT_VERSION\`
---
## 🌐 Gateway Access URLs
- Garden: https://app.radicle.xyz/nodes/seed.radicle.garden/rad:$PROJECT_ID
- Kairos: https://app.radicle.xyz/nodes/$RAD_SEED/rad:$PROJECT_ID
- Raw: https://app.radicle.network/$PROJECT_ID
## 🔍 Commit Metadata
- Commit: $CURRENT_COMMIT
- Branch: $CURRENT_BRANCH
- Timestamp: $(date -Iseconds)
- SHA256 (tree): $(git rev-parse HEAD^{tree})
- Garden 🌱: [$GARDEN_URL]($GARDEN_URL)
- Kairos 🌀: [$KAIROS_URL]($KAIROS_URL)
- Raw 🔧: [$RAW_URL]($RAW_URL)
---
## 📦 Commit Metadata
- **Commit SHA**: \`$COMMIT_SHA\`
- **Tree SHA**: \`$TREE_SHA\`
- **Timestamp**: \`$TIMESTAMP\`
---
## 💻 Platform Metadata
- User: $(whoami)
- Hostname: $(hostname)
- OS: $(uname -a)
- Working Dir: $(pwd)
- **User**: \`$USER_NAME\`
- **Hostname**: \`$HOST_NAME\`
- **Architecture**: \`$ARCHITECTURE\`
- **IP Address**: \`$IP_ADDR\`
- **MAC Address**: \`$MAC_ADDR\`
- **Uptime**: \`$UPTIME\`
- **CPU**: \`$CPU_MODEL\`
- **RAM (GB)**: \`$TOTAL_RAM\`
- **Running in Docker**: \`$IS_DOCKER\`
- **Running in WSL**: \`$IS_WSL\`
- **OS Info**: \`$OS_INFO\`
---
_Auto-generated by \`gitfield-radicle\` on $TIMESTAMP._
EOF
# ── Step 6: Output for Human Use ─────────────────────────────────
echo -e "\n✅ Radicle push complete for \033[1m$REPO_NAME\033[0m"
echo -e "🌱 Garden URL: \033[4m$GARDEN_URL\033[0m"
echo -e "🌀 Kairos URL: \033[4m$KAIROS_URL\033[0m"
echo -e "🔧 Raw Gateway: \033[4m$RAW_URL\033[0m"
echo -e "\n🧬 Metadata stored in: $METADATA_FILE"
echo -e "📁 Project ID: $PROJECT_ID"
echo -e "👤 Peer ID: $PEER_ID"
echo -e "🕒 Timestamp: $TIMESTAMP\n"