react-native-tor icon indicating copy to clipboard operation
react-native-tor copied to clipboard

Passing Arguments to libtor

Open Oct4Pie opened this issue 3 years ago • 2 comments

I have found a way of passing a bridge to the tor client; however, I still need more customization. I did that by setting a .torrc file in /data/user/0/com.<app>/cache/sifir_sdk/tor. I see that tor starts with

libtor: Starting tor with args: [
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "tor",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "DataDirectory",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "/data/user/0/com.test10/cache/sifir_sdk/tor/data",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "CacheDirectory",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "/data/user/0/com.test10/cache/sifir_sdk/tor/cache",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "SocksPort",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "44209",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "ControlPort",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "auto",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "CookieAuthentication",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "1",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "ControlPortWriteToFile",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "/data/user/0/com.test10/cache/sifir_sdk/tor/ctl.info",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "ControlPortFileGroupReadable",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "1",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "TruncateLogFile",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "1",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "Log",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "info file /data/user/0/com.test10/cache/sifir_sdk/tor/logs/sifir_tor_log.info",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "Log",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk:     "err file /data/user/0/com.test10/cache/sifir_sdk/tor/logs/sifir_tor_log.err",
12-23 14:24:20.129 30063 30341 D sifir-rs-sdk: ]

However, I do not know the API for passing custom arguments. Knowing how to do that would be really helpful. Thanks for your attention.

Oct4Pie avatar Dec 23 '21 22:12 Oct4Pie

Hey @Oct4Pie , that's actually a nice feature to have. So would the ability to pass a .torrc file to the module be good enough ? Or do you need to pass specific arguments to libtor ? Right now initialization arguments (TorServiceParam) are limited to what is needed to get it going, but can be augmented.

Let me know

gabidi avatar Dec 24 '21 16:12 gabidi

Thanks for your response, @gabidi. I think both would be great. I think a .torrc file would be cleaner for setting multiple configurations. I only could get .torrc to work on android because iOS does not support environment variables.

Oct4Pie avatar Dec 24 '21 18:12 Oct4Pie