Work on webui, testing stuff

This commit is contained in:
eyedeekay
2025-02-09 12:18:57 -05:00
parent a8d467fc10
commit 96f1dea458
4 changed files with 9 additions and 18 deletions

3
go.mod
View File

@@ -5,7 +5,7 @@ go 1.23.5
require (
github.com/go-i2p/go-connfilter v0.0.0-20250205023438-0f2b889a80f6
github.com/go-i2p/go-forward v0.0.0-20250202052226-ee8a43dcb664
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250209024146-bb43a7caaf9f
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250209030407-ba90db65df97
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15
github.com/go-i2p/i2pkeys v0.33.92
github.com/go-i2p/onramp v0.33.92
@@ -23,7 +23,6 @@ require (
github.com/txthinking/runnergroup v0.0.0-20210608031112-152c7c4432bf // indirect
github.com/urfave/cli v1.22.16 // indirect
golang.org/x/crypto v0.32.0 // indirect
golang.org/x/mobile v0.0.0-20250106192035-c31d5b91ecc3 // indirect
golang.org/x/mod v0.23.0 // indirect
golang.org/x/net v0.34.0 // indirect
golang.org/x/sync v0.11.0 // indirect

13
go.sum
View File

@@ -1,5 +1,4 @@
github.com/BurntSushi/toml v1.4.0/go.mod h1:ukJfTF/6rtPPRCnwkur4qwRxa8vTRFBF0uk2lLoLwho=
github.com/cpuguy83/go-md2man/v2 v2.0.5 h1:ZtcqGrnekaHpVLArFSe4HK5DoKx1T0rq2DwVB0alcyc=
github.com/cpuguy83/go-md2man/v2 v2.0.5/go.mod h1:tgQtvFlXSQOSOSIRvRPT7W67SCa46tRHOmNcaadrF8o=
github.com/cpuguy83/go-md2man/v2 v2.0.6 h1:XJtiaUW6dEEqVuZiMTn1ldk455QWwEIsMIJlo5vtkx0=
github.com/cpuguy83/go-md2man/v2 v2.0.6/go.mod h1:oOW0eioCTA6cOiMLiUPZOpcVxMig6NIQQ7OS05n1F4g=
@@ -12,12 +11,8 @@ github.com/go-i2p/go-connfilter v0.0.0-20250205023438-0f2b889a80f6 h1:kOJH77NTMY
github.com/go-i2p/go-connfilter v0.0.0-20250205023438-0f2b889a80f6/go.mod h1:qSZ3m4cEeyQc391rRXIGYEq9zakEPMJG9WfeQ49gByU=
github.com/go-i2p/go-forward v0.0.0-20250202052226-ee8a43dcb664 h1:j+RzLt8jZPT9CeiLFDWEXvJPb6Orn3UQgywTx8iL1O4=
github.com/go-i2p/go-forward v0.0.0-20250202052226-ee8a43dcb664/go.mod h1:+R0jJkt7KIjVs2h83ENnORyaHJtPE9QCLpbYDiU6r84=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250203061220-6b5e19741c47 h1:3F1vbqVvh12ge45nIsZtadP5n/rQ3f0+i1kJeCcrJGo=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250203061220-6b5e19741c47/go.mod h1:u8CgiYIfehSFpoVWNe1up6TO4sasPpRUHxZw7W2e4sM=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250208035926-cff0b0758eda h1:I5z+lG0tk6TB/GY1wEZLVJZer8kuA9KCG0IdrJWGghQ=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250208035926-cff0b0758eda/go.mod h1:u8CgiYIfehSFpoVWNe1up6TO4sasPpRUHxZw7W2e4sM=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250209024146-bb43a7caaf9f h1:sLuEjwk/1NfH7krFMdyyqeM43IpkcaYBxv4pt6k8l3I=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250209024146-bb43a7caaf9f/go.mod h1:u8CgiYIfehSFpoVWNe1up6TO4sasPpRUHxZw7W2e4sM=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250209030407-ba90db65df97 h1:NywKIHXpkEA0P98SMMnwDPeAU5gk0D7aHyVLS34ijqI=
github.com/go-i2p/go-i2ptunnel-config v0.0.0-20250209030407-ba90db65df97/go.mod h1:u8CgiYIfehSFpoVWNe1up6TO4sasPpRUHxZw7W2e4sM=
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15 h1:ASjMbwlepoDQfrhv+H2B5ICBPJU5ES1JzmOxzPDx3YQ=
github.com/go-i2p/go-limit v0.0.0-20250203203118-210616857c15/go.mod h1:4jjmVRhvKj47sQ6B6wdDhN1IrEZunE6KwkYLQx/BeVE=
github.com/go-i2p/i2pkeys v0.0.0-20241108200332-e4f5ccdff8c4/go.mod h1:m5TlHjPZrU5KbTd7Lr+I2rljyC6aJ88HdkeMQXV0U0E=
@@ -61,8 +56,6 @@ golang.org/x/crypto v0.0.0-20210513164829-c07d793c2f9a/go.mod h1:P+XmwS30IXTQdn5
golang.org/x/crypto v0.0.0-20210921155107-089bfa567519/go.mod h1:GvvjBRRGRdwPK5ydBHafDWAxML/pGHZbMvKqRZ5+Abc=
golang.org/x/crypto v0.32.0 h1:euUpcYgM8WcP71gNpTqQCn6rC2t6ULUPiOzfWaXVVfc=
golang.org/x/crypto v0.32.0/go.mod h1:ZnnJkOaASj8g0AjIduWNlq2NRxL0PlBrbKVyZ6V/Ugc=
golang.org/x/mobile v0.0.0-20250106192035-c31d5b91ecc3 h1:8LrYkH99trX3onYF3dT9frUSRDXokkceG+9tHBaDAFQ=
golang.org/x/mobile v0.0.0-20250106192035-c31d5b91ecc3/go.mod h1:sY92m3V/rTEa4JCJ1FkKHK978K6wxOSX1PStMYo+6wI=
golang.org/x/mod v0.6.0-dev.0.20220419223038-86c51ed26bb4/go.mod h1:jJ57K6gSWd91VN4djpZkiMVwK6gcyfeH4XE8wZrZaV4=
golang.org/x/mod v0.7.0/go.mod h1:iBbtSCu2XBx23ZKBPSOrRkjjQPZFPuis4dIYUhu/chs=
golang.org/x/mod v0.23.0 h1:Zb7khfcRGKk+kqfxFaP5tZqCnDZMjC5VtUBs87Hr6QM=
@@ -88,8 +81,6 @@ golang.org/x/sys v0.0.0-20220715151400-c0bba94af5f8/go.mod h1:oPkhp1MJrh7nUepCBc
golang.org/x/sys v0.0.0-20220722155257-8c9f86f7a55f/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.2.0/go.mod h1:oPkhp1MJrh7nUepCBck5+mAzfO9JrbApNNgaTdGDITg=
golang.org/x/sys v0.27.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.29.0 h1:TPYlXGxvx1MGTn2GiZDhnjPA9wZzZeGKHHmKhHYvgaU=
golang.org/x/sys v0.29.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/sys v0.30.0 h1:QjkSwP/36a20jFYWkSue1YwXzLmsV5Gfq7Eiy72C1uc=
golang.org/x/sys v0.30.0/go.mod h1:/VUhepiaJMQUp4+oa/7Zr1D23ma6VTLIYjOOTFZPUcA=
golang.org/x/term v0.0.0-20201126162022-7de9c90e9dd1/go.mod h1:bj7SfCRtBDWHUb9snDiAeCFNEtKQo2Wmx5Cou7ajbmo=

View File

@@ -4,6 +4,7 @@ import (
"net/http"
i2ptunnel "github.com/go-i2p/go-i2ptunnel/lib/core"
"github.com/go-i2p/go-i2ptunnel/lib/loader"
)
/**
@@ -23,10 +24,11 @@ func (c *Config) ServeHTTP(w http.ResponseWriter, r *http.Request) {
}
func NewConfig(yamlFile string) (*Config, error) {
c := &Config{}
err := c.LoadConfig(yamlFile)
tunnel, err := loader.Load(yamlFile, "localhost:7656")
if err != nil {
return nil, err
}
return c, nil
return &Config{
I2PTunnel: tunnel,
}, nil
}

View File

@@ -4,7 +4,6 @@ import (
"net/http"
"os"
"path/filepath"
"strings"
i2ptunnel "github.com/go-i2p/go-i2ptunnel/lib/core"
templates "github.com/go-i2p/go-i2ptunnel/webui/templates"
@@ -74,7 +73,7 @@ func NewControllerGroup(directory string) (*ControllerGroup, error) {
}
for _, file := range files {
if !file.IsDir() && strings.HasSuffix(file.Name(), ".yaml") {
if !file.IsDir() {
controller, err := NewController(filepath.Join(directory, file.Name()))
if err != nil {
return nil, err