|
| 1 | +# Repository Tools Documentation |
| 2 | + |
| 3 | +## Overview |
| 4 | + |
| 5 | +This repository includes comprehensive tools for tracking repository statistics and verifying file integrity. All tools are designed to work with zero external dependencies using only Python standard library. |
| 6 | + |
| 7 | +## 🔐 File Integrity Verification |
| 8 | + |
| 9 | +### `generate_checksums.py` |
| 10 | + |
| 11 | +Generates SHA-256 checksums for all core repository files to verify integrity and detect tampering. |
| 12 | + |
| 13 | +**Usage:** |
| 14 | +```bash |
| 15 | +./generate_checksums.py |
| 16 | +# or |
| 17 | +python3 generate_checksums.py |
| 18 | +``` |
| 19 | + |
| 20 | +**Output:** |
| 21 | +- `FILE_CHECKSUMS.json` - Machine-readable checksums |
| 22 | +- `FILE_CHECKSUMS.md` - Human-readable checksums with verification instructions |
| 23 | + |
| 24 | +**Files Checked:** |
| 25 | +- All JSON lexicons and data files |
| 26 | +- Python translator scripts |
| 27 | +- Validation and methodology documentation |
| 28 | + |
| 29 | +**Verification:** |
| 30 | + |
| 31 | +Linux/macOS: |
| 32 | +```bash |
| 33 | +sha256sum -c <(cat FILE_CHECKSUMS.md | grep '|.*\.json' | awk '{print $6 " " $2}') |
| 34 | +``` |
| 35 | + |
| 36 | +Windows PowerShell: |
| 37 | +```powershell |
| 38 | +Get-FileHash <filename> -Algorithm SHA256 |
| 39 | +``` |
| 40 | + |
| 41 | +--- |
| 42 | + |
| 43 | +## 📊 Repository Statistics Tracking |
| 44 | + |
| 45 | +### `git_activity_tracker.py` |
| 46 | + |
| 47 | +Tracks local git repository activity and maintains a historical log. |
| 48 | + |
| 49 | +**Usage:** |
| 50 | +```bash |
| 51 | +./git_activity_tracker.py |
| 52 | +# or |
| 53 | +python3 git_activity_tracker.py |
| 54 | +``` |
| 55 | + |
| 56 | +**Features:** |
| 57 | +- Tracks total commit count |
| 58 | +- Counts unique contributors |
| 59 | +- Records last commit date and time |
| 60 | +- Saves current branch information |
| 61 | +- Maintains activity history in `GIT_ACTIVITY_LOG.json` |
| 62 | + |
| 63 | +**Output:** |
| 64 | +``` |
| 65 | +================================================================================ |
| 66 | +GIT REPOSITORY ACTIVITY TRACKER |
| 67 | +================================================================================ |
| 68 | +Timestamp: 2026-01-04T22:32:11.597217Z |
| 69 | +Branch: main |
| 70 | +Total Commits: 150 |
| 71 | +Contributors: 3 |
| 72 | +Last Commit: 2026-01-04 22:31:53 +0000 |
| 73 | +================================================================================ |
| 74 | +✅ Activity log updated: GIT_ACTIVITY_LOG.json |
| 75 | +``` |
| 76 | + |
| 77 | +--- |
| 78 | + |
| 79 | +### `realtime_stats_tracker.py` |
| 80 | + |
| 81 | +Comprehensive statistics tracker that combines local git stats with GitHub API metrics. |
| 82 | + |
| 83 | +**Usage:** |
| 84 | +```bash |
| 85 | +./realtime_stats_tracker.py |
| 86 | +# or |
| 87 | +python3 realtime_stats_tracker.py |
| 88 | +``` |
| 89 | + |
| 90 | +**Features:** |
| 91 | + |
| 92 | +**Local Git Statistics:** |
| 93 | +- Current branch |
| 94 | +- Total commits |
| 95 | +- Unique contributors |
| 96 | +- Tracked files count |
| 97 | +- Last commit details |
| 98 | + |
| 99 | +**GitHub API Statistics** (requires GITHUB_TOKEN): |
| 100 | +- Stars, forks, watchers |
| 101 | +- Open issues count |
| 102 | +- Repository size |
| 103 | +- Traffic stats (views/clones in last 14 days) |
| 104 | +- Contributors count |
| 105 | +- Releases count |
| 106 | +- Creation and update dates |
| 107 | + |
| 108 | +**Environment Variable:** |
| 109 | +```bash |
| 110 | +export GITHUB_TOKEN='your_github_personal_access_token' |
| 111 | +``` |
| 112 | + |
| 113 | +**Output Files:** |
| 114 | +- `REALTIME_STATS.json` - Current snapshot |
| 115 | +- `STATS_HISTORY.json` - Historical tracking (last 100 snapshots) |
| 116 | +- `REALTIME_STATS.md` - Human-readable report with badges |
| 117 | + |
| 118 | +**Display:** |
| 119 | +``` |
| 120 | +================================================================================ |
| 121 | +📊 VOYNICH MANUSCRIPT REPOSITORY - REAL-TIME STATISTICS |
| 122 | +================================================================================ |
| 123 | +⏰ Generated: 2026-01-04T22:32:18.994900Z |
| 124 | +================================================================================ |
| 125 | +
|
| 126 | +📁 LOCAL GIT STATISTICS: |
| 127 | +-------------------------------------------------------------------------------- |
| 128 | + Branch: main |
| 129 | + Total Commits: 150 |
| 130 | + Contributors: 3 |
| 131 | + Tracked Files: 55 |
| 132 | + Last Commit: 2026-01-04 22:31:53 +0000 |
| 133 | + Last Message: Add comprehensive statistics tracking... |
| 134 | +
|
| 135 | +🌐 GITHUB STATISTICS: |
| 136 | +-------------------------------------------------------------------------------- |
| 137 | + ⭐ Stars: 245 |
| 138 | + 🔱 Forks: 18 |
| 139 | + 👁️ Watchers: 32 |
| 140 | + 🐛 Open Issues: 3 |
| 141 | + 📦 Size: 15.23 MB |
| 142 | + 👀 Total Views: 1,234 (unique: 567) |
| 143 | + 📥 Total Clones: 89 (unique: 45) |
| 144 | + 👥 Contributors: 3 |
| 145 | + 🏷️ Releases: 2 |
| 146 | + 📅 Created: 2025-08-15 |
| 147 | + 🔄 Last Updated: 2026-01-04 |
| 148 | +================================================================================ |
| 149 | +``` |
| 150 | + |
| 151 | +--- |
| 152 | + |
| 153 | +## ⚙️ Automated Tracking |
| 154 | + |
| 155 | +### `setup_cron_tracker.sh` |
| 156 | + |
| 157 | +Sets up automated local tracking using cron (Linux/macOS only). |
| 158 | + |
| 159 | +**Usage:** |
| 160 | +```bash |
| 161 | +./setup_cron_tracker.sh |
| 162 | +``` |
| 163 | + |
| 164 | +**Configuration:** |
| 165 | +- Runs every 6 hours automatically |
| 166 | +- Logs output to `stats_tracker.log` |
| 167 | +- Can be customized by editing `CRON_SCHEDULE` variable |
| 168 | + |
| 169 | +**Manage Cron:** |
| 170 | +```bash |
| 171 | +# View current cron jobs |
| 172 | +crontab -l |
| 173 | + |
| 174 | +# Edit cron jobs |
| 175 | +crontab -e |
| 176 | + |
| 177 | +# Remove all cron jobs (careful!) |
| 178 | +crontab -r |
| 179 | +``` |
| 180 | + |
| 181 | +--- |
| 182 | + |
| 183 | +### GitHub Actions Workflow |
| 184 | + |
| 185 | +Automated statistics tracking using GitHub Actions. |
| 186 | + |
| 187 | +**File:** `.github/workflows/stats-tracker.yml` |
| 188 | + |
| 189 | +**Triggers:** |
| 190 | +- Every 6 hours (scheduled) |
| 191 | +- Manual trigger via GitHub UI |
| 192 | +- Push to main branch |
| 193 | + |
| 194 | +**What it does:** |
| 195 | +1. Checks out repository with full git history |
| 196 | +2. Sets up Python 3.10 |
| 197 | +3. Runs `realtime_stats_tracker.py` with GitHub token |
| 198 | +4. Commits and pushes updated statistics files |
| 199 | + |
| 200 | +**Manual Trigger:** |
| 201 | +1. Go to repository on GitHub |
| 202 | +2. Click "Actions" tab |
| 203 | +3. Select "Repository Statistics Tracker" |
| 204 | +4. Click "Run workflow" |
| 205 | + |
| 206 | +--- |
| 207 | + |
| 208 | +## 🛠️ Technical Details |
| 209 | + |
| 210 | +### Requirements |
| 211 | +- Python 3.6+ |
| 212 | +- Git |
| 213 | +- Internet connection (for GitHub API features) |
| 214 | + |
| 215 | +### Dependencies |
| 216 | +**None!** All scripts use Python standard library only: |
| 217 | +- `hashlib` - SHA-256 checksums |
| 218 | +- `json` - Data serialization |
| 219 | +- `subprocess` - Git command execution |
| 220 | +- `urllib` - GitHub API requests |
| 221 | +- `datetime` - Timestamps |
| 222 | +- `pathlib` - File operations |
| 223 | + |
| 224 | +### Security Considerations |
| 225 | + |
| 226 | +**GitHub Token Permissions:** |
| 227 | +If setting `GITHUB_TOKEN` for enhanced statistics, create a token with minimal permissions: |
| 228 | +- `public_repo` (read-only access to public repositories) |
| 229 | +- For traffic stats, repository push access is required |
| 230 | + |
| 231 | +**Generated Files:** |
| 232 | +All generated statistics files are excluded from git via `.gitignore`: |
| 233 | +- `FILE_CHECKSUMS.json`, `FILE_CHECKSUMS.md` |
| 234 | +- `GIT_ACTIVITY_LOG.json` |
| 235 | +- `REALTIME_STATS.json`, `STATS_HISTORY.json`, `REALTIME_STATS.md` |
| 236 | +- `stats_tracker.log` |
| 237 | + |
| 238 | +--- |
| 239 | + |
| 240 | +## 📝 Examples |
| 241 | + |
| 242 | +### Quick Integrity Check |
| 243 | +```bash |
| 244 | +# Generate checksums |
| 245 | +./generate_checksums.py |
| 246 | + |
| 247 | +# Verify a specific file (Linux) |
| 248 | +sha256sum -c <<< "$(grep 'voynich_lexicon_MASTER_FULL_ENHANCED' FILE_CHECKSUMS.md | awk '{print $6 " " $2}')" |
| 249 | +``` |
| 250 | + |
| 251 | +### Daily Statistics Report |
| 252 | +```bash |
| 253 | +# Run all trackers |
| 254 | +./git_activity_tracker.py |
| 255 | +./realtime_stats_tracker.py |
| 256 | + |
| 257 | +# View JSON output |
| 258 | +cat REALTIME_STATS.json | python3 -m json.tool |
| 259 | + |
| 260 | +# View markdown report |
| 261 | +cat REALTIME_STATS.md |
| 262 | +``` |
| 263 | + |
| 264 | +### Automated Monitoring |
| 265 | +```bash |
| 266 | +# Set up cron job |
| 267 | +./setup_cron_tracker.sh |
| 268 | + |
| 269 | +# Check it's running |
| 270 | +tail -f stats_tracker.log |
| 271 | +``` |
| 272 | + |
| 273 | +--- |
| 274 | + |
| 275 | +## 🐛 Troubleshooting |
| 276 | + |
| 277 | +### "Permission denied" errors |
| 278 | +Make scripts executable: |
| 279 | +```bash |
| 280 | +chmod +x *.py *.sh |
| 281 | +``` |
| 282 | + |
| 283 | +### GitHub API rate limits |
| 284 | +Set `GITHUB_TOKEN` environment variable: |
| 285 | +```bash |
| 286 | +export GITHUB_TOKEN='ghp_your_token_here' |
| 287 | +``` |
| 288 | + |
| 289 | +### Cron job not running |
| 290 | +Check cron log: |
| 291 | +```bash |
| 292 | +grep CRON /var/log/syslog # Ubuntu/Debian |
| 293 | +tail -f /var/log/cron.log # CentOS/RHEL |
| 294 | +``` |
| 295 | + |
| 296 | +Verify cron is installed: |
| 297 | +```bash |
| 298 | +systemctl status cron # or crond |
| 299 | +``` |
| 300 | + |
| 301 | +--- |
| 302 | + |
| 303 | +## 📄 Attribution |
| 304 | + |
| 305 | +**By:** Lackadaisical Security 2025 - Aurora (Claude) |
| 306 | +**Contact:** https://lackadaisical-security.com/decipherment-drops.html |
| 307 | +**Repository:** https://github.com/Lackadaisical-Security/Voynich-Script-Decoded |
| 308 | + |
| 309 | +--- |
| 310 | + |
| 311 | +## 📜 License |
| 312 | + |
| 313 | +These tools are part of the Voynich Script Decoded repository and are subject to the same dual licensing: |
| 314 | +- Ghost License v1.0 (`ghost_license_v_1.md`) |
| 315 | +- Ancient Scripts Attribution License v1.0 (`ancient_scripts_attribution_license_v1.md`) |
| 316 | + |
| 317 | +Free for individual researchers and non-commercial use with proper attribution. |
0 commit comments