diff --git a/.gitfield/canonical.meta.asc b/.gitfield/canonical.meta.asc new file mode 100644 index 0000000..f1ce718 --- /dev/null +++ b/.gitfield/canonical.meta.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYc0ACgkQTifTfDWI +cr9+fA/9HKoqzwFd4GprjFO9zLEIlq2UDIz9zG3XJ0gyB8pCTg2FpcLFrca4Bh92 +JzBJg2wL6Coer9c4QeaC8l/LdIEsLnnKDofQ2W5OwpCxnSF9Gz4O0HR4ePdWOeuI +T/ruhJinSVjaKUrcaj7PtBSyheUzxN3mzp5k3V4aKBlbsvpKKtvtDm66VgRQuG58 +ItpxFqH6q2auj+YY4L2RvDZ0hIB73/9OnzIUowq5jxmtODGrLcZqfwhM19Pr7WiS +1BVlmKlOjYCRmDkfCIJeJcNS4zQAeb1Pd3yHfbjBH8bxATP5YIG/OEHMReFjMFtT +h/ZsqDg7eACz7Tc0uSvQ8RKAD7fD9nFizAKbu738SS11Gb4gT+tU2mEQQXk8kdxd +XlQbOTI/saiOSdarGpxWyQ6TFPOxHizwVTTcsXeIbS8SClJMFJIXiHBF9uX4QUmF +eWttZ1uFSzFYFoL8EHY8BYmz7BM1BpvodK9qxOiUDq/3RtVpZhDDPqgYVumopRbr +CxuXeHucdy6TeR8BSrp3WRt9U3QKYX8KGlbKbiME8ZKmzq3Ido8QJi2XYIBY8VTS +++HKD0f9E6sHDm+tHfWIMrg++r03J9vHtULytE1VSClBIse+vWN5DUkg9xbARsoA +cz0Eozm1UJxBhCTJRoO++stx2eu2osPdPhT2iz81cn8Pk53OYqU= +=FoGU +-----END PGP SIGNATURE----- diff --git a/.gitfield/index.json.asc b/.gitfield/index.json.asc new file mode 100644 index 0000000..c4f3e9c --- /dev/null +++ b/.gitfield/index.json.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYdcACgkQTifTfDWI +cr8VGg//eumu8s8bdbmm0vojkecLZ+xWzKBkuLoWbWutbe8em/nPMAK0r1jLTOPE +QNvHtRw9CmKtlY46XJgYOkrgc8Cq3qBaKYIpneOc/H0DD9EOTnXEviRp7lhbn1Q2 +xseHaUlQjJB0qTiF0AYy23+1b5gbgQahWy2GVzHyVUREVKP5BAOE8iWmFoQgS7I9 +ZaMbCXR6VCU1fgFJa3/OcauWN1vzcZNg3p4XzP7PYsBO2gQ+NwQ7q2wIPonRFD67 +htIjA7MCjeab5CR7cRK7HoiCmIWJOPkYwDHssgKH5UQx0VIZvXOzu7Gi8znc0eJe +USzJsXNRECVJqCMYDE5NLo/4LXtj+5WmUPz9xHq3gYehmi31N/+/nJoA5Hj4JYOJ +ZSsdMCeVz9yfE0T/ZPZ6FcRI41H2uuNcEab0F+ydof2Up5A+GupxruKxwqtDWQBp +iejSPB5gmUGUMHuWXblGySfp9QFKExvWGU+diqVa1xFN11G7yCgpfYRGiuUemxqI +DAB9zCT0FgNgb5AUKLfY/7D0UMXRZYEp1nqclL4nYFCuuXVqp7O/DvH1DLqF+qZp +wA8zRjhJDIXaTtCuZtDBWS/mPmh5+jQec6HvN1CFcC9juV5ZXGZwOzH0F7yCUwq1 +AFXl6uKpyp4nJSk5iqX/cfPb5hyMLK2qxG5OSYul+DUU3GJJIPY= +=mKVE +-----END PGP SIGNATURE----- diff --git a/.gitfield/push_log.json b/.gitfield/push_log.json index 65218e9..b9491fb 100644 --- a/.gitfield/push_log.json +++ b/.gitfield/push_log.json @@ -242,6 +242,12 @@ "branch": "master", "commit": "4e7ae3a9a314b0914c31a9bf1b8672159602e17e", "message": "Generated index.json at 2025-06-09T21:04:01Z" + }, + { + "timestamp": "2025-06-09 17:36:38", + "branch": "master", + "commit": "3453c72cb0b2835ab6cd140626942b30308f1d13", + "message": "Signed /home/mrhavens/fieldcraft/git-sigil/docs/integrity.sha256 with GPG key 4E27D37C358872BF at 2025-06-09T22:35:36Z" } ] } diff --git a/.gitfield/pushed.log b/.gitfield/pushed.log index 2e01398..51956ec 100644 --- a/.gitfield/pushed.log +++ b/.gitfield/pushed.log @@ -397,3 +397,7 @@ Diff Summary: .gitfield/github.sigil.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) +[2025-06-09T22:36:40Z] Local: , Branch=master, Commit=c70557d + Diff Summary: + .gitfield/local.sigil.md | 18 +++++++++--------- + 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.well-known/gitfield.json.asc b/.well-known/gitfield.json.asc new file mode 100644 index 0000000..81e978a --- /dev/null +++ b/.well-known/gitfield.json.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYeQACgkQTifTfDWI +cr+A5g//YjOz79a2rncTjFL/b2UM4tvhd8rvZz1Vr0g92D+xKN+yqttm+jqlFXo8 +tLGQSMos4Alq9iSUd7oxy8QnLFJCHV/nuWVxlJCgiuItRkDbRyOElQw9JmyQPXTG +uxYUY9kpeAWJUzdpBNG4/OZRE0kPSwtQUZsYbF7HJMjDjFSG5iqxJbehBUW6g1Lh +TGTXCmODj+0uwB2poYRfLMxl9IPBnmOpbFtp+4azCoLGZpe9BBL2U0bpJGm6uPoP +usNduf3g54WPTgShBBqvIkKjg7CmyjON7oFDuATcFBpsCcFXJCf43WBC6cHzaaP7 +zjiZl5U4G8U5iZxShKZU7JI5Uy4xKLjnQ71QC6zWuzHTPwH2skBvsHkIUflbFG/1 +5YrdxXMzlTQ30Upn0okNSNfdCCfor/6H/n3a2LdJpyMCj+9VjhK00hC6zW3EXFxI +YcuOUumZCfszOk0gXpydoxBywQkXgBBZCGc+SbMMyHU9eaxSexIrkcGpAPzLFgXe +wB4VxLEBon/OTxQcmuMwMgZJZdURlqpVhdSF2cNUQ3qRkJUBnrbGrfYFmMSFsEC5 ++Y77tP/HEu/cCdZ/xgOkYuyYnRLDlfsO0upkFE/yRHSZpGHB2FFlpeYuPFqGMNnB ++mVS06H+BdrLxT41oJdAPzb28XqMrKdMXamUyRJ9HWlTDJzRF2M= +=6HOn +-----END PGP SIGNATURE----- diff --git a/bin/gitfield-sync b/bin/gitfield-sync index 4da547e..259cae9 100755 --- a/bin/gitfield-sync +++ b/bin/gitfield-sync @@ -10,12 +10,21 @@ REPO_NAME=$(basename "$REPO_PATH") GITFIELD_DIR="$REPO_PATH/.gitfield" WELL_KNOWN_DIR="$REPO_PATH/.well-known" DOCS_DIR="$REPO_PATH/docs" +DOCS_WELL_KNOWN_DIR="$DOCS_DIR/.well-known" LOG_FILE="$GITFIELD_DIR/pushed.log" GITFIELD_MD="$REPO_PATH/GITFIELD.md" CANONICAL_META="$GITFIELD_DIR/canonical.meta" CANONICAL_MD="$GITFIELD_DIR/canonical.md" INDEX_JSON="$GITFIELD_DIR/index.json" WELL_KNOWN_JSON="$WELL_KNOWN_DIR/gitfield.json" +GITFIELD_README="$GITFIELD_DIR/README.txt" +DOCS_CANONICAL_META="$DOCS_DIR/canonical.meta" +DOCS_CANONICAL_MD="$DOCS_DIR/canonical.md" +DOCS_INDEX_JSON="$DOCS_DIR/index.json" +DOCS_PUSHED_LOG="$DOCS_DIR/pushed.log" +DOCS_GITFIELD_README="$DOCS_DIR/gitfield.README.txt" +DOCS_GITFIELD_JSON="$DOCS_DIR/gitfield.json" +DOCS_WELL_KNOWN_JSON="$DOCS_WELL_KNOWN_DIR/gitfield.json" DOCS_INDEX="$DOCS_DIR/index.html" DOCS_CSS="$DOCS_DIR/style.css" DOCS_REPOS_JSON="$DOCS_DIR/repos.json" @@ -23,9 +32,11 @@ DOCS_README="$DOCS_DIR/README.md" DOCS_NOJEKYLL="$DOCS_DIR/.nojekyll" DOCS_ROBOTS="$DOCS_DIR/robots.txt" DOCS_SITEMAP="$DOCS_DIR/sitemap.xml" +DOCS_INTEGRITY="$DOCS_DIR/integrity.sha256" TIMESTAMP=$(date -u '+%Y-%m-%dT%H:%M:%SZ') -SCRIPT_VERSION="1.2" # Updated version for /docs and Radicle fixes -PRESERVE_META=${PRESERVE_META:-false} # Flag to preserve existing metadata +SCRIPT_VERSION="1.4" # Updated for GPG integration +PRESERVE_META=${PRESERVE_META:-false} # Preserve existing metadata +FORCE_DOCS=${FORCE_DOCS:-false} # Force overwrite of /docs metadata # URLs for each platform CANONICAL_URL="https://remember.thefoldwithin.earth/mrhavens/$REPO_NAME" @@ -35,7 +46,8 @@ BITBUCKET_URL="https://bitbucket.org/thefoldwithin/$REPO_NAME" FORGEJO_URL="https://remember.thefoldwithin.earth/mrhavens/$REPO_NAME" CODEBERG_URL="https://codeberg.org/mrhavens/$REPO_NAME" GITEA_URL="https://gitea.com/mrhavens/$REPO_NAME" -RADICLE_RID="rad:z3FEj7rF8gZw9eFksCuiN43qjzrex" # Fixed: removed rad:rad: +RADICLE_RID="rad:z3FEj7rF8gZw9eFksCuiN43qjzrex" +RADICLE_URL="https://app.radicle.xyz/nodes/z3FEj7rF8gZw9eFksCuiN43qjzrex" RADICLE_PEER_ID="z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz" # Metadata configuration @@ -46,12 +58,26 @@ MIRRORS=( "$FORGEJO_URL" "$CODEBERG_URL" "$GITEA_URL" - "$RADICLE_RID" # Fixed: use rad: prefix directly + "$RADICLE_RID" ) COMMIT_HASH=$(git -C "$REPO_PATH" rev-parse --short HEAD 2>/dev/null || echo "unknown") TREE_HASH=$(git -C "$REPO_PATH" rev-parse HEAD^{tree} 2>/dev/null || echo "unknown") SYNC_CYCLES=0 +# GPG configuration +GPG_KEYS=() +GPG_EMAILS=() +GPG_NAMES=() +while IFS= read -r line; do + if [[ "$line" =~ ^pub[[:space:]]+rsa[0-9]+[[:space:]]+([0-9]{4}-[0-9]{2}-[0-9]{2})[[:space:]]+\[SC\] ]]; then + key_id=$(gpg --list-keys --with-colons | grep -B1 "^pub" | grep "^pub" | awk -F: '{print $5}' | head -n1) + GPG_KEYS+=("$key_id") + elif [[ "$line" =~ ^uid[[:space:]]+\[ultimate\][[:space:]]+(.*)\<(.*)\> ]]; then + GPG_NAMES+=("${BASH_REMATCH[1]% }") + GPG_EMAILS+=("${BASH_REMATCH[2]}") + fi +done < <(gpg --list-keys) + # ╭─────────────────────────────────────╮ # │ LOGGING UTILS │ # ╰─────────────────────────────────────╮ @@ -91,6 +117,47 @@ find_script() { error "Script $script_name not found in any search path" } +# ╭─────────────────────────────────────╮ +# │ GPG SIGNING FUNCTION │ +# ╰─────────────────────────────────────╮ +sign_file() { + local file=$1 + local sig_file="${file}.sig" + if [ ! -f "$file" ]; then + warn "File $file does not exist, skipping signing" + return + fi + for key_id in "${GPG_KEYS[@]}"; do + gpg --armor --detach-sign --default-key "$key_id" "$file" > "$sig_file.$key_id" 2>/dev/null || warn "Failed to sign $file with key $key_id, continuing..." + if [ -f "$sig_file.$key_id" ]; then + git -C "$REPO_PATH" add "$sig_file.$key_id" + git -C "$REPO_PATH" commit -m "Signed $file with GPG key $key_id at $TIMESTAMP" || warn "No changes to commit for $sig_file.$key_id" + info "Signed $file with key $key_id, signature at $sig_file.$key_id" + copy_to_docs "$sig_file.$key_id" "$DOCS_DIR/$(basename "$sig_file.$key_id")" + fi + done +} + +# ╭─────────────────────────────────────╮ +# │ METADATA COPY FUNCTION │ +# ╰─────────────────────────────────────╮ +copy_to_docs() { + local src=$1 + local dest=$2 + if [ ! -f "$src" ]; then + warn "Source file $src does not exist, skipping copy to $dest" + return + fi + if [ "$FORCE_DOCS" = "false" ] && [ -f "$dest" ]; then + info "Preserving existing $dest (--force-docs not enabled)" + return + fi + cp "$src" "$dest" || warn "Failed to copy $src to $dest, continuing..." + git -C "$REPO_PATH" add "$dest" + git -C "$REPO_PATH" commit -m "Copied $dest to docs at $TIMESTAMP" || warn "No changes to commit for $dest" + info "Copied $src to $dest and committed" +} + # ╭─────────────────────────────────────╮ # │ METADATA GENERATION │ # ╰─────────────────────────────────────╮ @@ -113,12 +180,22 @@ $(printf ' "%s",\n' "${MIRRORS[@]}" | sed '$ s/,$//') "timestamp": "$TIMESTAMP", "commit": "$COMMIT_HASH", "tree_hash": "$TREE_HASH", - "synced_cycles": $SYNC_CYCLES + "synced_cycles": $SYNC_CYCLES, + "gpg_signatures": [ +$(for i in "${!GPG_KEYS[@]}"; do + echo " {\"key_id\": \"${GPG_KEYS[i]}\", \"name\": \"${GPG_NAMES[i]}\", \"email\": \"${GPG_EMAILS[i]}\"}" | sed '$ s/,$//' +done) + ] } EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$CANONICAL_META" git -C "$REPO_PATH" add "$CANONICAL_META" git -C "$REPO_PATH" commit -m "Generated canonical.meta at $TIMESTAMP" || warn "No changes to commit for $CANONICAL_META" info "Generated and committed $CANONICAL_META" + copy_to_docs "$CANONICAL_META" "$DOCS_CANONICAL_META" + sign_file "$CANONICAL_META" + sign_file "$DOCS_CANONICAL_META" } generate_canonical_md() { @@ -141,13 +218,21 @@ This canonical URL serves as the primary, authoritative source for the project, **Declared by**: Mark Randall Havens **Timestamp**: $TIMESTAMP +## GPG Signatures + +This declaration is signed with the following GPG keys: + +$(for i in "${!GPG_KEYS[@]}"; do + echo "- **${GPG_NAMES[i]}** <${GPG_EMAILS[i]}> (Key ID: ${GPG_KEYS[i]})" +done) + ## Mirror Repositories The project is mirrored across multiple platforms to enhance redundancy and accessibility: $(for mirror in "${MIRRORS[@]}"; do if [[ "$mirror" == rad:* ]]; then - echo "- **Radicle**: [$mirror](https://app.radicle.xyz/nodes/$mirror) (Decentralized, censorship-resistant)" + echo "- **Radicle**: [$mirror]($RADICLE_URL) (Decentralized, censorship-resistant)" else echo "- [$mirror]($mirror)" fi @@ -159,17 +244,20 @@ The GitField framework employs a recursive, multi-repository strategy to defend ## Push Log -The latest push operations are logged in [\`.gitfield/pushed.log\`](./pushed.log) for transparency and auditability. +The latest push operations are logged in [\`pushed.log\`](./pushed.log) for transparency and auditability. ## GitHub Pages -A public-facing canonical declaration is available at [docs/index.html](./docs/index.html) for enhanced discoverability and SEO. +A public-facing canonical declaration is available at [index.html](./index.html) for enhanced discoverability and SEO. _Auto-generated by \`gitfield-sync\` at $TIMESTAMP (v$SCRIPT_VERSION)._ EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$CANONICAL_MD" git -C "$REPO_PATH" add "$CANONICAL_MD" git -C "$REPO_PATH" commit -m "Generated canonical.md at $TIMESTAMP" || warn "No changes to commit for $CANONICAL_MD" info "Generated and committed $CANONICAL_MD" + copy_to_docs "$CANONICAL_MD" "$DOCS_CANONICAL_MD" } generate_index_json() { @@ -192,12 +280,22 @@ $(printf ' "%s",\n' "${MIRRORS[@]}" | sed '$ s/,$//') "commit": "$COMMIT_HASH", "tree_hash": "$TREE_HASH", "timestamp": "$TIMESTAMP", - "synced_cycles": $SYNC_CYCLES + "synced_cycles": $SYNC_CYCLES, + "gpg_signatures": [ +$(for i in "${!GPG_KEYS[@]}"; do + echo " {\"key_id\": \"${GPG_KEYS[i]}\", \"name\": \"${GPG_NAMES[i]}\", \"email\": \"${GPG_EMAILS[i]}\"}" | sed '$ s/,$//' +done) + ] } EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$INDEX_JSON" git -C "$REPO_PATH" add "$INDEX_JSON" git -C "$REPO_PATH" commit -m "Generated index.json at $TIMESTAMP" || warn "No changes to commit for $INDEX_JSON" info "Generated and committed $INDEX_JSON" + copy_to_docs "$INDEX_JSON" "$DOCS_INDEX_JSON" + sign_file "$INDEX_JSON" + sign_file "$DOCS_INDEX_JSON" } generate_well_known_json() { @@ -221,22 +319,34 @@ $(printf ' "%s",\n' "${MIRRORS[@]}" | sed '$ s/,$//') "publisher": { "@type": "Person", "name": "Mark Randall Havens" - } + }, + "gpg_signatures": [ +$(for i in "${!GPG_KEYS[@]}"; do + echo " {\"key_id\": \"${GPG_KEYS[i]}\", \"name\": \"${GPG_NAMES[i]}\", \"email\": \"${GPG_EMAILS[i]}\"}" | sed '$ s/,$//' +done) + ] } EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$WELL_KNOWN_JSON" git -C "$REPO_PATH" add "$WELL_KNOWN_JSON" git -C "$REPO_PATH" commit -m "Generated .well-known/gitfield.json at $TIMESTAMP" || warn "No changes to commit for $WELL_KNOWN_JSON" info "Generated and committed $WELL_KNOWN_JSON" + copy_to_docs "$WELL_KNOWN_JSON" "$DOCS_GITFIELD_JSON" + mkdir -p "$DOCS_WELL_KNOWN_DIR" + copy_to_docs "$WELL_KNOWN_JSON" "$DOCS_WELL_KNOWN_JSON" + sign_file "$WELL_KNOWN_JSON" + sign_file "$DOCS_GITFIELD_JSON" + sign_file "$DOCS_WELL_KNOWN_JSON" } generate_gitfield_readme() { - local readme_file="$GITFIELD_DIR/README.txt" - info "Generating $readme_file..." - if [ "$PRESERVE_META" = "true" ] && [ -f "$readme_file" ]; then - info "Preserving existing $readme_file (--preserve-meta enabled)" + info "Generating $GITFIELD_README..." + if [ "$PRESERVE_META" = "true" ] && [ -f "$GITFIELD_README" ]; then + info "Preserving existing $GITFIELD_README (--preserve-meta enabled)" return fi - cat > "$readme_file" < "$GITFIELD_README" < +

