Skip to content

Commit

Permalink
trying to get traefik working
Browse files Browse the repository at this point in the history
  • Loading branch information
ec2 committed Sep 19, 2024
1 parent ab1c2d2 commit 3141f07
Show file tree
Hide file tree
Showing 4 changed files with 75 additions and 4 deletions.
24 changes: 24 additions & 0 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
version: "3.3"

networks:
proxy:
external: { }

services:
grpc-proxy:
image: "traefik:v3.1"
container_name: "traefik"

# - "traefik.http.middlewares.testheader.headers.accesscontrolallowmethods=POST,GET,OPTIONS,PUT"
# - "traefik.http.middlewares.testheader.headers.accesscontrolalloworigin=*"
# - "traefik.http.middlewares.testheader.headers.accesscontrolmaxage=100"
# - "traefik.http.middlewares.testheader.headers.addvaryheader=true"

ports:
- "1234:1234"
volumes:
- "/var/run/docker.sock:/var/run/docker.sock:ro"
- "./dynamic.yml:/etc/traefik/dynamic.yml:ro"
- "./traefik.yml:/etc/traefik/traefik.yml:ro"
networks:
- proxy
29 changes: 29 additions & 0 deletions dynamic.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
http:
routers:
routerTest:
service: srv-grpc
rule: Host(`*`)
entryPoints:
- web

middlewares:
test-grpc-web:
grpcWeb:
allowOrigins:
- "*"
headers:
accessControlAllowMethods:
- "POST"
- "GET"
- "OPTIONS"
- "PUT"
accessControlAllowHeaders: "*"
accessControlAllowOriginList: "*"
addVaryHeader: true
accessControlMaxAge: 100

services:
srv-grpc:
loadBalancer:
servers:
- url: https://zec.rocks:443
6 changes: 2 additions & 4 deletions tests/simple-sync-and-send.rs
Original file line number Diff line number Diff line change
Expand Up @@ -14,9 +14,7 @@ use wasm_bindgen::prelude::wasm_bindgen;
use wasm_bindgen::{JsCast, UnwrapThrowExt};
use wasm_bindgen_futures::{spawn_local, JsFuture};
use wasm_thread as thread;
use web_sys::{
DedicatedWorkerGlobalScope, Headers, RequestCache, RequestCredentials, RequestInit, Response,
};

use zcash_client_backend::proto::service::compact_tx_streamer_client::CompactTxStreamerClient;
use zcash_client_backend::proto::service::ChainSpec;

Expand All @@ -40,7 +38,7 @@ async fn test_get_and_scan_range() {
assert!(!thread::is_web_worker_thread());
let main_handler = thread::Builder::new().spawn_async(|| async {
assert!(thread::is_web_worker_thread());
let mut w = WebWallet::new("test", "https://zcash-testnet.chainsafe.dev", 1).unwrap();
let mut w = WebWallet::new("test", "http://localhost:1234", 1).unwrap();

let id = w.create_account(SEED, HD_INDEX, BIRTHDAY).await.unwrap();
tracing::info!("Created account with id: {}", id);
Expand Down
20 changes: 20 additions & 0 deletions traefik.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
global:
sendAnonymousUsage: false

api:
dashboard: true
insecure: true

log:
level: DEBUG
format: common

entryPoints:
web:
address: :1234

providers:
file:
directory: /etc/traefik/
docker:
exposedByDefault: false

0 comments on commit 3141f07

Please sign in to comment.