-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Cannot build: can't find reason for requirement on github.com/google/pprof #11
Comments
It is super cool! But alas, you have hit a known bug in the We've figured out, that with Caddy, specifying the version of v2.6.3 or higher (v2.6.4 is current) fixes it. The plugin can do that in its go.mod or you can manually create a replacement in your own go.mod. |
I've had to update both the Caddy and the Tailscale dependencies to get this to build and to work (somehow with the old Tailscale version the node would seemingly be connected to the tailnet but no traffic would actually go through). --- a/go.mod
+++ b/go.mod
@@ -3,8 +3,8 @@ module github.com/tailscale/caddy-tailscale
go 1.19
require (
- github.com/caddyserver/caddy/v2 v2.5.3-0.20220831215348-67098e5cbd68
- tailscale.com v1.1.1-0.20220902232949-3344c3b89bd1
+ github.com/caddyserver/caddy/v2 v2.6.4
+ tailscale.com v1.36.2
)
require ( (+ many more changes after running I've also had to patch the module slightly because the newer version of --- a/module.go
+++ b/module.go
@@ -46,7 +46,7 @@ func getPlainListener(_ context.Context, network string, addr string, _ net.List
return nil, err
}
- return s.Listen(network, ":"+port)
+ return s.Listen("tcp", ":"+port)
}
func getTLSListener(_ context.Context, network string, addr string, _ net.ListenConfig) (any, error) {
@@ -60,7 +60,7 @@ func getTLSListener(_ context.Context, network string, addr string, _ net.Listen
return nil, err
}
- ln, err := s.Listen(network, ":"+port)
+ ln, err := s.Listen("tcp", ":"+port)
if err != nil {
return nil, err
} Edit: And just for posterity, here's the terrible, no good, very hacky workaround for tailscale/tailscale#6973 that I've added to this module to make it work across restarts of Caddy on Windows: --- a/module.go
+++ b/module.go
@@ -20,6 +20,10 @@ import (
"tailscale.com/client/tailscale"
"tailscale.com/tsnet"
"tailscale.com/util/strs"
+
+ "path/filepath"
+ "tailscale.com/ipn"
+ "tailscale.com/ipn/store"
)
var (
@@ -121,6 +125,22 @@ func getServer(_, addr string) (*tsnet.Server, error) {
if err := os.MkdirAll(s.Dir, 0700); err != nil {
return nil, err
}
+
+ stateFile := filepath.Join(s.Dir, "tailscaled.state")
+ log.Printf("attempting to fix state file %s", stateFile)
+ tmpStore, err := store.New(log.Printf, stateFile)
+ if err != nil {
+ log.Printf("could not open store: %v", err)
+ } else {
+ value, err := tmpStore.ReadState(ipn.CurrentProfileStateKey)
+ if err == nil {
+ err := tmpStore.WriteState(ipn.ServerModeStartKey, value)
+ if err != nil {
+ log.Printf("could not fix state file: %v", err)
+ }
+ }
+ }
+
}
servers[host] = s |
@Zaba if you have the time, could you please submit your code as a pull request? Currently running into the same issue. |
I applied the changes as originally I also ran into compiling issues with the old dependencies (ref: #9). I have a repo, that works with gitpod at: https://gitpod.io/#https://github.com/spotsnel/caddy-tailscale the changes in Besides this, it works... although it might be that the templates didn't render correctly? Any suggestions to remove the hard-coded |
The change to hardcode Technically it doesn't have to be |
Hey ! Running into same issue here ! 2023/06/15 21:00:24 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go get -d -v
2023/06/15 21:00:28 [INFO] Build environment ready
2023/06/15 21:00:28 [INFO] Building Caddy
2023/06/15 21:00:28 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go mod tidy -e
go: finding module for package golang.org/x/crypto/internal/subtle
caddy imports
github.com/tailscale/caddy-tailscale imports
tailscale.com/tsnet imports
tailscale.com/ipn/ipnlocal imports
github.com/tailscale/golang-x-crypto/ssh imports
github.com/tailscale/golang-x-crypto/chacha20 imports
github.com/tailscale/golang-x-crypto/internal/subtle tested by
github.com/tailscale/golang-x-crypto/internal/subtle.test imports
golang.org/x/crypto/internal/subtle: module golang.org/x/crypto@latest found (v0.10.0), but does not contain package golang.org/x/crypto/internal/subtle
2023/06/15 21:00:28 [INFO] exec (timeout=-2562047h47m16.854775808s): /usr/local/go/bin/go build -o /home/pi/temp/caddy -ldflags -w -s -trimpath
package caddy
imports github.com/tailscale/caddy-tailscale
imports tailscale.com/tsnet
imports tailscale.com/ipn/ipnlocal
imports tailscale.com/net/dns
imports tailscale.com/net/tstun
imports gvisor.dev/gvisor/pkg/tcpip
imports gvisor.dev/gvisor/pkg/atomicbitops
imports gvisor.dev/gvisor/pkg/cpuid
imports gvisor.dev/gvisor/pkg/state
imports gvisor.dev/gvisor/pkg/state/wire
imports gvisor.dev/gvisor/pkg/gohacks: build constraints exclude all Go files in /home/pi/go/pkg/mod/gvisor.dev/gvisor@v0.0.0-20220801230058-850e42eb4444/pkg/gohacks
2023/06/15 21:00:29 [INFO] Cleaning up temporary folder: /tmp/buildenv_2023-06-15-2100.2723375457
2023/06/15 21:00:29 [FATAL] exit status 1 pi@john:~/temp $ go version
go version go1.20.5 linux/arm64 I'm on Raspberry Pi 4GB, running latest Go and xcaddy, Raspberry Pi OS based on Debian 11. |
Oh, I didn't realised it wasn't the same issue EDIT : OP's issue happened for me the first 2 times I tried to build, nothing changed between retrys (no updates, etc...). Then it showed me the error of my previous comment. |
@fr3nchalp4a I ran into that issue as well. I'm still running into some issues, but am getting closer.
The first error is due to this commit. I'm going to need to learn some go to tackle this, it seems like mashing commands I don't understand isn't going to get me to power through the dependency hell that my chosen set of plugins seems to create.
|
I was able to get this to build by replacing the the tailscale-caddy module with the contents on #13.
|
#13 has been merged, which I believe addresses most (or all?) of the issues mentioned here. This bumps us to caddy v2.6.4, which @mholt noted fixes the original problem discussed. #13 also includes some other changes which I believe takes care of needing to hardcard a network value of "tcp" as well as the tailscale.com/util/strs issue. If any of these problems remain after updating to the latest version of caddy-tailscale, feel free to reply here or open a new issue. |
Yayyyy thanks Will! |
I wanted to give this a try because it looks extremely Cool, but I'm having trouble building it, it seems that the Go package manager is getting Confused:
The text was updated successfully, but these errors were encountered: