repos / pico

pico services - prose.sh, pastes.sh, imgs.sh, feeds.sh, pgs.sh
git clone https://github.com/picosh/pico.git

commit
c028a22
parent
396ba64
author
Eric Bower
date
2024-07-09 03:38:24 +0000 UTC
chore: ptun => tunkit
4 files changed,  +13, -15
M go.mod
M go.sum
M go.mod
+2, -2
 1@@ -2,7 +2,7 @@ module github.com/picosh/pico
 2 
 3 go 1.22
 4 
 5-// replace github.com/picosh/ptun => ../ptun
 6+// replace github.com/picosh/tunkit => ../tunkit
 7 
 8 replace github.com/picosh/send => ../send
 9 
10@@ -32,8 +32,8 @@ require (
11 	github.com/muesli/reflow v0.3.0
12 	github.com/neurosnap/go-exif-remove v0.0.0-20221010134343-50d1e3c35577
13 	github.com/picosh/pobj v0.0.0-20240708144544-9d0e2ca3d3dc
14-	github.com/picosh/ptun v0.0.0-20240529133708-fcf1376b935e
15 	github.com/picosh/send v0.0.0-20240706191319-a4ef3917a8bd
16+	github.com/picosh/tunkit v0.0.0-20240709033345-8315d4f3cd0e
17 	github.com/sabhiram/go-gitignore v0.0.0-20210923224102-525f6e181f06
18 	github.com/sendgrid/sendgrid-go v3.14.0+incompatible
19 	github.com/simplesurance/go-ip-anonymizer v0.0.0-20200429124537-35a880f8e87d
M go.sum
+2, -4
 1@@ -221,12 +221,10 @@ github.com/philhofer/fwd v1.1.2 h1:bnDivRJ1EWPjUIRXV5KfORO897HTbpFAQddBdE8t7Gw=
 2 github.com/philhofer/fwd v1.1.2/go.mod h1:qkPdfjR2SIEbspLqpe1tO4n5yICnr2DY7mqEx2tUTP0=
 3 github.com/picosh/pobj v0.0.0-20240708144544-9d0e2ca3d3dc h1:ylEMiypOHSUhZfMFljs++FhooNHAXFsMMsT1cxoPVHE=
 4 github.com/picosh/pobj v0.0.0-20240708144544-9d0e2ca3d3dc/go.mod h1:CViLWaCp2KP/zJdd7miNPkJb6i0v9HOgZ2wdbQuxCrQ=
 5-github.com/picosh/ptun v0.0.0-20240529133708-fcf1376b935e h1:Um9aCUg1ysiUaB0nh3400UHlFAnhd8BXBsawqePxxqQ=
 6-github.com/picosh/ptun v0.0.0-20240529133708-fcf1376b935e/go.mod h1:WXCrhe0l9VL3ji0pdhvSJD6LLx99rJoAA/+PUQXf0Mo=
 7-github.com/picosh/send v0.0.0-20240706191319-a4ef3917a8bd h1:8JkwHLddx7RU40lOdj9BRUPtKgpM9+GaSP66ikOSYbo=
 8-github.com/picosh/send v0.0.0-20240706191319-a4ef3917a8bd/go.mod h1:V418obz9YdzjS3/oFzyDFzmPDnLu1nvy3wkLaixiT84=
 9 github.com/picosh/senpai v0.0.0-20240503200611-af89e73973b0 h1:pBRIbiCj7K6rGELijb//dYhyCo8A3fvxW5dijrJVtjs=
10 github.com/picosh/senpai v0.0.0-20240503200611-af89e73973b0/go.mod h1:QaBDtybFC5gz7EG/9c3bgzuyW7W5W2rYLFZxWNuWk3Q=
11+github.com/picosh/tunkit v0.0.0-20240709033345-8315d4f3cd0e h1:3rNSjBJ6VlvngWF58V/z0fPLH7WyzKpSboC6YznECgw=
12+github.com/picosh/tunkit v0.0.0-20240709033345-8315d4f3cd0e/go.mod h1:UrDH/VCIc1wg/L6iY2zSYt4TiGw+25GsKSnkVkU40Dw=
13 github.com/pkg/sftp v1.13.6 h1:JFZT4XbOU7l77xGSpOdW+pwIMqP044IyjXX6FGyEKFo=
14 github.com/pkg/sftp v1.13.6/go.mod h1:tz1ryNURKu77RL+GuCzmoJYxQczL3wLNNpPWagdg4Qk=
15 github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4=
M imgs/ssh.go
+6, -6
 1@@ -24,7 +24,7 @@ import (
 2 	"github.com/picosh/pico/db/postgres"
 3 	"github.com/picosh/pico/shared"
 4 	"github.com/picosh/pico/shared/storage"
 5-	"github.com/picosh/ptun"
 6+	"github.com/picosh/tunkit"
 7 )
 8 
 9 type ctxUserKey struct{}
10@@ -79,7 +79,7 @@ func (e *ErrorHandler) ServeHTTP(w http.ResponseWriter, r *http.Request) {
11 	http.Error(w, e.Err.Error(), http.StatusInternalServerError)
12 }
13 
14-func createServeMux(handler *CliHandler, pubsub *ptun.PubSubHandler) func(ctx ssh.Context) http.Handler {
15+func createServeMux(handler *CliHandler, pubsub *tunkit.PubSubHandler) func(ctx ssh.Context) http.Handler {
16 	return func(ctx ssh.Context) http.Handler {
17 		router := http.NewServeMux()
18 
19@@ -303,16 +303,16 @@ func StartSshServer() {
20 		RegistryUrl: registryUrl,
21 	}
22 
23-	pubsub := ptun.NewPubSubHandler(logger)
24+	pubsub := tunkit.NewPubSubHandler(logger)
25 	s, err := wish.NewServer(
26 		wish.WithAddress(fmt.Sprintf("%s:%s", host, port)),
27 		wish.WithHostKeyPath("ssh_data/term_info_ed25519"),
28 		wish.WithPublicKeyAuth(AuthHandler(dbh, logger)),
29 		wish.WithMiddleware(WishMiddleware(handler)),
30-		ptun.WithWebTunnel(
31-			ptun.NewWebTunnelHandler(createServeMux(handler, pubsub), logger),
32+		tunkit.WithWebTunnel(
33+			tunkit.NewWebTunnelHandler(createServeMux(handler, pubsub), logger),
34 		),
35-		ptun.WithPubSub(pubsub),
36+		tunkit.WithPubSub(pubsub),
37 	)
38 
39 	if err != nil {
M pgs/ssh.go
+3, -3
 1@@ -18,7 +18,6 @@ import (
 2 	"github.com/picosh/pico/shared"
 3 	"github.com/picosh/pico/shared/storage"
 4 	wsh "github.com/picosh/pico/wish"
 5-	"github.com/picosh/ptun"
 6 	"github.com/picosh/send/list"
 7 	"github.com/picosh/send/pipe"
 8 	"github.com/picosh/send/proxy"
 9@@ -26,6 +25,7 @@ import (
10 	wishrsync "github.com/picosh/send/send/rsync"
11 	"github.com/picosh/send/send/scp"
12 	"github.com/picosh/send/send/sftp"
13+	"github.com/picosh/tunkit"
14 )
15 
16 func createRouter(cfg *shared.ConfigSite, handler *uploadassets.UploadAssetHandler) proxy.Router {
17@@ -91,7 +91,7 @@ func StartSshServer() {
18 		AnalyticsQueue: ch,
19 	}
20 
21-	webTunnel := &ptun.WebTunnelHandler{
22+	webTunnel := &tunkit.WebTunnelHandler{
23 		Logger:      logger,
24 		HttpHandler: createHttpHandler(apiConfig),
25 	}
26@@ -101,7 +101,7 @@ func StartSshServer() {
27 		wish.WithAddress(fmt.Sprintf("%s:%s", host, port)),
28 		wish.WithHostKeyPath("ssh_data/term_info_ed25519"),
29 		wish.WithPublicKeyAuth(sshAuth.PubkeyAuthHandler),
30-		ptun.WithWebTunnel(webTunnel),
31+		tunkit.WithWebTunnel(webTunnel),
32 		withProxy(
33 			cfg,
34 			handler,