avpnusr / torprivoxy

Tor and Privoxy in docker container
26 stars 6 forks source link

Tor obfs4 bridges #30

Closed skrashevich closed 1 year ago

skrashevich commented 1 year ago

Added support for obfs4 bridges through the environment variable

r35p3ct commented 9 months ago

Am I adding variables correctly?

image

skrashevich commented 9 months ago

Am I adding variables correctly?

no

r35p3ct commented 9 months ago

Am I adding variables correctly?

no

Tell me how to add a bridge correctly.

crnah2o commented 7 months ago

Am I adding variables correctly?

no

Would you be so kind as to help us with the correct form to set variable(s)? Thanks in advance.

If I'm reading the changes correctly, you've implemented a "check" if the "BRIDGE" environment variable exists, and if it does, it triggers appending the contencts of torrc.bridge to the torrc.base that was copied to the torrc in /etc/service/tor/ while copying the value of the environment variable "BRIDGES" to the Bridge line in torrc. Well, for some reason both the torrc.base and torrc.bridge file in my case have the line that presents the location of the obfs4 executable and the line(s) from the torrc.bridge file get appended without a line break, so you get something like:

/etc/service/tor $ cat torrc
SOCKSPort 0.0.0.0:9050
ExitPolicy reject *:*
BridgeRelay 0
ClientTransportPlugin obfs4 exec /usr/local/bin/obfs4proxyUseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy managed

Also, the "BRIDGE" variable doesn't get copied to the torrc file.

Would you be so kind as to check if it's an error on your part? Thanks very much in advance.

crnah2o commented 7 months ago

Am I adding variables correctly?

no

Tell me how to add a bridge correctly.

Did you manage to do it? If not, here's how I did it as a very temp and janky fix. Went into the docker, set the /etc/service/tor/torrc file (in vi) by myself by deleting the line before the last from the start up to "Use Bridges 1" so that "Use Bridges 1" stays by itself on that line. Leave the line that defines the location of obfs4 executable and add (a) line(s) under it with bridge(s) of your choice. It looks something like this in my case:

/etc/service/tor $ cat torrc
SOCKSPort 0.0.0.0:9050
ExitPolicy reject *:*
BridgeRelay 0
UseBridges 1
ClientTransportPlugin obfs4 exec /usr/bin/obfs4proxy managed
Bridge _here you put bridges as you get from tor-project_

After you modified the torrc file, you SIGTERM the tor -f ./torrc process and then runsv restarts it and re-reads the new torrc file with bridges. NB, it's not a persistant fix, nor am I a trustworthy person (I'm a total noob); please check what I've told you here before using in real life.