Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
Briar Desktop
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Model registry
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
briar
Briar Desktop
Commits
add3b53e
Commit
add3b53e
authored
3 years ago
by
Sebastian
Browse files
Options
Downloads
Patches
Plain Diff
Allow Tor ports to be specified on the command line
parent
8b0c11fb
No related branches found
Branches containing commit
No related tags found
Tags containing commit
1 merge request
!35
Make it possible to run multiple versions of briar-desktop concurrently
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/main/kotlin/org/briarproject/briar/desktop/DesktopModule.kt
+6
-2
6 additions, 2 deletions
...in/kotlin/org/briarproject/briar/desktop/DesktopModule.kt
src/main/kotlin/org/briarproject/briar/desktop/Main.kt
+12
-1
12 additions, 1 deletion
src/main/kotlin/org/briarproject/briar/desktop/Main.kt
with
18 additions
and
3 deletions
src/main/kotlin/org/briarproject/briar/desktop/DesktopModule.kt
+
6
−
2
View file @
add3b53e
...
...
@@ -50,7 +50,11 @@ import javax.inject.Singleton
SocksModule
::
class
]
)
internal
class
DesktopModule
(
private
val
appDir
:
Path
)
{
internal
class
DesktopModule
(
private
val
appDir
:
Path
,
private
val
socksPort
:
Int
=
DEFAULT_SOCKS_PORT
,
private
val
controlPort
:
Int
=
DEFAULT_CONTROL_PORT
)
{
@Provides
@Singleton
...
...
@@ -67,7 +71,7 @@ internal class DesktopModule(private val appDir: Path) {
@Provides
@Singleton
fun
provideTorPorts
():
TorPorts
{
return
TorPortsImpl
(
DEFAULT_SOCKS_PORT
,
DEFAULT_CONTROL_PORT
)
return
TorPortsImpl
(
socksPort
,
controlPort
)
}
@Provides
...
...
This diff is collapsed.
Click to expand it.
src/main/kotlin/org/briarproject/briar/desktop/Main.kt
+
12
−
1
View file @
add3b53e
...
...
@@ -7,7 +7,10 @@ import com.github.ajalt.clikt.parameters.options.counted
import
com.github.ajalt.clikt.parameters.options.default
import
com.github.ajalt.clikt.parameters.options.flag
import
com.github.ajalt.clikt.parameters.options.option
import
com.github.ajalt.clikt.parameters.types.int
import
org.briarproject.bramble.BrambleCoreEagerSingletons
import
org.briarproject.bramble.api.plugin.TorConstants.DEFAULT_CONTROL_PORT
import
org.briarproject.bramble.api.plugin.TorConstants.DEFAULT_SOCKS_PORT
import
org.briarproject.briar.BriarCoreEagerSingletons
import
org.briarproject.briar.desktop.utils.FileUtils
import
org.briarproject.briar.desktop.utils.InternationalizationUtils.i18n
...
...
@@ -43,6 +46,14 @@ private class Main : CliktCommand(
metavar
=
"PATH"
,
envvar
=
"BRIAR_DATA_DIR"
).
default
(
DEFAULT_DATA_DIR
)
private
val
socksPort
by
option
(
"--socks-port"
,
help
=
"Tor Socks Port"
).
int
().
default
(
DEFAULT_SOCKS_PORT
)
private
val
controlPort
by
option
(
"--control-port"
,
help
=
"Tor Control Port"
).
int
().
default
(
DEFAULT_CONTROL_PORT
)
@OptIn
(
ExperimentalComposeUiApi
::
class
)
override
fun
run
()
{
...
...
@@ -57,7 +68,7 @@ private class Main : CliktCommand(
val
dataDir
=
getDataDir
()
val
app
=
DaggerBriarDesktopApp
.
builder
().
desktopModule
(
DesktopModule
(
dataDir
)
DesktopModule
(
dataDir
,
socksPort
,
controlPort
)
).
build
()
// We need to load the eager singletons directly after making the
// dependency graphs
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment