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
27df73db
Commit
27df73db
authored
Aug 17, 2022
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
tun
parent
a42ac769
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
40 additions
and
0 deletions
+40
-0
ansible/protocols/tun/configure.yaml
ansible/protocols/tun/configure.yaml
+2
-0
ansible/protocols/tun/uninstall.yaml
ansible/protocols/tun/uninstall.yaml
+7
-0
ansible/protocols/wg/configure.yaml
ansible/protocols/wg/configure.yaml
+2
-0
src/inventory.ts
src/inventory.ts
+29
-0
No files found.
ansible/protocols/tun/configure.yaml
0 → 100644
View file @
27df73db
-
name
:
'
{{conn.name}}:
stop
wg'
include_tasks
:
../wg/uninstall.yaml
ansible/protocols/tun/uninstall.yaml
0 → 100644
View file @
27df73db
-
name
:
'
{{conn.name}}:
stop
tun'
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
stopped
:
true
services
:
-
'
tun-{{conn.name}}'
ignore_errors
:
true
ansible/protocols/wg/configure.yaml
View file @
27df73db
-
name
:
'
{{conn.name}}:
stop
oc'
include_tasks
:
../oc/uninstall.yaml
-
name
:
'
{{conn.name}}:
stop
tun'
include_tasks
:
../tun/uninstall.yaml
-
name
:
'
{{conn.name}}:
wg
conf'
become
:
true
template
:
...
...
src/inventory.ts
View file @
27df73db
...
...
@@ -582,6 +582,35 @@ class InventoryBuilder {
}
}
if
(
protocol
===
'
tun
'
)
{
const
containerName
=
`tun-
${
name
}
`
;
const
dev
=
`mc-
${
name
}
`
;
const
tunMtu
=
mtu
-
24
;
const
envs
=
`dev=
${
dev
}
localPeerAddress=
${
localPeerAddress
}
remotePeerAddress=
${
remotePeerAddress
}
localPeerAddress6=
${
localPeerAddress
}
remotePeerAddress6=
${
remotePeerAddress6
}
remoteNextMark=
${
remoteNextMark
}
inbound=
${
inbound
?
'
True
'
:
'
False
'
}
outbound=
${
inbound
?
'
True
'
:
'
False
'
}
mtu=
${
tunMtu
}
`
;
local
.
dockerServices
.
services
[
containerName
]
=
{
restart
:
'
always
'
,
image
:
`git-registry.mycard.moe/railgun/tun
${
this
.
getDockerImageTag
(
local
)}
`
,
network_mode
:
'
host
'
,
cap_add
:
[
'
NET_ADMIN
'
],
devices
:
[
'
/dev/net/tun:/dev/net/tun
'
],
volumes
:
[
'
$HOME/nextgen-network/scripts:$HOME/nextgen-network/scripts:ro
'
],
environment
:
{
LOCAL_ID
:
local
.
id
,
REMOTE_ID
:
remote
.
id
,
PROTO
:
params
.
p
||
144
,
LOCAL_SECRET
:
local
.
wgPrivateKey
,
REMOTE_SECRET
:
remote
.
wgPrivateKey
,
DEV
:
dev
,
ENDPOINT
:
remoteAddress
,
MARK
:
localGatewayMark
||
0
,
UP_SCRIPT
:
`ip address add
${
local
.
address
}
dev
${
dev
}
; ip link set dev
${
dev
}
mtu
${
tunMtu
}
; ip link set
${
dev
}
up; env
${
envs
}
$HOME/nextgen-network/scripts/postup.sh &> /dev/stdout`
,
DOWN_SCRIPT
:
`env
${
envs
}
$HOME/nextgen-network/scripts/predown.sh &> /dev/stdout`
},
};
}
//console.log(local.name, name, mtu);
if
(
outbound
)
{
...
...
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