{"id":29869627,"url":"https://github.com/coralesoft/openwrt-wireguard-installer","last_synced_at":"2025-07-30T17:02:29.054Z","repository":{"id":305876733,"uuid":"1024235951","full_name":"Coralesoft/Openwrt-Wireguard-Installer","owner":"Coralesoft","description":"Interactive WireGuard installer for OpenWrt. Generates peer configs with QR codes, applies UCI network/firewall changes, and supports rollback.","archived":false,"fork":false,"pushed_at":"2025-07-30T06:59:22.000Z","size":108,"stargazers_count":2,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-07-30T08:46:34.037Z","etag":null,"topics":["firewall","network-automation","network-tools","networking","openwrt","openwrt-configuration","openwrt-installation","qr-code","router","security","shell-script","uci","vpn","wireguard"],"latest_commit_sha":null,"homepage":"","language":"Shell","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/Coralesoft.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"zenodo":null}},"created_at":"2025-07-22T11:40:33.000Z","updated_at":"2025-07-30T06:59:25.000Z","dependencies_parsed_at":"2025-07-22T13:38:11.584Z","dependency_job_id":null,"html_url":"https://github.com/Coralesoft/Openwrt-Wireguard-Installer","commit_stats":null,"previous_names":["coralesoft/openwrt-wireguard-installer"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/Coralesoft/Openwrt-Wireguard-Installer","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coralesoft%2FOpenwrt-Wireguard-Installer","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coralesoft%2FOpenwrt-Wireguard-Installer/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coralesoft%2FOpenwrt-Wireguard-Installer/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coralesoft%2FOpenwrt-Wireguard-Installer/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Coralesoft","download_url":"https://codeload.github.com/Coralesoft/Openwrt-Wireguard-Installer/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Coralesoft%2FOpenwrt-Wireguard-Installer/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":267905414,"owners_count":24163903,"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","status":"online","status_checked_at":"2025-07-30T02:00:09.044Z","response_time":70,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["firewall","network-automation","network-tools","networking","openwrt","openwrt-configuration","openwrt-installation","qr-code","router","security","shell-script","uci","vpn","wireguard"],"created_at":"2025-07-30T17:00:48.868Z","updated_at":"2025-07-30T17:02:28.933Z","avatar_url":"https://github.com/Coralesoft.png","language":"Shell","funding_links":["https://www.buymeacoffee.com/r6zt79njh5m"],"categories":[],"sub_categories":[],"readme":"# OpenWrt WireGuard Ineractive Installer\n\nAn interactive shell script to quickly and safely configure a WireGuard VPN server on an OpenWrt router.\n\nIt guides you through generating keys, applying network and firewall settings, and creating ready-to-import `.conf` files for client devices — with optional QR code output for mobile use and built-in rollback for peace of mind.\n\nv2025.7.5\n---\n\n## ✨ Features\n\n-  Interactive prompts for all setup variables\n-  Generates secure keypairs and `.conf` files for each peer\n-  Optional QR code output for mobile devices\n-  Automatically applies UCI network and firewall rules\n-  Creates timestamped backups and supports rollback\n-  Built specifically for OpenWrt\n\n---\n\n## 🧱 Requirements\n\n- OpenWrt 23.05 or newer (tested on Raspberry Pi CM router and a x86 based router)\n- Installed packages:\n  ```sh\n  opkg update\n  opkg install wireguard-tools luci-app-wireguard\n  ```\n- (Optional for QR codes):\n  ```sh\n  opkg install qrencode\n  ```\n\n---\n\n## 📥 Installation\n\n1. **Download the script**:\n   ```sh\n   curl -O https://raw.githubusercontent.com/Coralesoft/openwrt-wireguard-installer/main/wg-openwrt-installer.sh\n   chmod +x wg-openwrt-installer.sh\n   ```\n\n2. **Run it ** on your OpenWrt router:\n   ```sh\n   ./wg-openwrt-installer.sh\n   ```\n\n---\n\n## ⚙️ Usage\n\nThe script will prompt you to:\n- Name the WireGuard interface\n- Set port, address, zones, and DNS\n- Enter your public endpoint (`host:port`)\n- Define the number of peers\n- Provide each peer’s name and IP\n\nEach peer will get:\n- A secure private key\n- A complete `.conf` file (for use in desktop or mobile clients)\n- An optional QR code displayed in the terminal (if `qrencode` is installed)\n\n---\n\n## 📂 Output\n\nAll generated files are saved under:\n\n```\n/etc/wireguard/\n  ├── privatekey            # Server key\n  ├── publickey             # Server key\n  └── peers/\n        ├── phone.conf\n        ├── phone-privatekey\n        ├── phone-publickey\n        └── ...\n```\n\n---\n\n## 🔄 Rollback\n\nAt the end of the setup, you’ll be prompted to roll back your changes.  \nIf confirmed, it restores:\n\n- `/etc/config/network.bak.\u003ctimestamp\u003e`\n- `/etc/config/firewall.bak.\u003ctimestamp\u003e`\n\n---\n\n##  Example\n\nA sample generated `.conf` for a peer:\n\n```ini\n[Interface]\nPrivateKey = xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx\nAddress = 192.168.20.2/32\nDNS = 192.168.20.1\n\n[Peer]\nPublicKey = yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy\nEndpoint = vpn.example.com:51820\nAllowedIPs = 0.0.0.0/0\nPersistentKeepalive = 25\n```\n\nImport this into the WireGuard app on iOS/Android, or use with `wg-quick` on desktop.\n\n---\n\n## 📌 Roadmap\n\n- [ ] Add uninstall/teardown script - in progress \n- [ ] Regenerate or revoke peer keys\n- [ ] Add script to regenerate peer QR codes\n\n\n---\n\n## 🧹 Uninstall\n\nTo remove all WireGuard configuration, keys, peers, and firewall rules, use the included uninstall script.\n\n### Usage\n\nRun normally to uninstall:\n\n```sh\n./wg-uninstall.sh\n```\n\nRun in dry-run mode to preview what will be removed:\n\n```sh\n./wg-uninstall.sh --dry-run\n```\n---\n\n## 💬 Feedback\n\nPull requests, issues, and suggestions are welcome.  \nOpen an issue at [github.com/Coralesoft/Openwrt-Wireguard-Installer/issues](https://github.com/Coralesoft/Openwrt-Wireguard-Installer/issues).\n\n\n## Support the Project\nIf this project helps you streamline your OpenWrt setup and you’d like to support ongoing development, consider buying me a coffee. Your contribution keeps the creativity flowing and helps sustain future updates.\n\n\u003ca href=\"https://www.buymeacoffee.com/r6zt79njh5m\" target=\"_blank\"\u003e\n  \u003cimg src=\"https://cdn.buymeacoffee.com/buttons/v2/default-yellow.png\" alt=\"Buy Me A Coffee\" style=\"height:60px;width:217px;\" /\u003e\n\u003c/a\u003e\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoralesoft%2Fopenwrt-wireguard-installer","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fcoralesoft%2Fopenwrt-wireguard-installer","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fcoralesoft%2Fopenwrt-wireguard-installer/lists"}