# Go Site Clone
![Go Version](https://img.shields.io/badge/Go-1.24+-00ADD8?style=flat&logo=go) ![Wails](https://img.shields.io/badge/Wails-3.0--alpha-DF5B00?style=flat) ![Nuxt](https://img.shields.io/badge/Nuxt-4.1.2-00DC82?style=flat&logo=nuxt.js) ![License](https://img.shields.io/badge/License-MIT-green?style=flat) A powerful website cloning and local deployment tool built with Wails3 + Nuxt.js [Features](#-features) β€’ [Quick Start](#-quick-start) β€’ [Usage](#-usage) β€’ [Architecture](#-architecture) β€’ [Configuration](#-configuration)
--- ## πŸ“– Overview Go Site Clone is a powerful website cloning tool that can completely capture all resources of a website (HTML, CSS, JavaScript, images, videos, etc.) and support local deployment. It uses a real browser engine for resource capture, equipped with comprehensive anti-detection mechanisms and browser fingerprint spoofing system. ### ✨ Highlights - πŸš€ **Real Browser Engine** - Based on Chrome DevTools Protocol, simulating real user behavior - 🎭 **Fingerprint Spoofing** - Canvas fingerprint, timezone, language, UserAgent comprehensive disguise - πŸ”„ **Smart Resource Management** - Auto deduplication, same-domain filtering, categorized storage - πŸ“¦ **Complete Site Cloning** - Support for static resources and dynamic content - πŸ–₯️ **Cross-Platform** - One-click packaging for Windows, macOS, Linux - πŸ’« **Modern UI** - Nuxt.js + Ant Design Vue responsive interface - 🌐 **Local Site Service** - Integrated Nginx for one-click local mirror site startup --- ## 🎯 Features ### Resource Capture - βœ… Complete HTML page cloning - βœ… Batch CSS stylesheet download - βœ… JavaScript file capture - βœ… Image resources (JPG, PNG, GIF, SVG, WebP) - βœ… Video files (MP4, WebM, etc.) - βœ… Fonts and other static resources - βœ… Smart link traversal (auto-track internal links) ### Anti-Detection - 🎭 Canvas fingerprint randomization - 🌍 Timezone simulation (global timezone support) - πŸ—£οΈ Language and locale spoofing - πŸ” Custom UserAgent - πŸ“ Geolocation coordinate spoofing - πŸ•΅οΈ Stealth plugin integration (bypass anti-bot detection) ### File Management - πŸ“ Auto-categorized storage by domain - πŸ” Resource type classification - πŸ“Š Real-time download progress - πŸ—‚οΈ Local site list view - πŸ“‚ One-click folder opening ### Local Deployment - 🌐 Integrated Nginx server - ⚑ Quick start local mirror sites - πŸ”§ Custom port configuration - πŸ“ Site configuration management --- ## πŸš€ Quick Start ### Requirements - Go 1.24 or higher - Node.js 18+ and npm/pnpm - Wails CLI v3 ### Installation #### 1. Install Wails CLI ```bash go install github.com/wailsapp/wails/v3/cmd/wails3@latest ``` #### 2. Clone Repository ```bash git clone https://github.com/zhuy1228/go-site-clone.git cd go-site-clone ``` #### 3. Install Go Dependencies ```bash go mod download ``` #### 4. Install Frontend Dependencies ```bash cd frontend npm install # or use pnpm pnpm install ``` ### Development Mode ```bash # Start dev server with hot-reload wails3 dev ``` The app will start in development mode with auto-reload for both frontend and backend changes. ### Production Build ```bash # Build production version wails3 build # Output in build/ directory ``` --- ## πŸ“š Usage ### Basic Workflow 1. **Start Application** ```bash wails3 dev # or run the built executable ``` 2. **Enter Target Website URL** - Input the website URL you want to clone - Example: `https://example.com` 3. **Get Resource List** - Click "Get Resources" button - System automatically analyzes and lists all resources 4. **Download Site** - Select resource types to download - Click "Download" to start cloning - View real-time download progress 5. **Local Preview** - Select a site from download list - Click "Open Folder" to view files - Or use integrated Nginx service for local deployment ### Configuration Edit `config.yaml` to customize settings: ```yaml # Application name appName: "Go Site Clone" # Local service port port: 6997 # WebSocket connection URL wsUrl: "106.12.33.188:6996" # STUN server address stunUrl: "stun:106.12.33.188:3478" # API service URL apiUrl: "http://106.12.33.188:6996" # Website file save directory siteFileDir: "www" ``` ### API Methods The application exposes the following methods for frontend: #### `GetResources(url string)` Get all resource lists for specified URL **Parameters:** - `url`: Target website URL **Returns:** `ResourcesList` object with categorized resources #### `DownloadSite(uri string, resources ResourcesList)` Download website resources to local **Parameters:** - `uri`: Website URL - `resources`: Resource list object **Returns:** `bool` - Success status #### `GetDownloadList()` Get list of downloaded websites **Returns:** `[]FileDir` - File directory list #### `OpenSiteFileDir(path string)` Open folder for specified website **Parameters:** - `path`: Relative path **Returns:** `bool` - Operation success status --- ## πŸ—οΈ Architecture ### Tech Stack **Backend (Go)** - [Wails v3](https://wails.io/) - Application framework - [go-rod](https://github.com/go-rod/rod) - Browser automation - [go-rod/stealth](https://github.com/go-rod/stealth) - Anti-detection - [goquery](https://github.com/PuerkitoBio/goquery) - HTML parsing - [go-sqlite3](https://github.com/mattn/go-sqlite3) - Database - [yaml.v3](https://github.com/go-yaml/yaml) - Configuration **Frontend (Nuxt.js)** - [Nuxt 4](https://nuxt.com/) - Vue framework - [Vue 3](https://vuejs.org/) - Reactive framework - [Ant Design Vue](https://antdv.com/) - UI component library - [Chart.js](https://www.chartjs.org/) - Charts - [Wails Runtime](https://wails.io/) - Frontend-backend communication ### Project Structure ``` go-site-clone/ β”œβ”€β”€ app.go # Application main logic β”œβ”€β”€ main.go # Program entry β”œβ”€β”€ config.yaml # Configuration file β”œβ”€β”€ go.mod # Go module dependencies β”‚ β”œβ”€β”€ config/ # Configuration loader β”‚ └── index.go β”‚ β”œβ”€β”€ services/ # Business services β”‚ β”œβ”€β”€ site_service.go # Website cloning core β”‚ └── nginx_service.go # Nginx service management β”‚ β”œβ”€β”€ libs/ # Core libraries β”‚ β”œβ”€β”€ browser.go # Browser pool management β”‚ β”œβ”€β”€ chrome.go # Chrome instance creation β”‚ β”œβ”€β”€ sqlite.go # Database operations β”‚ β”œβ”€β”€ pack.go # Packaging utilities β”‚ └── browser-fingerprint/ # Browser fingerprint spoofing β”‚ β”œβ”€β”€ index.go β”‚ β”œβ”€β”€ canvas.go # Canvas fingerprint β”‚ └── timezone.go # Timezone simulation β”‚ β”œβ”€β”€ types/ # Type definitions β”‚ β”œβ”€β”€ fingerprint_type.go # Fingerprint parameter types β”‚ β”œβ”€β”€ task_type.go # Task types β”‚ └── nginx_template.go # Nginx templates β”‚ β”œβ”€β”€ utils/ # Utility functions β”‚ β”œβ”€β”€ file.go # File download/management β”‚ └── index.go # Environment checks β”‚ β”œβ”€β”€ frontend/ # Nuxt.js frontend β”‚ β”œβ”€β”€ nuxt.config.ts # Nuxt configuration β”‚ β”œβ”€β”€ package.json # Frontend dependencies β”‚ β”œβ”€β”€ app/ # Application code β”‚ β”‚ β”œβ”€β”€ app.vue # Root component β”‚ β”‚ β”œβ”€β”€ components/ # Vue components β”‚ β”‚ β”œβ”€β”€ pages/ # Page routes β”‚ β”‚ β”œβ”€β”€ layouts/ # Layout templates β”‚ β”‚ └── plugins/ # Plugins β”‚ └── bindings/ # Go binding types β”‚ β”œβ”€β”€ user-data/ # Browser user data β”œβ”€β”€ www/ # Website file storage β”œβ”€β”€ plugin/ # Plugins β”‚ └── nginx/ # Nginx plugin └── build/ # Build configuration β”œβ”€β”€ darwin/ # macOS packaging config β”œβ”€β”€ linux/ # Linux packaging config └── windows/ # Windows packaging config ``` --- ## βš™οΈ Configuration ### Browser Fingerprint Config ```go type BrowserFingerprintParams struct { Canvas bool // Randomize Canvas fingerprint TimeZone string // Timezone, e.g., "America/New_York" Language string // Language, e.g., "en-US" UserAgent string // Custom UserAgent GeoLocation string // Geolocation, e.g., "40.7128,-74.0060" } ``` --- ## πŸ”§ Development ### Adding Features 1. **Backend Services** - Create new service in `services/` - Implement business logic - Expose methods in `app.go` for frontend 2. **Frontend UI** - Add new pages in `frontend/app/pages/` - Add components in `frontend/app/components/` - Use Wails Runtime to call backend methods ### Debugging ```bash # View detailed logs wails3 dev -v # Build with verbose output wails3 build -v # Clean build cache wails3 build -clean ``` --- ## πŸ“¦ Build & Deploy ### Windows ```bash wails3 build -platform windows/amd64 ``` Executable in `build/bin/` ### macOS ```bash wails3 build -platform darwin/universal ``` Generates `.app` bundle ### Linux ```bash wails3 build -platform linux/amd64 ``` Supports `.deb`, `.rpm`, AppImage formats --- ## 🀝 Contributing Issues and Pull Requests are welcome! 1. Fork the repository 2. Create feature branch (`git checkout -b feature/AmazingFeature`) 3. Commit changes (`git commit -m 'Add some AmazingFeature'`) 4. Push to branch (`git push origin feature/AmazingFeature`) 5. Submit Pull Request --- ## πŸ“„ License This project is licensed under the MIT License - see [LICENSE](LICENSE) file --- ## πŸ™ Acknowledgments - [Wails](https://wails.io/) - Excellent Go + Web framework - [go-rod](https://go-rod.github.io/) - Powerful browser automation - [Nuxt.js](https://nuxt.com/) - Elegant Vue framework - [Ant Design Vue](https://antdv.com/) - Beautiful UI components --- ## πŸ“ž Contact - Author: zhuy1228 - Project: [https://github.com/zhuy1228/go-site-clone](https://github.com/zhuy1228/go-site-clone) ---
**If this project helps you, please give it a ⭐️** Made with ❀️ by zhuy1228 **[δΈ­ζ–‡ζ–‡ζ‘£](README_CN.md)**