Портирование программы на линукс (debian) (vibe-kanban 5dca5182)

Теперь, когда я убедился что программа хорошо работает на 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 проект - он не требует вмешательств!
This commit is contained in:
Vibe Kanban
2026-01-16 23:53:16 +03:00
parent 9fbc7066cd
commit fbc595f568
11 changed files with 1638 additions and 0 deletions

View File

@@ -0,0 +1,74 @@
# 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:
1. Copy the linux-port directory to your Debian system
2. Install required packages:
```bash
sudo apt update
sudo apt install golang gcc build-essential libgtk-3-dev libcairo2-dev libgl1-mesa-dev
```
3. Navigate to the directory and build:
```bash
cd linux-port
go mod tidy
CGO_ENABLED=1 GOOS=linux GOARCH=amd64 go build -o hamy-vpn-client .
```
## To Create a .deb Package:
1. Install packaging tools:
```bash
sudo apt install dh-golang devscripts
```
2. 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
```
3. 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.
```
4. Build the package:
```bash
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