tWrite the onion hostname on key generation to a corresponding file. - tordam - A library for peer discovery inside the Tor network HTML git clone https://git.parazyd.org/tordam DIR Log DIR Files DIR Refs DIR README DIR LICENSE --- DIR commit 7e61c981f5539bf669653ba3f6a277fcab6c812a DIR parent 35119a0520a9674773b63fdc229a1eabe6b3ab82 HTML Author: parazyd <parazyd@dyne.org> Date: Tue, 20 Feb 2018 13:06:54 +0100 Write the onion hostname on key generation to a corresponding file. Diffstat: M cmd/dam-client/main.go | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) --- DIR diff --git a/cmd/dam-client/main.go b/cmd/dam-client/main.go t@@ -27,6 +27,7 @@ import ( "crypto/rsa" "encoding/base64" "encoding/json" + "io/ioutil" "log" "math/rand" "os" t@@ -206,7 +207,11 @@ func main() { lib.CheckError(err) err = lib.SavePrivRsa(lib.PrivKeyPath, key) lib.CheckError(err) - // TODO: save or log hostname + onionaddr, err := lib.OnionFromPubkeyRsa(key.PublicKey) + lib.CheckError(err) + err = ioutil.WriteFile("hostname", onionaddr, 0644) + lib.CheckError(err) + log.Println("Our hostname is:", string(onionaddr)) } // Start up the hidden service