lightweight go reverse proxy for ollama with bearer token authentication
go proxy ollama

chore: improve error messages

Changed files
+5 -5
+3 -3
.env.example
···
# Authentication token (required)
# Generate a strong random token for production use
-
AUTH_TOKEN=your-secret-token-here
+
OP_AUTH_TOKEN=your-secret-token-here
# Ollama server URL (optional, defaults to http://localhost:11434)
-
OLLAMA_URL=http://localhost:11434
+
OP_OLLAMA_URL=http://localhost:11434
# Proxy server port (optional, defaults to 11433)
-
PORT=11433
+
OP_PORT=11433
+1 -1
Makefile
···
lint: ## Run linter
golangci-lint run
-
run: ## Run the application (requires AUTH_TOKEN env var)
+
run: ## Run the application (requires OP_AUTH_TOKEN env var)
go run .
clean: ## Remove build artifacts
+1 -1
main.go
···
token := os.Getenv(authEnv)
if token == "" {
-
log.Fatal("AUTH_TOKEN environment variable is required")
+
log.Fatalf("%s environment variable is required", authEnv)
}
proxy, err := newProxy(ollamaURL)