diff --git a/.gitfield/README.txt b/.gitfield/README.txt index 33c1890..f8c5d61 100644 --- a/.gitfield/README.txt +++ b/.gitfield/README.txt @@ -14,4 +14,4 @@ The directory contains metadata and logs for the GitField multi-repository publ These files provide transparency, auditability, and discoverability, ensuring the project's persistence against deplatforming, censorship, or algorithmic manipulation. For a public-facing declaration, see [docs/index.html](../docs/index.html). -Generated by `gitfield-sync` at 2025-06-13T03:33:02Z (v1.4). +Generated by `gitfield-sync` at 2025-06-14T01:21:44Z (v1.4). diff --git a/.gitfield/canonical.md b/.gitfield/canonical.md index 9ac9b4f..352fc70 100644 --- a/.gitfield/canonical.md +++ b/.gitfield/canonical.md @@ -9,7 +9,7 @@ This repository, `git-sigil`, is canonically hosted at: This canonical URL serves as the primary, authoritative source for the project, maintained by **Mark Randall Havens** and **Solaria Lumis Havens** to ensure sovereignty, resilience, and protection against deplatforming or narrative erasure. **Declared by**: Mark Randall Havens -**Timestamp**: 2025-06-13T03:33:02Z +**Timestamp**: 2025-06-14T01:21:44Z ## GPG Signatures @@ -41,4 +41,4 @@ The latest push operations are logged in [`pushed.log`](./pushed.log) for transp A public-facing canonical declaration is available at [index.html](./index.html) for enhanced discoverability and SEO. -_Auto-generated by `gitfield-sync` at 2025-06-13T03:33:02Z (v1.4)._ +_Auto-generated by `gitfield-sync` at 2025-06-14T01:21:44Z (v1.4)._ diff --git a/.gitfield/canonical.meta b/.gitfield/canonical.meta index ca13c79..db0cfa6 100644 --- a/.gitfield/canonical.meta +++ b/.gitfield/canonical.meta @@ -13,10 +13,10 @@ "rid": "rad:z3FEj7rF8gZw9eFksCuiN43qjzrex", "peer_id": "z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz" }, - "timestamp": "2025-06-13T03:33:02Z", - "commit": "cd1b681", - "tree_hash": "b58bc1b191b7891bae0ab479d938eedaf5e0f3fb", - "synced_cycles": 3, + "timestamp": "2025-06-14T01:21:44Z", + "commit": "03c37e1", + "tree_hash": "4cf23cd25c21f6b41c80e5377ebabc11d193f6fd", + "synced_cycles": 0, "gpg_signatures": [ ] diff --git a/.gitfield/gogs.sigil.md b/.gitfield/gogs.sigil.md new file mode 100644 index 0000000..4f15a9a --- /dev/null +++ b/.gitfield/gogs.sigil.md @@ -0,0 +1,55 @@ +# šŸ”— GOGS Repository Link + +- **Repo Name**: `git-sigil` +- **GOGS User**: `mrhavens` +- **Remote URL**: [https://netmon.thefoldwithin.earth/mrhavens/git-sigil](https://netmon.thefoldwithin.earth/mrhavens/git-sigil) +- **Local Repo Path**: `/home/mrhavens/fieldwork/git-sigil` +- **Remote Label**: `gogs` +- **Default Branch**: `master` +- **Repo Created**: `2025-06-13 01:37:22` + +--- + +## šŸ“¦ Commit Info + +- **This Commit Timestamp**: `2025-06-13 01:37:22` +- **Last Commit SHA**: `c067a9a35bb2aa01534641530e04d121b460bb45` +- **Last Commit Message**: `GOGS metadata link commit at 2025-06-13 01:28:57 — https://netmon.thefoldwithin.earth/mrhavens/git-sigil/commit/bce675bc7e628fa22832272a21d2ed02b5172fbd` +- **Last Commit Author**: `Mark Randall Havens ` +- **Last Commit Date**: `Fri Jun 13 01:28:57 2025 -0500` +- **This Commit URL**: [https://netmon.thefoldwithin.earth/mrhavens/git-sigil/commit/c067a9a35bb2aa01534641530e04d121b460bb45](https://netmon.thefoldwithin.earth/mrhavens/git-sigil/commit/c067a9a35bb2aa01534641530e04d121b460bb45) + +--- + +## šŸ“Š Repo Status + +- **Total Commits**: `1312` +- **Tracked Files**: `163` +- **Uncommitted Changes**: `Yes` +- **Latest Tag**: `None` + +--- + +## 🧭 Environment + +- **Host Machine**: `samson` +- **Current User**: `mrhavens` +- **Time Zone**: `CDT` +- **Script Version**: `2.3` + +--- + +## 🧬 Hardware & OS Fingerprint + +- **OS Name**: `Linux` +- **OS Version**: `Ubuntu 22.04.5 LTS` +- **Kernel Version**: `6.6.87.1-microsoft-standard-WSL2` +- **Architecture**: `x86_64` +- **System Uptime**: $(uptime -p 2>/dev/null || echo "Unknown")` +- **Local IP**: $(hostname -I 2>/dev/null | awk '{print }' 2>/dev/null || echo "Unknown")` +- **CPU Model**: $(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ //' 2>/dev/null || echo "Unknown")` +- **Total RAM (GB)**: $(awk '/MemTotal/ {printf "%.2f", /1024/1024}' /proc/meminfo 2>/dev/null || echo "Unknown")` + +--- + +_Auto-generated by `gitfield-gogs` push script._ diff --git a/.gitfield/index.json b/.gitfield/index.json index d1472ff..5dc1a67 100644 --- a/.gitfield/index.json +++ b/.gitfield/index.json @@ -14,10 +14,10 @@ "rid": "rad:z3FEj7rF8gZw9eFksCuiN43qjzrex", "peer_id": "z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz" }, - "commit": "cd1b681", - "tree_hash": "b58bc1b191b7891bae0ab479d938eedaf5e0f3fb", - "timestamp": "2025-06-13T03:33:02Z", - "synced_cycles": 3, + "commit": "03c37e1", + "tree_hash": "4cf23cd25c21f6b41c80e5377ebabc11d193f6fd", + "timestamp": "2025-06-14T01:21:44Z", + "synced_cycles": 0, "gpg_signatures": [ ] diff --git a/.gitfield/local.sigil.md b/.gitfield/local.sigil.md index a153082..714faa2 100644 --- a/.gitfield/local.sigil.md +++ b/.gitfield/local.sigil.md @@ -6,26 +6,26 @@ - **Local Repo Path**: `/home/mrhavens/fieldwork/git-sigil` - **Remote Label**: `local` - **Default Branch**: `master` -- **Repo Created**: `2025-06-12 22:39:18` +- **Repo Created**: `2025-06-13 20:21:44` --- ## šŸ“¦ Commit Info -- **This Commit Timestamp**: `2025-06-12 22:39:18` -- **Last Commit SHA**: `1b3cbddd28f16b6e3971bc60603c0ebcf3506b19` -- **Last Commit Message**: `Generated index.json at 2025-06-13T03:33:02Z` +- **This Commit Timestamp**: `2025-06-13 20:21:44` +- **Last Commit SHA**: `a6287409fdb3eb82cbd23f779f76d6348f313795` +- **Last Commit Message**: `Generated docs/integrity.sha256 at 2025-06-14T01:21:44Z` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Thu Jun 12 22:39:17 2025 -0500` +- **Last Commit Date**: `Fri Jun 13 20:21:44 2025 -0500` - **This Commit URL**: `file:///home/mrhavens/git-local-repos/git-sigil.git` --- ## šŸ“Š Repo Status -- **Total Commits**: `1268` -- **Tracked Files**: `160` -- **Uncommitted Changes**: `No` +- **Total Commits**: `1322` +- **Tracked Files**: `163` +- **Uncommitted Changes**: `Yes` - **Latest Tag**: `None` --- @@ -48,7 +48,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 2 days, 5 hours, 12 minutes` +- **System Uptime**: `up 3 days, 2 hours, 54 minutes` - **MAC Address**: `00:15:5d:11:35:bd` - **Local IP**: `172.28.107.95` - **CPU Model**: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` diff --git a/.gitfield/push_log.json b/.gitfield/push_log.json index d43f8a9..2662fda 100644 --- a/.gitfield/push_log.json +++ b/.gitfield/push_log.json @@ -338,6 +338,18 @@ "branch": "master", "commit": "1b3cbddd28f16b6e3971bc60603c0ebcf3506b19", "message": "Generated index.json at 2025-06-13T03:33:02Z" + }, + { + "timestamp": "2025-06-13 00:33:24", + "branch": "master", + "commit": "025c2edbd4516465df2e3e56de876251028d0fdb", + "message": "Generated docs/integrity.sha256 at 2025-06-13T05:33:24Z" + }, + { + "timestamp": "2025-06-13 20:21:44", + "branch": "master", + "commit": "a6287409fdb3eb82cbd23f779f76d6348f313795", + "message": "Generated docs/integrity.sha256 at 2025-06-14T01:21:44Z" } ] } diff --git a/.gitfield/pushed.log b/.gitfield/pushed.log index dd06e7c..7066151 100644 --- a/.gitfield/pushed.log +++ b/.gitfield/pushed.log @@ -907,3 +907,27 @@ Diff Summary: .gitfield/github.sigil.md | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) +[2025-06-13T05:33:24Z] Local: , Branch=master, Commit=bb86593 + Diff Summary: + .gitfield/local.sigil.md | 14 +++++++------- + 1 file changed, 7 insertions(+), 7 deletions(-) +[2025-06-13T05:33:27Z] Radicle: RID=rad:z3FEj7rF8gZw9eFksCuiN43qjzrex, Peer ID=z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz, Branch=master, Commit=bb86593 + CLI: rad inspect rad:z3FEj7rF8gZw9eFksCuiN43qjzrex # View project details + CLI: git ls-tree -r --name-only HEAD # View file structure + Diff Summary: + .gitfield/push_log.json | 6 ++ + .gitfield/pushed.log | 4 + + bin/gitfield-netmon | 282 ++++++++++++++++++++++++++++++++++++++++++++++++ + 3 files changed, 292 insertions(+) +[2025-06-14T01:21:44Z] Local: , Branch=master, Commit=03c37e1 + Diff Summary: + .gitfield/local.sigil.md | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) +[2025-06-14T01:21:46Z] Radicle: RID=rad:z3FEj7rF8gZw9eFksCuiN43qjzrex, Peer ID=z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz, Branch=master, Commit=03c37e1 + CLI: rad inspect rad:z3FEj7rF8gZw9eFksCuiN43qjzrex # View project details + CLI: git ls-tree -r --name-only HEAD # View file structure + Diff Summary: + .gitfield/push_log.json | 6 + + .gitfield/pushed.log | 4 + + bin/gitfield-netmon | 301 +++++++++++++++++++----------------------------- + 3 files changed, 127 insertions(+), 184 deletions(-) diff --git a/.gitfield/remember.sigil.md b/.gitfield/remember.sigil.md index d9c8560..c948b51 100644 --- a/.gitfield/remember.sigil.md +++ b/.gitfield/remember.sigil.md @@ -6,25 +6,25 @@ - **Local Repo Path**: `/home/mrhavens/fieldwork/git-sigil` - **Remote Label**: `remember` - **Default Branch**: `master` -- **Repo Created**: `2025-06-12 22:39:29` +- **Repo Created**: `2025-06-13 20:21:48` --- ## šŸ“¦ Commit Info -- **This Commit Timestamp**: `2025-06-12 22:39:29` -- **Last Commit SHA**: `f914ea0e89ff7009c85a494d67cf64887c6a3186` -- **Last Commit Message**: `Post-Radicle sync at 2025-06-13T03:33:02Z` +- **This Commit Timestamp**: `2025-06-13 20:21:48` +- **Last Commit SHA**: `337eaed966c8009457b47aa5369d61a9a561227d` +- **Last Commit Message**: `Post-Radicle sync at 2025-06-14T01:21:44Z` - **Last Commit Author**: `Mark Randall Havens ` -- **Last Commit Date**: `Thu Jun 12 22:39:28 2025 -0500` -- **This Commit URL**: [https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/f914ea0e89ff7009c85a494d67cf64887c6a3186](https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/f914ea0e89ff7009c85a494d67cf64887c6a3186) +- **Last Commit Date**: `Fri Jun 13 20:21:46 2025 -0500` +- **This Commit URL**: [https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/337eaed966c8009457b47aa5369d61a9a561227d](https://remember.thefoldwithin.earth/mrhavens/git-sigil/commit/337eaed966c8009457b47aa5369d61a9a561227d) --- ## šŸ“Š Repo Status -- **Total Commits**: `1271` -- **Tracked Files**: `160` +- **Total Commits**: `1325` +- **Tracked Files**: `163` - **Uncommitted Changes**: `No` - **Latest Tag**: `None` @@ -48,7 +48,7 @@ - **Running in Docker**: `No` - **Running in WSL**: `Yes` - **Virtual Machine**: `wsl` -- **System Uptime**: `up 2 days, 5 hours, 12 minutes` +- **System Uptime**: `up 3 days, 2 hours, 54 minutes` - **MAC Address**: `00:15:5d:11:35:bd` - **Local IP**: `172.28.107.95` - **CPU Model**: `Intel(R) Core(TM) i7-7700K CPU @ 4.20GHz` diff --git a/.well-known/gitfield.json b/.well-known/gitfield.json index 3c4a9bc..20e01ae 100644 --- a/.well-known/gitfield.json +++ b/.well-known/gitfield.json @@ -13,7 +13,7 @@ "https://gitea.com/mrhavens/git-sigil", "rad:z3FEj7rF8gZw9eFksCuiN43qjzrex" ], - "dateModified": "2025-06-13T03:33:02Z", + "dateModified": "2025-06-14T01:21:44Z", "publisher": { "@type": "Person", "name": "Mark Randall Havens" diff --git a/bin/gitfield-netmon b/bin/gitfield-netmon new file mode 100755 index 0000000..6eabcac --- /dev/null +++ b/bin/gitfield-netmon @@ -0,0 +1,295 @@ +#!/bin/bash +set -eo pipefail +IFS=$'\n\t' + +# Configuration +GIT_REMOTE_NAME="gogs" +GOGS_DOMAIN="netmon.thefoldwithin.earth" +GOGS_API="https://$GOGS_DOMAIN/api/v1" +USERNAME="mrhavens" +REPO_ROOT=$(git rev-parse --show-toplevel 2>/dev/null) || { echo "[ERROR] Not inside a git repository." >&2; exit 1; } +REPO_NAME=$(basename "$REPO_ROOT") || { echo "[ERROR] Failed to get repository name" >&2; exit 1; } +MARKDOWN_FILE="$REPO_ROOT/.gitfield/gogs.sigil.md" +DEFAULT_NAME="Mark Randall Havens" +DEFAULT_EMAIL="mark.r.havens@gmail.com" +TOKEN_FILE="$HOME/.gitfield_token_gogs" +SCRIPT_VERSION="2.3" + +# Logging functions +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; } + +# Check for required tools +info "Checking for required tools..." +for cmd in git curl jq; do + command -v "$cmd" >/dev/null || { + sudo apt update -qq || warn "Failed to update package lists, continuing..." + sudo apt install -y git curl jq || error "Failed to install $cmd" + } +done + +# Function to prompt for GOGS token or password +prompt_for_credentials() { + info "Credentials required." + echo "šŸ” Generate a token at https://$GOGS_DOMAIN/user/settings/applications (Recommended)" + echo " - REQUIRED: Select the 'write:repository' scope" + echo "šŸ” Alternatively, use your GOGS password" + echo "šŸ” Paste your GOGS Personal Access Token or Password (will not be echoed):" + read -rsp "Token/Password: " CRED + echo + [[ -z "$CRED" ]] && error "Credentials cannot be empty" + echo "$CRED" > "$TOKEN_FILE" || error "Failed to write credentials to $TOKEN_FILE" + chmod 600 "$TOKEN_FILE" || error "Failed to set permissions on $TOKEN_FILE" + info "Credentials saved at $TOKEN_FILE" +} + +# Handle credentials +RESET_AUTH=false +if [[ "${1:-}" == "--reset-auth" ]]; then + RESET_AUTH=true + rm -f "$TOKEN_FILE" "$HOME/.git-credentials" 2>/dev/null || warn "Failed to remove credential files" + info "Authentication reset requested." +fi + +if [[ -f "$TOKEN_FILE" && "$RESET_AUTH" == false ]]; then + CRED=$(cat "$TOKEN_FILE" 2>/dev/null) || error "Failed to read credentials from $TOKEN_FILE" + info "Using cached credentials from $TOKEN_FILE" +else + prompt_for_credentials +fi + +# Verify GOGS token +info "Verifying GOGS credentials (read access)..." +TOKEN_TEST=$(curl -k -s -H "Authorization: token $CRED" "$GOGS_API/user" | jq -r .login 2>/dev/null || echo "") +if [[ "$TOKEN_TEST" != "$USERNAME" ]]; then + warn "Token verification failed. Credentials may be a password or invalid token." + # Retry with credentials as password if token fails + PASSWORD_TEST=$(curl -k -s -u "$USERNAME:$CRED" "$GOGS_API/user" | jq -r .login 2>/dev/null || echo "") + if [[ "$PASSWORD_TEST" != "$USERNAME" ]]; then + warn "Password verification also failed. Please provide valid credentials." + rm -f "$TOKEN_FILE" + prompt_for_credentials + TOKEN_TEST=$(curl -k -s -H "Authorization: token $CRED" "$GOGS_API/user" | jq -r .login 2>/dev/null || echo "") + PASSWORD_TEST=$(curl -k -s -u "$USERNAME:$CRED" "$GOGS_API/user" | jq -r .login 2>/dev/null || echo "") + [[ "$TOKEN_TEST" != "$USERNAME" && "$PASSWORD_TEST" != "$USERNAME" ]] && error "New credentials verification failed. Ensure they are valid." + fi + info "Credentials verified as password: $PASSWORD_TEST" +else + info "Credentials verified as token: $TOKEN_TEST" +fi + +# Test write access via API +info "Testing write access via API..." +TEST_REPO="test-repo-$(date +%s)" +WRITE_TEST=$(curl -k -v -H "Authorization: token $CRED" -X POST "$GOGS_API/user/repos" -H "Content-Type: application/json" -d "{\"name\": \"$TEST_REPO\", \"description\": \"Test\", \"private\": false, \"auto_init\": false}" 2>&1) +if [[ $? -ne 0 || $(echo "$WRITE_TEST" | grep -i "401" 2>/dev/null) ]]; then + warn "Write access test failed with token: $WRITE_TEST" + WRITE_TEST=$(curl -k -v -u "$USERNAME:$CRED" -X POST "$GOGS_API/user/repos" -H "Content-Type: application/json" -d "{\"name\": \"$TEST_REPO\", \"description\": \"Test\", \"private\": false, \"auto_init\": false}" 2>&1) + if [[ $? -ne 0 || $(echo "$WRITE_TEST" | grep -i "401" 2>/dev/null) ]]; then + error "Write access failed with both token and password. Check GOGS configuration." + fi + info "Write access test passed with password: $WRITE_TEST" +else + info "Write access test passed with token: $WRITE_TEST" +fi + +# Test Git push with credentials +info "Testing Git push with credentials..." +GIT_TEST=$(git ls-remote --heads "https://$USERNAME:$CRED@$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git" 2>&1) +if [[ $? -ne 0 || $(echo "$GIT_TEST" | grep -i "401" 2>/dev/null) ]]; then + warn "Git push test failed with token: $GIT_TEST" + GIT_TEST=$(git ls-remote --heads "https://$USERNAME:$CRED@$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git" 2>&1) + if [[ $? -ne 0 || $(echo "$GIT_TEST" | grep -i "401" 2>/dev/null) ]]; then + warn "Git push test also failed with password. This suggests a GOGS Git-over-HTTP issue." + warn "1. Edit /home/git/gogs/custom/conf/app.ini and ensure:" + warn " [auth] ENABLE_ACCESS_TOKEN = true" + warn " [git] DISABLE_HTTP_GIT = false" + warn "2. Restart GOGS: sudo systemctl restart gogs" + warn "3. Try manual push with token: git push https://$USERNAME:$CRED@$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git $DEFAULT_BRANCH" + warn "4. Try manual push with password: git push https://$USERNAME:$CRED@$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git $DEFAULT_BRANCH" + warn "5. Check GOGS logs: sudo tail -f /home/git/gogs/log/gogs.log" + error "Git push test failed. Adjust GOGS configuration or use manual workaround." + fi + info "Git push test passed with password: $GIT_TEST" +else + info "Git push test passed with token: $GIT_TEST" +fi + +# Set git user info +git config --global user.name "$DEFAULT_NAME" || warn "Failed to set git user name" +git config --global user.email "$DEFAULT_EMAIL" || warn "Failed to set git user email" +info "Git identity set to: $DEFAULT_NAME <$DEFAULT_EMAIL>" + +# Ensure at least one commit exists +if ! git rev-parse HEAD &>/dev/null; then + error "No commits found. Please add and commit files first." +fi + +# Configure git credentials for HTTPS +info "Configuring git credentials for HTTPS..." +if [[ "$TOKEN_TEST" == "$USERNAME" ]]; then + echo "https://$USERNAME:$CRED@$GOGS_DOMAIN" > "$HOME/.git-credentials" || error "Failed to write git credentials" +else + echo "https://$USERNAME:$CRED@$GOGS_DOMAIN" > "$HOME/.git-credentials" || error "Failed to write git credentials" +fi +chmod 600 "$HOME/.git-credentials" || error "Failed to set permissions on git credentials" + +# Check and create GOGS repository +info "Checking if repository exists..." +EXISTS=$(curl -k -s -H "Authorization: token $CRED" "$GOGS_API/repos/$USERNAME/$REPO_NAME" | jq -r .name 2>/dev/null || echo "") +if [[ "$EXISTS" != "$REPO_NAME" ]]; then + info "Creating repository $REPO_NAME on GOGS..." + CURL_OUTPUT=$(curl -k -s --fail -X POST "$GOGS_API/user/repos" \ + -H "Authorization: token $CRED" \ + -H "Content-Type: application/json" \ + -d "{\"name\": \"$REPO_NAME\", \"description\": \"Created via gitfield-gogs\", \"private\": false, \"auto_init\": false}" 2>&1) || { + warn "Failed to create repository with token: $CURL_OUTPUT" + CURL_OUTPUT=$(curl -k -s --fail -u "$USERNAME:$CRED" -X POST "$GOGS_API/user/repos" \ + -H "Content-Type: application/json" \ + -d "{\"name\": \"$REPO_NAME\", \"description\": \"Created via gitfield-gogs\", \"private\": false, \"auto_init\": false}" 2>&1) + if [[ $? -ne 0 ]]; then + error "Repository creation failed with both token and password. Check GOGS configuration." + fi + info "Repository created successfully with password." + } + info "Repository created successfully with token." +fi + +# Set up git remote +REMOTE_URL="https://$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git" +if ! git remote get-url "$GIT_REMOTE_NAME" &>/dev/null; then + info "Adding remote $GIT_REMOTE_NAME..." + git remote add "$GIT_REMOTE_NAME" "$REMOTE_URL" || error "Failed to add remote $GIT_REMOTE_NAME" +else + info "Updating remote $GIT_REMOTE_NAME..." + git remote set-url "$GIT_REMOTE_NAME" "$REMOTE_URL" || error "Failed to set remote URL for $GIT_REMOTE_NAME" +fi + +# Generate metadata file +mkdir -p "$(dirname "$MARKDOWN_FILE")" || error "Failed to create directory for $MARKDOWN_FILE" +TIMESTAMP=$(date '+%Y-%m-%d %H:%M:%S') || error "Failed to get timestamp" +DEFAULT_BRANCH=$(git symbolic-ref --short HEAD) || error "Failed to get default branch" +REPO_PATH="$REPO_ROOT" +LATEST_SHA=$(git rev-parse HEAD) || error "Failed to get latest commit SHA" +LAST_COMMIT_MSG=$(git log -1 --pretty=format:"%s" 2>/dev/null || echo "Unknown") +LAST_COMMIT_DATE=$(git log -1 --pretty=format:"%ad" 2>/dev/null || echo "Unknown") +LAST_COMMIT_AUTHOR=$(git log -1 --pretty=format:"%an <%ae>" 2>/dev/null || echo "Unknown") +TOTAL_COMMITS=$(git rev-list --count HEAD 2>/dev/null || echo "Unknown") +TRACKED_FILES=$(git ls-files 2>/dev/null | wc -l 2>/dev/null || echo "Unknown") +UNCOMMITTED=$(if ! git diff --quiet 2>/dev/null || ! git diff --cached --quiet 2>/dev/null; then echo "Yes"; else echo "No"; fi) +LATEST_TAG=$(git describe --tags --abbrev=0 2>/dev/null || echo "None") +HOSTNAME=$(hostname 2>/dev/null || echo "Unknown") +CURRENT_USER=$(whoami 2>/dev/null || echo "Unknown") +TIMEZONE=$(date +%Z 2>/dev/null || echo "Unknown") +OS_NAME=$(uname -s 2>/dev/null || echo "Unknown") +KERNEL_VERSION=$(uname -r 2>/dev/null || echo "Unknown") +ARCHITECTURE=$(uname -m 2>/dev/null || echo "Unknown") +OS_PRETTY_NAME=$(grep PRETTY_NAME /etc/os-release 2>/dev/null | cut -d= -f2 | tr -d '"' || echo "Unknown") +WEB_LINK="https://$GOGS_DOMAIN/$USERNAME/$REPO_NAME" + +cat > "$MARKDOWN_FILE" </dev/null || echo "Unknown")\` +- **Local IP**: \$(hostname -I 2>/dev/null | awk '{print $1}' 2>/dev/null || echo "Unknown")\` +- **CPU Model**: \$(grep -m1 'model name' /proc/cpuinfo 2>/dev/null | cut -d: -f2 | sed 's/^ //' 2>/dev/null || echo "Unknown")\` +- **Total RAM (GB)**: \$(awk '/MemTotal/ {printf "%.2f", $2/1024/1024}' /proc/meminfo 2>/dev/null || echo "Unknown")\` + +--- + +_Auto-generated by \`gitfield-gogs\` push script._ +EOF +[[ $? -eq 0 ]] || error "Failed to write metadata to $MARKDOWN_FILE" + +# Commit and push +set +e +info "Committing markdown file..." +git add "$MARKDOWN_FILE" || warn "Failed to add markdown file" +git commit -m "GOGS metadata link commit at $TIMESTAMP — $WEB_LINK/commit/$LATEST_SHA" || warn "No changes to commit" + +info "Pushing to GOGS..." +if ! git config --get branch."$DEFAULT_BRANCH".remote &>/dev/null; then + if ! git push -u "$GIT_REMOTE_NAME" "$DEFAULT_BRANCH" 2>&1 | tee /tmp/git-push.log; then + warn "Push to GOGS failed. Check /tmp/git-push.log for details." + if grep -q "401" /tmp/git-push.log; then + warn "HTTP 401 error detected. Token or password failed for Git push." + warn "This suggests a GOGS Git-over-HTTP configuration issue." + warn "1. Edit /home/git/gogs/custom/conf/app.ini and ensure:" + warn " [auth] ENABLE_ACCESS_TOKEN = true" + warn " [git] DISABLE_HTTP_GIT = false" + warn "2. Restart GOGS: sudo systemctl restart gogs" + warn "3. Try manual push with current credentials: git push https://$USERNAME:$CRED@$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git $DEFAULT_BRANCH" + warn "4. Check GOGS logs: sudo tail -f /home/git/gogs/log/gogs.log" + error "Push failed. Adjust GOGS configuration or verify credentials." + else + error "Failed to push to $REMOTE_URL. Check network or GOGS server." + fi + fi +else + if ! git push "$GIT_REMOTE_NAME" "$DEFAULT_BRANCH" 2>&1 | tee /tmp/git-push.log; then + warn "Push to GOGS failed. Check /tmp/git-push.log for details." + if grep -q "401" /tmp/git-push.log; then + warn "HTTP 401 error detected. Token or password failed for Git push." + warn "This suggests a GOGS Git-over-HTTP configuration issue." + warn "1. Edit /home/git/gogs/custom/conf/app.ini and ensure:" + warn " [auth] ENABLE_ACCESS_TOKEN = true" + warn " [git] DISABLE_HTTP_GIT = false" + warn "2. Restart GOGS: sudo systemctl restart gogs" + warn "3. Try manual push with current credentials: git push https://$USERNAME:$CRED@$GOGS_DOMAIN/$USERNAME/$REPO_NAME.git $DEFAULT_BRANCH" + warn "4. Check GOGS logs: sudo tail -f /home/git/gogs/log/gogs.log" + error "Push failed. Adjust GOGS configuration or verify credentials." + else + error "Failed to push to $REMOTE_URL. Check network or GOGS server." + fi + fi +fi +set -e + +info "āœ… GOGS push complete." +echo -e "\nšŸ”— View in browser: $WEB_LINK\n" diff --git a/docs/README.md b/docs/README.md index 9964e3f..66a37ec 100644 --- a/docs/README.md +++ b/docs/README.md @@ -24,4 +24,4 @@ The directory hosts a public-facing, SEO-optimized canonical declaration for th This directory ensures the `git-sigil` project is discoverable via search engines and accessible to humans and bots. It declares the canonical repository at [https://remember.thefoldwithin.earth/mrhavens/git-sigil](https://remember.thefoldwithin.earth/mrhavens/git-sigil) and links to all mirrors, reinforcing the GitField recursive metadata strategy for sovereign publishing. -Generated by `gitfield-sync` at 2025-06-13T03:33:02Z (v1.4). +Generated by `gitfield-sync` at 2025-06-14T01:21:44Z (v1.4). diff --git a/docs/index.html b/docs/index.html index f0ac896..540d957 100644 --- a/docs/index.html +++ b/docs/index.html @@ -27,7 +27,7 @@ "https://gitea.com/mrhavens/git-sigil", "rad:z3FEj7rF8gZw9eFksCuiN43qjzrex" ], - "dateModified": "2025-06-13T03:33:02Z", + "dateModified": "2025-06-14T01:21:44Z", "author": { "@type": "Person", "name": "Mark Randall Havens" @@ -43,7 +43,7 @@ - +

