Commit Graph

19 Commits

Author SHA1 Message Date
86f19ba044 feat: Add AlexHost deployment pipeline and bot control functionality
All checks were successful
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Successful in 59s
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
- Add Gitea Actions workflow for manual AlexHost deployment
- Add docker-compose.alexhost.yml for production deployment
- Add deploy-alexhost.sh script with server-side build support
- Add Bot Control feature (Start/Stop/Restart) for remote bot management
- Add discovery control endpoint in TeleBot
- Update TeleBot with StartPollingAsync/StopPolling/RestartPollingAsync
- Fix platform architecture issues by building on target server
- Update docker-compose configurations for all environments

Deployment tested successfully:
- TeleShop: healthy at https://teleshop.silentmary.mywire.org
- TeleBot: healthy with discovery integration
- SilverPay: connectivity verified

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-26 12:33:46 +00:00
10d3164139 feat: Add fresh database deployment + comprehensive setup documentation
All checks were successful
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Successful in 58s
## CI/CD Improvements

**Database Reset on Every Deployment:**
- CT109 Pre-Production: Automatically deletes database volume before deployment
- Production VPS: Same fresh database logic for consistent deployments
- Creates timestamped backup before deletion for safety
- Ensures 100% fresh state (only admin user, no sample data)

**Security Fix:**
- Moved hardcoded Telegram bot token to Gitea secret
- Now uses ${{ secrets.CT109_TELEGRAM_BOT_TOKEN }} in workflow
- Prevents token exposure in repository

## Documentation Created

**DEPLOYMENT.md (Rewritten):**
- Fixed incorrect deployment path (/opt/littleshop → ~/littleshop for CT109)
- Added comprehensive CI/CD-based deployment guide
- Documented automatic fresh database on every deployment
- Included network architecture diagrams
- Added troubleshooting for common networking issues
- Removed incorrect docker-compose manual instructions

**SILVERPAY_SETUP.md (New):**
- Complete SilverPay integration configuration guide
- Installation instructions for CT109
- API key generation and webhook security
- Payment workflow documentation
- Troubleshooting common integration issues
- Alternative BTCPay Server reference

**BOT_REGISTRATION.md (New):**
- TeleBot first-time setup and registration guide
- Automatic vs manual registration workflows
- Bot token security best practices
- API endpoints for bot management
- Comprehensive troubleshooting section
- Database schema documentation

## Gitea Secrets Required

To complete deployment, add this secret in Gitea repository settings:

**Name:** CT109_TELEGRAM_BOT_TOKEN
**Value:** 8254383681:AAE_j4cUIP9ABVE4Pqrmtgjfmqq1yc4Ow5A

## Breaking Changes

⚠️ **Database will be deleted on every deployment**
- All products, orders, customers, and payments will be reset
- Only admin user and bot registrations preserved
- Backups created automatically before deletion

This is intentional for testing environments - ensures consistent, repeatable deployments.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-18 18:08:22 +00:00
sysadmin
417c4a68ae ci: Configure TeleBot token for CT109 pre-production deployment
All checks were successful
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Successful in 1m0s
- Added Telegram__BotToken environment variable to ct109 deployment
- Token: 8254383681:AAE_j4cUIP9ABVE4Pqrmtgjfmqq1yc4Ow5A (@Teleshopio_bot)
- Ensures pre-production uses the correct bot instance

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-17 18:19:15 +00:00
25ec371961 fix: Simplify to use public HTTPS clone (no authentication needed)
All checks were successful
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Successful in 1m2s
2025-11-17 14:07:12 +00:00
1a7fd96486 fix: Auto-detect Gitea SSH port instead of hardcoding 2223
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 14:02:21 +00:00
e7659a4615 fix: Switch from HTTPS token to SSH key authentication for git clone
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 2s
2025-11-17 13:51:36 +00:00
b08ff7ad83 fix: Simplify git clone to use token:@host format
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:50:17 +00:00
f4346a799e fix: Use git credential helper for Gitea authentication
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:46:03 +00:00
310f1f63de fix: Update secret name from SECRET to GIT_TOKEN
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:44:41 +00:00
b6569154a4 fix: Remove oauth2 prefix for Gitea token authentication (Gitea uses different format than GitHub)
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:41:27 +00:00
edffa1f249 fix: Use tilde expansion and escape variables for remote execution
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:40:06 +00:00
e8ef0710a2 fix: Use SECRET instead of GITEA_TOKEN (Gitea naming restriction)
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:38:32 +00:00
af0f8e1f7a fix: Add Gitea token authentication for git clone
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:35:30 +00:00
541b531290 fix: Use home directory instead of /opt for CT109 deployment (permission issue)
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-17 13:29:17 +00:00
d4c2bedf9b debug: Add verbose logging to SSH setup step
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 2s
2025-11-17 13:23:29 +00:00
5951e2a89a fix: Use hardcoded repository URL instead of gitea context variable
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 1s
2025-11-16 21:11:13 +00:00
8a70e4aad1 fix: Replace GitHub Actions with native git commands for Gitea compatibility
Some checks failed
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Failing after 0s
Issues Fixed:
1. Gitea Actions runner lacks Node.js (required for actions/checkout@v4)
2. Gitea Actions doesn't support actions/upload-artifact@v4
3. Build jobs were unnecessary overhead

