Experimental GTKWebkit based UI
This commit is contained in:
10
Dockerfile
10
Dockerfile
@ -4,15 +4,15 @@ ENV samhost=sam-host
|
|||||||
ENV samport=7656
|
ENV samport=7656
|
||||||
ENV args=""
|
ENV args=""
|
||||||
ENV user=$user
|
ENV user=$user
|
||||||
ENV GOPATH=/opt/$user/go
|
ENV GOPATH=/usr
|
||||||
RUN apk update -U
|
RUN apk update -U
|
||||||
RUN apk add go git make musl-dev
|
RUN apk add go git make musl-dev webkit2gtk-dev gtk+3.0-dev
|
||||||
RUN mkdir -p /opt/$user
|
RUN mkdir -p /opt/$user
|
||||||
RUN adduser -h /opt/$user -D -g "$user,,,," $user
|
RUN adduser -h /opt/$user -D -g "$user,,,," $user
|
||||||
COPY . /usr/src/samcatd
|
COPY . /usr/src/sam-forwarder
|
||||||
WORKDIR /usr/src/samcatd
|
WORKDIR /usr/src/github.com/eyedeekay/sam-forwarder
|
||||||
RUN go get -u github.com/eyedeekay/sam-forwarder/samcatd
|
RUN go get -u github.com/eyedeekay/sam-forwarder/samcatd
|
||||||
RUN make all install
|
RUN make dylink install
|
||||||
USER $user
|
USER $user
|
||||||
WORKDIR /opt/$user/
|
WORKDIR /opt/$user/
|
||||||
CMD samcatd -f /usr/src/eephttpd/etc/samcatd/tunnels.ini -littleboss start
|
CMD samcatd -f /usr/src/eephttpd/etc/samcatd/tunnels.ini -littleboss start
|
||||||
|
14
Makefile
14
Makefile
@ -84,11 +84,17 @@ daemon: clean-daemon bin/$(samcatd)
|
|||||||
|
|
||||||
bin/$(samcatd):
|
bin/$(samcatd):
|
||||||
mkdir -p bin
|
mkdir -p bin
|
||||||
cd samcatd && go build -a -tags netgo \
|
cd samcatd && go build -a -tags "netgo static" \
|
||||||
-ldflags '-w -extldflags "-static"' \
|
-ldflags '-w -extldflags "-static"' \
|
||||||
-o ../bin/$(samcatd) \
|
-o ../bin/$(samcatd) \
|
||||||
./*.go
|
./*.go
|
||||||
|
|
||||||
|
bin/$(samcatd)-webview:
|
||||||
|
mkdir -p bin
|
||||||
|
cd samcatd && go build -a -tags "netgo nostatic" \
|
||||||
|
-o ../bin/$(samcatd)-webview \
|
||||||
|
./*.go
|
||||||
|
|
||||||
update:
|
update:
|
||||||
git config --global url."git@github.com:RTradeLtd".insteadOf "https://github.com/RTradeLtd"
|
git config --global url."git@github.com:RTradeLtd".insteadOf "https://github.com/RTradeLtd"
|
||||||
|
|
||||||
@ -159,8 +165,7 @@ example-config:
|
|||||||
|
|
||||||
|
|
||||||
docker-build:
|
docker-build:
|
||||||
docker build --no-cache \
|
docker build --build-arg user=$(samcatd) \
|
||||||
--build-arg user=$(samcatd) \
|
|
||||||
-f Dockerfile \
|
-f Dockerfile \
|
||||||
-t eyedeekay/$(samcatd) .
|
-t eyedeekay/$(samcatd) .
|
||||||
|
|
||||||
@ -179,9 +184,6 @@ docker-run:
|
|||||||
eyedeekay/$(samcatd)
|
eyedeekay/$(samcatd)
|
||||||
make follow
|
make follow
|
||||||
|
|
||||||
c:
|
|
||||||
go build ./i2pkeys
|
|
||||||
|
|
||||||
follow:
|
follow:
|
||||||
docker logs -f $(samcatd)
|
docker logs -f $(samcatd)
|
||||||
|
|
||||||
|
40
README.md
40
README.md
@ -1,14 +1,10 @@
|
|||||||
# sam-forwarder
|
# sam-forwarder
|
||||||
|
|
||||||
Forward a local port to i2p over the SAM API, or proxy a destination to a port
|
Forward a local port to i2p over the SAM API, or proxy a destination to a port
|
||||||
on the local host. This is a work-in-progress, but the basic functionality is,
|
on the local host. This is no longer substantially a work-in-progress, it's a
|
||||||
there and it's already pretty useful. Everything TCP works, but UDP forwarding
|
very useful way of configuring applications in an i2ptunnel-like way. TCP and
|
||||||
has much less real use than TCP. Turns out UDP was less broken than I thought
|
UDP are supported, but there may be some lingering bugs in UDP, please report
|
||||||
though.
|
them if found.
|
||||||
|
|
||||||
Since it seems to be doing UDP now, if you'd like to donate to further
|
|
||||||
development there are some wallet addresses at the bottom of this readme for
|
|
||||||
now.
|
|
||||||
|
|
||||||
## getting
|
## getting
|
||||||
|
|
||||||
@ -38,24 +34,17 @@ There are a number of ways to use sam-forwarder:
|
|||||||
|
|
||||||
## binaries
|
## binaries
|
||||||
|
|
||||||
Two binaries are produced by this repo. The first, ephsite, is only capable
|
The standalone application for configuring tunnels is named samcatd and it's
|
||||||
of running one tunnel at a time and doesn't have VPN support. I'm only updating
|
main package is in the directory ```./samcatd```. It works as a cli and is
|
||||||
it to make sure that the embeddable interface in existing applications doesn't
|
capable of running a WebUI, which is currently view-only. In a future time, the
|
||||||
change. It will go away and be replaced with a wrapper to translate it to
|
WebUI will also be capable of configuring and editing tunnels.
|
||||||
'samcatd -s' commands whenever I complete [docs/CHECKLIST.md](docs/CHECKLIST.md).
|
|
||||||
|
|
||||||
The second, samcatd, is more advanced. It can start multiple tunnels with their
|
The previous application ephsite has been fully retired. If you were using it,
|
||||||
own settings, or be used to start tunnels on the fly like ephsite by passing the
|
it can usually be replaced with ```samcatd -s``` and your existing arguments.
|
||||||
-s option. Eventually I'm probably just going to use this to configure all of my
|
|
||||||
tunnels.
|
|
||||||
|
|
||||||
Current limitations:
|
Current limitations:
|
||||||
====================
|
====================
|
||||||
|
|
||||||
I need to document it better.
|
|
||||||
[Besides fixing up the comments, this should help for now.](docs/USAGE.md). I
|
|
||||||
also need to control output verbosity better.
|
|
||||||
|
|
||||||
I need samcatd to accept a configuration folder identical to
|
I need samcatd to accept a configuration folder identical to
|
||||||
/etc/i2pd/tunnels.conf.d, since part of the point of this is to be compatible
|
/etc/i2pd/tunnels.conf.d, since part of the point of this is to be compatible
|
||||||
with i2pd's tunnels configuration. Once this is done, I'll resume turning it
|
with i2pd's tunnels configuration. Once this is done, I'll resume turning it
|
||||||
@ -68,9 +57,6 @@ with the key will be able to decrypt and start the tunnels. It is up to the user
|
|||||||
to determine how to go about managing these keys. Right now this system is
|
to determine how to go about managing these keys. Right now this system is
|
||||||
pretty bad. I'll be addressing that soon too.
|
pretty bad. I'll be addressing that soon too.
|
||||||
|
|
||||||
TCP and UDP are both working now. but UDP requires the service to already be
|
|
||||||
configured to work. Changes to address this shortcoming are pending.
|
|
||||||
|
|
||||||
Experimental support for KCP-based error correction and streaming-over-datagrams
|
Experimental support for KCP-based error correction and streaming-over-datagrams
|
||||||
is in the works. Some kind of reverse-proxy or filter is also an obvious choice.
|
is in the works. Some kind of reverse-proxy or filter is also an obvious choice.
|
||||||
|
|
||||||
@ -86,7 +72,11 @@ relevant i2cp and tunnel options, which I'm keeping track of
|
|||||||
I need to just change how the configuration is done entirely. I want it to work
|
I need to just change how the configuration is done entirely. I want it to work
|
||||||
with the configuration formats used by each I2P router.
|
with the configuration formats used by each I2P router.
|
||||||
|
|
||||||
TLS configuration is experimental.
|
TLS configuration is experimental. I have decided to implement optional,
|
||||||
|
automatically-configured self-signed TLS certificates. No CA support is planned
|
||||||
|
as an alternative CA would have to be used and no apparent option exists which
|
||||||
|
would be usable. If you're working on anything like that, I would like very
|
||||||
|
to know.
|
||||||
|
|
||||||
## Stuff that's using it:
|
## Stuff that's using it:
|
||||||
|
|
||||||
|
2
go.mod
2
go.mod
@ -14,6 +14,8 @@ require (
|
|||||||
github.com/justinas/nosurf v0.0.0-20190416172904-05988550ea18
|
github.com/justinas/nosurf v0.0.0-20190416172904-05988550ea18
|
||||||
github.com/kr/pty v1.1.8 // indirect
|
github.com/kr/pty v1.1.8 // indirect
|
||||||
github.com/zieckey/goini v0.0.0-20180118150432-0da17d361d26
|
github.com/zieckey/goini v0.0.0-20180118150432-0da17d361d26
|
||||||
|
github.com/zserge/lorca v0.1.8
|
||||||
|
github.com/zserge/webview v0.0.0-20190123072648-16c93bcaeaeb
|
||||||
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
|
golang.org/x/net v0.0.0-20190813141303-74dc4d7220e7 // indirect
|
||||||
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
|
golang.org/x/sys v0.0.0-20190813064441-fde4db37ae7a // indirect
|
||||||
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
|
golang.org/x/time v0.0.0-20190308202827-9d24e82272b4 // indirect
|
||||||
|
@ -53,7 +53,12 @@ func (s *SAMManager) Serve() bool {
|
|||||||
|
|
||||||
if s.UseWeb == true {
|
if s.UseWeb == true {
|
||||||
go s.handlerMux.ListenAndServe()
|
go s.handlerMux.ListenAndServe()
|
||||||
|
if _, err := s.LaunchUI(); err != nil {
|
||||||
|
log.Println(err.Error())
|
||||||
|
return false
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
Close := false
|
Close := false
|
||||||
for !Close {
|
for !Close {
|
||||||
time.Sleep(1 * time.Second)
|
time.Sleep(1 * time.Second)
|
||||||
|
Reference in New Issue
Block a user