Skip to content

Commit 847ba24

Browse files
authored
Merge pull request #22 from breez/web-proxy
Add web proxy
2 parents 691f5a9 + f7efd0c commit 847ba24

5 files changed

Lines changed: 472 additions & 11 deletions

File tree

config/config.go

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -29,10 +29,11 @@ func (c *Certificate) UnmarshalEnvironmentValue(data string) error {
2929
}
3030

3131
type Config struct {
32-
GrpcListenAddress string `env:"GRPC_LISTEN_ADDRESS,default=0.0.0.0:8080"`
33-
SQLiteDirPath string `env:"SQLITE_DIR_PATH,default=db"`
34-
PgDatabaseUrl string `env:"DATABASE_URL"`
35-
CACert *Certificate `env:"CA_CERT"`
32+
GrpcListenAddress string `env:"GRPC_LISTEN_ADDRESS,default=0.0.0.0:8080"`
33+
GrpcWebListenAddress string `env:"GRPC_WEB_LISTEN_ADDRESS,default=0.0.0.0:8081"`
34+
SQLiteDirPath string `env:"SQLITE_DIR_PATH,default=db"`
35+
PgDatabaseUrl string `env:"DATABASE_URL"`
36+
CACert *Certificate `env:"CA_CERT"`
3637
}
3738

3839
func NewConfig() (*Config, error) {

fly.toml

Lines changed: 19 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -21,15 +21,27 @@ cpus = 1
2121
[[services]]
2222
internal_port = 8080
2323
protocol = "tcp"
24-
min_machines_running = 2
24+
min_machines_running = 1
2525
processes = ['app']
26-
27-
[[services.ports]]
28-
handlers = ["tls"]
29-
port = 443
30-
tls_options = { "alpn" = ["h2"] }
31-
26+
[[services.ports]]
27+
handlers = ["tls"]
28+
port = 443
29+
tls_options = { "alpn" = ["h2"] }
3230
[services.concurrency]
3331
type = "connections"
3432
hard_limit = 1000
3533
soft_limit = 500
34+
35+
[[services]]
36+
internal_port = 8081
37+
protocol = "tcp"
38+
min_machines_running = 1
39+
processes = ['app']
40+
[[services.ports]]
41+
handlers = ["tls", "http"]
42+
port = 442
43+
44+
[services.concurrency]
45+
type = "connections"
46+
hard_limit = 1000
47+
soft_limit = 500

go.mod

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,11 +19,14 @@ require (
1919
)
2020

2121
require (
22+
github.com/cenkalti/backoff/v4 v4.1.2 // indirect
2223
github.com/davecgh/go-spew v1.1.1 // indirect
2324
github.com/decred/dcrd/dcrec/secp256k1/v4 v4.0.1 // indirect
25+
github.com/desertbit/timer v0.0.0-20180107155436-c41aec40b27f // indirect
2426
github.com/gobuffalo/here v0.6.0 // indirect
2527
github.com/hashicorp/errwrap v1.1.0 // indirect
2628
github.com/hashicorp/go-multierror v1.1.1 // indirect
29+
github.com/improbable-eng/grpc-web v0.15.0 // indirect
2730
github.com/jackc/chunkreader/v2 v2.0.1 // indirect
2831
github.com/jackc/pgconn v1.14.3 // indirect
2932
github.com/jackc/pgerrcode v0.0.0-20220416144525-469b46aa5efa // indirect
@@ -34,10 +37,12 @@ require (
3437
github.com/jackc/pgtype v1.14.0 // indirect
3538
github.com/jackc/pgx/v4 v4.18.2 // indirect
3639
github.com/jackc/puddle/v2 v2.2.1 // indirect
40+
github.com/klauspost/compress v1.15.11 // indirect
3741
github.com/lib/pq v1.10.9 // indirect
3842
github.com/markbates/pkger v0.17.1 // indirect
3943
github.com/pmezard/go-difflib v1.0.0 // indirect
4044
github.com/rogpeppe/go-internal v1.13.1 // indirect
45+
github.com/rs/cors v1.11.1 // indirect
4146
go.uber.org/atomic v1.7.0 // indirect
4247
golang.org/x/crypto v0.23.0 // indirect
4348
golang.org/x/net v0.25.0 // indirect
@@ -46,4 +51,5 @@ require (
4651
golang.org/x/text v0.16.0 // indirect
4752
google.golang.org/genproto/googleapis/rpc v0.0.0-20240528184218-531527333157 // indirect
4853
gopkg.in/yaml.v3 v3.0.1 // indirect
54+
nhooyr.io/websocket v1.8.6 // indirect
4955
)

0 commit comments

Comments
 (0)