GitField Sovereign Canonical Repository: $REPO_NAME

@@ -316,6 +432,12 @@ $(printf ' "%s",\n' "${MIRRORS[@]}" | sed '$ s/,$//')

This repository, $REPO_NAME, is canonically hosted at:

$CANONICAL_URL

Maintained by Mark Randall Havens and Solaria Lumis Havens, this canonical source ensures sovereignty and resilience against deplatforming, censorship, and algorithmic manipulation.

+

Signed with the following GPG keys:

+

Mirror Repositories

@@ -323,7 +445,7 @@ $(printf ' "%s",\n' "${MIRRORS[@]}" | sed '$ s/,$//')
@@ -349,9 +472,9 @@ done)

Source Links

Access the project's metadata and logs:

@@ -361,6 +484,8 @@ done) EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$DOCS_INDEX" git -C "$REPO_PATH" add "$DOCS_INDEX" git -C "$REPO_PATH" commit -m "Generated docs/index.html at $TIMESTAMP" || warn "No changes to commit for $DOCS_INDEX" info "Generated and committed $DOCS_INDEX" @@ -443,12 +568,20 @@ $(printf ' "%s",\n' "${MIRRORS[@]}" | sed '$ s/,$//') "radicle": { "rid": "$RADICLE_RID", "peer_id": "$RADICLE_PEER_ID" - } + }, + "gpg_signatures": [ +$(for i in "${!GPG_KEYS[@]}"; do + echo " {\"key_id\": \"${GPG_KEYS[i]}\", \"name\": \"${GPG_NAMES[i]}\", \"email\": \"${GPG_EMAILS[i]}\"}" | sed '$ s/,$//' +done) + ] } EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$DOCS_REPOS_JSON" git -C "$REPO_PATH" add "$DOCS_REPOS_JSON" git -C "$REPO_PATH" commit -m "Generated docs/repos.json at $TIMESTAMP" || warn "No changes to commit for $DOCS_REPOS_JSON" info "Generated and committed $DOCS_REPOS_JSON" + sign_file "$DOCS_REPOS_JSON" } generate_docs_readme() { @@ -468,10 +601,18 @@ The `/docs` directory hosts a public-facing, SEO-optimized canonical declaration - **index.html**: The canonical declaration page, including JSON-LD metadata and links to all mirrors. - **style.css**: Minimal stylesheet for elegant, recursive branding. - **repos.json**: Machine-readable list of the canonical URL and all mirror repositories. +- **canonical.meta**: Machine-readable JSON metadata declaring the canonical URL and mirrors. +- **canonical.md**: Human-readable Markdown summary of the canonical declaration. +- **index.json**: Machine-readable manifest of all remotes and sync details. +- **gitfield.json**: SEO-friendly JSON-LD metadata. +- **.well-known/gitfield.json**: SEO metadata mirror. +- **pushed.log**: Log of push operations across all platforms. +- **gitfield.README.txt**: Explanation of the GitField metadata structure. - **README.md**: This file, explaining the purpose of the `/docs` directory. - **.nojekyll**: Bypasses Jekyll processing for GitHub Pages. - **robots.txt**: Allows full indexing by search engine bots. - **sitemap.xml**: Auto-generated sitemap for improved SEO. +- **integrity.sha256**: SHA-256 hash of all metadata files for integrity verification. ## Purpose @@ -479,6 +620,8 @@ This directory ensures the \`$REPO_NAME\` project is discoverable via search eng Generated by \`gitfield-sync\` at $TIMESTAMP (v$SCRIPT_VERSION). EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$DOCS_README" git -C "$REPO_PATH" add "$DOCS_README" git -C "$REPO_PATH" commit -m "Generated docs/README.md at $TIMESTAMP" || warn "No changes to commit for $DOCS_README" info "Generated and committed $DOCS_README" @@ -530,6 +673,60 @@ generate_docs_sitemap() { weekly 1.0 + + $GITHUB_URL/docs/index.html + $TIMESTAMP + weekly + 0.9 + + + $GITHUB_URL/docs/canonical.meta + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/canonical.md + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/index.json + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/gitfield.json + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/.well-known/gitfield.json + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/repos.json + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/pushed.log + $TIMESTAMP + weekly + 0.8 + + + $GITHUB_URL/docs/gitfield.README.txt + $TIMESTAMP + weekly + 0.8 + $(for mirror in "${MIRRORS[@]}"; do if [[ "$mirror" != rad:* ]]; then echo " " @@ -547,15 +744,41 @@ EOF info "Generated and committed $DOCS_SITEMAP" } +generate_docs_integrity() { + info "Generating $DOCS_INTEGRITY..." + mkdir -p "$DOCS_DIR" + if [ "$PRESERVE_META" = "true" ] && [ -f "$DOCS_INTEGRITY" ]; then + info "Preserving existing $DOCS_INTEGRITY (--preserve-meta enabled)" + return + fi + cat > "$DOCS_INTEGRITY" <> "$DOCS_INTEGRITY" || warn "Failed to compute SHA-256 for $file, continuing..." + else + warn "File $file does not exist, skipping SHA-256 computation" + fi + done + git -C "$REPO_PATH" add "$DOCS_INTEGRITY" + git -C "$REPO_PATH" commit -m "Generated docs/integrity.sha256 at $TIMESTAMP" || warn "No changes to commit for $DOCS_INTEGRITY" + info "Generated and committed $DOCS_INTEGRITY" + sign_file "$DOCS_INTEGRITY" +} + # ╭─────────────────────────────────────╮ # │ INITIAL SETUP │ # ╰─────────────────────────────────────╮ -mkdir -p "$GITFIELD_DIR" "$WELL_KNOWN_DIR" "$DOCS_DIR" +mkdir -p "$GITFIELD_DIR" "$WELL_KNOWN_DIR" "$DOCS_DIR" "$DOCS_WELL_KNOWN_DIR" if [ ! -f "$LOG_FILE" ]; then echo "# Push Log for $REPO_NAME" > "$LOG_FILE" echo "# Generated by gitfield-sync" >> "$LOG_FILE" echo "" >> "$LOG_FILE" + copy_to_docs "$LOG_FILE" "$DOCS_PUSHED_LOG" fi # ╭─────────────────────────────────────╮ @@ -577,7 +800,7 @@ The \`$REPO_NAME\` project employs a multi-repository strategy across seven dist The following platforms host the \`$REPO_NAME\` repository, each chosen for its unique strengths and contributions to the project's goals. ### 1. Radicle -- **RID**: [$RADICLE_RID](https://app.radicle.xyz/nodes/$RADICLE_RID) +- **RID**: [$RADICLE_RID]($RADICLE_URL) - **Peer ID**: $RADICLE_PEER_ID - **Purpose**: Radicle is a decentralized, peer-to-peer git platform that ensures sovereignty and censorship resistance. It hosts the repository in a distributed network, independent of centralized servers. - **Value**: Protects against deplatforming by eliminating reliance on centralized infrastructure, ensuring the project remains accessible in a decentralized ecosystem. @@ -637,7 +860,7 @@ The decision to maintain multiple repositories stems from the need to safeguard - **Resilience**: If one platform removes or restricts access, or if search engines like Google delist content, the project remains accessible on other platforms and discoverable via alternative search engines such as Bing, DuckDuckGo, and Yahoo. - **Sovereignty**: Radicle’s decentralized nature and Forgejo’s self-hosted infrastructure ensure the project cannot be fully censored or controlled by any single entity. - **Diversity**: Each platform’s unique features (e.g., GitHub’s community, GitLab’s CI/CD, Bitbucket’s integrations, Radicle’s decentralization, Forgejo’s self-hosting, Codeberg’s community-driven model, Gitea’s lightweight efficiency) enhance the project’s functionality and reach. -- **Transparency**: Metadata snapshots in the \`.gitfield\` directory and public-facing documentation in the \`/docs\` directory provide a verifiable record of the project’s state across all platforms. +- **Transparency**: Metadata snapshots in the \`.gitfield\` directory (for internal audit) and public-facing documentation in the \`/docs\` directory provide a verifiable record of the project’s state across all platforms. This multi-repository approach, bolstered by Forgejo’s sovereign hosting and GitHub Pages’ discoverability, reflects a commitment to preserving the integrity, accessibility, and independence of \`$REPO_NAME\`, ensuring it remains available to contributors and users regardless of external pressures. @@ -645,12 +868,16 @@ This multi-repository approach, bolstered by Forgejo’s sovereign hosting and G ## 📜 Metadata and Logs -- **Canonical Metadata**: The canonical repository is declared in [\`.gitfield/canonical.meta\`](./.gitfield/canonical.meta) (machine-readable JSON) and [\`.gitfield/canonical.md\`](./.gitfield/canonical.md) (human-readable Markdown). -- **Index Manifest**: A full manifest of remotes, commit details, and sync cycles is available in [\`.gitfield/index.json\`](./.gitfield/index.json). -- **Well-Known Metadata**: SEO-friendly metadata with Schema.org JSON-LD is available in [\`.well-known/gitfield.json\`](./.well-known/gitfield.json). -- **Push Log**: The \`.gitfield/pushed.log\` file records the date, time, commit hash, and RID/URL of every push operation across all platforms, providing a transparent audit trail. -- **GitField Directory**: The \`.gitfield\` directory contains additional metadata and platform-specific sigils (e.g., \`github.sigil.md\`). See [\`.gitfield/README.txt\`](./.gitfield/README.txt) for details. -- **GitHub Pages**: A public-facing, SEO-optimized canonical declaration is available in [\`docs/index.html\`](./docs/index.html), with additional metadata in [\`docs/repos.json\`](./docs/repos.json) and a sitemap in [\`docs/sitemap.xml\`](./docs/sitemap.xml). +- **Canonical Metadata**: The canonical repository is declared in [\`docs/canonical.meta\`](./docs/canonical.meta) (machine-readable JSON) and [\`docs/canonical.md\`](./docs/canonical.md) (human-readable Markdown). Internal copies are maintained in \`.gitfield/\` for version tracking. +- **Index Manifest**: A full manifest of remotes, commit details, and sync cycles is available in [\`docs/index.json\`](./docs/index.json). +- **SEO Metadata**: SEO-friendly metadata with Schema.org JSON-LD is available in [\`docs/gitfield.json\`](./docs/gitfield.json) and [\`docs/.well-known/gitfield.json\`](./docs/.well-known/gitfield.json). +- **Push Log**: The [\`docs/pushed.log\`](./docs/pushed.log) file records the date, time, commit hash, and RID/URL of every push operation across all platforms, providing a transparent audit trail. +- **GitField Directory**: The \`.gitfield\` directory contains internal metadata and platform-specific sigils (e.g., \`github.sigil.md\`). See [\`docs/gitfield.README.txt\`](./docs/gitfield.README.txt) for details. +- **GitHub Pages**: A public-facing, SEO-optimized canonical declaration is available in [\`docs/index.html\`](./docs/index.html), with a sitemap in [\`docs/sitemap.xml\`](./docs/sitemap.xml) and integrity hashes in [\`docs/integrity.sha256\`](./docs/integrity.sha256). +- **GPG Signatures**: Metadata files are signed with the following GPG keys: +$(for i in "${!GPG_KEYS[@]}"; do + echo " - ${GPG_NAMES[i]} <${GPG_EMAILS[i]}> (Key ID: ${GPG_KEYS[i]})" +done) - **Recursive Sync**: The repository is synchronized across all platforms in a recursive loop (three cycles) to ensure interconnected metadata captures the latest state of the project. - **Push Order**: The repository is synchronized in the following order: **Radicle → Forgejo → Codeberg → Gitea → GitLab → Bitbucket → GitHub**. This prioritizes Radicle’s decentralized, censorship-resistant network as the primary anchor, followed by Forgejo’s sovereign, self-hosted infrastructure, Codeberg’s community-driven platform, Gitea’s lightweight efficiency, GitLab’s robust DevOps features, Bitbucket’s enterprise redundancy, and GitHub’s broad visibility, ensuring a resilient and accessible metadata chain. @@ -658,6 +885,8 @@ This multi-repository approach, bolstered by Forgejo’s sovereign hosting and G _Auto-generated by \`gitfield-sync\` at $TIMESTAMP (v$SCRIPT_VERSION)._ EOF + # Sanitize rad:rad: + sed -i 's/rad:rad:/rad:/g' "$GITFIELD_MD" git -C "$REPO_PATH" add "$GITFIELD_MD" git -C "$REPO_PATH" commit -m "Generated GITFIELD.md at $TIMESTAMP" || warn "No changes to commit for $GITFIELD_MD" info "Generated and committed $GITFIELD_MD" @@ -691,6 +920,7 @@ log_url() { fi info "Logged push to $LOG_FILE: [$timestamp] $platform: $url, Branch=$branch, Commit=$COMMIT_HASH" fi + copy_to_docs "$LOG_FILE" "$DOCS_PUSHED_LOG" } # ╭─────────────────────────────────────╮ @@ -747,6 +977,7 @@ run_push_cycle() { generate_docs_nojekyll generate_docs_robots generate_docs_sitemap + generate_docs_integrity } # ╭─────────────────────────────────────╮ @@ -754,7 +985,7 @@ run_push_cycle() { # ╰─────────────────────────────────────╮ info "Starting gitfield-sync for $REPO_NAME..." -# Parse --preserve-meta flag +# Parse flags while [ $# -gt 0 ]; do case "$1" in --preserve-meta) @@ -762,6 +993,11 @@ while [ $# -gt 0 ]; do info "Preserve metadata flag enabled" shift ;; + --force-docs) + FORCE_DOCS=true + info "Force docs overwrite flag enabled" + shift + ;; *) warn "Unknown argument: $1" shift @@ -790,6 +1026,7 @@ generate_docs_readme generate_docs_nojekyll generate_docs_robots generate_docs_sitemap +generate_docs_integrity # Run push cycles run_push_cycle 1 @@ -798,10 +1035,12 @@ run_push_cycle 2 run_push_cycle 3 info "✅ gitfield-sync completed successfully." -info "🔗 View logs: $LOG_FILE" +info "✅ Canonical sync exported to /docs successfully." +info "🔗 View logs: $DOCS_PUSHED_LOG" info "🔗 View multi-repo manifest: $GITFIELD_MD" -info "🔗 View canonical metadata: $CANONICAL_META" -info "🔗 View canonical declaration: $CANONICAL_MD" -info "🔗 View index manifest: $INDEX_JSON" -info "🔗 View well-known metadata: $WELL_KNOWN_JSON" +info "🔗 View canonical metadata: $DOCS_CANONICAL_META" +info "🔗 View canonical declaration: $DOCS_CANONICAL_MD" +info "🔗 View index manifest: $DOCS_INDEX_JSON" +info "🔗 View SEO metadata: $DOCS_GITFIELD_JSON" info "🔗 View GitHub Pages: $DOCS_INDEX" +info "🔗 View integrity hashes: $DOCS_INTEGRITY" diff --git a/bin/gitfield-sync-OLD4 b/bin/gitfield-sync-OLD4 new file mode 100755 index 0000000..4da547e --- /dev/null +++ b/bin/gitfield-sync-OLD4 @@ -0,0 +1,807 @@ +#!/bin/bash +set -euo pipefail +IFS=$'\n\t' + +# ╭─────────────────────────────────────╮ +# │ CONFIGURATION │ +# ╰─────────────────────────────────────╮ +REPO_PATH=$(git rev-parse --show-toplevel 2>/dev/null) || error "Not inside a Git repository" +REPO_NAME=$(basename "$REPO_PATH") +GITFIELD_DIR="$REPO_PATH/.gitfield" +WELL_KNOWN_DIR="$REPO_PATH/.well-known" +DOCS_DIR="$REPO_PATH/docs" +LOG_FILE="$GITFIELD_DIR/pushed.log" +GITFIELD_MD="$REPO_PATH/GITFIELD.md" +CANONICAL_META="$GITFIELD_DIR/canonical.meta" +CANONICAL_MD="$GITFIELD_DIR/canonical.md" +INDEX_JSON="$GITFIELD_DIR/index.json" +WELL_KNOWN_JSON="$WELL_KNOWN_DIR/gitfield.json" +DOCS_INDEX="$DOCS_DIR/index.html" +DOCS_CSS="$DOCS_DIR/style.css" +DOCS_REPOS_JSON="$DOCS_DIR/repos.json" +DOCS_README="$DOCS_DIR/README.md" +DOCS_NOJEKYLL="$DOCS_DIR/.nojekyll" +DOCS_ROBOTS="$DOCS_DIR/robots.txt" +DOCS_SITEMAP="$DOCS_DIR/sitemap.xml" +TIMESTAMP=$(date -u '+%Y-%m-%dT%H:%M:%SZ') +SCRIPT_VERSION="1.2" # Updated version for /docs and Radicle fixes +PRESERVE_META=${PRESERVE_META:-false} # Flag to preserve existing metadata + +# URLs for each platform +CANONICAL_URL="https://remember.thefoldwithin.earth/mrhavens/$REPO_NAME" +GITHUB_URL="https://github.com/mrhavens/$REPO_NAME" +GITLAB_URL="https://gitlab.com/mrhavens/$REPO_NAME" +BITBUCKET_URL="https://bitbucket.org/thefoldwithin/$REPO_NAME" +FORGEJO_URL="https://remember.thefoldwithin.earth/mrhavens/$REPO_NAME" +CODEBERG_URL="https://codeberg.org/mrhavens/$REPO_NAME" +GITEA_URL="https://gitea.com/mrhavens/$REPO_NAME" +RADICLE_RID="rad:z3FEj7rF8gZw9eFksCuiN43qjzrex" # Fixed: removed rad:rad: +RADICLE_PEER_ID="z6Mkw5s3ppo26C7y7tGK5MD8n2GqTHS582PPpeX5Xqbu2Mpz" + +# Metadata configuration +MIRRORS=( + "$GITHUB_URL" + "$GITLAB_URL" + "$BITBUCKET_URL" + "$FORGEJO_URL" + "$CODEBERG_URL" + "$GITEA_URL" + "$RADICLE_RID" # Fixed: use rad: prefix directly +) +COMMIT_HASH=$(git -C "$REPO_PATH" rev-parse --short HEAD 2>/dev/null || echo "unknown") +TREE_HASH=$(git -C "$REPO_PATH" rev-parse HEAD^{tree} 2>/dev/null || echo "unknown") +SYNC_CYCLES=0 + +# ╭─────────────────────────────────────╮ +# │ LOGGING UTILS │ +# ╰─────────────────────────────────────╮ +info() { echo -e "\e[1;34m[INFO]\e[0m $*" >&2; } +warn() { echo -e "\e[1;33m[WARN]\e[0m $*" >&2; } +error() { echo -e "\e[1;31m[ERROR]\e[0m $*" >&2; exit 1; } + +# ╭─────────────────────────────────────╮ +# │ SCRIPT LOOKUP FUNCTION │ +# ╰─────────────────────────────────────╮ +find_script() { + local script_name=$1 + local search_paths=( + "$HOME/.local/gitfieldbin" + "$HOME/.local/bin" + "$HOME/.local/gitfield" + "$HOME/.local/bin/gitfield" + "$HOME/.local/bin/gitfieldbin" + "$REPO_PATH/bin" + ) + + for path in "${search_paths[@]}"; do + if [ -f "$path/$script_name" ]; then + if [ -x "$path/$script_name" ]; then + if [[ "$path" != "$HOME"* && "$path" != "$REPO_PATH"* ]]; then + info "Using script: \e[1;31m$path/$script_name\e[0m (outside home or repo)" + else + info "Using script: $path/$script_name" + fi + echo "$path/$script_name" + return 0 + else + warn "Found $path/$script_name but it is not executable" + fi + fi + done + error "Script $script_name not found in any search path" +} + +# ╭─────────────────────────────────────╮ +# │ METADATA GENERATION │ +# ╰─────────────────────────────────────╮ +generate_canonical_meta() { + info "Generating $CANONICAL_META..." + if [ "$PRESERVE_META" = "true" ] && [ -f "$CANONICAL_META" ]; then + info "Preserving existing $CANONICAL_META (--preserve-meta enabled)" + return + fi + cat > "$CANONICAL_META" < "$CANONICAL_MD" < "$INDEX_JSON" < "$WELL_KNOWN_JSON" < "$readme_file" < "$DOCS_INDEX" < + + + + + GitField Sovereign Canonical Repository: $REPO_NAME + + + + + + + + + +
+

GitField Sovereign Canonical Repository: $REPO_NAME

+
+
+
+

Canonical Declaration

+

This repository, $REPO_NAME, is canonically hosted at:

+

$CANONICAL_URL

+

Maintained by Mark Randall Havens and Solaria Lumis Havens, this canonical source ensures sovereignty and resilience against deplatforming, censorship, and algorithmic manipulation.

+
+
+

Mirror Repositories

+

The project is mirrored across multiple platforms for redundancy and accessibility:

+
    +$(for mirror in "${MIRRORS[@]}"; do + if [[ "$mirror" == rad:* ]]; then + echo "
  • Radicle: $mirror (Decentralized, censorship-resistant)
  • " + else + echo "
  • $mirror
  • " + fi +done) +
+
+
+

Metadata Manifest

+

Metadata for this project is available in:

+ +
+
+

Why Recursive Sovereignty Matters

+

The GitField framework distributes $REPO_NAME across decentralized (Radicle), self-hosted (Forgejo), and community-driven (Codeberg, Gitea) platforms, alongside mainstream services (GitHub, GitLab, Bitbucket). This recursive strategy defends against past deplatforming attempts by individuals such as Joel Johnson, Dr. Peter Gaied, and Andrew LeCody, ensuring the project's persistence and accessibility.

+
+
+

Source Links

+

Access the project's metadata and logs:

+ +
+
+
+

Mark Randall Havens & Solaria Lumis Havens · The Fold Within · 2025

+
+ + +EOF + git -C "$REPO_PATH" add "$DOCS_INDEX" + git -C "$REPO_PATH" commit -m "Generated docs/index.html at $TIMESTAMP" || warn "No changes to commit for $DOCS_INDEX" + info "Generated and committed $DOCS_INDEX" +} + +generate_docs_css() { + info "Generating $DOCS_CSS..." + mkdir -p "$DOCS_DIR" + if [ "$PRESERVE_META" = "true" ] && [ -f "$DOCS_CSS" ]; then + info "Preserving existing $DOCS_CSS (--preserve-meta enabled)" + return + fi + cat > "$DOCS_CSS" < "$DOCS_REPOS_JSON" < "$DOCS_README" < "$DOCS_ROBOTS" < "$DOCS_SITEMAP" < + + + $CANONICAL_URL + $TIMESTAMP + weekly + 1.0 + +$(for mirror in "${MIRRORS[@]}"; do + if [[ "$mirror" != rad:* ]]; then + echo " " + echo " $mirror" + echo " $TIMESTAMP" + echo " weekly" + echo " 0.8" + echo " " + fi +done) + +EOF + git -C "$REPO_PATH" add "$DOCS_SITEMAP" + git -C "$REPO_PATH" commit -m "Generated docs/sitemap.xml at $TIMESTAMP" || warn "No changes to commit for $DOCS_SITEMAP" + info "Generated and committed $DOCS_SITEMAP" +} + +# ╭─────────────────────────────────────╮ +# │ INITIAL SETUP │ +# ╰─────────────────────────────────────╮ +mkdir -p "$GITFIELD_DIR" "$WELL_KNOWN_DIR" "$DOCS_DIR" + +if [ ! -f "$LOG_FILE" ]; then + echo "# Push Log for $REPO_NAME" > "$LOG_FILE" + echo "# Generated by gitfield-sync" >> "$LOG_FILE" + echo "" >> "$LOG_FILE" +fi + +# ╭─────────────────────────────────────╮ +# │ GENERATE GITFIELD.MD │ +# ╰─────────────────────────────────────╮ +generate_gitfield_md() { + info "Generating $GITFIELD_MD..." + cat > "$GITFIELD_MD" </dev/null || echo "unknown") + local diff_summary=$(git -C "$REPO_PATH" diff --stat HEAD^ HEAD 2>/dev/null || echo "No diff available") + if [ "$platform" = "Radicle" ]; then + echo "[$timestamp] $platform: RID=$rid, Peer ID=$peer_id, Branch=$branch, Commit=$COMMIT_HASH" >> "$LOG_FILE" + echo " CLI: rad inspect $rid # View project details" >> "$LOG_FILE" + echo " CLI: git ls-tree -r --name-only HEAD # View file structure" >> "$LOG_FILE" + if [ -n "$diff_summary" ]; then + echo " Diff Summary:" >> "$LOG_FILE" + echo "$diff_summary" | sed 's/^/ /' >> "$LOG_FILE" + fi + info "Logged push to $LOG_FILE: [$timestamp] $platform: RID=$rid, Peer ID=$peer_id, Branch=$branch, Commit=$COMMIT_HASH" + else + echo "[$timestamp] $platform: $url, Branch=$branch, Commit=$COMMIT_HASH" >> "$LOG_FILE" + if [ -n "$diff_summary" ]; then + echo " Diff Summary:" >> "$LOG_FILE" + echo "$diff_summary" | sed 's/^/ /' >> "$LOG_FILE" + fi + info "Logged push to $LOG_FILE: [$timestamp] $platform: $url, Branch=$branch, Commit=$COMMIT_HASH" + fi +} + +# ╭─────────────────────────────────────╮ +# │ EXECUTE PUSH SCRIPT │ +# ╰─────────────────────────────────────╮ +execute_push() { + local script_name=$1 + local platform=$2 + local url=$3 + local rid=$4 + local peer_id=$5 + local script_path + script_path=$(find_script "$script_name") || error "Failed to find $script_name" + info "Executing $platform push with script: $script_path" + if [ -x "$script_path" ]; then + pushd "$REPO_PATH" >/dev/null + "$script_path" || warn "Execution of $script_path failed, continuing..." + log_url "$platform" "$url" "$rid" "$peer_id" + git add . || warn "Nothing to add after $script_path" + git commit -m "Post-$platform sync at $TIMESTAMP" || warn "No changes to commit after $script_path" + popd >/dev/null + else + error "Script $script_path is not executable" + fi +} + +# ╭─────────────────────────────────────╮ +# │ RECURSIVE PUSH LOOP │ +# ╰─────────────────────────────────────╮ +run_push_cycle() { + local cycle_number=$1 + info "Starting push cycle $cycle_number..." + SYNC_CYCLES=$cycle_number + + execute_push "gitfield-local" "Local" "" "" "" + execute_push "gitfield-radicle" "Radicle" "" "$RADICLE_RID" "$RADICLE_PEER_ID" + execute_push "gitfield-remember" "Forgejo" "$FORGEJO_URL" "" "" + execute_push "gitfield-codeberg" "Codeberg" "$CODEBERG_URL" "" "" + execute_push "gitfield-gitea" "Gitea" "$GITEA_URL" "" "" + execute_push "gitfield-gitlab" "GitLab" "$GITLAB_URL" "" "" + execute_push "gitfield-bitbucket" "Bitbucket" "$BITBUCKET_URL" "" "" + execute_push "gitfield-github" "GitHub" "$GITHUB_URL" "" "" + + # Regenerate metadata after each cycle to update sync_cycles + generate_canonical_meta + generate_canonical_md + generate_index_json + generate_well_known_json + generate_gitfield_readme + generate_docs_index + generate_docs_css + generate_docs_repos_json + generate_docs_readme + generate_docs_nojekyll + generate_docs_robots + generate_docs_sitemap +} + +# ╭─────────────────────────────────────╮ +# │ MAIN EXECUTION │ +# ╰─────────────────────────────────────╮ +info "Starting gitfield-sync for $REPO_NAME..." + +# Parse --preserve-meta flag +while [ $# -gt 0 ]; do + case "$1" in + --preserve-meta) + PRESERVE_META=true + info "Preserve metadata flag enabled" + shift + ;; + *) + warn "Unknown argument: $1" + shift + ;; + esac +done + +if [ ! -d "$REPO_PATH/.git" ]; then + pushd "$REPO_PATH" >/dev/null + git init + git add . + git commit -m "Initial commit" || warn "Nothing to commit" + popd >/dev/null +fi + +# Generate initial metadata +generate_canonical_meta +generate_canonical_md +generate_index_json +generate_well_known_json +generate_gitfield_readme +generate_docs_index +generate_docs_css +generate_docs_repos_json +generate_docs_readme +generate_docs_nojekyll +generate_docs_robots +generate_docs_sitemap + +# Run push cycles +run_push_cycle 1 +generate_gitfield_md +run_push_cycle 2 +run_push_cycle 3 + +info "✅ gitfield-sync completed successfully." +info "🔗 View logs: $LOG_FILE" +info "🔗 View multi-repo manifest: $GITFIELD_MD" +info "🔗 View canonical metadata: $CANONICAL_META" +info "🔗 View canonical declaration: $CANONICAL_MD" +info "🔗 View index manifest: $INDEX_JSON" +info "🔗 View well-known metadata: $WELL_KNOWN_JSON" +info "🔗 View GitHub Pages: $DOCS_INDEX" diff --git a/docs/.well-known/gitfield.json.asc b/docs/.well-known/gitfield.json.asc new file mode 100644 index 0000000..e69011f --- /dev/null +++ b/docs/.well-known/gitfield.json.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYesACgkQTifTfDWI +cr+/khAAs5aiy4eR27MS20ZZvxgnO5ZNuVIjgikupmUTJGHw3HMKVZ711b5xU6rq +IVZIUIdnduGlXVyBqYNCNJPPiCWetqc1aW0733qPZDzcvSwwxttzc772JOzZJOSc +WrI8Ylz8y65OevXLc9fx5yqWSyN4UuEL+XT3Biub0ooMrGaQu2h0vAHlFZKHfUWR +4uLaHk+WHYxrfPpT4ZxRn88Q+5SbTn2UqUPGUU+UXVnBt7+5Yczcw+39Q70Wa+HV +psXJh9cjb3Yms9lUwToBm36Czu6pWlZ/dtdj7AA3B6TC5PAmMY7NrjBFiPHNtLKk +0cNiWxEpqd7o1jRllkIw+Azdww+xXxitf5lvTKu57+FtiwvOD9VkkBA5fzeQRkrk +5atPiSSKs0CuUELFeStGOJS7MKLOHrjlGhQ5R2i/ytTXmFsl2pO6yqZ/3lMVJtwb +LUs2LnAyKb1al7FYxmqS7SSIEU76HOdFEFUr16W1wUqBxnghAVVPoy+3mm4an2M9 +clu7CZOY2S3L2WhdFmbmY3joSD1yEzFLG6DU5QuCTY6xFr3rIlbzcsfkQyIVpzCd ++ADgtQ2EgZQk6S5KQ442eLLk4uZu4mQRN+sTYcJmgj2kXf89yMSMAa1OxVwa8n1l +CM4IlG67Epoin9T5E8Y5FzVs14Y30/6nPqOq6vGoI9NSh7oAluE= +=/76A +-----END PGP SIGNATURE----- diff --git a/docs/canonical.meta.asc b/docs/canonical.meta.asc new file mode 100644 index 0000000..606758d --- /dev/null +++ b/docs/canonical.meta.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYdEACgkQTifTfDWI +cr+i4A/+KfwU8E80i6JnuluVqxgZtrtvRUJ68BZvonVA0oRAPwXiSGISbM1JLzIX +Z1zcY9s0bQBsDbVx4oe6SN2BxjNHm3AoHz7eyEcyiodvMflwsrgHyaZt0a7rwP2c +VzX5SBiPi8LgUwa2zhvT+/xPpVCHFs981sUHQ3Am7DDhBsCyQikPP4G/wmv56T9M +2tQP1BzCoQEVdtHSWNTCEMXcu9bWYRUxgmcS/rmGyCgLdZGuptJjDB6upOX2ePjv +dgkCQqOHpLXslXjTrjqMfOI5reou9sHyKqeuqsdmdYTi1RWLLzUl9BHCzd1IrP0z +HVOt2vC4FgBV/mFvncwbJQrynXIA/e1hADd3GjNMO1LS7IXhrc7+IJ66K+aQ/kUk +bhhEe/FQpmylFjchyKxmnDCR9zxZL4GszSfYfu/GQE8JFVNZXVfM81v+AFk1LIY1 +8ya6Oy//lce5dXEi66fTYyR3bVDosiHodW1inbDoIluC0BFr+EKJKs5Ffw6pNhjv +Lw5wOowAUvJKam4VVSfwh9tXNwwn9btsGUwU7bMNeWaOZ5Y/W0yUXk0CAbxnsXBp +MCtMeZvjqcPlrcgO8f6DOmgf64CW7Z7/lyJ2/TymsoTSK5XroV3qULJZ1ABu8gRJ +r0EsTD9UaECsiCGR9Vyyu/cSwAlgD5b8TYnS/sZ+EhRi1nD5LP8= +=ugTN +-----END PGP SIGNATURE----- diff --git a/docs/gitfield.json.asc b/docs/gitfield.json.asc new file mode 100644 index 0000000..b724772 --- /dev/null +++ b/docs/gitfield.json.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYeYACgkQTifTfDWI +cr/u7A/9G4JcgOCX+hB20T++vtL6MNITlvYuMs2XFIK0Jvc2YJIIorbVtJMEgl0p +JEnGz/yVnlsuaU6Orn780VO1IQuMiyZyypUirUnzC9QVEJVbecgRmeey4YuFyVeP +w6HxEjLPmiaAZ61G5xa6bZt129MmNiubjHCeY8Jk7BBnl388/RLTUQ85vQsrILoo +8QzRI6WoqCjphqHHxIBF/eJYZ3ejDbHoYJaVBKp5XzeEdwr7+j3J6V7DhpKkSr12 +hDU7m+jk+RPpRiPbNvIOaUdw8rux7eisaUOtFeF/2Bh6Pi3YigwKvN/1DFeS02uD +zax9u8P56Bk6wjdF0dF+Cyld3v4Y+jyQmgQCpxRHX4NqdzdglpqEeOsqjuW93eMG +VQ0nF4j24ByqPQXHawgY2hvyRknVXW+aS6eO2JqVkv13CzRX1FdfN1ya6Ipw2Hk0 +JpxK/uBY60nHdL8Jr01XnvAWUcViaKOLWX1AIsoeFKO9xC43lqmvWsZYUF/UuJlk +eQTkisUivctgHfTMWlJrD5E0EkUaU+w3H+tt/JS695yU9OshcXRn8fm/N1SvnLyN +uoatiCvNMHX3f7Y+mCi7UC66Ye86sQeZyu53Nl6XtoZXu5lCXJ774s50QdlZb8vW +AN9xBgG0CXw8nhEUATUa96U5ZxTe0t9lIlbCLm8zQWNFq8Q5mFE= +=Icou +-----END PGP SIGNATURE----- diff --git a/docs/index.json.asc b/docs/index.json.asc new file mode 100644 index 0000000..2a08dcc --- /dev/null +++ b/docs/index.json.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYdsACgkQTifTfDWI +cr+cWBAAuSlp8MHjbwll6yf+BjTQ3XiATD4brRgbzKI7M+VSQIBHdTXdTVfUBW70 +hiqsrT46xXyRZF51S3tfNQdeNh5ghOvDky8DApVZkbSsR40bfBoOxhzLMMikglCT +8CLnD0jSoDgs1ZmLFLUSkKOhKSnbus8gTam7Q6JWLPjLtIDUn/H7ecay/g3y87NM +8wI9ysgXreGBI0kgvaunW02DoV9TXXul5D4aN/I+ABnhn0A/FH7+txWdwpC36iB0 +DdcY3jJuEyP+GDnUa+sdsthSy6EIy4Ivybx+EfN9dGFbOf/mfEZgrPOy1JjwmBZ1 +Z/EIIrwrSVL8tJJyRzrwsXV7Ajk/P6Zp+5Flz7ojlMAC83VgIc6no5X9QhHT5VAu +xJN95fpNBK9Yn4r4MAGQNtwQGEjrLyEDwUxaVG2D86osUyO/6D8HmhJksUwPbAp0 +i7BWKp3WTfBmHeCV4Wdxp94kN3msC6dirLlNveBEiDfYyn35Il3MDCMTYnhmmQom +r32jmEw4ks047GPlxM2uyqZeiJAXOgXA5UOKioLYHbsUovstMTdlKdk4E8p3dHeh +yqAHDSdCFfzU2jeGIBoiFfBetROgJaYIBhiyGwgnhQa5u1xObcX6DRphFGUYya0A +r+MvxcZ/4muwiwerYnxCZLrzw5TfJnRYGw8hGzCaE2kZQlkBIF0= +=W4qV +-----END PGP SIGNATURE----- diff --git a/docs/integrity.sha256.asc b/docs/integrity.sha256.asc new file mode 100644 index 0000000..41050c8 --- /dev/null +++ b/docs/integrity.sha256.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYfYACgkQTifTfDWI +cr94Cw//SqQWgaVF9YrahT1Ho0GFWf6jk3UYDa37uR+a6kJ60SP7Q1SmWFUQuuIU +BlW5w0MO0CqVImV+7zWsFQmiUTdDFe1zl8PBjj9MghYCw/r6KH9C3vV0moBKRK5V +ZtnOxAKpyna7r0H0IbVGr4baPS9uxiw8/uPShoLDT1p21fF2BjWk3FZfuJFMQ26d +MZDLHky8+ZGxkSqlpseLp/VS+egxMyYGiMvm5V261i93jPvrR+wvsaoZ0QxUerq4 +6jm04kC9UfNcPFal8iRWh4i2IW+N9evq0HtYi6JJ/89qDjieohM0TwZ422amn1wo +gWwjmNCwVG8WtFQM0tgcWG2W6n9yrFgIx33KUc2QP6uHi6nCeLWQRQsMC0wt+zVL +Zlcq+CBAlU9O1JHwQQ22hegDTrkdjgjYmoJ4oO6hcQ43bVEvkgbxzpgQ8wjZ1xkY +igKchS3pP8MaS56cSLquEuvSJFonDW9yGTQOZF8rTN1UWWDGnRVNobcls3onSViF +389ii6FfQvo/W2VV1BP1cBfvWo8Wr16xxKtMK65y3UulFnqYYyQxouVnbGCGxzWD +5nzXQS8xbbl6JeFwc6C9mXiMP0HCd97+3WRrYxFbMiQ+rWoBQ+0lH2ECQo5PM4Be +YDRFFCPIYTAWm1P2P2UGc2IBdtU/Cw6Wpfaa/tXteXY+T+ljAG8= +=bG1U +-----END PGP SIGNATURE----- diff --git a/docs/repos.json.asc b/docs/repos.json.asc new file mode 100644 index 0000000..979c944 --- /dev/null +++ b/docs/repos.json.asc @@ -0,0 +1,16 @@ +-----BEGIN PGP SIGNATURE----- + +iQIzBAABCgAdFiEEif0F7T4AkoRgIfM3TifTfDWIcr8FAmhHYfEACgkQTifTfDWI +cr+P2g/+PrlHJFxPBAOSYb3L+dLC8PEoONRND72I1qGb98EGgjXbU2Rws4tVXqbU ++5dxZj9fT0TtjWCKRSC3CjATy87ord43nueaW4fy8J6k6ZvlB/A0a/mqGhPSm2vN +UupG3rxOH7+JXsuq7N2fLHKlu04ruCRQ+sw/FjDDx+0Z98zL8o3/3wWWl0m7UlVs +4/fz2DnIJBGGl0+buwgjetSSSzrzRB+VvNS195So5Yq8O5/GStzwxcU8unCt8EHf +zZprZhJUAmu43KHDS9a23dnRdofSdJ++lL7pHUOhkrQUW6oA3PWS3xU/zU84k82v +2uFYp8VMzbLFTVAW4axLGD70sWoPWkuyYPtCJXUxNpkimDTmE2tNKbPAliwfbhbU +WWOy8ZlgKtEIVoK3ldL99aLzP7xhzhnMLYK9mOnyVjF2rriAo1jGEuk8eUtBu08K +iEdRBWeKI5GJTcDntaHEslk+R/ImAy9GJ1r3TWI/Esc/+GgweUFDS8A3GYKaCcEk ++cNtg0iF5xCdWBGTFn5SIOChUDJ+7Pmvxx73LtdPJ/VKkHo9vyODjf1CWUhW4+Ro +McF+pUQrSn821GvQY/zi2OMWuRggUaON565CGH0G3H2GsFgaZzKstfflYWUJK0ZI +vduqMVYK1moFAsCkCUeFPYaPHbz1PxaSYjUnWlR81ThmgY4Op5c= +=LJ86 +-----END PGP SIGNATURE-----