Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
T
tun
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Locked Files
Issues
0
Issues
0
List
Boards
Labels
Service Desk
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Security & Compliance
Security & Compliance
Dependency List
License Compliance
Packages
Packages
List
Container Registry
Analytics
Analytics
CI / CD
Code Review
Insights
Issues
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Railgun
tun
Commits
6754a9e8
Commit
6754a9e8
authored
Apr 07, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tun proxy
parent
0f404acf
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
9 additions
and
5 deletions
+9
-5
src/inventory.ts
src/inventory.ts
+9
-5
No files found.
src/inventory.ts
View file @
6754a9e8
...
@@ -51,6 +51,7 @@ interface Gateway {
...
@@ -51,6 +51,7 @@ interface Gateway {
hidden
:
boolean
;
hidden
:
boolean
;
badUdp
:
boolean
;
badUdp
:
boolean
;
redirectAllPorts
:
boolean
;
redirectAllPorts
:
boolean
;
tunProxy
:
string
;
}
}
class
InventoryBuilder
{
class
InventoryBuilder
{
...
@@ -149,7 +150,7 @@ class InventoryBuilder {
...
@@ -149,7 +150,7 @@ class InventoryBuilder {
gateway
.
selectionMark
=
0
;
gateway
.
selectionMark
=
0
;
gateway
.
redirectServerPort
=
60100
;
gateway
.
redirectServerPort
=
60100
;
}
}
gateway
.
redirectTargetPorts
=
gateway
.
redirectAllPorts
?
'
1:65535
'
:
this
.
vars
.
redirectTargetPorts
.
replace
(
/-/g
,
'
:
'
);
gateway
.
redirectTargetPorts
=
(
gateway
.
redirectAllPorts
||
gateway
.
tunProxy
)
?
'
1:65535
'
:
this
.
vars
.
redirectTargetPorts
.
replace
(
/-/g
,
'
:
'
);
gateway
.
pccRules
=
[];
gateway
.
pccRules
=
[];
}
}
return
gateways
;
return
gateways
;
...
@@ -314,11 +315,14 @@ class InventoryBuilder {
...
@@ -314,11 +315,14 @@ class InventoryBuilder {
const
gostConfig
:
GostConfig
=
{
const
gostConfig
:
GostConfig
=
{
Routes
:
availableGateways
.
map
(
gateway
=>
{
Routes
:
availableGateways
.
map
(
gateway
=>
{
const
useWarp
=
host
.
arch
!==
'
arm
'
&&
gateway
.
warp
;
let
tunProxy
:
string
=
gateway
.
tunProxy
;
if
(
gateway
.
tunProxy
===
'
warp
'
)
{
tunProxy
=
`http://localhost:
${
gateway
.
redirectServerPort
-
2000
}
`
;
}
return
{
return
{
ServeNodes
:
[
`red://
${
host
.
address
}
:
${
gateway
.
redirectServerPort
}
`
],
ServeNodes
:
[
`red://
${
host
.
address
}
:
${
gateway
.
redirectServerPort
}
`
],
Mark
:
useWarp
?
0
:
gateway
.
selectionMark
as
number
,
Mark
:
tunProxy
?.
includes
(
'
localhost
'
)
?
0
:
gateway
.
selectionMark
as
number
,
ChainNodes
:
useWarp
?
[
`http://localhost:
${
gateway
.
redirectServerPort
-
2000
}
`
]
:
undefined
ChainNodes
:
tunProxy
?
tunProxy
.
split
(
'
|
'
)
:
undefined
}
}
})
})
};
};
...
@@ -336,7 +340,7 @@ class InventoryBuilder {
...
@@ -336,7 +340,7 @@ class InventoryBuilder {
command
:
'
-C /etc/gost/gost.json
'
command
:
'
-C /etc/gost/gost.json
'
};
};
if
(
host
.
arch
!==
'
arm
'
)
{
if
(
host
.
arch
!==
'
arm
'
)
{
for
(
const
gateway
of
availableGateways
.
filter
(
gw
=>
gw
.
warp
))
{
for
(
const
gateway
of
availableGateways
.
filter
(
gw
=>
gw
.
tunProxy
===
'
warp
'
))
{
host
.
dockerServices
.
services
[
`warp-
${
gateway
.
isp
}
`
]
=
{
host
.
dockerServices
.
services
[
`warp-
${
gateway
.
isp
}
`
]
=
{
restart
:
'
always
'
,
restart
:
'
always
'
,
image
:
'
git-registry.mycard.moe/nanahira/warp-proxy
'
,
image
:
'
git-registry.mycard.moe/nanahira/warp-proxy
'
,
...
...
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