mirror of
https://github.com/netbirdio/netbird.git
synced 2026-08-31 12:01:29 +02:00
trying embedded caddy reverse proxy
This commit is contained in:
31
proxy/scripts/generate-proto.sh
Executable file
31
proxy/scripts/generate-proto.sh
Executable file
@@ -0,0 +1,31 @@
|
||||
#!/bin/bash
|
||||
|
||||
set -e
|
||||
|
||||
# Check if protoc is installed
|
||||
if ! command -v protoc &> /dev/null; then
|
||||
echo "Error: protoc is not installed"
|
||||
echo "Install with: apt-get install -y protobuf-compiler"
|
||||
exit 1
|
||||
fi
|
||||
|
||||
# Check if protoc-gen-go is installed
|
||||
if ! command -v protoc-gen-go &> /dev/null; then
|
||||
echo "Installing protoc-gen-go..."
|
||||
go install google.golang.org/protobuf/cmd/protoc-gen-go@latest
|
||||
fi
|
||||
|
||||
# Check if protoc-gen-go-grpc is installed
|
||||
if ! command -v protoc-gen-go-grpc &> /dev/null; then
|
||||
echo "Installing protoc-gen-go-grpc..."
|
||||
go install google.golang.org/grpc/cmd/protoc-gen-go-grpc@latest
|
||||
fi
|
||||
|
||||
echo "Generating protobuf files..."
|
||||
|
||||
# Generate Go code from proto files
|
||||
protoc --go_out=. --go_opt=paths=source_relative \
|
||||
--go-grpc_out=. --go-grpc_opt=paths=source_relative \
|
||||
pkg/grpc/proto/proxy.proto
|
||||
|
||||
echo "Proto generation complete!"
|
||||
Reference in New Issue
Block a user