Skip to content

Commit d858c26

Browse files
committed
proxy: use default block g1
1 parent 1fc0aae commit d858c26

6 files changed

Lines changed: 39 additions & 17 deletions

File tree

model/network_client_proxy_model.go

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -496,7 +496,7 @@ func CreateProxyClient(
496496
wgPort := 8084
497497

498498
proxyHost := fmt.Sprintf("%s.%s", "cosmic", server.RequireDomain())
499-
block := ""
499+
block := "g1"
500500

501501
socksProxyUrl := fmt.Sprintf("socks5h://%s:%d", proxyHost, socksProxyPort)
502502

proxy/main.go

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -131,7 +131,9 @@ func main() {
131131
settings,
132132
)
133133

134-
newWatchdog(ctx, 5*time.Second)
134+
if server.RequireEnv() != "local" {
135+
newWatchdog(ctx, 5*time.Second)
136+
}
135137

136138
notif := newProxyClientNotification(ctx, settings)
137139
sub := notif.AddProxyClientsCallback(func(proxyClients []*model.ProxyClient) {

proxy/proxy_client_notification.go

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -34,8 +34,7 @@ func newProxyClientNotification(ctx context.Context, settings *ProxySettings) *p
3434

3535
func (self *proxyClientNotification) run() {
3636
proxyHost := server.RequireHost()
37-
// FIXME allow an optional block until migration is complete
38-
block, _ := server.Block()
37+
block := server.RequireBlock()
3938

4039
nextChangeId := int64(0)
4140
for {
@@ -50,6 +49,8 @@ func (self *proxyClientNotification) run() {
5049
if err != nil {
5150
glog.Infof("[pcn]err=%s\n", err)
5251
} else if 0 < len(proxyClients) {
52+
53+
glog.Infof("[pcn]found %d new proxy clients (...%d)\n", len(proxyClients), nextChangeId)
5354
self.proxyClients(maps.Values(proxyClients))
5455
}
5556
select {

proxy/run-builder.sh

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,16 @@
22

33
env=main
44

5-
export GOEXPERIMENT=greenteagc
6-
export WARP_DOMAIN="bringyour.com"
7-
export WARP_SERVICE="proxy"
8-
export WARP_VERSION="0.0.0-local"
9-
export WARP_ENV="$env"
10-
export BRINGYOUR_POSTGRES_HOSTNAME="192.168.51.43"
11-
export BRINGYOUR_REDIS_HOSTNAME="192.168.51.43"
5+
export GOEXPERIMENT=greenteagc;
6+
export WARP_DOMAIN="bringyour.com";
7+
export WARP_SERVICE="proxy";
8+
export WARP_VERSION="0.0.0-local";
9+
export WARP_ENV="$env";
10+
# FIXME this is temporary until the final deploy is worked out
11+
export WARP_HOST="cosmic.bringyour.com";
12+
export WARP_BLOCK="g1";
13+
export BRINGYOUR_POSTGRES_HOSTNAME="192.168.51.43";
14+
export BRINGYOUR_REDIS_HOSTNAME="192.168.51.43";
1215
while [ 1 ]; do
1316
go run . "$@"
1417
done

proxy/run-local.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/usr/bin/env bash
2+
3+
export WARP_DOMAIN="bringyour.com";
4+
export WARP_HOST="127.0.0.1";
5+
export WARP_BLOCK="local";
6+
export WARP_SERVICE="proxy";
7+
export WARP_VERSION="0.0.0-local";
8+
export WARP_ENV="local";
9+
# FIXME this is temporary until the final deploy is worked out
10+
export WARP_HOST="cosmic.bringyour.com"
11+
export BRINGYOUR_POSTGRES_HOSTNAME="local-pg.bringyour.com";
12+
export BRINGYOUR_REDIS_HOSTNAME="local-redis.bringyour.com";
13+
go run . "$@"

proxy/run-main.sh

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -5,10 +5,13 @@ env=main
55
# you must port forward to the main db and redis from 127.0.0.1
66
# e.g. ssh -i ${main-data-key} -L 5432:127.0.0.1:5432 -L 6379:127.0.0.1:6379 by@${main-data-host} -N
77

8-
export WARP_DOMAIN="bringyour.com"; \
9-
export WARP_SERVICE="proxy"; \
10-
export WARP_VERSION="0.0.0-local"; \
11-
export WARP_ENV="$env"; \
12-
export BRINGYOUR_POSTGRES_HOSTNAME="127.0.0.1"; \
13-
export BRINGYOUR_REDIS_HOSTNAME="127.0.0.1"; \
8+
export WARP_DOMAIN="bringyour.com";
9+
export WARP_SERVICE="proxy";
10+
export WARP_VERSION="0.0.0-local";
11+
export WARP_ENV="$env";
12+
# FIXME this is temporary until the final deploy is worked out
13+
export WARP_HOST="cosmic.bringyour.com";
14+
export WARP_BLOCK="g1";
15+
export BRINGYOUR_POSTGRES_HOSTNAME="127.0.0.1";
16+
export BRINGYOUR_REDIS_HOSTNAME="127.0.0.1";
1417
go run . "$@"

0 commit comments

Comments
 (0)