Теперь, когда я убедился что программа хорошо работает на windows, мы будем ее портировать на debian. как я это вижу: Ты создашь папку внутри проекта и будешь писать его там (чтобы не поломать текущий) 1. **Удалить Windows-специфичные зависимости** (`golang.org/x/sys/windows/registry` и всё, что связано с реестром). 2. **Заменить `sing-box.exe` → `sing-box`** (бинарник для Linux: https://github.com/SagerNet/sing-box/releases/download/v1.12.16/sing-box-1.12.16-linux-amd64.tar.gz) и реализовать автозагрузку с latest с источника. 3. **Убрать скрытие окна процесса** (`HideWindow` — это Windows-only). 4. **Реализовать управление системным прокси в Linux** (или отказаться от него, если не критично). 5. **Собрать проект под Linux** (cross-compilation или нативно). 6. **Подготовить структуру папок и права**. 7. **(Опционально) Упаковать в `.deb`** И главное - не редактируй текущий windows проект - он не требует вмешательств!
1.9 KiB
1.9 KiB
Debian Package Creation Instructions for HamyVPNClient
Files Included:
- main.go (the Linux-compatible source code)
- go.mod (dependencies)
- setup.sh (initial setup script)
- README.md (documentation)
- build_debian.sh (build script)
- debian/ (Debian packaging files)
To Build on Debian/Ubuntu:
-
Copy the linux-port directory to your Debian system
-
Install required packages:
sudo apt update sudo apt install golang gcc build-essential libgtk-3-dev libcairo2-dev libgl1-mesa-dev -
Navigate to the directory and build:
cd linux-port go mod tidy CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o hamy-vpn-client .
To Create a .deb Package:
-
Install packaging tools:
sudo apt install dh-golang devscripts -
Create the package structure:
hamy-vpn-client/ ├── DEBIAN/ │ └── control ├── usr/ │ ├── bin/ │ │ └── hamy-vpn-client │ └── share/ │ └── applications/ │ └── hamy-vpn-client.desktop └── opt/ └── hamy-vpn-client/ ├── main.go ├── go.mod └── README.md -
Create the control file in DEBIAN/control:
Package: hamy-vpn-client Version: 1.0.0 Section: net Priority: optional Architecture: amd64 Depends: libc6, libgtk-3-0 Maintainer: Your Name <your.email@example.com> Description: HamyVPN Client for VLESS connections A GUI application for managing VLESS connections using sing-box. -
Build the package:
dpkg-deb --build hamy-vpn-client
Notes:
- The application will auto-download sing-box on first run if not present
- Requires a graphical environment (X11/Wayland) to run
- Supports system proxy configuration for GNOME and KDE environments