mirror of
https://github.com/google/nomulus.git
synced 2025-05-02 04:57:51 +02:00
Opened two ports (30010 and 30011 by default) that handles HTTP(S) GET requests. the HTTP request is redirected to the corresponding HTTPS site, whereas the HTTPS request is redirected to a site that supports web WHOIS. The GCLB currently exposes port 80, but not port 443 on its TCP proxy load balancer (see https://cloud.google.com/load-balancing/docs/choosing-load-balancer). As a result, the HTTP traffic has to be routed by the HTTP load balancer, which requires a separate HTTP health check (as opposed to the TCP health check that the TCP proxy LB uses). This CL also added support for HTTP health check. There is not a strong case for adding an end-to-end test for WebWhoisProtocolsModule (like those for EppProtocolModule, etc) as it just assembles standard HTTP codecs used for an HTTP server, plus the WebWhoisRedirectHandler, which is tested. The end-to-end test would just be testing if the Netty provided HTTP handlers correctly parse raw HTTP messages. Sever other small improvement is also included: [1] Use setInt other than set when setting content length in HTTP headers. I don't think it is necessary, but it is nevertheless a better practice to use a more specialized setter. [2] Do not write metrics when running locally. [3] Rename the qualifier @EppCertificates to @ServerSertificate as it now provides the certificate used in HTTPS traffic as well. ------------- Created by MOE: https://github.com/google/moe MOE_MIGRATED_REVID=206944843
85 lines
2.2 KiB
Text
85 lines
2.2 KiB
Text
# Description:
|
|
# This package contains the code for the binary that proxies TCP traffic from
|
|
# the GCE/GKE to AppEngine.
|
|
|
|
load("@io_bazel_rules_docker//container:container.bzl", "container_image", "container_push")
|
|
|
|
package(
|
|
default_visibility = ["//java/google/registry:registry_project"],
|
|
)
|
|
|
|
licenses(["notice"]) # Apache 2.0
|
|
|
|
java_library(
|
|
name = "proxy",
|
|
srcs = glob(["**/*.java"]),
|
|
resources = glob([
|
|
"resources/*",
|
|
"config/*.yaml",
|
|
]),
|
|
deps = [
|
|
"//java/google/registry/config",
|
|
"//java/google/registry/util",
|
|
"@com_beust_jcommander",
|
|
"@com_fasterxml_jackson_core",
|
|
"@com_fasterxml_jackson_core_jackson_annotations",
|
|
"@com_fasterxml_jackson_core_jackson_databind",
|
|
"@com_google_api_client",
|
|
"@com_google_apis_google_api_services_cloudkms",
|
|
"@com_google_apis_google_api_services_monitoring",
|
|
"@com_google_apis_google_api_services_storage",
|
|
"@com_google_auto_value",
|
|
"@com_google_code_findbugs_jsr305",
|
|
"@com_google_dagger",
|
|
"@com_google_flogger",
|
|
"@com_google_flogger_system_backend",
|
|
"@com_google_guava",
|
|
"@com_google_monitoring_client_metrics",
|
|
"@com_google_monitoring_client_stackdriver",
|
|
"@io_netty_buffer",
|
|
"@io_netty_codec",
|
|
"@io_netty_codec_http",
|
|
"@io_netty_common",
|
|
"@io_netty_handler",
|
|
"@io_netty_transport",
|
|
"@javax_inject",
|
|
"@joda_time",
|
|
"@org_bouncycastle_bcpkix_jdk15on",
|
|
],
|
|
)
|
|
|
|
java_binary(
|
|
name = "proxy_server",
|
|
main_class = "google.registry.proxy.ProxyServer",
|
|
runtime_deps = [
|
|
":proxy",
|
|
"@io_netty_tcnative",
|
|
],
|
|
)
|
|
|
|
container_image(
|
|
name = "proxy_image",
|
|
base = "@java_base//image",
|
|
entrypoint = [
|
|
"java",
|
|
"-jar",
|
|
"proxy_server_deploy.jar",
|
|
],
|
|
files = [":proxy_server_deploy.jar"],
|
|
ports = [
|
|
"30000",
|
|
"30001",
|
|
"30002",
|
|
"30010",
|
|
"30011",
|
|
],
|
|
)
|
|
|
|
container_push(
|
|
name = "proxy_push",
|
|
format = "Docker",
|
|
image = ":proxy_image",
|
|
registry = "gcr.io",
|
|
repository = "GCP_PROJECT/IMAGE_NAME",
|
|
tag = "bazel",
|
|
)
|