{"id":27057329,"url":"https://github.com/help660vip/wireguard","last_synced_at":"2025-04-05T11:18:48.170Z","repository":{"id":276655232,"uuid":"929879262","full_name":"help660vip/wireguard","owner":"help660vip","description":null,"archived":false,"fork":false,"pushed_at":"2025-02-09T16:51:07.000Z","size":6,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-02-09T17:30:27.363Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/help660vip.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2025-02-09T16:07:36.000Z","updated_at":"2025-02-09T16:51:10.000Z","dependencies_parsed_at":"2025-02-09T17:40:55.477Z","dependency_job_id":null,"html_url":"https://github.com/help660vip/wireguard","commit_stats":null,"previous_names":["help660vip/wireguard"],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/help660vip%2Fwireguard","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/help660vip%2Fwireguard/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/help660vip%2Fwireguard/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/help660vip%2Fwireguard/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/help660vip","download_url":"https://codeload.github.com/help660vip/wireguard/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":247325832,"owners_count":20920743,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2025-04-05T11:18:47.702Z","updated_at":"2025-04-05T11:18:48.164Z","avatar_url":"https://github.com/help660vip.png","language":"Shell","funding_links":[],"categories":[],"sub_categories":[],"readme":"# WireGuard 自动化部署脚本\n\n本项目提供一个 Bash 脚本，能够快速生成 WireGuard 服务器和多个客户端的配置文件，简化 VPN 配置过程。\n\n## 📌 功能特点\n- 自动创建 WireGuard 服务器和客户端配置\n- 支持用户自定义监听端口和公网 IP\n- 一键生成服务器密钥对与客户端密钥对\n- 支持最多 253 个客户端的批量配置\n- 服务器配置文件自动更新，无需手动添加 Peer\n\n## 📂 目录结构\n```\nwireguard_setup/\n│── wg0.conf              # 服务器 WireGuard 配置文件\n│── server_privatekey      # 服务器私钥\n│── server_publickey       # 服务器公钥\n│── clients/\n│   ├── keys/              # 客户端密钥存储\n│   │   ├── client1_privatekey\n│   │   ├── client1_publickey\n│   ├── configs/           # 客户端配置文件存储\n│   │   ├── client1_wg0.conf\n│   │   ├── client2_wg0.conf\n```\n\n## 🚀 使用方法\n### 1. 安装 WireGuard\n在运行脚本之前，请确保您的系统已安装 WireGuard。\n#### Ubuntu/Debian:\n```bash\nsudo apt update \u0026\u0026 sudo apt install -y wireguard\n```\n#### CentOS:\n```bash\nsudo yum install -y epel-release\nsudo yum install -y wireguard-tools\n```\n#### Arch Linux:\n```bash\nsudo pacman -S wireguard-tools\n```\n#### macOS (使用 Homebrew):\n```bash\nbrew install wireguard-tools\n```\n\n### 2. 克隆仓库\n```bash\ngit clone https://github.com/help660vip/wireguard.git\ncd wireguard\nchmod +x setup_wireguard.sh\n```\n\n### 3. 运行脚本\n```bash\n./setup_wireguard.sh\n```\n\n### 4. 配置过程中需要输入的信息\n- **服务器监听端口**（默认为 `51820`）\n- **服务器公网 IP 或域名**\n- **客户端数量**（默认为 `50`，范围 `1-253`）\n\n### 5. 启动 WireGuard 服务器\n```bash\nsudo wg-quick up wg0\n```\n\n### 6. 客户端连接\n将 `clients/configs/clientX_wg0.conf` 文件导入 WireGuard 客户端即可。\n\n## 🔧 其他功能\n### 生成客户端二维码（适用于移动端）\n安装 `qrencode` 后，可以使用以下命令生成二维码：\n```bash\nqrencode -t ansiutf8 \u003c clients/configs/client1_wg0.conf\n```\n\n## ⚠️ 注意事项\n- **请妥善保管私钥文件**，避免泄露。\n- **确保 WireGuard 内核模块已安装**，否则需要手动安装 WireGuard。\n- **客户端数量超过 253 可能导致 IP 地址冲突**，如有更大需求，可修改子网配置。\n\n## 📜 许可证\n本项目基于 MIT 许可证开源，欢迎修改和优化。\n\n## 📞 反馈与支持\n如有问题或建议，请访问 [GitHub 项目地址](https://github.com/help660vip/wireguard) 提交 Issue。\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelp660vip%2Fwireguard","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fhelp660vip%2Fwireguard","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fhelp660vip%2Fwireguard/lists"}