Update .gitignore to include scripts for loading environment variables and Git credentials. Remove obsolete documentation files including 100_PERCENT_LINK_VERIFICATION_ACHIEVED.md, CROSS_REFERENCE_VERIFICATION_REPORT.md, DOCUMENT_RELATIONSHIP_VISUALIZATION.md, and several project management reports to streamline the repository and enhance maintainability. Revise DOCUMENT_RELATIONSHIP_MAP.md to correct link paths and add a new section for visual specifications.

This commit is contained in:
defiQUG
2025-12-09 02:28:28 -08:00
parent b64b9cef3c
commit deef0051b3
126 changed files with 18365 additions and 573 deletions

View File

@@ -0,0 +1,30 @@
#!/bin/bash
# Git credential helper that uses GITHUB_TOKEN from .env file
if [ "$1" = get ]; then
# Load .env if it exists
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
fi
# Read the input
protocol=""
host=""
path=""
while IFS= read -r line; do
case "$line" in
protocol=*) protocol="${line#*=}" ;;
host=*) host="${line#*=}" ;;
path=*) path="${line#*=}" ;;
esac
done
# Only handle GitHub HTTPS URLs
if [ "$protocol" = "https" ] && [ "$host" = "github.com" ]; then
if [ -n "$GITHUB_TOKEN" ]; then
echo "username=git"
echo "password=$GITHUB_TOKEN"
fi
fi
fi

12
scripts/load_env.sh Executable file
View File

@@ -0,0 +1,12 @@
#!/bin/bash
# Load environment variables from .env file
if [ -f .env ]; then
export $(grep -v '^#' .env | xargs)
echo "Environment variables loaded from .env"
echo "GITHUB_TOKEN is set: ${GITHUB_TOKEN:0:10}..."
else
echo "Error: .env file not found"
exit 1
fi

View File

@@ -0,0 +1,88 @@
#!/bin/bash
# Setup Automated Link Verification Cron Jobs
# This script sets up automated link verification using cron
set -e
# Colors for output
GREEN='\033[0;32m'
YELLOW='\033[1;33m'
NC='\033[0m' # No Color
PROJECT_ROOT="$(cd "$(dirname "${BASH_SOURCE[0]}")/.." && pwd)"
SCRIPT_DIR="${PROJECT_ROOT}/scripts"
LOG_DIR="${PROJECT_ROOT}/logs"
echo "=========================================="
echo "Link Verification Cron Job Setup"
echo "=========================================="
echo ""
# Create logs directory if it doesn't exist
if [ ! -d "$LOG_DIR" ]; then
echo "Creating logs directory: $LOG_DIR"
mkdir -p "$LOG_DIR"
fi
# Make scripts executable
echo "Making verification scripts executable..."
chmod +x "${SCRIPT_DIR}/verify_cross_references.sh"
chmod +x "${SCRIPT_DIR}/verify_cross_references_simple.sh"
if [ -f "${SCRIPT_DIR}/verify_links.py" ]; then
chmod +x "${SCRIPT_DIR}/verify_links.py"
fi
# Create cron job entries
echo ""
echo "Cron job configuration:"
echo "----------------------"
echo ""
echo "Daily Verification (2 AM):"
echo "0 2 * * * cd ${PROJECT_ROOT} && ${SCRIPT_DIR}/verify_cross_references_simple.sh >> ${LOG_DIR}/daily_verification_\$(date +\\%Y-\\%m-\\%d).log 2>&1"
echo ""
echo "Weekly Comprehensive Verification (Sunday 3 AM):"
echo "0 3 * * 0 cd ${PROJECT_ROOT} && ${SCRIPT_DIR}/verify_cross_references.sh >> ${LOG_DIR}/weekly_verification_\$(date +\\%Y-\\%m-\\%d).log 2>&1"
echo ""
# Ask user if they want to install cron jobs
read -p "Do you want to install these cron jobs? (y/n): " -n 1 -r
echo ""
if [[ $REPLY =~ ^[Yy]$ ]]; then
# Create temporary cron file
CRON_TEMP=$(mktemp)
# Get existing crontab
crontab -l > "$CRON_TEMP" 2>/dev/null || true
# Add new cron jobs
echo "" >> "$CRON_TEMP"
echo "# DBIS Documentation Link Verification" >> "$CRON_TEMP"
echo "# Daily verification at 2 AM" >> "$CRON_TEMP"
echo "0 2 * * * cd ${PROJECT_ROOT} && ${SCRIPT_DIR}/verify_cross_references_simple.sh >> ${LOG_DIR}/daily_verification_\$(date +\\%Y-\\%m-\\%d).log 2>&1" >> "$CRON_TEMP"
echo "" >> "$CRON_TEMP"
echo "# Weekly comprehensive verification on Sunday at 3 AM" >> "$CRON_TEMP"
echo "0 3 * * 0 cd ${PROJECT_ROOT} && ${SCRIPT_DIR}/verify_cross_references.sh >> ${LOG_DIR}/weekly_verification_\$(date +\\%Y-\\%m-\\%d).log 2>&1" >> "$CRON_TEMP"
# Install new crontab
crontab "$CRON_TEMP"
rm "$CRON_TEMP"
echo -e "${GREEN}✓ Cron jobs installed successfully!${NC}"
echo ""
echo "To view your cron jobs, run: crontab -l"
echo "To remove these cron jobs, edit: crontab -e"
else
echo -e "${YELLOW}Cron jobs not installed.${NC}"
echo ""
echo "To install manually, add these lines to your crontab (crontab -e):"
echo ""
echo "0 2 * * * cd ${PROJECT_ROOT} && ${SCRIPT_DIR}/verify_cross_references_simple.sh >> ${LOG_DIR}/daily_verification_\$(date +\\%Y-\\%m-\\%d).log 2>&1"
echo "0 3 * * 0 cd ${PROJECT_ROOT} && ${SCRIPT_DIR}/verify_cross_references.sh >> ${LOG_DIR}/weekly_verification_\$(date +\\%Y-\\%m-\\%d).log 2>&1"
fi
echo ""
echo "=========================================="
echo "Setup Complete"
echo "=========================================="