Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
S
sshuttle
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
pub
sshuttle
Commits
62e1ac4b
Commit
62e1ac4b
authored
Feb 01, 2011
by
Avery Pennarun
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
ui-macos: add checkboxes for --no-latency-control and --dns options.
parent
f2297066
Changes
4
Expand all
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
220 additions
and
44 deletions
+220
-44
MainMenu.xib
ui-macos/MainMenu.xib
+194
-38
main.py
ui-macos/main.py
+17
-5
models.py
ui-macos/models.py
+7
-0
run.do
ui-macos/run.do
+2
-1
No files found.
ui-macos/MainMenu.xib
View file @
62e1ac4b
This diff is collapsed.
Click to expand it.
ui-macos/main.py
View file @
62e1ac4b
...
@@ -2,7 +2,8 @@ import sys, os, pty
...
@@ -2,7 +2,8 @@ import sys, os, pty
from
AppKit
import
*
from
AppKit
import
*
import
my
,
models
,
askpass
import
my
,
models
,
askpass
def
sshuttle_args
(
host
,
auto_nets
,
auto_hosts
,
nets
,
debug
):
def
sshuttle_args
(
host
,
auto_nets
,
auto_hosts
,
dns
,
nets
,
debug
,
no_latency_control
):
argv
=
[
my
.
bundle_path
(
'sshuttle/sshuttle'
,
''
),
'-r'
,
host
]
argv
=
[
my
.
bundle_path
(
'sshuttle/sshuttle'
,
''
),
'-r'
,
host
]
assert
(
argv
[
0
])
assert
(
argv
[
0
])
if
debug
:
if
debug
:
...
@@ -11,6 +12,10 @@ def sshuttle_args(host, auto_nets, auto_hosts, nets, debug):
...
@@ -11,6 +12,10 @@ def sshuttle_args(host, auto_nets, auto_hosts, nets, debug):
argv
.
append
(
'--auto-nets'
)
argv
.
append
(
'--auto-nets'
)
if
auto_hosts
:
if
auto_hosts
:
argv
.
append
(
'--auto-hosts'
)
argv
.
append
(
'--auto-hosts'
)
if
dns
:
argv
.
append
(
'--dns'
)
if
no_latency_control
:
argv
.
append
(
'--no-latency-control'
)
argv
+=
nets
argv
+=
nets
return
argv
return
argv
...
@@ -131,6 +136,7 @@ class SshuttleController(NSObject):
...
@@ -131,6 +136,7 @@ class SshuttleController(NSObject):
prefsWindow
=
objc
.
IBOutlet
()
prefsWindow
=
objc
.
IBOutlet
()
serversController
=
objc
.
IBOutlet
()
serversController
=
objc
.
IBOutlet
()
logField
=
objc
.
IBOutlet
()
logField
=
objc
.
IBOutlet
()
noLatencyControlField
=
objc
.
IBOutlet
()
servers
=
[]
servers
=
[]
conns
=
{}
conns
=
{}
...
@@ -159,8 +165,11 @@ class SshuttleController(NSObject):
...
@@ -159,8 +165,11 @@ class SshuttleController(NSObject):
conn
=
Runner
(
sshuttle_args
(
host
,
conn
=
Runner
(
sshuttle_args
(
host
,
auto_nets
=
nets_mode
==
models
.
NET_AUTO
,
auto_nets
=
nets_mode
==
models
.
NET_AUTO
,
auto_hosts
=
server
.
autoHosts
(),
auto_hosts
=
server
.
autoHosts
(),
dns
=
server
.
useDns
(),
nets
=
manual_nets
,
nets
=
manual_nets
,
debug
=
self
.
debugField
.
state
()),
debug
=
self
.
debugField
.
state
(),
no_latency_control
=
self
.
noLatencyControlField
.
state
()),
logfunc
=
logfunc
,
promptfunc
=
promptfunc
,
logfunc
=
logfunc
,
promptfunc
=
promptfunc
,
serverobj
=
server
)
serverobj
=
server
)
self
.
conns
[
host
]
=
conn
self
.
conns
[
host
]
=
conn
...
@@ -279,13 +288,15 @@ class SshuttleController(NSObject):
...
@@ -279,13 +288,15 @@ class SshuttleController(NSObject):
net
.
setWidth_
(
width
)
net
.
setWidth_
(
width
)
nl
.
append
(
net
)
nl
.
append
(
net
)
autoNets
=
s
.
get
(
'autoNets'
,
1
)
autoNets
=
s
.
get
(
'autoNets'
,
models
.
NET_AUTO
)
autoHosts
=
s
.
get
(
'autoHosts'
,
1
)
autoHosts
=
s
.
get
(
'autoHosts'
,
True
)
useDns
=
s
.
get
(
'useDns'
,
autoNets
==
models
.
NET_ALL
)
srv
=
models
.
SshuttleServer
.
alloc
()
.
init
()
srv
=
models
.
SshuttleServer
.
alloc
()
.
init
()
srv
.
setHost_
(
host
)
srv
.
setHost_
(
host
)
srv
.
setAutoNets_
(
autoNets
)
srv
.
setAutoNets_
(
autoNets
)
srv
.
setAutoHosts_
(
autoHosts
)
srv
.
setAutoHosts_
(
autoHosts
)
srv
.
setNets_
(
nl
)
srv
.
setNets_
(
nl
)
srv
.
setUseDns_
(
useDns
)
sl
.
append
(
srv
)
sl
.
append
(
srv
)
self
.
serversController
.
addObjects_
(
sl
)
self
.
serversController
.
addObjects_
(
sl
)
self
.
serversController
.
setSelectionIndex_
(
0
)
self
.
serversController
.
setSelectionIndex_
(
0
)
...
@@ -303,7 +314,8 @@ class SshuttleController(NSObject):
...
@@ -303,7 +314,8 @@ class SshuttleController(NSObject):
d
=
dict
(
host
=
s
.
host
(),
d
=
dict
(
host
=
s
.
host
(),
nets
=
nets
,
nets
=
nets
,
autoNets
=
s
.
autoNets
(),
autoNets
=
s
.
autoNets
(),
autoHosts
=
s
.
autoHosts
())
autoHosts
=
s
.
autoHosts
(),
useDns
=
s
.
useDns
())
l
.
append
(
d
)
l
.
append
(
d
)
my
.
Defaults
()
.
setObject_forKey_
(
l
,
'servers'
)
my
.
Defaults
()
.
setObject_forKey_
(
l
,
'servers'
)
self
.
fill_menu
()
self
.
fill_menu
()
...
...
ui-macos/models.py
View file @
62e1ac4b
...
@@ -122,6 +122,7 @@ class SshuttleServer(NSObject):
...
@@ -122,6 +122,7 @@ class SshuttleServer(NSObject):
def
setAutoNets_
(
self
,
v
):
def
setAutoNets_
(
self
,
v
):
self
.
_k_autoNets
=
v
self
.
_k_autoNets
=
v
self
.
setNetsHidden_
(
-
1
)
self
.
setNetsHidden_
(
-
1
)
self
.
setUseDns_
(
v
==
NET_ALL
)
config_changed
()
config_changed
()
def
autoHosts
(
self
):
def
autoHosts
(
self
):
...
@@ -129,3 +130,9 @@ class SshuttleServer(NSObject):
...
@@ -129,3 +130,9 @@ class SshuttleServer(NSObject):
def
setAutoHosts_
(
self
,
v
):
def
setAutoHosts_
(
self
,
v
):
self
.
_k_autoHosts
=
v
self
.
_k_autoHosts
=
v
config_changed
()
config_changed
()
def
useDns
(
self
):
return
getattr
(
self
,
'_k_useDns'
,
False
)
def
setUseDns_
(
self
,
v
):
self
.
_k_useDns
=
v
config_changed
()
ui-macos/run.do
View file @
62e1ac4b
redo-ifchange debug.app
redo-ifchange debug.app
exec >&2
exec >&2
./debug.app/Contents/MacOS/run
./debug.app/Contents/MacOS/Sshuttle
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment