Giter Site home page Giter Site logo

Comments (14)

arj03 avatar arj03 commented on June 8, 2024

Yeah, the server thing is a bit of a mis-normer. There way I have it configured on my pub is:

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 8008 127.0.0.1:8008
HiddenServicePort 8807 127.0.0.1:8807

HiddenServiceVersion 3

For ssb-viewer and sbot. I could have multiple of those configurations if I wanted to listen to more onion addresses.

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

So - tor connections come in through the net server? (but client connections go out through tor plugin)

Hmm, there is code there for creating a server though... I remember looking at this when you were making the PR it seemed like it should be possible but wasn't as easy (iirc, because the tor npm modules weren't quite complete?)

from multiserver.

arj03 avatar arj03 commented on June 8, 2024

Yes. We still proxy client connections through tor directly.

I'm not sure the server code makes much sense. You'd have to create the hidden service anyway, so why not just add the HiddenServicePort as well. That's also the normal way you expose things as a hidden service. It should probably just be deleted.

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

hmm, so i'm thinking about what we need to do to make sure that this returns the correct answer an sbot.getAddress. It should say the port on the onion address? I figure it should say the net port? But for onion only mode, we want it to only list the onion address, and the net connection should be localhost only (and not in the address).

if you have two hidden services, do they have different addresses?

from multiserver.

arj03 avatar arj03 commented on June 8, 2024

Right now I just run sbot with: sbot server --port 8008. But there is a problem with generating invites if sbot doesn't know its domain (--host). How will that work with the multiple addresses? I chose not to specify host because I also serve ssb-viewer on normal web, but otherwise I would have used --host and specify my onion addr. That way it would only accept incoming onion traffic, but there is still the --tor-only for when doing connections with other pubs. I'm actually really exciting about your proposal with multiple addresses, where one could specify and onion and a normal address, that way people can choose the security they want without compromising anything.

And yeah two hidden services would be two different addresses. But it shouldn't be that much different from the maybe more common case with serving content over both tor and normal net.

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

yup! but we gotta make sure that the proposed pattern works for the various usecases we already have. I think currently probably the most awkward thing is that we require more than one server - I worry that some things do not support a "port" like concept.

I think we'll need to remove --tor-only and expand this to per protocol config.
so, net has a port, ws has a port, and tor has it's port. then we can set a host for net and host for tor.

{
  "multiserver": {
    "net": {port: ..., host: "localhost", scope: 'local'},
    "onion": {port: ..., host: onion_address, scope: 'public'}
  }
}

hmm, okay, maybe when we call getAddress() we need to pass wether we want a public, private, or local address. The local machine can access local, private network can access private address, or public. So we shouldn't advertise our local network ip on a public address. I think it would be best to just have a flag on the config sections, because sometimes addresses that look private are actually public (cjdns!) also we should probably handle cjdns as a plugin instead of pretending it's a raw net address, which is not quite true.

If the scope is local, the server should reject connections from outside that scope - but this will work for tor, since it's proxied via another process on the same machine. though if it's on another machine on your network, could do it as scope=private.

hmm... okay so far I have been assuming that when you run two security protocols, you open two servers with on port and port+1... this would mean for tor that you have two hidden services, with the same host, but the second one is has a different port. Is this possible? or would we need to set hosts in an array? {onion: {host: [host1, host2]}}

I don't think using the same host is a privacy problem, since I presume that the actual port you are connecting too is inside SOCKS5, which is encrypted even to the last node in the tor circuit.

from multiserver.

arj03 avatar arj03 commented on June 8, 2024

I think you are right about the port. We should reuse them. So if I want to run both normal and tor I would have:

{
  "multiserver": {
    "net": {port: 8008, host: "localhost", scope: 'public'},
    "onion": {port: 8009, host: onion_address, scope: 'public'}
  }
}

And then specify in my tor config that 8008 maps to 8009 internally. If I run multiple onions it would be:

{
  "multiserver": {
    "onion": {port: 8008, host: onion_address1, scope: 'public'},
    "onion": {port: 8009, host: onion_address2, scope: 'public'}
  }
}

And tor only (I agree we need to remove the hack) would simply be:

{
  "multiserver": {
    "onion": {port: 8008, host: onion_address1, scope: 'public'}
  }
}

I'm not sure about scope. I don't think its needed actually. The great thing about the above, is that I then easily do something like this in the future:

{
  "multiserver": {
    "onion": {port: 8008, host: onion_address1, scope: 'public'},
    "bluetooth": { scope: 'private'}
  }
}

That would be a great setting for privacy minded individual on a phone. The bluetooth should of course only be enabled when in a place where one wants to exchange messages in the physical world.

from multiserver.

arj03 avatar arj03 commented on June 8, 2024

Wait the double onion won't work. Maybe it needs to be an array instead:

{
  "multiserver": {
    "onion": [{port: 8008, host: onion_address1, scope: 'public'},
    {port: 8009, host: onion_address2, scope: 'public'}]
  }
}

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

Wait the double onion won't work.

what is the reason? - is it that tor can't accept connections to the same hidden-service on multiple ports? It seems to me this would actually break quite a few things if so, such as FTP (which has a control connection, and payload connection, a weird design but it's standard)

we need something that is simple enough that people can easily follow the instructions, and hopefully minimal configuration.

from multiserver.

arj03 avatar arj03 commented on June 8, 2024

I just meant that a dictionary can't have the same key twice :)

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

oh right of course.

I'm still trying to figure out though: Is possible to have one hidden service, but expose more than one port over it? so bothXYZ...onion:8008 and XYZ....onion:8009. I'm pretty sure that onion will hide what port you want to connect to, so this seems reasonable if tor was configured with more than one port open.

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

oh yeah, @ahdinosaur has also described a need to have a differing internal host (that you bind to) and external host (which is what you tell everyone about)

from multiserver.

arj03 avatar arj03 commented on June 8, 2024

Yeah that's exactly the same thing that we need for tor.

Tor basically just wraps transporting the messages between two machines. Once it has traveled through the hoops it meets the config file:

HiddenServiceDir /var/lib/tor/hidden_service/
HiddenServicePort 8008 127.0.0.1:8008
HiddenServicePort 8807 127.0.0.1:8807

Here you can see I map both port 8807 and 8008 to localhost. In /var/lib/tor/hidden_service/ is the key for a specific onion addr, I could have multiple if I wanted to.

from multiserver.

dominictarr avatar dominictarr commented on June 8, 2024

right. I think this will be easiest if we have the same host with different ports - we can easily increment the port number when we create a second connection.

from multiserver.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.