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

chore: improve error messages

+5 -5
+3 -3
.env.example
··· 1 1 # Authentication token (required) 2 2 # Generate a strong random token for production use 3 - AUTH_TOKEN=your-secret-token-here 3 + OP_AUTH_TOKEN=your-secret-token-here 4 4 5 5 # Ollama server URL (optional, defaults to http://localhost:11434) 6 - OLLAMA_URL=http://localhost:11434 6 + OP_OLLAMA_URL=http://localhost:11434 7 7 8 8 # Proxy server port (optional, defaults to 11433) 9 - PORT=11433 9 + OP_PORT=11433
+1 -1
Makefile
··· 9 9 lint: ## Run linter 10 10 golangci-lint run 11 11 12 - run: ## Run the application (requires AUTH_TOKEN env var) 12 + run: ## Run the application (requires OP_AUTH_TOKEN env var) 13 13 go run . 14 14 15 15 clean: ## Remove build artifacts
+1 -1
main.go
··· 28 28 29 29 token := os.Getenv(authEnv) 30 30 if token == "" { 31 - log.Fatal("AUTH_TOKEN environment variable is required") 31 + log.Fatalf("%s environment variable is required", authEnv) 32 32 } 33 33 34 34 proxy, err := newProxy(ollamaURL)