diff --git a/GITHUB_AUTH_SETUP.md b/GITHUB_AUTH_SETUP.md deleted file mode 100644 index 78b1356..0000000 --- a/GITHUB_AUTH_SETUP.md +++ /dev/null @@ -1,116 +0,0 @@ -# GitHub Authentication Setup Guide - -GitHub requires secure authentication for pushing code. Choose one of these methods: - -## 🔑 Option 1: SSH Keys (Recommended) - -SSH keys are more secure and convenient - no password prompts after setup. - -### Setup Steps: -1. **Generate SSH key** (if you don't have one): - ```bash - ssh-keygen -t ed25519 -C "your_email@example.com" - # Press Enter to accept default file location - # Enter a secure passphrase (optional but recommended) - ``` - -2. **Add SSH key to ssh-agent**: - ```bash - eval "$(ssh-agent -s)" - ssh-add ~/.ssh/id_ed25519 - ``` - -3. **Copy public key to clipboard**: - ```bash - cat ~/.ssh/id_ed25519.pub - # Copy the entire output - ``` - -4. **Add key to GitHub**: - - Go to: https://github.com/settings/keys - - Click "New SSH key" - - Paste your public key - - Give it a descriptive title - - Click "Add SSH key" - -5. **Test connection**: - ```bash - ssh -T git@github.com - # Should say: "Hi username! You've successfully authenticated" - ``` - -6. **Use SSH repository URL**: - - Format: `git@github.com:username/repository.git` - - Example: `git@github.com:megaproxy/petbot-irc-game.git` - ---- - -## 🎫 Option 2: Personal Access Token - -Use HTTPS with a token instead of your password. - -### Setup Steps: -1. **Create Personal Access Token**: - - Go to: https://github.com/settings/tokens - - Click "Generate new token" → "Generate new token (classic)" - - Give it a descriptive name: "PetBot Development" - - Select scopes: - - ✅ `repo` (for private repositories) - - ✅ `public_repo` (for public repositories) - - Click "Generate token" - - **Copy the token immediately** (you won't see it again!) - -2. **Use HTTPS repository URL**: - - Format: `https://github.com/username/repository.git` - - Example: `https://github.com/megaproxy/petbot-irc-game.git` - -3. **When prompted for password**: - - Username: Your GitHub username - - Password: **Use your Personal Access Token** (NOT your account password) - -4. **Optional: Store credentials** (so you don't have to enter token every time): - ```bash - git config --global credential.helper store - # After first successful push, credentials will be saved - ``` - ---- - -## 🚀 After Authentication Setup - -Once you've set up authentication, you can proceed with the GitHub setup: - -1. **Create GitHub repository** at https://github.com/new -2. **Run our setup script**: - ```bash - ./setup-github.sh - ``` -3. **Choose your authentication method** (SSH or Token) -4. **Enter your repository URL** -5. **Done!** Future pushes will be automatic - ---- - -## 🔧 Troubleshooting - -### SSH Issues: -- **"Permission denied"**: Check if SSH key is added to GitHub -- **"Could not open a connection"**: Check SSH agent with `ssh-add -l` -- **"Bad owner or permissions"**: Fix with `chmod 600 ~/.ssh/id_ed25519` - -### Token Issues: -- **"Authentication failed"**: Make sure you're using the token, not your password -- **"Remote access denied"**: Check token has correct scopes (repo/public_repo) -- **"Token expired"**: Create a new token at https://github.com/settings/tokens - -### General Issues: -- **"Repository not found"**: Check repository URL and access permissions -- **"Updates were rejected"**: Repository might not be empty - contact support - ---- - -## 📚 Official Documentation - -- **SSH Keys**: https://docs.github.com/en/authentication/connecting-to-github-with-ssh -- **Personal Access Tokens**: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token -- **Git Authentication**: https://docs.github.com/get-started/getting-started-with-git/about-remote-repositories \ No newline at end of file diff --git a/README.md b/README.md index dcd473c..a74469f 100644 --- a/README.md +++ b/README.md @@ -37,8 +37,8 @@ A feature-rich IRC bot that brings Pokemon-style pet collecting and battling to ### Installation 1. Clone the repository: ```bash - git clone https://github.com/yourusername/petbot.git - cd petbot + git clone ssh://git@192.168.1.249:2230/megaproxy/Petbot.git + cd Petbot ``` 2. Install dependencies: diff --git a/setup-github.sh b/setup-github.sh deleted file mode 100755 index 1c2d717..0000000 --- a/setup-github.sh +++ /dev/null @@ -1,138 +0,0 @@ -#!/bin/bash -# GitHub Setup Script for PetBot -# Run this script after creating your GitHub repository and setting up authentication - -echo "🚀 PetBot GitHub Setup" -echo "======================" - -# Check if we're in a git repository -if [ ! -d ".git" ]; then - echo "❌ Error: Not in a git repository" - exit 1 -fi - -echo "🔐 GitHub Authentication Setup Required" -echo "=======================================" -echo "" -echo "GitHub requires secure authentication. Choose one option:" -echo "" -echo "Option 1: SSH Key (Recommended)" -echo " • More secure and convenient" -echo " • No password prompts after setup" -echo " • Repository URL format: git@github.com:username/repo.git" -echo "" -echo "Option 2: Personal Access Token" -echo " • Use HTTPS with token instead of password" -echo " • Repository URL format: https://github.com/username/repo.git" -echo "" -echo "📖 Setup guides:" -echo " SSH Keys: https://docs.github.com/en/authentication/connecting-to-github-with-ssh" -echo " Access Tokens: https://docs.github.com/en/authentication/keeping-your-account-and-data-secure/creating-a-personal-access-token" -echo "" - -# Ask user which method they want to use -echo "Which authentication method did you set up?" -echo "1) SSH Key" -echo "2) Personal Access Token (HTTPS)" -read -p "Enter choice (1 or 2): " AUTH_CHOICE - -case $AUTH_CHOICE in - 1) - echo "" - echo "📝 Enter your SSH repository URL:" - echo " Format: git@github.com:yourusername/petbot-irc-game.git" - read -p "SSH URL: " REPO_URL - - if [[ ! "$REPO_URL" =~ ^git@github\.com: ]]; then - echo "❌ Error: Please use SSH URL format (git@github.com:username/repo.git)" - exit 1 - fi - ;; - 2) - echo "" - echo "📝 Enter your HTTPS repository URL:" - echo " Format: https://github.com/yourusername/petbot-irc-game.git" - read -p "HTTPS URL: " REPO_URL - - if [[ ! "$REPO_URL" =~ ^https://github\.com/ ]]; then - echo "❌ Error: Please use HTTPS URL format (https://github.com/username/repo.git)" - exit 1 - fi - - echo "" - echo "⚠️ Important: When prompted for password, use your Personal Access Token" - echo " Do NOT use your GitHub account password" - ;; - *) - echo "❌ Invalid choice" - exit 1 - ;; -esac - -if [ -z "$REPO_URL" ]; then - echo "❌ Error: No URL provided" - exit 1 -fi - -# Test GitHub connection -echo "" -echo "🔍 Testing GitHub connection..." -if [ "$AUTH_CHOICE" = "1" ]; then - ssh -T git@github.com 2>/dev/null - if [ $? -ne 1 ]; then - echo "❌ SSH connection test failed. Please check your SSH key setup." - echo " Guide: https://docs.github.com/en/authentication/connecting-to-github-with-ssh" - exit 1 - fi - echo "✅ SSH connection successful" -else - echo "⚠️ HTTPS connection will be tested during push" -fi - -# Add remote origin -echo "" -echo "🔗 Adding GitHub remote..." -git remote add origin "$REPO_URL" 2>/dev/null || { - echo "🔄 Remote already exists, updating..." - git remote set-url origin "$REPO_URL" -} - -# Push to GitHub -echo "⬆️ Pushing to GitHub..." -if ! git push -u origin main; then - echo "" - echo "❌ Push failed. Common solutions:" - if [ "$AUTH_CHOICE" = "1" ]; then - echo " • Check SSH key is added to GitHub: https://github.com/settings/keys" - echo " • Verify SSH agent is running: ssh-add -l" - else - echo " • Use Personal Access Token as password (not account password)" - echo " • Create token at: https://github.com/settings/tokens" - echo " • Token needs 'repo' scope for private repos" - fi - echo " • Verify repository exists and you have write access" - exit 1 -fi - -# Push tags -echo "🏷️ Pushing tags..." -git push --tags - -echo "" -echo "✅ Setup complete!" -echo "" -echo "🎯 Your repository is now on GitHub:" -echo " Repository: $REPO_URL" -echo " Current version: v0.1.0" -echo " Authentication: $([ "$AUTH_CHOICE" = "1" ] && echo "SSH Key" || echo "Personal Access Token")" -echo "" -echo "🔄 Future updates will be automatic:" -echo " - Claude will commit changes with descriptive messages" -echo " - Changelog will be updated automatically" -echo " - Version tags will be created for releases" -echo " - All changes will be pushed to GitHub" -echo "" -echo "📚 Useful commands:" -echo " git status - Check repository status" -echo " git log --oneline - View commit history" -echo " git tag -l - List all version tags" \ No newline at end of file