dockerfile for new server
This commit is contained in:
14
Dockerfile
14
Dockerfile
@@ -3,16 +3,12 @@ RUN apk update -U
|
||||
RUN apk add go git make musl-dev
|
||||
RUN mkdir -p /opt/eephttpd
|
||||
RUN adduser -h /opt/eephttpd -D -g 'eephttpd,,,,' eephttpd
|
||||
|
||||
USER eephttpd
|
||||
RUN git clone https://github.com/eyedeekay/sam-forwarder /opt/eephttpd/src
|
||||
WORKDIR /opt/eephttpd/src
|
||||
COPY . /usr/src/eephttpd
|
||||
WORKDIR /usr/src/eephttpd
|
||||
RUN make deps server
|
||||
RUN install -m755 bin/eephttpd /usr/bin/eephttpd
|
||||
|
||||
USER root
|
||||
RUN ls -lah bin ; false
|
||||
RUN cp bin/eephttpd /usr/bin/eephttpd
|
||||
USER eephttpd
|
||||
|
||||
WORKDIR /opt/eephttpd/
|
||||
VOLUME /opt/eephttpd/www
|
||||
CMD eephttpd
|
||||
CMD eephttpd -sh=sam-host -sp=7656 -r
|
||||
|
27
Makefile
27
Makefile
@@ -26,11 +26,11 @@ bin/$(appname):
|
||||
mkdir -p bin
|
||||
cd main && go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o ../bin/$(appname)
|
||||
|
||||
server: clean-server bin/eephttpd
|
||||
server: clean-server bin/$(eephttpd)
|
||||
|
||||
bin/eephttpd:
|
||||
bin/$(eephttpd):
|
||||
mkdir -p bin
|
||||
go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o ./bin/eephttpd ./example/serve.go
|
||||
go build -a -tags netgo -ldflags '-w -extldflags "-static"' -o ./bin/$(eephttpd) ./example/serve.go
|
||||
|
||||
all: build server
|
||||
|
||||
@@ -38,7 +38,7 @@ clean:
|
||||
rm -f bin/$(appname)
|
||||
|
||||
clean-server:
|
||||
rm -f bin/eephttpd
|
||||
rm -f bin/$(eephttpd)
|
||||
|
||||
noopts: clean
|
||||
mkdir -p bin
|
||||
@@ -59,28 +59,29 @@ gendoc: all
|
||||
./bin/$(appname) -h 2>> USAGE.md; true
|
||||
@echo '```' >> USAGE.md
|
||||
@echo "" >> USAGE.md
|
||||
@echo "eephttpd - Static file server automatically forwarded to i2p" >> USAGE.md
|
||||
@echo "$(eephttpd) - Static file server automatically forwarded to i2p" >> USAGE.md
|
||||
@echo "============================================================" >> USAGE.md
|
||||
@echo "" >> USAGE.md
|
||||
@echo "eephttpd is a static http server which automatically runs on i2p with" >> USAGE.md
|
||||
@echo "$(eephttpd) is a static http server which automatically runs on i2p with" >> USAGE.md
|
||||
@echo "the help of the SAM bridge. By default it will only be available from" >> USAGE.md
|
||||
@echo "the localhost and it's i2p tunnel. It can be masked from the localhost" >> USAGE.md
|
||||
@echo "using a container." >> USAGE.md
|
||||
@echo "" >> USAGE.md
|
||||
@echo '```' >> USAGE.md
|
||||
./bin/eephttpd -h 2>> USAGE.md; true
|
||||
./bin/$(eephttpd) -h 2>> USAGE.md; true
|
||||
@echo '```' >> USAGE.md
|
||||
@echo "" >> USAGE.md
|
||||
@cat USAGE.md
|
||||
|
||||
docker-build:
|
||||
docker build -f Dockerfile -t eyedeekay/eephttpd .
|
||||
docker build -f Dockerfile -t eyedeekay/$(eephttpd) .
|
||||
|
||||
docker-run:
|
||||
docker run -i -t -d \
|
||||
--network si \
|
||||
--network-alias eephttpd \
|
||||
--hostname eephttpd \
|
||||
--name eephttpd \
|
||||
--network-alias $(eephttpd) \
|
||||
--hostname $(eephttpd) \
|
||||
--name $(eephttpd) \
|
||||
--restart always \
|
||||
--volume eephttpd:/home/eephttpd/www \
|
||||
eyedeekay/eephttpd
|
||||
--volume $(eephttpd):/home/$(eephttpd)/www \
|
||||
eyedeekay/$(eephttpd)
|
||||
|
@@ -142,12 +142,12 @@ their own projects. An i2p-native static site generator in the style of jekyll
|
||||
(but in go) could be cool.
|
||||
-----BEGIN PGP SIGNATURE-----
|
||||
|
||||
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAltrVJEACgkQ11wDs5te
|
||||
FOERAwgAn7pziYLhw8Tt2OQvO3I6ac5v/Bdliqm112rcKYylGLOQJoVXVznpuRI9
|
||||
wgyiRHQoyCuggj/1M/UOthvFAllxSH0xV8avPxnM/JvI+CfrWoMphUD12qhfsryu
|
||||
WLDrnzuiIGgSvYoUngqFzKEgnRTHf4mPa2bvw8IOtjN6LddgI5gh3yc7AmiawxtS
|
||||
fE9wLkfqjMQgwYR6y82WswyYvFeWha43nokfBJHB2N+lStZz6OLXU4i7C5RRkyYv
|
||||
76w/kVhbqCoYTq+4S8/RGNvHvuDErY5RLQIc0zhWPdzrzaBJchCf3xPRqQGAN9tF
|
||||
w/E1X9zmUTJvV2Tw+aKfWLSqOKHFFQ==
|
||||
=cC10
|
||||
iQEzBAEBCAAdFiEEcNIGBzi++AUjrK/311wDs5teFOEFAltrV8MACgkQ11wDs5te
|
||||
FOEDtAf+Oqw5m4FrSiObMyHcOyBtz7zTyd1w4FyhRwcWUDcoEOuFh/Daua6xuMW9
|
||||
TL6HNr9SFi7Qi454DFwze61wPTeen3vvZWg/fW30roTLWNaeOGp5CyL0AcT7hnGZ
|
||||
JOI7IS+Kgvlfu5f9Lzdll+KVIsOPK9i8l4ct+b4eAjTzhB0yVAHz9/N5UkQROpLB
|
||||
Vm+6VOYsjDRyc77t5Ys2LG3sJsF19aL53+1JazDqOi1KfFx59gGMZ6k2JOaJkJ5w
|
||||
DfmGTk+t5rRewhcPTYShfLXLhUNjXdbgyl5I3goPTD47YvgzgAaxyF1icsBWv9It
|
||||
uci7UFhDTR93yswrQkeZ6SWHSFhNCw==
|
||||
=0djn
|
||||
-----END PGP SIGNATURE-----
|
||||
|
57
USAGE.md
57
USAGE.md
@@ -55,7 +55,7 @@ Usage of ./bin/ephsite:
|
||||
-samport string
|
||||
SAM port (default "7656")
|
||||
-save
|
||||
Use saved file and persist tunnel(If false, tunnel will not persist after program is stopped. (default true)
|
||||
Use saved file and persist tunnel(If false, tunnel will not persist after program is stopped.
|
||||
-udp
|
||||
UDP mode(true or false)
|
||||
-zeroin
|
||||
@@ -63,3 +63,58 @@ Usage of ./bin/ephsite:
|
||||
-zeroout
|
||||
Allow zero-hop, non-anonymous tunnels out(true or false)
|
||||
```
|
||||
|
||||
eephttpd - Static file server automatically forwarded to i2p
|
||||
============================================================
|
||||
|
||||
eephttpd is a static http server which automatically runs on i2p with
|
||||
the help of the SAM bridge. By default it will only be available from
|
||||
the localhost and it's i2p tunnel. It can be masked from the localhost
|
||||
using a container.
|
||||
|
||||
```
|
||||
flag needs an argument: -h
|
||||
Usage of ./bin/eephttpd:
|
||||
-c Use an encrypted leaseset(true or false) (default true)
|
||||
-d string
|
||||
the directory of static files to host(default ./www) (default "./www")
|
||||
-f string
|
||||
Use an ini file for configuration (default "none")
|
||||
-g Uze gzip(true or false) (default true)
|
||||
-h string
|
||||
hostname to serve on (default "127.0.0.1")
|
||||
-i save i2p keys(and thus destinations) across reboots (default true)
|
||||
-ib int
|
||||
Set inbound tunnel backup quantity(0 to 5) (default 4)
|
||||
-il int
|
||||
Set inbound tunnel length(0 to 7) (default 3)
|
||||
-iq int
|
||||
Set inbound tunnel quantity(0 to 15) (default 8)
|
||||
-iv int
|
||||
Set inbound tunnel length variance(-7 to 7)
|
||||
-n string
|
||||
name to give the tunnel(default static-eepSite) (default "static-eepSite")
|
||||
-ob int
|
||||
Set outbound tunnel backup quantity(0 to 5) (default 4)
|
||||
-ol int
|
||||
Set outbound tunnel length(0 to 7) (default 3)
|
||||
-oq int
|
||||
Set outbound tunnel quantity(0 to 15) (default 8)
|
||||
-ov int
|
||||
Set outbound tunnel length variance(-7 to 7)
|
||||
-p string
|
||||
port to serve locally on (default "8100")
|
||||
-r Reduce tunnel quantity when idle(true or false)
|
||||
-rc int
|
||||
Reduce idle tunnel quantity to X (0 to 5) (default 3)
|
||||
-rt int
|
||||
Reduce tunnel quantity after X (minutes) (default 10)
|
||||
-s string
|
||||
the directory to save the keys in(default ./) (default ".")
|
||||
-sh string
|
||||
sam host to connect to (default "127.0.0.1")
|
||||
-sp string
|
||||
sam port to connect to (default "7656")
|
||||
-z Allow zero-hop, non-anonymous tunnels(true or false)
|
||||
```
|
||||
|
||||
|
@@ -30,7 +30,7 @@ func main() {
|
||||
"name to give the tunnel(default static-eepSite)")
|
||||
useCompression := flag.Bool("g", true,
|
||||
"Uze gzip(true or false)")
|
||||
encryptLeaseSet := flag.Bool("c", true,
|
||||
encryptLeaseSet := flag.Bool("c", false,
|
||||
"Use an encrypted leaseset(true or false)")
|
||||
|
||||
allowZeroHop := flag.Bool("z", false,
|
||||
|
Reference in New Issue
Block a user