Compare commits
6 Commits
Author | SHA1 | Date | |
---|---|---|---|
![]() |
11d1479dcf | ||
![]() |
82b8f97ba4 | ||
![]() |
9ed8caaec3 | ||
![]() |
54edb1b12e | ||
![]() |
824441fa69 | ||
![]() |
da1beba872 |
@@ -11,4 +11,4 @@ RUN apt-get update && \
|
||||
RUN /usr/lib/go-1.13/bin/go build -v -tags netgo -ldflags '-w -extldflags "-static"'
|
||||
USER $I2P_UID
|
||||
WORKDIR /var/lib/i2p/i2p-config/reseed
|
||||
ENTRYPOINT [ "/var/lib/i2p/go/src/github.com/eyedeekay/i2p-tools-1/i2p-tools-1", "reseed", "--yes=true", "--netdb=/var/lib/i2p/i2p-config/netDb" ]
|
||||
ENTRYPOINT [ "/var/lib/i2p/go/src/github.com/eyedeekay/i2p-tools-1/entrypoint.sh" ]
|
21
Makefile
21
Makefile
@@ -1,5 +1,5 @@
|
||||
|
||||
VERSION=0.0.3
|
||||
VERSION=0.0.4
|
||||
APP=i2p-tools-1
|
||||
USER_GH=eyedeekay
|
||||
|
||||
@@ -14,6 +14,8 @@ MIN_GO_VERSION?=1.13
|
||||
I2P_UID=$(shell id -u i2psvc)
|
||||
I2P_GID=$(shell id -g i2psvc)
|
||||
|
||||
WHOAMI=$(shell whoami)
|
||||
|
||||
echo:
|
||||
@echo "type make version to do release $(APP) $(VERSION) $(GOOS) $(GOARCH) $(MIN_GO_VERSION) $(I2P_UID) $(I2P_GID)"
|
||||
|
||||
@@ -107,18 +109,29 @@ docker-server:
|
||||
--publish 8443:8443 \
|
||||
--restart=always \
|
||||
--volume /var/lib/i2p/i2p-config/netDb:/var/lib/i2p/i2p-config/netDb:z \
|
||||
--volume /var/lib/i2p/i2p-config/reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
--volume reseed-keyss:/var/lib/i2p/i2p-config/reseed \
|
||||
eyedeekay/reseed \
|
||||
--signer=hankhill19580@gmail.com
|
||||
docker logs -f reseed
|
||||
|
||||
docker-run:
|
||||
docker run --rm -itd \
|
||||
docker run -itd \
|
||||
--name reseed \
|
||||
--user $(I2P_UID) \
|
||||
--group-add $(I2P_GID) \
|
||||
--publish 8443:8443 \
|
||||
--volume /var/lib/i2p/i2p-config/netDb:/var/lib/i2p/i2p-config/netDb:z \
|
||||
--volume /var/lib/i2p/i2p-config/reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
--volume reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
eyedeekay/reseed \
|
||||
--signer=hankhill19580@gmail.com
|
||||
|
||||
docker-homerun:
|
||||
docker run -itd \
|
||||
--name reseed \
|
||||
--user 1000 \
|
||||
--group-add 1000 \
|
||||
--publish 8443:8443 \
|
||||
--volume $(HOME)/i2p/netDb:/var/lib/i2p/i2p-config/netDb:z \
|
||||
--volume reseed-keys:/var/lib/i2p/i2p-config/reseed:z \
|
||||
eyedeekay/reseed \
|
||||
--signer=hankhill19580@gmail.com
|
10
README.md
10
README.md
@@ -24,8 +24,8 @@ and group inside the container as I2P.
|
||||
|
||||
When you run a reseed under Docker in this fashion, it will automatically
|
||||
generate a self-signed certificate for your reseed server in a Docker volume
|
||||
under your I2P directory. *Back up this directory*, if it is lost it is
|
||||
impossible to reproduce.
|
||||
mamed reseed-keys. *Back up this directory*, if it is lost it is impossible
|
||||
to reproduce.
|
||||
|
||||
Please note that Docker is not currently compatible with .onion reseeds unless
|
||||
you pass the --network=host tag.
|
||||
@@ -37,7 +37,7 @@ you pass the --network=host tag.
|
||||
--publish 443:8443 \
|
||||
--restart always \
|
||||
--volume $HOME/.i2p/netDb:$HOME/.i2p/netDb:z \
|
||||
--volume $HOME/i2p/reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
--volume reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
eyedeekay/reseed \
|
||||
--signer $YOUR_EMAIL_HERE
|
||||
|
||||
@@ -50,7 +50,7 @@ you pass the --network=host tag.
|
||||
--publish 443:8443 \
|
||||
--restart always \
|
||||
--volume /PATH/TO/USER/I2P/HERE/netDb:/var/lib/i2p/i2p-config/netDb:z \
|
||||
--volume /PATH/TO/USER/I2P/HERE/reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
--volume reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
eyedeekay/reseed \
|
||||
--signer $YOUR_EMAIL_HERE
|
||||
|
||||
@@ -68,7 +68,7 @@ work for you. In that case, just copy-and-paste:
|
||||
--publish 443:8443 \
|
||||
--restart always \
|
||||
--volume /var/lib/i2p/i2p-config/netDb:/var/lib/i2p/i2p-config/netDb:z \
|
||||
--volume /var/lib/i2p/i2p-config/reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
--volume reseed-keys:/var/lib/i2p/i2p-config/reseed \
|
||||
eyedeekay/reseed \
|
||||
--signer $YOUR_EMAIL_HERE
|
||||
|
||||
|
@@ -227,7 +227,7 @@ func reseedAction(c *cli.Context) {
|
||||
}
|
||||
|
||||
// prompt to create tls keys if they don't exist?
|
||||
auto := c.Bool("yes")
|
||||
auto := c.Bool("yes")
|
||||
err := checkOrNewTLSCert(i2pTlsHost, &i2pTlsCert, &i2pTlsKey, auto)
|
||||
if nil != err {
|
||||
log.Fatalln(err)
|
||||
@@ -267,7 +267,7 @@ func reseedAction(c *cli.Context) {
|
||||
}
|
||||
|
||||
// prompt to create tls keys if they don't exist?
|
||||
auto := c.Bool("yes")
|
||||
auto := c.Bool("yes")
|
||||
err := checkOrNewTLSCert(onionTlsHost, &onionTlsCert, &onionTlsKey, auto)
|
||||
if nil != err {
|
||||
log.Fatalln(err)
|
||||
@@ -289,7 +289,7 @@ func reseedAction(c *cli.Context) {
|
||||
}
|
||||
|
||||
// prompt to create tls keys if they don't exist?
|
||||
auto := c.Bool("yes")
|
||||
auto := c.Bool("yes")
|
||||
err := checkOrNewTLSCert(tlsHost, &tlsCert, &tlsKey, auto)
|
||||
if nil != err {
|
||||
log.Fatalln(err)
|
||||
@@ -309,7 +309,7 @@ func reseedAction(c *cli.Context) {
|
||||
}
|
||||
|
||||
// load our signing privKey
|
||||
auto := c.Bool("yes")
|
||||
auto := c.Bool("yes")
|
||||
privKey, err := getOrNewSigningCert(&signerKey, signerID, auto)
|
||||
if nil != err {
|
||||
log.Fatalln(err)
|
||||
|
14
cmd/utils.go
14
cmd/utils.go
@@ -42,14 +42,14 @@ func signerFile(signerID string) string {
|
||||
func getOrNewSigningCert(signerKey *string, signerID string, auto bool) (*rsa.PrivateKey, error) {
|
||||
if _, err := os.Stat(*signerKey); nil != err {
|
||||
fmt.Printf("Unable to read signing key '%s'\n", *signerKey)
|
||||
if !auto {
|
||||
fmt.Printf("Would you like to generate a new signing key for %s? (y or n): ", signerID)
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
input, _ := reader.ReadString('\n')
|
||||
if []byte(input)[0] != 'y' {
|
||||
return nil, fmt.Errorf("A signing key is required")
|
||||
if !auto {
|
||||
fmt.Printf("Would you like to generate a new signing key for %s? (y or n): ", signerID)
|
||||
reader := bufio.NewReader(os.Stdin)
|
||||
input, _ := reader.ReadString('\n')
|
||||
if []byte(input)[0] != 'y' {
|
||||
return nil, fmt.Errorf("A signing key is required")
|
||||
}
|
||||
}
|
||||
}
|
||||
if err := createSigningCertificate(signerID); nil != err {
|
||||
return nil, err
|
||||
}
|
||||
|
3
entrypoint.sh
Executable file
3
entrypoint.sh
Executable file
@@ -0,0 +1,3 @@
|
||||
#! /usr/bin/env sh
|
||||
|
||||
/var/lib/i2p/go/src/github.com/eyedeekay/i2p-tools-1/i2p-tools-1 reseed --yes=true --netdb=/var/lib/i2p/i2p-config/netDb $@
|
Reference in New Issue
Block a user