3 Commits

Author SHA1 Message Date
idk
5e5c9c0d2f Allow configuration of the signer email with a file 2021-12-14 22:44:52 -05:00
idk
3088a5b6d0 Allow configuration of the signer email with a file 2021-12-14 22:26:47 -05:00
idk
3859e539c5 fail when signer==you@mail.i2p 2021-12-14 22:12:05 -05:00
4 changed files with 35 additions and 48 deletions

View File

@@ -1,5 +1,5 @@
VERSION=0.2.10 VERSION=0.2.11
APP=reseed-tools APP=reseed-tools
USER_GH=eyedeekay USER_GH=eyedeekay
CGO_ENABLED=0 CGO_ENABLED=0
@@ -278,6 +278,7 @@ upload-single-su3:
tmp/content: tmp/content:
mkdir -p tmp mkdir -p tmp
cp -rv content tmp/content cp -rv content tmp/content
echo "you@mail.i2p" > tmp/signer
tmp/lib: tmp/lib:
mkdir -p tmp/lib mkdir -p tmp/lib
@@ -290,13 +291,13 @@ su3s: tmp/content tmp/lib
-author=hankhill19580@gmail.com \ -author=hankhill19580@gmail.com \
-autostart=true \ -autostart=true \
-clientname=reseed-tools-$(GOOS)-$(GOARCH) \ -clientname=reseed-tools-$(GOOS)-$(GOARCH) \
-command="reseed-tools-$(GOOS)-$(GOARCH) reseed --yes --signer=you@mail.i2p --port=$(PLUGIN_PORT)" \ -command="reseed-tools-$(GOOS)-$(GOARCH) reseed --yes --signer=\$$PLUGIN/signer --port=$(PLUGIN_PORT)" \
-consolename="Reseed Tools" \ -consolename="Reseed Tools" \
-consoleurl="https://127.0.0.1:$(PLUGIN_PORT)" \ -consoleurl="https://127.0.0.1:$(PLUGIN_PORT)" \
-updateurl="http://idk.i2p/reseed-tools/reseed-tools-$(GOOS)-$(GOARCH).su3" \ -updateurl="http://idk.i2p/reseed-tools/reseed-tools-$(GOOS)-$(GOARCH).su3" \
-website="http://idk.i2p/reseed-tools/" \ -website="http://idk.i2p/reseed-tools/" \
-icondata="content/images/reseed-icon.png" \ -icondata="content/images/reseed-icon.png" \
-delaystart="86400" \ -delaystart="1" \
-desc="`cat description-pak`" \ -desc="`cat description-pak`" \
-exename=reseed-tools-$(GOOS)-$(GOARCH) \ -exename=reseed-tools-$(GOOS)-$(GOARCH) \
-targetos="$(GOOS)" \ -targetos="$(GOOS)" \

View File

