Skip to content

Commit 0e7175e

Browse files
committed
Latest
1 parent 1b17cf4 commit 0e7175e

18 files changed

Lines changed: 711 additions & 62 deletions

.dockerignore

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,3 @@
11
.git
2-
node_modules
2+
node_modules
3+
data

.idea/development.iml

Lines changed: 3 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

.idea/material_theme_project_new.xml

Lines changed: 3 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Makefile

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,13 +5,13 @@ export COMPOSE_FILE = docker-compose.solo.yml
55
endif
66

77
ifeq ($(wildcard .e),)
8-
export VITE_CONFIG_DIRECTORY = /app/web/packages/teleport
8+
export VITE_CONFIG_DIRECTORY = /app/teleport/web/packages/teleport
99
export TOOL_FOLDER = tool
1010
export LICENSE_FILE = ../teleport/empty.pem
1111
else
12-
export VITE_CONFIG_DIRECTORY = /app/e/web/teleport
12+
export VITE_CONFIG_DIRECTORY = /app/web
1313
export TOOL_FOLDER = e/tool
14-
export LICENSE_FILE = ../../teleport/e/fixtures/license-all-features.pem
14+
export LICENSE_FILE = ../../teleport/e/fixtures/license-enterprise.pem
1515
endif
1616

1717
## -- 🛟 Lifecycle --
@@ -99,6 +99,11 @@ teleport-logs:
9999
teleport-shell:
100100
docker compose exec -it go.teleport /bin/bash
101101

102+
103+
.PHONY: delete-db-volume
104+
delete-db-volume:
105+
docker compose down db -v
106+
102107
## -- 🔧 Misc --
103108

104109
.PHONY: help

README.md

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,15 +3,17 @@
33
This helps you run a local Teleport environment locally at https://go.teleport, with trusted local certificates (no
44
`--insecure` anywhere).
55

6-
It sets up a single Teleport service that runs the Auth and Proxy services, as well as a container to run Vite so you
6+
It sets up a single Teleport service that runs the Auth and Proxy services, as well as a container to run Webpack so you
77
can build both Teleport and the Web code at the same time. It also runs Application Access with the debug dumper app.
88

99
File changes for the Teleport repo are sync'd and then [air](https://github.com/cosmtrek/air) watches for any changes to
1010
your local Teleport repo, and will rebuild and relaunch Teleport when you change a `.go` or `.yaml` file.
1111

12-
This uses caching for both Go and Vite, so although the first initial run will take a few minutes, subsequent runs
12+
This uses caching for both Go and Webpack, so although the first initial run will take a few minutes, subsequent runs
1313
of `make start` will build both Teleport and the frontend and have them up and running in <5s.
1414

15+
This should work on v13+ of Teleport. If you're running v12 or below, checkout the `old` branch and re-run `make build`.
16+
1517
![make help](images/help.png)
1618

1719
![Teleport](images/teleport.png)

accessgraph/.air.toml

Lines changed: 25 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,25 @@
1+
root = "."
2+
tmp_dir = "tmp"
3+
4+
[build]
5+
bin = "tmp/tag"
6+
include_ext = ["go", "yaml"]
7+
exclude_dir = ["web", "e2e", "teleport"]
8+
exclude_unchanged = true
9+
follow_symlink = true
10+
stop_on_error = true
11+
send_interrupt = true
12+
kill_delay = 1000
13+
args_bin = ["start"]
14+
15+
[log]
16+
time = false
17+
18+
[color]
19+
main = "magenta"
20+
watcher = "cyan"
21+
build = "yellow"
22+
runner = "green"
23+
24+
[misc]
25+
clean_on_exit = true

accessgraph/Dockerfile

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# First stage: Build the Go application
2+
FROM golang:1.24 AS builder
3+
4+
# Set the Current Working Directory inside the container
5+
WORKDIR /app
6+
7+
ENV GOPATH "/go"
8+
ENV GOROOT "/usr/local/go"
9+
ENV GOOS "linux"
10+
ENV CGO_ENABLED 1
11+
ENV GOARCH "amd64"
12+
13+
COPY development/certs/server.key /var/lib/teleport-certs/server.key
14+
COPY development/certs/server.crt /var/lib/teleport-certs/server.crt
15+
16+
RUN cp /var/lib/teleport-certs/server.crt /usr/local/share/ca-certificates/teleport.crt && update-ca-certificates
17+
18+
RUN go install github.com/air-verse/air@latest
19+
20+
ENTRYPOINT ["/go/bin/air"]

accessgraph/config.yaml

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
backend:
2+
postgres:
3+
connection: postgres://postgres:localpass@db:5432/postgres?sslmode=disable
4+
tls:
5+
cert: keys/server.crt
6+
key: keys/server_docker.key
7+
8+
tracing:
9+
enabled: false
10+
11+
log:
12+
level: DEBUG
13+
14+
registration_cas:
15+
- keys/teleport_host_ca.pem
16+
- keys/ca.crt

base/docker-compose.yml