GitField Sovereign Canonical Repository: git-sigil

diff --git a/docs/integrity.sha256 b/docs/integrity.sha256 index b31bfa8..6615f67 100644 --- a/docs/integrity.sha256 +++ b/docs/integrity.sha256 @@ -1,5 +1,5 @@ # SHA-256 Integrity Hashes for /docs Metadata Files -# Generated by gitfield-sync at 2025-06-13T03:33:02Z (v1.4) +# Generated by gitfield-sync at 2025-06-14T01:21:44Z (v1.4) 6093f6beb366d18662b3cea94d3c24b232ab174ccc860b00e97aef51a6f5e4ed /home/mrhavens/fieldwork/git-sigil/docs/canonical.meta 5ae6c8cbcd409b4b672aa34bff98e061810a9e85818abd1bc0a028fe7edfcd65 /home/mrhavens/fieldwork/git-sigil/docs/canonical.md diff --git a/docs/sitemap.xml b/docs/sitemap.xml index 11560e3..9749597 100644 --- a/docs/sitemap.xml +++ b/docs/sitemap.xml @@ -2,97 +2,97 @@ https://remember.thefoldwithin.earth/mrhavens/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 1.0 https://github.com/mrhavens/git-sigil/docs/index.html - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.9 https://github.com/mrhavens/git-sigil/docs/canonical.meta - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/canonical.md - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/index.json - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/gitfield.json - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/.well-known/gitfield.json - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/repos.json - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/pushed.log - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil/docs/gitfield.README.txt - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://github.com/mrhavens/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://gitlab.com/mrhavens/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://bitbucket.org/thefoldwithin/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://remember.thefoldwithin.earth/mrhavens/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://codeberg.org/mrhavens/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 https://gitea.com/mrhavens/git-sigil - 2025-06-13T03:33:02Z + 2025-06-14T01:21:44Z weekly 0.8 diff --git a/test b/test new file mode 100644 index 0000000..e69de29