refactor(repo): reorganize repository structure for improved navigation and maintainability
Implement comprehensive directory reorganization to improve discoverability,
logical grouping, and separation of concerns across documentation, scripts,
and infrastructure snapshots.
Major Changes:
1. Documentation Reorganization:
- Created start-here-docs/ for onboarding documentation
* Moved QUICK-START.md, START-HERE.md, GIT-SETUP-GUIDE.md
* Moved GIT-QUICK-REFERENCE.md, SCRIPT-USAGE.md, SETUP-COMPLETE.md
- Created troubleshooting/ directory
* Moved BUGFIX-SUMMARY.md for centralized issue resolution
- Created mcp/ directory for Model Context Protocol configurations
* Moved OBSIDIAN-MCP-SETUP.md to mcp/obsidian/
2. Scripts Reorganization:
- Created scripts/crawlers-exporters/ for infrastructure collection
* Moved collect*.sh scripts and collection documentation
* Consolidates Proxmox homelab export tooling
- Created scripts/fixers/ for operational repair scripts
* Moved fix_n8n_db_*.sh scripts
* Isolated scripts with embedded credentials (templates tracked)
- Created scripts/qol/ for quality-of-life utilities
* Moved git-aliases.sh and git-first-commit.sh
3. Infrastructure Snapshots:
- Created disaster-recovery/ for active infrastructure state
* Moved latest homelab-export-20251202-204939/ snapshot
* Contains current VM/CT configurations and system state
- Created archive-homelab/ for historical snapshots
* Moved homelab-export-*.tar.gz archives
* Preserves point-in-time backups for reference
4. Agent Definitions:
- Created sub-agents/ directory
* Added backend-builder.md (development agent)
* Added lab-operator.md (infrastructure operations agent)
* Added librarian.md (git/version control agent)
* Added scribe.md (documentation agent)
5. Updated INDEX.md:
- Reflects new directory structure throughout
- Updated all file path references
- Enhanced navigation with new sections
- Added agent roles documentation
- Updated quick reference commands
6. Security Improvements:
- Updated .gitignore to match reorganized file locations
- Corrected path for scripts/fixers/fix_n8n_db_c_locale.sh exclusion
- Maintained template-based credential management pattern
Infrastructure State Update:
- Latest snapshot: 2025-12-02 20:49:54
- Removed: VM 101 (gitlab), CT 112 (Anytype)
- Added: CT 113 (n8n)
- Total: 9 VMs, 3 Containers
Impact:
- Improved repository navigation and discoverability
- Logical separation of documentation, scripts, and snapshots
- Clearer onboarding path for new users
- Enhanced maintainability through organized structure
- Foundation for multi-agent workflow support
Files changed: 90 files (+935/-349)
- 3 modified, 14 new files, 73 renames/moves
🤖 Generated with [Claude Code](https://claude.com/claude-code)
Co-Authored-By: Claude <noreply@anthropic.com>
This commit is contained in:
139
scripts/qol/git-first-commit.sh
Normal file
139
scripts/qol/git-first-commit.sh
Normal file
@@ -0,0 +1,139 @@
|
||||
#!/bin/bash
|
||||
# First-time Git Setup and Initial Commit Helper
|
||||
# This script helps you make your first commit to the homelab repository
|
||||
|
||||
set -e
|
||||
|
||||
# Colors for pretty output
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
YELLOW='\033[1;33m'
|
||||
RED='\033[0;31m'
|
||||
NC='\033[0m' # No Color
|
||||
|
||||
echo -e "${BLUE}================================================${NC}"
|
||||
echo -e "${BLUE} Homelab Git - Initial Commit Setup${NC}"
|
||||
echo -e "${BLUE}================================================${NC}"
|
||||
echo
|
||||
|
||||
# Check if we're in the right directory
|
||||
if [ ! -d ".git" ]; then
|
||||
echo -e "${RED}Error: Not in a git repository!${NC}"
|
||||
echo "Please run this script from /home/jramos/homelab"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if git user is configured
|
||||
USER_NAME=$(git config --global user.name 2>/dev/null || echo "")
|
||||
USER_EMAIL=$(git config --global user.email 2>/dev/null || echo "")
|
||||
|
||||
if [ -z "$USER_NAME" ] || [ -z "$USER_EMAIL" ]; then
|
||||
echo -e "${YELLOW}Git user not configured. Let's set that up first.${NC}"
|
||||
echo
|
||||
|
||||
# Get user name
|
||||
if [ -z "$USER_NAME" ]; then
|
||||
echo -e "${BLUE}Enter your name (e.g., 'John Smith'):${NC}"
|
||||
read -p "> " USER_NAME
|
||||
git config --global user.name "$USER_NAME"
|
||||
echo -e "${GREEN}Name set to: $USER_NAME${NC}"
|
||||
fi
|
||||
|
||||
# Get user email
|
||||
if [ -z "$USER_EMAIL" ]; then
|
||||
echo
|
||||
echo -e "${BLUE}Enter your email (e.g., 'john@example.com'):${NC}"
|
||||
read -p "> " USER_EMAIL
|
||||
git config --global user.email "$USER_EMAIL"
|
||||
echo -e "${GREEN}Email set to: $USER_EMAIL${NC}"
|
||||
fi
|
||||
|
||||
echo
|
||||
fi
|
||||
|
||||
echo -e "${GREEN}Git user configured:${NC}"
|
||||
echo " Name: $(git config --global user.name)"
|
||||
echo " Email: $(git config --global user.email)"
|
||||
echo
|
||||
|
||||
# Show current status
|
||||
echo -e "${YELLOW}Current repository status:${NC}"
|
||||
git status
|
||||
echo
|
||||
|
||||
# Ask about .env file
|
||||
echo -e "${YELLOW}About the .env file:${NC}"
|
||||
echo "The .gitignore file is configured to IGNORE your .env file"
|
||||
echo "(it contains sensitive information and should not be committed)"
|
||||
echo
|
||||
echo "Only .env.example will be tracked in git."
|
||||
echo
|
||||
|
||||
# Ask if ready to commit
|
||||
echo -e "${BLUE}Ready to create your first commit?${NC}"
|
||||
echo "This will add all files (except those in .gitignore) to version control."
|
||||
echo
|
||||
read -p "Continue? (y/n): " -n 1 -r
|
||||
echo
|
||||
if [[ ! $REPLY =~ ^[Yy]$ ]]; then
|
||||
echo -e "${YELLOW}Commit cancelled. No changes made.${NC}"
|
||||
exit 0
|
||||
fi
|
||||
|
||||
# Add all files
|
||||
echo
|
||||
echo -e "${YELLOW}Step 1: Adding files to staging area...${NC}"
|
||||
git add .
|
||||
|
||||
# Show what will be committed
|
||||
echo
|
||||
echo -e "${YELLOW}Step 2: Files to be committed:${NC}"
|
||||
git status
|
||||
|
||||
# Create the commit
|
||||
echo
|
||||
echo -e "${YELLOW}Step 3: Creating initial commit...${NC}"
|
||||
git commit -m "Initial commit: Homelab infrastructure repository
|
||||
|
||||
This commit includes:
|
||||
- Proxmox configuration collection scripts
|
||||
- Environment configuration templates
|
||||
- Comprehensive documentation
|
||||
- Git ignore patterns for sensitive data
|
||||
|
||||
Infrastructure: Proxmox VE 8.3.3
|
||||
Node: serviceslab
|
||||
VMs: 11 virtual machines (docker-hub, gitlab, dev, ansible, CML, web servers, db)
|
||||
Containers: 3 LXC containers (nginx, netbox, anytype)
|
||||
"
|
||||
|
||||
echo
|
||||
echo -e "${GREEN}================================================${NC}"
|
||||
echo -e "${GREEN} Success! Your homelab is now under version control${NC}"
|
||||
echo -e "${GREEN}================================================${NC}"
|
||||
echo
|
||||
echo "What you can do now:"
|
||||
echo
|
||||
echo -e "${BLUE}View commit history:${NC}"
|
||||
echo " git log"
|
||||
echo
|
||||
echo -e "${BLUE}View changes since last commit:${NC}"
|
||||
echo " git status"
|
||||
echo " git diff"
|
||||
echo
|
||||
echo -e "${BLUE}Make changes and commit them:${NC}"
|
||||
echo " # Make your changes to files"
|
||||
echo " git add <file> # Stage specific file"
|
||||
echo " git add . # Stage all changes"
|
||||
echo " git commit -m \"Description\" # Commit with message"
|
||||
echo
|
||||
echo -e "${BLUE}View file history:${NC}"
|
||||
echo " git log --oneline"
|
||||
echo " git log --graph --oneline --all"
|
||||
echo
|
||||
echo -e "${YELLOW}Repository location:${NC}"
|
||||
echo " Linux: /home/jramos/homelab"
|
||||
echo " Windows: \\\\wsl\$\\Ubuntu\\home\\jramos\\homelab"
|
||||
echo
|
||||
echo -e "${GREEN}Happy homelabbing!${NC}"
|
||||
echo
|
||||
Reference in New Issue
Block a user