server: fix build
This commit is contained in:
parent
bb701a0b0b
commit
122e1a87ce
|
@ -81,8 +81,7 @@ func New(cfg Config) (*Server, error) {
|
||||||
s := &Server{
|
s := &Server{
|
||||||
cfg: &cfg,
|
cfg: &cfg,
|
||||||
|
|
||||||
db: db,
|
db: db,
|
||||||
tor: t,
|
|
||||||
|
|
||||||
rpcS: rpcs,
|
rpcS: rpcs,
|
||||||
rpcAddr: l.Addr().String(),
|
rpcAddr: l.Addr().String(),
|
||||||
|
@ -196,11 +195,6 @@ func (s *Server) restore() error {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
_, err = s.tor.AddOnion(pKey, 80, "127.0.0.1:"+s.cfg.WebPort)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
log.Printf("added: %s (%s)", rt.Hostname, rt.OnionHostname)
|
log.Printf("added: %s (%s)", rt.Hostname, rt.OnionHostname)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -234,12 +228,6 @@ func (rs *RPCServer) AddHost(req routerpc.AddHostRequest, resp *routerpc.AddHost
|
||||||
return errors.New("there must be a 1024 bit RSA private key")
|
return errors.New("there must be a 1024 bit RSA private key")
|
||||||
}
|
}
|
||||||
|
|
||||||
oi, err := rs.tor.AddOnion(pKey, 80, "127.0.0.1:"+rs.cfg.WebPort)
|
|
||||||
if err != nil {
|
|
||||||
return err
|
|
||||||
}
|
|
||||||
|
|
||||||
resp.OnionHostname = oi.OnionID + ".onion"
|
|
||||||
resp.Token = token
|
resp.Token = token
|
||||||
resp.PrivKey = pKey
|
resp.PrivKey = pKey
|
||||||
|
|
||||||
|
@ -249,7 +237,7 @@ func (rs *RPCServer) AddHost(req routerpc.AddHostRequest, resp *routerpc.AddHost
|
||||||
resp.Hostname = elfs.MakeName() + rs.cfg.DomainSuffix
|
resp.Hostname = elfs.MakeName() + rs.cfg.DomainSuffix
|
||||||
}
|
}
|
||||||
|
|
||||||
err = rs.db.SaveRoute(resp)
|
err := rs.db.SaveRoute(resp)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue