Thank you for your interest in contributing to Hostlink!
- Go 1.23 or higher
- SQLite (included in most systems)
-
Clone the repository
git clone https://github.com/selfhost-dev/hostlink.git cd hostlink -
Set up environment (optional)
Copy the example environment file:
cp .env.example .env
The application will automatically load
.envfile on startup.Default configuration works out of the box:
- Server runs on
localhost:8080 - SQLite database:
hostlink-dev.db - Agent data stored in
.local/directory
- Server runs on
-
Create local data directory
mkdir -p .local
-
Run the application
go run main.go
The server will start at
http://localhost:8080 -
Verify it's running
curl http://localhost:8080/health
Run all tests:
go test ./...Run unit tests only:
go test ./app/... ./domain/... ./internal/...Run integration tests:
go test -tags=integration ./test/integration/...Run smoke tests:
go test -tags=smoke ./test/smoke/...Run tests with coverage:
go test -cover ./...- Make your changes
- Run tests to ensure everything works
- Run
go fmt ./...to format code - Commit your changes following conventional commits
- Push and create a pull request
See .env.example for all available configuration options.
Key variables for development:
APP_ENV- Set todevelopment(default)SH_APP_PORT- Server port (default: 8080)SH_DB_URL- Database URL (default:file:hostlink-dev.db)
The hlctl CLI tool is located in cmd/hlctl/.
go build -o hlctl cmd/hlctl/main.goOr build and install to $GOPATH/bin:
go install ./cmd/hlctlUnit tests:
go test ./cmd/hlctl/...Integration tests:
go test -tags=integration ./test/integration -run TestHlctlSmoke tests (requires running server):
# Start the server first
go run main.go
# In another terminal
go test -tags=smoke ./test/smoke -run TestHlctlFeel free to open an issue on GitHub or reach out to the maintainers.