Lines changed: 53 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,26 +2,26 @@ services:
22
frontend:
33
container_name: frontend
44
build:
5-
dockerfile: ../development/frontend/Dockerfile
6-
context: ../../teleport
7-
working_dir: ${VITE_CONFIG_DIRECTORY}
8-
command: pnpm start
5+
dockerfile: development/frontend/Dockerfile
6+
context: ../../
7+
target: node-dependencies
8+
working_dir: /app/web
9+
command: yarn start
910
networks:
1011
- teleport
1112
ports:
1213
- 443:3000
1314
volumes:
14-
- ../../teleport/web/:/app/web/
15-
- ../../teleport/gen/proto/ts/:/app/gen/proto/ts/
16-
- ../../teleport/e/web/:/app/e/web/
17-
- ../../teleport/lib/srv/desktop/rdp/rdpclient/:/app/lib/srv/desktop/rdp/rdpclient
15+
- ../../access-graph/web:/app/web
16+
- ../../access-graph/teleport:/app/teleport
1817
- ../certs:/app/certs:ro
19-
- /usr/local/cargo
18+
- ../data/cache/frontend:/webpack/cache:rw,delegated
2019
environment:
2120
NODE_OPTIONS: --max-old-space-size=8192
2221
PROXY_TARGET: go.teleport:443
2322
VITE_HTTPS_CERT: /app/certs/server.crt
2423
VITE_HTTPS_KEY: /app/certs/server.key
24+
POLY_API_KEY: HvMA3rfToChIPdffmVTJin92c8YpHRQ3
2525

2626
node:
2727
build:
@@ -30,8 +30,6 @@ services:
3030
target: static
3131
args:
3232
TOOL_FOLDER: ${TOOL_FOLDER}
33-
volumes:
34-
- /var/lib/teleport
3533
networks:
3634
- teleport
3735

@@ -68,6 +66,50 @@ services:
6866
- ../build/.air.toml:/app/.air.toml
6967
- ../teleport/teleport.yaml:/etc/teleport.yaml
7068
- ${LICENSE_FILE}:/etc/license.pem
69+
- ../../access-graph/keys/ca.crt:/etc/access-graph/keys/ca.crt
70+
environment:
71+
TELEPORT_UNSTABLE_VC_SYNC_ON_START: yes
72+
TELEPORT_ALLOW_NO_SECOND_FACTOR: yes
73+
TELEPORT_UNSTABLE_SKIP_VERSION_UPGRADE_CHECK: yes
74+
deploy:
75+
resources:
76+
limits:
77+
memory: 48G
78+
79+
access-graph:
80+
build:
81+
context: ../..
82+
dockerfile: development/accessgraph/Dockerfile
83+
command:
84+
- --build.cmd
85+
- "go build -o tmp/tag ./cmd/tag/main.go"
86+
ports:
87+
- 50051:50051
88+
volumes:
89+
- ../accessgraph/config.yaml:/app/config.yaml
90+
- ../../access-graph:/app
91+
- ../accessgraph/.air.toml:/app/.air.toml
92+
- /go/pkg/mod
93+
- /root/.cache/go-build
94+
networks:
95+
- teleport
96+
97+
db:
98+
build:
99+
context: ../..
100+
dockerfile: development/postgres/Dockerfile
101+
restart: always
102+
shm_size: 256m
103+
ports:
104+
- 5434:5432
105+
volumes:
106+
- /var/lib/postgresql/data
107+
environment:
108+
POSTGRES_USER: postgres
109+
POSTGRES_PASSWORD: localpass
110+
POSTGRES_DB: postgres
111+
networks:
112+
- teleport
71113

72114
networks:
73115
teleport:

build/Dockerfile

Lines changed: 12 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
FROM golang:1.23 AS base
1+
FROM golang:1.24 AS base
22

33
WORKDIR /app
44

@@ -23,6 +23,10 @@ ARG TOOL_FOLDER
2323

2424
FROM base AS tctl
2525

26+
#RUN dpkg --add-architecture amd64 \
27+
# && apt-get update \
28+
# && apt-get install -y --no-install-recommends gcc-x86-64-linux-gnu libc6-dev-amd64-cross
29+
2630
ENV GOPATH "/go"
2731
ENV GOROOT "/usr/local/go"
2832
ENV GOOS "linux"
@@ -44,7 +48,7 @@ RUN --mount=type=cache,target=/go/pkg/mod \
4448
--mount=type=cache,target=/root/.cache/go-build \
4549
go build -o /bin/tctl -ldflags '-w -s' ./tool/tctl
4650

47-
FROM golang:1.23 AS live-reload
51+
FROM golang:1.24 AS live-reload
4852

4953
COPY development/certs/server.key /var/lib/teleport-certs/server.key
5054
COPY development/certs/server.crt /var/lib/teleport-certs/server.crt
@@ -53,6 +57,12 @@ RUN cp /var/lib/teleport-certs/server.crt /usr/local/share/ca-certificates/telep
5357

5458
RUN go install github.com/air-verse/air@latest
5559

60+
COPY access-graph/keys/server.crt /var/lib/teleport-certs/access-graph.crt
61+
COPY access-graph/keys/ca.crt /var/lib/teleport-certs/access-graph-ca.crt
62+
63+
RUN cp /var/lib/teleport-certs/access-graph.crt /usr/local/share/ca-certificates/access-graph.crt && update-ca-certificates
64+
RUN cp /var/lib/teleport-certs/access-graph-ca.crt /usr/local/share/ca-certificates/access-graph-ca.crt && update-ca-certificates
65+
5666
COPY --from=tctl /bin/tctl /bin/tctl
5767

5868
ENV DEBUG "1"

0 commit comments

Comments
 (0)