Solution:
- Replaced actions/checkout@v4 with native git clone commands
- Removed separate build jobs (build-littleshop, build-telebot)
- Build Docker images directly on deployment targets via SSH
- Simplified workflow: deploy jobs now handle clone + build + deploy

Benefits:
- No Node.js dependency - uses native git/docker only
- Faster deployments - no image transfer overhead
- Simpler pipeline - fewer jobs and steps
- Better resource usage - builds on target server with proper resources

Changes:
- deploy-production: Builds images on VPS from git checkout
- deploy-preproduction: Builds images on CT109 from git checkout
- Removed artifact upload/download steps entirely
- Git clone/checkout happens on deployment targets

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:08:01 +00:00
b04de045c5 fix: Remove Docker buildx setup to resolve CI/CD permissions error
Some checks failed
Build and Deploy LittleShop / Build LittleShop Docker Image (push) Failing after 1s
Build and Deploy LittleShop / Build TeleBot Docker Image (push) Failing after 22s
Build and Deploy LittleShop / Deploy to Production VPS (Manual Only) (push) Has been skipped
Build and Deploy LittleShop / Deploy to Pre-Production (CT109) (push) Has been skipped
Issue:
- Docker buildx creates containerized builder requiring elevated capabilities
- Gitea Actions runner doesn't have permission to apply Linux capabilities
- Error: "unable to apply caps: operation not permitted"

Solution:
- Removed docker/setup-buildx-action from both build jobs
- Using standard docker build (already configured via DOCKER_BUILDKIT=1)
- BuildKit features still enabled via environment variable

Impact:
- CI/CD builds will now succeed without capability errors
- No functionality lost (workflow uses 'docker build', not 'docker buildx build')
- Faster build start (no buildx container creation overhead)

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-16 21:05:09 +00:00
47e43d4ff8 ci: Migrate from GitLab CI/CD to Gitea Actions with CT109 pre-production
**Migration Complete:**
- Removed GitLab CI/CD configuration (.gitlab-ci.yml)
- Created Gitea Actions workflows (.gitea/workflows/)
- Disabled automatic production deployment (manual only)
- Added pre-production deployment to CT109 Docker container

**New Workflows:**
- build-and-deploy.yml: Main CI/CD pipeline with CT109 deployment
- rollback.yml: Manual rollback capability
- README.md: Comprehensive workflow documentation

**Pre-Production Environment (CT109):**
- Host: 10.0.0.51
- User: sysadmin
- Port: 22
- Deploys on push to development/main branches
- Access URL: http://ct109.local:5100

**Documentation:**
- CI_CD_MIGRATION_GITEA.md: Complete migration guide
- CI_CD_CT109_PREPRODUCTION.md: CT109 deployment architecture
- GITEA_SECRETS_SETUP_GUIDE.md: Secrets configuration instructions

**Git Remote Updated:**
- Migrated from GitLab (gitlab.silverlabs.uk) to Gitea (git.silverlabs.uk)
- Using token authentication for push/pull operations

**Next Steps:**
1. Push code to Gitea to create repository
2. Add CT109 secrets via Gitea UI (CT109_HOST, CT109_SSH_PORT, CT109_USER, CT109_SSH_KEY)
3. Test pre-production deployment workflow

🚀 Generated with Claude Code

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-14 19:10:14 +00:00