05nelsonm / kmp-tor Goto Github PK
View Code? Open in Web Editor NEWKotlin Multiplatform Library for embedding Tor into your applications
License: Apache License 2.0
Kotlin Multiplatform Library for embedding Tor into your applications
License: Apache License 2.0
On GeoIP file update, files are not being extracted b/c they are split between 2 methods. when geoipv4 is extracted, the sha256sum file is written. Then when it comes time to extract the geoipv6 file, the new sha256sum file is written and geoipv6 file exists, so extraction is being skipped.
Trans Port setting again, same as #26
Currently, Destroyable.destroy
always launches a coroutine in order to shutdown. This is inconvenient and needs:
ConfChanged
is not a multi-line event (does not start with +
character when read off the socket).
Tor dispatches the following:
250 OK
650-CONF_CHANGED
650-ConnectionPadding=0
650-DormantTimeoutDisabledByIdleStreams=0
650 OK
upon notifying of listeners, the event string is failing to be parsed because there is no message on the 650-CONF_CHANGED
line to split. Instead, if splitting fails to occur, the message needs to be checked to see if it is ConfChanged
, and then enter some sort of configChangedMode
where by each following line is dispatched as an individual ConfChanged
event.
This would also be a good time to add better error handling so that the exception thrown is more informative (contains the replies that caused the failure).
Add a TorManagerEvent
that is dispatched to listeners in order to proc 1 time startup operations.
AddressInfo
is dispatched.DisableNetwork
)Running the JavaFx sample on Windows results in an exception stating "Tor Stopped Early. Bad Config?", even though tests for kmp-tor
module pass on Windows and Tor runs fine.
#25 is needed for further debugging.
Per the spec for:
Directives can be specified multiple times to bind to multiple address/ports.
the TorConfig.Setting.Ports
sealed class should override equals
/hashCode
in order to also take into account their value
when comparing in order to hold multiple Ports
within a Set<TorConfig.Setting>
.
Modification to the TorConfig.Builder
methods will also need to be had such that remove
-> removeInstanceOf
TorConfigProvider
will also need to have it's validatePortOptions
method modified to strip the client config of all port settings, validate them, and then add them to a new config after validation.
If configured to run a foreground service, and > API 26 (O), use startForegroundService
in stead of startService
:library:controller:kmp-tor-controller-common.TorControlHsFetch.hsFetch
interface method and associated inheritors:library:controller:kmp-tor-controller-common.TorControlResolve.resolve
interface method and associated inheritors:library:controller:kmp-tor-controller-common.TorControlMapAddress.mapAddress
interface method and associated inheritorsCurrently default localhost is set to 127.0.0.1
, but it could be set to something else for the given system.
Currently, TorManager
manages a single instance of Tor via use of static locks (Mutex
's) with it's queue. Adding the ability to pass in a mutex via constructor argument would allow for declaring multiple Tor instances.
Java Library consumer could better load balance across multiple servers running separate instances. Would require different TorConfigProvider.workDir
declarations.
Rework startup process to appropriately manage ownership over the Tor Process via the controller.
See spec for more info
Interactions with TorController
result in an exception being thrown when Tor returns a non 250
coded ReplyLine
. For example, 251
, or 252
.
25x
codes are successes, but denote that something else happened. They should not return in a kotlin.Result.Failure
.
Recent upgrade of GradleMavenPublish
caused maven central username/password retrieval to require calling rootProject.ext.get("...").toString()
instead of ext.get("...").toString()
. This causes polling of staged binary library to fail authentication when enabled.
When adding an existing onion address via it's private key, parsing the controller response fails because the flag DiscardPK
is not set and it is expecting a private key to be returned.
Controller should use the private key from the request in the returned HiddenServiceEntry
2022-04-05 07:15:17.721 5208-5208/io.toxicity.push I/System.out: D/TorListener: Action.Controller
2022-04-05 07:15:17.724 5208-5208/io.toxicity.push I/System.out: D/TorListener: >> ADD_ONION ED25519-V3:sGEW/Jjx6F0XrM4WZPsjUNUZrIRxb005HCxFcxN9o1T8ZLOGoLIYXkwAnvWZSIn2qE4s+UA7o9CKvQd8nKLKQA Port=443,127.0.0.1:61267
2022-04-05 07:15:17.826 5208-5208/io.toxicity.push I/System.out: D/TorListener: << 250-ServiceID=3bx4j5cueerin2bhif23vd3ibxol55px544ijgnfbgvj5nb5sytcbdqd
2022-04-05 07:15:17.826 5208-5208/io.toxicity.push I/System.out: D/TorListener: << 250 OK
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push I/System.out: E/TorListener: Failed to add HiddenService for ServerName(value=PushServer)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: io.matthewnelson.kmp.tor.controller.common.exceptions.TorControllerException: Failed to parse reply for onion address private key
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at io.matthewnelson.kmp.tor.controller.RealTorControlProcessor$onionAdd$hsEntry$1.invoke(TorControlProcessor.kt:542)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at io.matthewnelson.kmp.tor.controller.RealTorControlProcessor$onionAdd$hsEntry$1.invoke(TorControlProcessor.kt:510)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at io.matthewnelson.kmp.tor.controller.RealTorController$RealControlPortInteractor$processCommand$2.invokeSuspend(TorController.kt:231)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at kotlin.coroutines.jvm.internal.BaseContinuationImpl.resumeWith(ContinuationImpl.kt:33)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.DispatchedTask.run(DispatchedTask.kt:106)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.internal.LimitedDispatcher.run(LimitedDispatcher.kt:39)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.scheduling.TaskImpl.run(Tasks.kt:95)
2022-04-05 07:15:17.879 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler.runSafely(CoroutineScheduler.kt:571)
2022-04-05 07:15:17.880 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.executeTask(CoroutineScheduler.kt:750)
2022-04-05 07:15:17.880 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.runWorker(CoroutineScheduler.kt:678)
2022-04-05 07:15:17.881 5208-5208/io.toxicity.push W/System.err: at kotlinx.coroutines.scheduling.CoroutineScheduler$Worker.run(CoroutineScheduler.kt:665)
Set default stop_service_on_task_removed
to false when enable_foreground
is false such that TorService.onDestroy
will kill everything. This allows other Foreground Services that are inhibiting application process death from occuring to still have TorService
running w/o it being killed prematurely.
Will also need to add isServiceDestroyed
callback to notification as a fallback to the render
method logic so we aren't creating a new notification if listener is not removed properly.
Currently, the only way to retrieve AddressInfo
is by using a listener and storing whatever the latest dispatched value is.
TorStateManager
an addressInfo
propertyAddressInfo
an EMPTY
value to be returned when queried when Tor has not yet completed bootstrapping.Sometimes Bootstrapping stalls out, especially on the first time ever starting.
Adding a lambda argument to the ControlPortInteractor.processCommand
so replies can be mutated on the commandDispatcher thread instead of Main.
Currently, Jvm and Android start Tor via a Process. Reading the inputStream
and errorStream
and routing to listeners via TorManagerEvent
dispatching is needed in order to better facilitate debugging.
Will require refactoring TorManagerEvent
hierarchy.
Currently, querying the controller for client auth of a given onion address only returns a single entry.
There could be multiple entries for the given address, and this needs to return a list.
Client Authorization can only have a single private key added for a given hidden service address. Previous implementation was correct in returning a single entry instead of a list.
Issue #54 must be reverted
Hey, I'm pretty new in the whole kotlin space so forgive me if this is redundant, but, as far as I'm aware javaFX isn't embedded in the JRE by default anymore, making it an additional dependency users have too install.
Saying that would it be possible for you too supply a sample that doesn't utilize javafx, maybe just a pure console application or something as this is what the application I'm working on is based around.
Awaiting your response, sorry for my bad English.
--Shiro
Currently, TorManagerEvent.AddressInfo
and TorManagerEvent.StartUpCompleteForTorInstance
are dispatched upon bootstrap completion. If disable network is switched last minute, and bootstrapping completes, those events are not triggered.
Remove the check for if network state is network enabled.
Android API 31+ delays notification from being shown for a ForegroundService unless the setForegroundServiceBehavior
is set to Notification.FOREGROUND_SERVICE_IMMEDIATE
See HERE
Add ability to override via application flag, the call to exitProcess
for when the service is running in the Foreground and is destroyed when the task is removed.
Add ability to set HashedContorlPassword
in the TorConfig
.
:library:manager:kmp-tor-manager.TorConfigProvider.retrieve
method should implement logic to discern between which method to utilize when authenticating (cookie auth, or password).:library:controller:kmp-tor-controller-common
should have implementation to generate or consume a secret, providing the S2K computed string value.:library:controller:kmp-tor-controller-common
should have implementation of a wrapper class to denote valid S2K computed value to be set in the config.See the Spec for more details.
:library:controller:kmp-tor-controller-common.TorControlOnionAdd.onionAdd
interface method and associated inheritorsA declarative, efficient, and flexible JavaScript library for building user interfaces.
๐ Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. ๐๐๐
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google โค๏ธ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.