Files
claudetools/clients/internal-infrastructure/scripts/reset-gitea-password.sh
Mike Swanson 5cbd49ce24 Reorganize repo: compartmentalize scripts by client/project
Move 150+ scripts from root and scripts/ into client/project directories:
- clients/dataforth/scripts/ (110 files: AD2, sync, SSH, DB, DOS scripts)
- clients/bg-builders/scripts/ (14 files: Lesley mgmt, Exchange, termination)
- clients/internal-infrastructure/scripts/ (10 files: GDAP, Gitea, backups)
- projects/msp-tools/scripts/ (9 files: CIPP, MSP onboarding, Datto)
- projects/gururmm-agent/scripts/ (3 files: API test, JWT, record counts)
- clients/glaztech/scripts/ (1 file: CentraStage removal)

Also reorganized:
- VPN scripts → infrastructure/vpn-configs/
- Retrieved API/JS files → api/
- Forum posts → projects/community-forum/forum-posts/
- SSH docs → clients/internal-infrastructure/docs/
- NWTOC/CTONW docs → projects/wrightstown-smarthome/docs/
- ACG website files → projects/internal/acg-website-2025/
- Dataforth docs → clients/dataforth/docs/
- schema-retrieved.sql → docs/database/

Deleted 24 tmp_*.ps1 one-off debug scripts (preserved in git history).
Root reduced from 220+ files to 62 items (docs + directories only).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
2026-03-20 17:15:07 -07:00

73 lines
2.0 KiB
Bash

#!/bin/bash
# Reset Gitea password for mike@azcomputerguru.com
# Run this on Jupiter server (172.16.3.20) as root
# Note: Gitea runs in Docker container
echo "=== Gitea Password Reset (Docker) ==="
echo ""
# Check if running as root
if [ "$EUID" -ne 0 ]; then
echo "[ERROR] This script must be run as root"
exit 1
fi
# Find Gitea Docker container
echo "[1] Finding Gitea Docker container..."
CONTAINER=$(docker ps --filter 'name=gitea' --format '{{.Names}}' | head -n 1)
if [ -z "$CONTAINER" ]; then
echo "[ERROR] Cannot find Gitea container"
echo ""
echo "Available containers:"
docker ps --format '{{.Names}}'
exit 1
fi
echo "[OK] Found container: $CONTAINER"
echo ""
echo "[2] Current Gitea users:"
docker exec $CONTAINER gitea admin user list 2>/dev/null || \
echo "[WARNING] Could not list users"
echo ""
echo "[3] Resetting password for: mike@azcomputerguru.com"
echo ""
# Prompt for new password
read -sp "Enter new password: " NEW_PASSWORD
echo ""
read -sp "Confirm password: " CONFIRM_PASSWORD
echo ""
if [ "$NEW_PASSWORD" != "$CONFIRM_PASSWORD" ]; then
echo "[ERROR] Passwords do not match"
exit 1
fi
if [ -z "$NEW_PASSWORD" ]; then
echo "[ERROR] Password cannot be empty"
exit 1
fi
echo ""
echo "[4] Executing password change..."
# Reset password using docker exec (try username 'mike' first, then email)
docker exec $CONTAINER gitea admin user change-password --username mike --password "$NEW_PASSWORD" 2>&1 || \
docker exec $CONTAINER gitea admin user change-password --username mike@azcomputerguru.com --password "$NEW_PASSWORD" 2>&1
if [ $? -eq 0 ]; then
echo ""
echo "[SUCCESS] Password reset complete!"
echo ""
echo "You can now login at: https://git.azcomputerguru.com/"
echo "Username: mike@azcomputerguru.com (or just 'mike')"
echo "Password: (the one you just set)"
else
echo ""
echo "[ERROR] Password reset failed"
echo "Try running manually with different username format"
fi