# VoxBlog Quick Start Guide ## 🚀 Deploy to Production in 5 Minutes ### Prerequisites - VPS with Docker and Docker Compose installed - Gitea repository set up - Domain name (optional, for SSL) ### Step 1: Clone Repository on VPS ```bash ssh user@your-vps # Navigate to your deployment directory cd /var/www # or /home/user/apps # Clone from Gitea git clone https://your-gitea-url/username/voxblog.git cd voxblog ``` ### Step 2: Configure Secrets Recommended (production): export your Infisical service token so the deployment scripts can pull secrets on demand. ```bash # Export the service token (see INFISICAL_SETUP.md) export INFISICAL_TOKEN=st.your_service_token export INFISICAL_SITE_URL=https://secrets.pusula.blog export INFISICAL_API_URL=https://secrets.pusula.blog/api # optional, auto-derived otherwise ``` Fallback for local-only testing: ```bash cp .env.example .env nano .env # never commit this file ``` Whether Infisical or a temporary `.env` is used, ensure these variables exist: - `DB_ROOT_PASSWORD`, `DB_PASSWORD`, `DB_USER`, `DB_NAME`, `DB_HOST`, `DB_PORT` - `ADMIN_PASSWORD`, `OPENAI_API_KEY` - `GHOST_ADMIN_API_KEY`, `GHOST_ADMIN_API_URL` - `S3_BUCKET`, `S3_REGION`, `S3_ACCESS_KEY`, `S3_SECRET_KEY`, `S3_ENDPOINT` - `VITE_API_URL` ### Step 3: Deploy ```bash # Make deploy script executable chmod +x deploy.sh # Run deployment ./deploy.sh ``` That's it! Your application is now running: - **API**: http://your-vps:3301 - **Admin**: http://your-vps:3300 ### Step 4: Set Up CI/CD (Choose One) #### Option A: Gitea Actions (Recommended) 1. **Install Gitea Runner on VPS:** ```bash # Download runner wget https://dl.gitea.com/act_runner/latest/act_runner-latest-linux-amd64 chmod +x act_runner-latest-linux-amd64 sudo mv act_runner-latest-linux-amd64 /usr/local/bin/act_runner # Register (get token from Gitea: Settings → Actions → Runners) act_runner register \ --instance https://your-gitea-url \ --token YOUR_RUNNER_TOKEN \ --name voxblog-runner # Create systemd service sudo tee /etc/systemd/system/gitea-runner.service > /dev/null < /dev/null < /dev/null < backup-$(date +%Y%m%d).sql # Restore backup docker-compose exec -T mysql mysql -u voxblog -p voxblog < backup-20241025.sql ``` ### Full Backup ```bash # Backup data directory tar -czf voxblog-data-$(date +%Y%m%d).tar.gz data/ # Backup database docker-compose exec mysql mysqldump -u voxblog -p voxblog > db-backup-$(date +%Y%m%d).sql ``` ## 🔐 Security Checklist - [ ] Infisical secrets created with strong values - [ ] Firewall enabled (ufw) - [ ] SSH key-based authentication - [ ] SSL/TLS enabled (HTTPS) - [ ] Regular backups configured - [ ] Docker updated regularly - [ ] Monitor logs for suspicious activity ## 🎯 Production Checklist - [ ] Infisical production workspace populated - [ ] Domain name pointed to VPS - [ ] SSL certificate installed - [ ] Nginx reverse proxy configured - [ ] Gitea Actions/Webhook set up - [ ] INFISICAL_TOKEN (+ optional INFISICAL_SITE_URL) saved in Gitea secrets - [ ] Backup strategy in place - [ ] Monitoring set up - [ ] Firewall configured - [ ] Test deployment successful ## 📚 Additional Resources - [Full Deployment Guide](DEPLOYMENT_GUIDE.md) - [Docker Compose Docs](https://docs.docker.com/compose/) - [Gitea Actions Docs](https://docs.gitea.io/en-us/actions/) - [Nginx Docs](https://nginx.org/en/docs/) --- **Need help?** Check the logs first: `docker-compose logs -f`