mirror of
https://github.com/tale/headplane.git
synced 2026-07-26 07:48:14 +00:00
chore: add tooling for go wasm
This commit is contained in:
@@ -4,3 +4,5 @@ node_modules
|
||||
/build
|
||||
/test
|
||||
.env
|
||||
public/hp_ssh.wasm
|
||||
public/wasm_exec.js
|
||||
|
||||
@@ -0,0 +1,10 @@
|
||||
https://localhost {
|
||||
reverse_proxy headscale:8080
|
||||
tls /certs/localhost.pem /certs/localhost-key.pem
|
||||
|
||||
header {
|
||||
Access-Control-Allow-Origin *
|
||||
Access-Control-Allow-Headers *
|
||||
Access-Control-Allow-Methods GET, POST, OPTIONS
|
||||
}
|
||||
}
|
||||
@@ -7,6 +7,22 @@ networks:
|
||||
name: "headplane-dev"
|
||||
driver: "bridge"
|
||||
services:
|
||||
caddy:
|
||||
image: "caddy:2"
|
||||
container_name: "headplane-caddy"
|
||||
restart: "unless-stopped"
|
||||
depends_on:
|
||||
- "headscale"
|
||||
networks:
|
||||
- "headplane-dev"
|
||||
ports:
|
||||
- "80:80"
|
||||
- "443:443"
|
||||
volumes:
|
||||
- "./Caddyfile:/etc/caddy/Caddyfile"
|
||||
- "./test/caddy/data:/data"
|
||||
- "./test/caddy/config:/config"
|
||||
- "./test/caddy/certs:/certs"
|
||||
headscale:
|
||||
image: "headscale/headscale:0.26.0-debug"
|
||||
container_name: "headscale"
|
||||
|
||||
@@ -45,3 +45,9 @@ before commit to make these changes automatically.
|
||||
> All of these guidelines are fairly simple to follow and are flexible if needed.
|
||||
> I won't automatically close PRs or issues if they don't follow these rules,
|
||||
> but instead we can discuss them and see if we can come to a compromise.
|
||||
|
||||
### Contribution Tooling
|
||||
If you plan to work with the WASM SSH agent, you will need to install
|
||||
`mkcert` or an equivalent to create certificates in `./test/caddy/certs`.
|
||||
It expects a `localhost.pem` and `localhost-key.pem` file to be present in that
|
||||
directory. PNPM has a script to do it with `pnpm mkcert` already already.
|
||||
|
||||
@@ -0,0 +1,27 @@
|
||||
[tools]
|
||||
"go" = "1.24.4"
|
||||
"node" = "22"
|
||||
|
||||
[tasks.copy-wasm-shim]
|
||||
alias = ["gojs"]
|
||||
description = "Copies Go's wasm_exec.js to the public directory"
|
||||
run = [
|
||||
"echo $(go version) > public/wasm_exec.js",
|
||||
"cat $(go env GOROOT)/lib/wasm/wasm_exec.js >> public/wasm_exec.js",
|
||||
]
|
||||
|
||||
[tasks.build-go-wasm]
|
||||
alias = ["wasm"]
|
||||
depends = ["copy-wasm-shim"]
|
||||
description = "Builds the Go WebAssembly module for Tailscale SSH"
|
||||
env = { GOOS = "js", GOARCH = "wasm" }
|
||||
run = "go build -o public/hp_ssh.wasm ./cmd/hp_ssh"
|
||||
|
||||
[tasks.generate-caddy-certs]
|
||||
alias = ["mkcert"]
|
||||
dir = "{{cwd}}/test/caddy/certs"
|
||||
run = [
|
||||
"mkdir -p {{cwd}}/test/caddy/certs",
|
||||
"mkcert -install",
|
||||
"mkcert localhost"
|
||||
]
|
||||
Reference in New Issue
Block a user