-
Notifications
You must be signed in to change notification settings - Fork 16
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat: use standard grpc-web instead of improbable-eng
Signed-off-by: Norman Meier <[email protected]>
- Loading branch information
Showing
35 changed files
with
47,070 additions
and
23,100 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -42,9 +42,12 @@ generate.protobuf: node_modules | |
|
||
.PHONY: generate.weshnet | ||
generate.weshnet: node_modules | ||
go install google.golang.org/protobuf/cmd/[email protected] | ||
go install google.golang.org/grpc/cmd/[email protected] | ||
buf generate buf.build/berty/weshnet -o .weshgen | ||
rm -fr packages/api/weshnet | ||
mkdir -p packages/api/weshnet | ||
buf generate --template ./weshnet.buf.gen.yaml buf.build/gogo/protobuf -o .gogogen | ||
cp -r .gogogen/packages/api/gogoproto packages/api/weshnet/gogoproto | ||
rm -fr .gogogen | ||
buf generate --template ./weshnet.buf.gen.yaml buf.build/berty/weshnet -o .weshgen | ||
cp -r .weshgen/packages/api/ packages/api/weshnet/ | ||
rm -fr .weshgen | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,59 @@ | ||
admin: | ||
address: | ||
socket_address: { address: 0.0.0.0, port_value: 9901 } | ||
|
||
static_resources: | ||
listeners: | ||
- name: listener_0 | ||
address: | ||
socket_address: { address: 0.0.0.0, port_value: 8080 } | ||
filter_chains: | ||
- filters: | ||
- name: envoy.filters.network.http_connection_manager | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.network.http_connection_manager.v3.HttpConnectionManager | ||
codec_type: auto | ||
stat_prefix: ingress_http | ||
route_config: | ||
name: local_route | ||
virtual_hosts: | ||
- name: local_service | ||
domains: ["*"] | ||
routes: | ||
- match: { prefix: "/" } | ||
route: | ||
cluster: weshnet_service | ||
max_stream_duration: | ||
grpc_timeout_header_max: 0s | ||
cors: | ||
allow_origin_string_match: | ||
- prefix: "*" | ||
allow_methods: GET, PUT, DELETE, POST, OPTIONS | ||
allow_headers: keep-alive,user-agent,cache-control,content-type,content-transfer-encoding,custom-header-1,x-accept-content-transfer-encoding,x-accept-response-streaming,x-user-agent,x-grpc-web,grpc-timeout | ||
max_age: "1728000" | ||
expose_headers: custom-header-1,grpc-status,grpc-message | ||
http_filters: | ||
- name: envoy.filters.http.grpc_web | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.http.grpc_web.v3.GrpcWeb | ||
- name: envoy.filters.http.cors | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.http.cors.v3.Cors | ||
- name: envoy.filters.http.router | ||
typed_config: | ||
"@type": type.googleapis.com/envoy.extensions.filters.http.router.v3.Router | ||
clusters: | ||
- name: weshnet_service | ||
connect_timeout: 0.25s | ||
type: LOGICAL_DNS | ||
http2_protocol_options: {} | ||
lb_policy: ROUND_ROBIN | ||
load_assignment: | ||
cluster_name: weshnet_service | ||
endpoints: | ||
- lb_endpoints: | ||
- endpoint: | ||
address: | ||
socket_address: | ||
address: weshd | ||
port_value: 4242 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
# syntax=docker/dockerfile:1 | ||
|
||
ARG GO_VERSION="1.19" | ||
ARG RUNNER_IMAGE="gcr.io/distroless/static" | ||
|
||
# -------------------------------------------------------- | ||
# Builder | ||
# -------------------------------------------------------- | ||
|
||
FROM golang:${GO_VERSION}-alpine as builder | ||
|
||
RUN set -eux; apk add --no-cache ca-certificates build-base; apk add git linux-headers | ||
|
||
# Download go dependencies | ||
WORKDIR /app | ||
COPY go.* ./ | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/root/go/pkg/mod \ | ||
go mod download | ||
|
||
# Copy the remaining files | ||
COPY go ./go | ||
COPY .git ./.git | ||
|
||
# Build teritorid binary | ||
RUN --mount=type=cache,target=/root/.cache/go-build \ | ||
--mount=type=cache,target=/root/go/pkg/mod \ | ||
go build \ | ||
-mod=readonly \ | ||
-ldflags "-w -s -linkmode=external -extldflags '-Wl,-z,muldefs -static'" \ | ||
-trimpath \ | ||
-o /app/build/ \ | ||
./go/cmd/weshd | ||
|
||
# -------------------------------------------------------- | ||
# Runner | ||
# -------------------------------------------------------- | ||
|
||
FROM ${RUNNER_IMAGE} | ||
|
||
COPY --from=builder /app/build/weshd /bin/weshd | ||
|
||
ENV HOME /app | ||
WORKDIR $HOME | ||
|
||
ENTRYPOINT ["weshd"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.