@@ -34,35 +34,13 @@ and via the github mirror at https://github.com/eyedeekay/reseed-tools/releases.
These can be installed by adding them on the These can be installed by adding them on the
[http://127.0.0.1:7657/configplugins](http://127.0.0.1:7657/configplugins). [http://127.0.0.1:7657/configplugins](http://127.0.0.1:7657/configplugins).
After installing the plugin, you should immediately edit the `clients.config` After installing the plugin, you should immediately edit the `$PLUGIN/signer`
file in order to set your `--signer` email, which is used to name your keys. file in order to set your `--signer` email, which is used to name your keys.
For example, change: You can find the `$PLUGIN` directory in your I2P config directory, which is
usually `$HOME/.i2p` on Unixes.
```
clientApp.0.main=net.i2p.app.CorrectedShellService
clientApp.0.name=reseed-tools-linux-amd64
clientApp.0.args=$PLUGIN/lib/reseed-tools-linux-amd64 -shellservice.name "reseed-tools-linux-amd64" -shellservice.displayname "Reseed Tools" reseed --yes --signer=you@mail.i2p --port=7671
^ change this line
clientApp.0.delay=86400
clientApp.0.startOnLoad=true
clientApp.0.classpath=$PLUGIN/lib/shellservice.jar
```
into:
```
clientApp.0.main=net.i2p.app.CorrectedShellService
clientApp.0.name=reseed-tools-linux-amd64
clientApp.0.args=$PLUGIN/lib/reseed-tools-linux-amd64 -shellservice.name "reseed-tools-linux-amd64" -shellservice.displayname "Reseed Tools" reseed --yes --signer=hankhill19580@gmail.com --port=7671
^ fill in your email
clientApp.0.delay=86400
^ remove this line when you're done
clientApp.0.startOnLoad=true
clientApp.0.classpath=$PLUGIN/lib/shellservice.jar
```
This will allow the developers to contact you if your reseed has issues This will allow the developers to contact you if your reseed has issues
and authenticate your reseed. and will authenticate your reseed to the I2P routers that use it.
- darwin/amd64: [http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3](http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3) - darwin/amd64: [http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3](http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3)
- darwin/arm64: [http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3](http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3) - darwin/arm64: [http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3](http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3)

View File

@@ -2,6 +2,8 @@ package cmd
import ( import (
"context" "context"
"strings"
//"flag" //"flag"
"fmt" "fmt"
"io/ioutil" "io/ioutil"
@@ -214,6 +216,16 @@ func LoadKeys(keysPath string, c *cli.Context) (i2pkeys.I2PKeys, error) {
} }
} }
// fileExists checks if a file exists and is not a directory before we
// try using it to prevent further errors.
func fileExists(filename string) bool {
info, err := os.Stat(filename)
if os.IsNotExist(err) {
return false
}
return !info.IsDir()
}
func reseedAction(c *cli.Context) { func reseedAction(c *cli.Context) {
netdbDir := c.String("netdb") netdbDir := c.String("netdb")
if netdbDir == "" { if netdbDir == "" {
@@ -222,10 +234,22 @@ func reseedAction(c *cli.Context) {
} }
signerID := c.String("signer") signerID := c.String("signer")
if signerID == "" { if signerID == "" || signerID == "you@mail.i2p" {
fmt.Println("--signer is required") fmt.Println("--signer is required")
return return
} }
if !strings.Contains(signerID, "@") {
if !fileExists(signerID) {
fmt.Println("--signer must be an email address or a file containing an email address.")
return
}
bytes, err := ioutil.ReadFile(signerID)
if err != nil {
fmt.Println("--signer must be an email address or a file containing an email address.")
return
}
signerID = string(bytes)
}
var tlsCert, tlsKey string var tlsCert, tlsKey string
tlsHost := c.String("tlsHost") tlsHost := c.String("tlsHost")

View File

@@ -16,24 +16,8 @@
<p>Reseed-tools can be run as a user, as a freestanding service, or be installed as an I2P Plugin. It will attempt to configure itself automatically. You should make sure to set the <code>--signer</code> flag or the <code>RESEED_EMAIL</code> environment variable to configure your signing keys/contact info.</p> <p>Reseed-tools can be run as a user, as a freestanding service, or be installed as an I2P Plugin. It will attempt to configure itself automatically. You should make sure to set the <code>--signer</code> flag or the <code>RESEED_EMAIL</code> environment variable to configure your signing keys/contact info.</p>
<h4 id="plugin-install-urls">Plugin install URLs</h4> <h4 id="plugin-install-urls">Plugin install URLs</h4>
<p>Plugin releases are available inside of i2p at http://idk.i2p/reseed-tools/ and via the github mirror at https://github.com/eyedeekay/reseed-tools/releases. These can be installed by adding them on the <a href="http://127.0.0.1:7657/configplugins">http://127.0.0.1:7657/configplugins</a>.</p> <p>Plugin releases are available inside of i2p at http://idk.i2p/reseed-tools/ and via the github mirror at https://github.com/eyedeekay/reseed-tools/releases. These can be installed by adding them on the <a href="http://127.0.0.1:7657/configplugins">http://127.0.0.1:7657/configplugins</a>.</p>
<p>After installing the plugin, you should immediately edit the <code>clients.config</code> file in order to set your <code>--signer</code> email, which is used to name your keys. For example, change:</p> <p>After installing the plugin, you should immediately edit the <code>$PLUGIN/signer</code> file in order to set your <code>--signer</code> email, which is used to name your keys. You can find the <code>$PLUGIN</code> directory in your I2P config directory, which is usually <code>$HOME/.i2p</code> on Unixes.</p>
<pre><code>clientApp.0.main=net.i2p.app.CorrectedShellService <p>This will allow the developers to contact you if your reseed has issues and will authenticate your reseed to the I2P routers that use it.</p>
clientApp.0.name=reseed-tools-linux-amd64
clientApp.0.args=$PLUGIN/lib/reseed-tools-linux-amd64 -shellservice.name &quot;reseed-tools-linux-amd64&quot; -shellservice.displayname &quot;Reseed Tools&quot; reseed --yes --signer=you@mail.i2p --port=7671
^ change this line
clientApp.0.delay=86400
clientApp.0.startOnLoad=true
clientApp.0.classpath=$PLUGIN/lib/shellservice.jar</code></pre>
<p>into:</p>
<pre><code>clientApp.0.main=net.i2p.app.CorrectedShellService
clientApp.0.name=reseed-tools-linux-amd64
clientApp.0.args=$PLUGIN/lib/reseed-tools-linux-amd64 -shellservice.name &quot;reseed-tools-linux-amd64&quot; -shellservice.displayname &quot;Reseed Tools&quot; reseed --yes --signer=hankhill19580@gmail.com --port=7671
^ fill in your email
clientApp.0.delay=86400
^ remove this line when you&#39;re done
clientApp.0.startOnLoad=true
clientApp.0.classpath=$PLUGIN/lib/shellservice.jar</code></pre>
<p>This will allow the developers to contact you if your reseed has issues and authenticate your reseed.</p>
<ul> <ul>
<li>darwin/amd64: <a href="http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3">http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3</a></li> <li>darwin/amd64: <a href="http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3">http://idk.i2p/reseed-tools/reseed-tools-darwin-amd64.su3</a></li>
<li>darwin/arm64: <a href="http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3">http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3</a></li> <li>darwin/arm64: <a href="http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3">http://idk.i2p/reseed-tools/reseed-tools-darwin-arm64.su3</a></li>