Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
45 changes: 45 additions & 0 deletions .github/ISSUE_TEMPLATE/feature_request.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
name: Feature Request
description: Suggest a new feature or enhancement for kiji-proxy
title: "[Feature]: "
labels: ["enhancement"]
body:
- type: markdown
attributes:
value: |
Thanks for taking the time to suggest an improvement! Please fill out the sections below as clearly as you can.

- type: textarea
id: problem
attributes:
label: Problem
description: What problem or limitation are you running into? Why does it matter?
placeholder: "e.g. I often need to X, but currently the only way to do it is Y, which is tedious because..."
validations:
required: true

- type: textarea
id: proposed-solution
attributes:
label: Proposed Solution
description: Describe the feature or change you'd like to see.
placeholder: "e.g. Add a config option that allows..."
validations:
required: true

- type: textarea
id: alternatives
attributes:
label: Alternatives Considered
description: Have you tried any workarounds or considered other approaches?
placeholder: "e.g. I tried X but it doesn't work because..."
validations:
required: false

- type: textarea
id: context
attributes:
label: Additional Context
description: Any other context, screenshots, or references that might help.
placeholder: "Links, related issues, example configs, etc."
validations:
required: false
22 changes: 22 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
## Description

<!-- What does this PR do? Provide a clear, concise summary of the changes. -->

## Linked Issue

Closes #

## Testing Done

<!-- Describe what you tested and how. Include manual steps and/or test names. -->

- [ ] Unit tests pass (`go test ./...` / `npm test`)
- [ ] Manually verified the change works as expected

## Checklist

- [ ] Code follows the project's style guidelines (`gofmt`, `go vet`, linting)
- [ ] New or updated tests cover the changes (if applicable)
- [ ] Documentation has been updated (if applicable)
- [ ] No unrelated changes are included in this PR
- [ ] PR title is descriptive and references the issue where relevant
77 changes: 77 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Contributing to kiji-proxy

Thanks for your interest in contributing. This document covers how to get set up, run tests, and submit changes.

## Dev Setup

**Prerequisites:** Go 1.21+, Node.js 18+, make (optional but handy).

```bash
# Clone your fork
git clone https://github.com/<your-username>/kiji-proxy.git
cd kiji-proxy

# Install backend dependencies
cd src/backend && go mod download

# Install frontend dependencies
cd ../../src/frontend && npm install
```

Copy and edit the development config before running:

```bash
cp src/backend/config/config.development.json config.json
# Edit config.json with your API keys / settings
```

Start the backend:

```bash
go run ./src/backend/cmd/...
```

Start the frontend (separate terminal):

```bash
cd src/frontend && npm run dev
```

## Running Tests

```bash
# Backend unit tests
cd src/backend && go test ./...

# Backend tests with race detector
go test -race ./...

# Frontend tests
cd src/frontend && npm test
```

## Branching & PR Conventions

- Branch off `main`. Use short, descriptive names:
- `feat/<topic>` for new features
- `fix/<topic>` for bug fixes
- `docs/<topic>` for documentation-only changes
- Keep commits focused; one logical change per commit.
- Reference the issue your PR addresses with `Closes #<issue>` in the PR description.
- All CI checks must pass before a PR is merged.
- PRs require at least one approving review.

## Code Style

**Go:**
- Run `gofmt -w .` and `go vet ./...` before committing.
- Follow standard Go naming conventions.
- Add comments for exported types, functions, and constants.

**TypeScript / Frontend:**
- Run `npm run lint` before committing.
- Prefer explicit types over `any`.

## Reporting Issues

Use the GitHub issue tracker. Please search for existing issues before opening a new one. Include reproduction steps, expected vs. actual behavior, and relevant logs.
10 changes: 8 additions & 2 deletions src/backend/config/config.go
Original file line number Diff line number Diff line change
Expand Up @@ -73,6 +73,12 @@ type Config struct {
Proxy ProxyConfig `json:"Proxy"`
}

// DefaultForwardProxyPort is the default port for the forward (HTTP) proxy.
const DefaultForwardProxyPort = ":8080"

// DefaultTransparentProxyPort is the default port for the transparent proxy.
const DefaultTransparentProxyPort = ":8081"

// ModelVariantTrained is the full-precision model variant.
const ModelVariantTrained = "trained"

Expand Down Expand Up @@ -242,7 +248,7 @@ func DefaultConfig() *Config {
MistralProviderConfig: defaultMistralProviderConfig,
CustomProviderConfig: defaultCustomProviderConfig,
},
ProxyPort: ":8080",
ProxyPort: DefaultForwardProxyPort,
ONNXModelPath: "",
TokenizerPath: "",
ModelVariant: ModelVariantTrained,
Expand All @@ -261,7 +267,7 @@ func DefaultConfig() *Config {
},
Proxy: ProxyConfig{
TransparentEnabled: true,
ProxyPort: ":8081",
ProxyPort: DefaultTransparentProxyPort,
CAPath: caPath,
KeyPath: keyPath,
EnablePAC: true, // Enable PAC by default for automatic proxy configuration
Expand Down
2 changes: 1 addition & 1 deletion src/backend/server/server.go
Original file line number Diff line number Diff line change
Expand Up @@ -307,7 +307,7 @@ func (s *Server) Start() error {
func (s *Server) startTransparentProxy() {
proxyPort := s.config.Proxy.ProxyPort
if proxyPort == "" {
proxyPort = ":8080"
proxyPort = config.DefaultForwardProxyPort
}

log.Printf("Starting transparent proxy on port %s", proxyPort)
Expand Down
Loading