Skip to content

Commit

Permalink
Use secrets for telemetry (#616)
Browse files Browse the repository at this point in the history
* Use secrets for telemetry

* Fixed name

* Added test
  • Loading branch information
myleshorton authored Apr 26, 2024
1 parent 7a15939 commit 5799912
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 13 deletions.
5 changes: 5 additions & 0 deletions .github/workflows/go.yml
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@ on:
- '!.github/**'
- '!**.bash'

env:
TELEPORT_HOST: ${{secrets.TELEPORT_HOST}}

jobs:
build:
runs-on: ubuntu-latest
Expand All @@ -25,6 +28,8 @@ jobs:
- name: Granting private modules access
run: |
git config --global url."https://${{ secrets.CI_PRIVATE_REPOS_GH_TOKEN }}:[email protected]/".insteadOf "https://github.com/"
- name: Environment list
run: env
- name: Test
run: make test
- name: Build
Expand Down
15 changes: 2 additions & 13 deletions http_proxy.go
Original file line number Diff line number Diff line change
Expand Up @@ -72,14 +72,14 @@ import (

const (
timeoutToDialOriginSite = 10 * time.Second

teleportHost = "telemetry.iantem.io:443"
)

var (
log = golog.LoggerFor("lantern-proxy")

proxyNameRegex = regexp.MustCompile(`(fp-([a-z0-9]+-)?([a-z0-9]+)-[0-9]{8}-[0-9]+)(-.+)?`)

teleportHost = os.Getenv("TELEPORT_HOST")
)

// Proxy is an HTTP proxy.
Expand Down Expand Up @@ -189,17 +189,6 @@ type Proxy struct {

type listenerBuilderFN func(addr string) (net.Listener, error)

type addresses struct {
obfs4 string
obfs4Multiplex string
http string
httpMultiplex string
lampshade string
tlsmasq string
starbridge string
broflake string
}

// ListenAndServe listens, serves and blocks.
func (p *Proxy) ListenAndServe(ctx context.Context) error {
if p.CountryLookup == nil {
Expand Down
8 changes: 8 additions & 0 deletions http_proxy_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -63,6 +63,14 @@ var (
}
)

// Test to make sure we can lookup TELEPORT_HOST in CI
func TestTeleportHost(t *testing.T) {
teleportHost := os.Getenv("TELEPORT_HOST")
if teleportHost == "" {
t.Fatal("TELEPORT_HOST not set")
}
}

func TestMain(m *testing.M) {
flag.Parse()
var err error
Expand Down

0 comments on commit 5799912

Please sign in to comment.