ignicat/opencode-unlimited-usage
Tentang
Isolated Cloudflare WARP network namespace wrapper for opencode with automatic IPv6 /64 and edge rotation and a scoped kill-switch. Works across any glibc Linux distribution without altering host networking.
Sistem dan infrastrukturPertumbuhan bintang terukur
- dalam 24 jam
- 0
- dalam 7 hari
- 0
- dalam 15 hari
- Mengumpulkan riwayat
- dalam 1 bulan
- Mengumpulkan riwayat
Perubahan bersih pada periode yang tumpang tindih, bukan total harian. Pengukuran yang belum tersedia dibiarkan kosong. Bintang menunjukkan perhatian, bukan kualitas.
README.md
Asliopencode-unlimited-usage
Linux wrapper that routes opencode through an isolated Cloudflare WARP network and mount namespace, rotating IPv6 /64 allocations and Cloudflare edge addresses per session across any glibc Linux distribution without modifying host networking, DNS, or firewall output rules.
Requirements
- Linux (
x86_64oraarch64) with/dev/net/tunandglibc sudoaccess for namespace,veth, andwarp-svcmanagementbash,python3,curl,iproute2,util-linux(unshare,nsenter,flock),iptablesornftables
Installation
curl -fsSL https://raw.githubusercontent.com/ignicat/opencode-unlimited-usage/main/install.sh | bash
Or from a local clone:
git clone https://github.com/ignicat/opencode-unlimited-usage.git
cd opencode-unlimited-usage
./install.sh
install.sh installs missing base dependencies via the system package manager (apt-get, dnf, yum, pacman, xbps-install, apk, zypper, emerge), fetches cloudflare-warp binaries if absent, configures /etc/sudoers.d/opencode-unlimited, and wraps ~/.local/bin/opencode.
Usage
| Command | Description |
|---|---|
opencode |
Starts the isolated ouc namespace and zen-guard if inactive, then launches opencode with a random IPv6 edge and /etc/machine-id |
opencode-unlimited-doctor |
Verifies ouc, warp-svc, OUC_LEAKGUARD, WARP IPv6 egress, zen-guard, and confirms host network and /etc/resolv.conf are untouched |
opencode-unlimited-hop |
Blacklists the current /64 prefix and forces WARP re-registration inside ouc to obtain a fresh /64 |
opencode-unlimited-ctl <cmd> |
Manually start, stop (tears down ouc, veth, host NAT, restores ip_forward), restart, or print status |
Architecture
- Namespace isolation:
ouc-rootcreates network namespaceouc, attaches avethpair using a non-conflicting/30subnet, enables scoped host NAT/forwarding (iptablesornft), and runswarp-svcinsideoucwith isolatedSTATE_DIRECTORY,RUNTIME_DIRECTORY,LOGS_DIRECTORY, blocked/run/dbus, and a private/etcmount (overlaywithmount --bindfallback). Host routes, IP addresses,/etc/resolv.conf, andOUTPUTfirewall rules remain unchanged. - Kill-switch:
OUC_LEAKGUARDruns strictly insideouc, allowing non-root processes to exit only viaCloudflareWARPorlo. Tunnel drops fail closed without leaking host traffic. - Launch lane:
zen-lane.shinvokesouc-root enter, which binds1.1.1.1/2606:4700:4700::1111in/etc/resolv.conf, pinsopencode.ai,www.opencode.ai, andapi.opencode.aito a random IPv6AAAArecord, generates a random/etc/machine-id, drops privileges back to the calling user with full environment preservation, and executesopencode. - Quota rotation:
zen-guard.shruns under aflocksingleton lock, tails~/.local/share/opencode/log/opencode.log, blacklists burned/64prefixes in~/.local/share/opencode-unlimited/guard/state.jsononQuotaExceeded, and triggersouc-root hop(synchronized againstwarp-keeper.shviaflock).
Environment Variables
| Variable | Description | Default |
|---|---|---|
OUC_DIRECT |
Set to 1 to bypass ouc and run opencode directly on the host |
0 |
OUC_REAL_BIN |
Path to the target opencode binary |
~/.opencode/bin/opencode |
OUC_WARP_BIN |
Path to warp-cli |
Auto-detected |
OUC_WARP_SVC |
Path to warp-svc |
Auto-detected |
Installed Paths
/usr/local/bin/ouc-root,/usr/local/libexec/opencode-unlimited/— privileged namespace,warp-svc, keeper, and firewall scripts/opt/opencode-unlimited/bin/— extractedwarp-cli/warp-svcbinaries (when installed from.deb)~/.local/share/opencode-unlimited/— user scripts and/64blacklist state~/.local/bin/opencode,opencode-unlimited-{hop,doctor,ctl}— CLI wrapper and control links/etc/sudoers.d/opencode-unlimited— passwordlesssudorule forouc-root
Uninstall
curl -fsSL https://raw.githubusercontent.com/ignicat/opencode-unlimited-usage/main/uninstall.sh | bash
Or locally:
./uninstall.sh
License
MIT License. See LICENSE.
Jelajahi proyek terkait
Memuat…