Compare commits
41 commits
bb86593b10
...
7b53b457ba
Author | SHA1 | Date | |
---|---|---|---|
![]() |
7b53b457ba | ||
![]() |
337eaed966 | ||
![]() |
27285d1ab9 | ||
![]() |
4e45aadd8f | ||
![]() |
a6287409fd | ||
![]() |
5ed7d6135f | ||
![]() |
8d4de3c558 | ||
![]() |
236f4867b3 | ||
![]() |
8248cfa2d7 | ||
![]() |
63a81814e1 | ||
![]() |
a023d46d87 | ||
![]() |
187fc1a233 | ||
![]() |
a285b2081b | ||
![]() |
03c37e1103 | ||
![]() |
c067a9a35b | ||
![]() |
bce675bc7e | ||
![]() |
92c0600078 | ||
![]() |
4db690d1e2 | ||
![]() |
dcf57cc4a9 | ||
![]() |
2929dbb877 | ||
![]() |
20cf8504ea | ||
![]() |
ca1a619bbd | ||
![]() |
98895b2995 | ||
![]() |
cc31b3c026 | ||
![]() |
10bad046ba | ||
![]() |
d2134a901f | ||
![]() |
0f13101cc9 | ||
![]() |
1200a75939 | ||
![]() |
bbaa13ad6f | ||
![]() |
a68d390259 | ||
![]() |
6917e65dc8 | ||
![]() |
7ba153d969 | ||
![]() |
025c2edbd4 | ||
![]() |
8ecdb91190 | ||
![]() |
0175a00d0f | ||
![]() |
6722f3fa8a | ||
![]() |
9c79dbba63 | ||
![]() |
face83d487 | ||
![]() |
b289935ef2 | ||
![]() |
2e58f3d6e8 | ||
![]() |
c2f6133700 |
16 changed files with 436 additions and 50 deletions
|
@ -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).
|
||||
|
|
|
@ -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)._
|
||||
|
|
|
@ -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": [
|
||||
|
||||
]
|
||||
|
|
55
.gitfield/gogs.sigil.md
Normal file
55
.gitfield/gogs.sigil.md
Normal file
|
@ -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 <mark.r.havens@gmail.com>`
|
||||
- **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._
|
|
@ -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": [
|
||||
|
||||
]
|
||||
|
|
|
@ -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 <mark.r.havens@gmail.com>`
|
||||
- **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`
|
||||
|
|
|
@ -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"
|
||||
}
|
||||
]
|
||||
}
|
||||
|
|
|
@ -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(-)
|
||||
|
|
|
@ -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 <mark.r.havens@gmail.com>`
|
||||
- **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`
|
||||
|
|
|
@ -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"
|
||||
|
|
295
bin/gitfield-netmon
Executable file
295
bin/gitfield-netmon
Executable file
|
@ -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" <<EOF
|
||||
# 🔗 GOGS Repository Link
|
||||
|
||||
- **Repo Name**: \`$REPO_NAME\`
|
||||
- **GOGS User**: \`$USERNAME\`
|
||||
- **Remote URL**: [$WEB_LINK]($WEB_LINK)
|
||||
- **Local Repo Path**: \`$REPO_PATH\`
|
||||
- **Remote Label**: \`$GIT_REMOTE_NAME\`
|
||||
- **Default Branch**: \`$DEFAULT_BRANCH\`
|
||||
- **Repo Created**: \`$TIMESTAMP\`
|
||||
|
||||
---
|
||||
|
||||
## 📦 Commit Info
|
||||
|
||||
- **This Commit Timestamp**: \`$TIMESTAMP\`
|
||||
- **Last Commit SHA**: \`$LATEST_SHA\`
|
||||
- **Last Commit Message**: \`$LAST_COMMIT_MSG\`
|
||||
- **Last Commit Author**: \`$LAST_COMMIT_AUTHOR\`
|
||||
- **Last Commit Date**: \`$LAST_COMMIT_DATE\`
|
||||
- **This Commit URL**: [$WEB_LINK/commit/$LATEST_SHA]($WEB_LINK/commit/$LATEST_SHA)
|
||||
|
||||
---
|
||||
|
||||
## 📊 Repo Status
|
||||
|
||||
- **Total Commits**: \`$TOTAL_COMMITS\`
|
||||
- **Tracked Files**: \`$TRACKED_FILES\`
|
||||
- **Uncommitted Changes**: \`$UNCOMMITTED\`
|
||||
- **Latest Tag**: \`$LATEST_TAG\`
|
||||
|
||||
---
|
||||
|
||||
## 🧭 Environment
|
||||
|
||||
- **Host Machine**: \`$HOSTNAME\`
|
||||
- **Current User**: \`$CURRENT_USER\`
|
||||
- **Time Zone**: \`$TIMEZONE\`
|
||||
- **Script Version**: \`$SCRIPT_VERSION\`
|
||||
|
||||
---
|
||||
|
||||
## 🧬 Hardware & OS Fingerprint
|
||||
|
||||
- **OS Name**: \`$OS_NAME\`
|
||||
- **OS Version**: \`$OS_PRETTY_NAME\`
|
||||
- **Kernel Version**: \`$KERNEL_VERSION\`
|
||||
- **Architecture**: \`$ARCHITECTURE\`
|
||||
- **System Uptime**: \$(uptime -p 2>/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"
|
|
@ -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).
|
||||
|
|
|
@ -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 @@
|
|||
</script>
|
||||
</head>
|
||||
<body>
|
||||
<!-- Generated by gitfield-sync v1.4 | 2025-06-13T03:33:02Z -->
|
||||
<!-- Generated by gitfield-sync v1.4 | 2025-06-14T01:21:44Z -->
|
||||
<header>
|
||||
<h1>GitField Sovereign Canonical Repository: <code>git-sigil</code></h1>
|
||||
</header>
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -2,97 +2,97 @@
|
|||
<urlset xmlns="http://www.sitemaps.org/schemas/sitemap/0.9">
|
||||
<url>
|
||||
<loc>https://remember.thefoldwithin.earth/mrhavens/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>1.0</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/index.html</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.9</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/canonical.meta</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/canonical.md</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/index.json</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/gitfield.json</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/.well-known/gitfield.json</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/repos.json</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/pushed.log</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil/docs/gitfield.README.txt</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://github.com/mrhavens/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gitlab.com/mrhavens/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://bitbucket.org/thefoldwithin/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://remember.thefoldwithin.earth/mrhavens/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://codeberg.org/mrhavens/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
<url>
|
||||
<loc>https://gitea.com/mrhavens/git-sigil</loc>
|
||||
<lastmod>2025-06-13T03:33:02Z</lastmod>
|
||||
<lastmod>2025-06-14T01:21:44Z</lastmod>
|
||||
<changefreq>weekly</changefreq>
|
||||
<priority>0.8</priority>
|
||||
</url>
|
||||
|
|
0
test
Normal file
0
test
Normal file
Loading…
Add table
Add a link
Reference in a new issue