Streamline build from source steps

This commit is contained in:
Chiran Fernando 2025-05-22 17:07:45 +05:30
parent c7fc15399b
commit 2a0075b22e

118
README.md
View file

@ -223,102 +223,100 @@ asgardeo:
``` ```
## Build from Source ## Build from Source
### Prerequisites for Building ### Prerequisites
* Go 1.20 or higher * Go 1.20 or higher
* Git * Git
* Make (for Linux/macOS builds) * Make (optional, for simplified builds)
### Building on Linux/macOS ### Clone and Build
1. Clone the repository: 1. **Clone the repository:**
```bash ```bash
git clone https://github.com/wso2/open-mcp-auth-proxy git clone https://github.com/wso2/open-mcp-auth-proxy
cd open-mcp-auth-proxy cd open-mcp-auth-proxy
``` ```
2. Install dependencies: 2. **Install dependencies:**
```bash ```bash
go get -v -t -d ./... go get -v -t -d ./...
``` ```
3. Build for your platform: 3. **Build the application:**
**Option A: Using Make**
```bash ```bash
# Build for all platforms # Build for all platforms
make all make all
# Or build for a specific platform # Or build for specific platforms
make build-linux # For Linux make build-linux # For Linux (x86_64)
make build-darwin # For macOS
make build-linux-arm # For ARM-based Linux make build-linux-arm # For ARM-based Linux
make build-darwin # For macOS
make build-windows # For Windows make build-windows # For Windows
``` ```
4. Find your build in the `build` directory: **Option B: Manual build (works on all platforms)**
```bash ```bash
# For Linux # Build for your current platform
./build/linux/openmcpauthproxy --demo go build -o openmcpauthproxy ./cmd/proxy
# For macOS # Cross-compile for other platforms
./build/darwin/openmcpauthproxy --demo GOOS=linux GOARCH=amd64 go build -o openmcpauthproxy-linux ./cmd/proxy
GOOS=windows GOARCH=amd64 go build -o openmcpauthproxy.exe ./cmd/proxy
GOOS=darwin GOARCH=amd64 go build -o openmcpauthproxy-macos ./cmd/proxy
``` ```
### Building on Windows ### Run the Built Application
1. Clone the repository: After building, you'll find the executables in the `build` directory (when using Make) or in your project root (when building manually).
```powershell
git clone https://github.com/wso2/open-mcp-auth-proxy
cd open-mcp-auth-proxy
```
2. Install dependencies: **Linux/macOS:**
```powershell ```bash
go get -v -t -d ./... # If built with Make
``` ./build/linux/openmcpauthproxy --demo
3. Option 1: Build using Make if you have it installed: # If built manually
```powershell ./openmcpauthproxy --demo
make build-windows ```
```
Option 2: Build manually without Make: **Windows:**
```powershell ```powershell
mkdir -p build\windows # If built with Make
go build -o build\windows\openmcpauthproxy.exe .\cmd\proxy .\build\windows\openmcpauthproxy.exe --demo
copy config.yaml build\windows\
```
4. Run the built application: # If built manually
```powershell .\openmcpauthproxy.exe --demo
cd build\windows ```
.\openmcpauthproxy.exe --demo
```
### Starting the Proxy on Windows ### Available Command Line Options
1. Open Command Prompt or PowerShell ```bash
2. Navigate to the build directory: # Start in demo mode (using Asgardeo sandbox)
```powershell ./openmcpauthproxy --demo
cd build\windows
```
3. Run the executable with your desired options: # Start with your own Asgardeo organization
```powershell ./openmcpauthproxy --asgardeo
# Start in demo mode (using Asgardeo sandbox)
openmcpauthproxy.exe --demo
# Start with Asgardeo integration # Use stdio transport mode instead of SSE
openmcpauthproxy.exe --asgardeo ./openmcpauthproxy --demo --stdio
# Start in stdio mode # Enable debug logging
openmcpauthproxy.exe --demo --stdio ./openmcpauthproxy --demo --debug
# Enable debug logging # Show all available options
openmcpauthproxy.exe --demo --debug ./openmcpauthproxy --help
```
# See all available options ### Additional Make Targets
openmcpauthproxy.exe --help
```
4. The proxy will start and display messages indicating it's running If you're using Make, these additional targets are available:
5. To stop the proxy, press `Ctrl+C` in the command window
```bash
make test # Run tests
make coverage # Run tests with coverage report
make fmt # Format code with gofmt
make vet # Run go vet
make clean # Clean build artifacts
make help # Show all available targets
```