refactor: move V1 code into v1/ subdirectory

- git mv cmd/ internal/ pkg/ test/ go.mod go.sum Makefile build.sh docs/ v1/
- Create v1/README.md with V1 documentation
- Update root README for V1 + V2 structure
- V1 still builds (cd v1 && go build ./cmd/hostkeeper) and 105 tests pass
- Root is now clean for V2 development
This commit is contained in:
swanadiva
2026-07-07 11:56:27 +07:00
parent 8ebdebedc8
commit 847989df75
68 changed files with 58 additions and 116 deletions
+113
View File
@@ -0,0 +1,113 @@
# Installation Guide
## Prerequisites
- **Go 1.21+** — for building from source
- **Git** — for cloning the repository
- **Make** — optional, for build automation
## Installation Methods
### Method 1: Build from Source
```bash
git clone https://git.tukangketik.id/swanadiva/HostKeeper.git
cd hostkeeper
make build
sudo cp bin/hostkeeper /usr/local/bin/
```
### Method 2: Go Install
```bash
go install git.tukangketik.id/swanadiva/hostkeeper/cmd/hostkeeper@latest
```
This installs to `$GOPATH/bin` or `$HOME/go/bin`.
### Method 3: Cross-Platform Build
```bash
./build.sh
```
Binaries will be in the `build/` directory with SHA256 checksums.
## Platform-Specific Instructions
### macOS
```bash
# Install Go via Homebrew
brew install go
# Build and install
git clone https://git.tukangketik.id/swanadiva/HostKeeper.git
cd hostkeeper
make build
cp bin/hostkeeper /usr/local/bin/
```
### Linux (Ubuntu/Debian)
```bash
# Install Go
sudo apt update
sudo apt install golang git make
# Build and install
git clone https://git.tukangketik.id/swanadiva/HostKeeper.git
cd hostkeeper
make build
sudo cp bin/hostkeeper /usr/local/bin/
```
### Windows
```powershell
# Install Go from https://golang.org/dl/
# Clone repository
git clone https://git.tukangketik.id/swanadiva/HostKeeper.git
cd hostkeeper
# Build
go build -o hostkeeper.exe ./cmd/hostkeeper
```
### Termux (Android)
```bash
pkg install golang git make
git clone https://git.tukangketik.id/swanadiva/HostKeeper.git
cd hostkeeper
make build
cp bin/hostkeeper $PREFIX/bin/
```
## Verification
```bash
hostkeeper version
```
Expected output:
```
hostkeeper dev (built: ...)
```
## Troubleshooting
### Command Not Found
Ensure the binary is in your PATH:
```bash
export PATH=$PATH:/usr/local/bin
```
### Build Failures
```bash
make clean
make deps
make build
```