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
aaee2431
Commit
aaee2431
authored
Aug 13, 2021
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
routing playbook
parent
e2d94bfb
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
116 additions
and
37 deletions
+116
-37
ansible/routing.yaml
ansible/routing.yaml
+72
-0
process.sh
process.sh
+39
-0
routing.sh
routing.sh
+3
-0
update.sh
update.sh
+2
-37
No files found.
ansible/routing.yaml
0 → 100644
View file @
aaee2431
-
hosts
:
wg
remote_user
:
root
tasks
:
-
name
:
load vars
include_vars
:
file
:
'
../result/{{item}}.yaml'
with_items
:
-
global-vars
-
vars-{{inventory_hostname_short}}
-
name
:
check iptables Type
become
:
true
shell
:
iptables --version | grep nf_tables
register
:
iptables_type_result
failed_when
:
iptables_type_result.rc >
1
when
:
iptables_type == 'auto'
-
name
:
use iptables-legacy
set_fact
:
iptables_type
:
legacy
when
:
iptables_type == 'auto' and iptables_type_result.rc ==
1
-
name
:
use iptables-nft
set_fact
:
iptables_type
:
nft
when
:
iptables_type == 'auto' and iptables_type_result.rc ==
0
-
name
:
post scripts
template
:
src
:
scripts/{{item}}.sh.j2
dest
:
'
{{ansible_user_dir}}/nextgen-network/scripts/{{item}}.sh'
mode
:
a+x
with_items
:
-
postup
-
predown
-
global-postup
-
utility
-
switch-rules-up
-
switch-rules-down
-
ocserv-postup
-
ocserv-predown
-
name
:
monitor route plans
template
:
src
:
route-plans.j2
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/route-plans'
notify
:
restart_monitor
when
:
not noBird
-
name
:
gost.json
copy
:
content
:
'
{{gostConfig
|
to_nice_json}}'
dest
:
'
{{ansible_user_dir}}/nextgen-network/services/gost.json'
notify
:
restart_gost
when
:
installGost
-
name
:
chnroute
become
:
true
shell
:
|
ipset flush chnrouter
sed '/^create chnrouter hash:net family inet$/d' {{ansible_user_dir}}/nextgen-network/ipsets/chnrouter.ipset | ipset restore
-
name
:
reload_switch_rules
become
:
true
shell
:
'
{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-down.sh
;
{{ansible_user_dir}}/nextgen-network/scripts/switch-rules-up.sh'
handlers
:
-
name
:
restart_gost
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
restarted
:
true
services
:
-
gost
when
:
installGost
-
name
:
restart_monitor
docker_compose
:
project_src
:
'
{{ansible_user_dir}}/nextgen-network/services'
restarted
:
true
services
:
-
gateways-monitor
when
:
not noBird
process.sh
0 → 100755
View file @
aaee2431
#!/usr/bin/env bash
set
-x
set
-e
#echo "现在会真正去部署了,请务必带 --limit 运行。"
#echo "现在开放测试的节点:south.mycard.moe,yuzurisa.mycard.moe,hk-hkg-alql2.mycard.moe,ayane.mycard.moe,hk-hkg-alql3.mycard.moe,wg-router.mycard.moe,kuroko.mycard.moe"
#read -p '确认无误后按回车继续'
#cd lists
#./run.sh
#cd ..
mkdir
-p
result
npm run build
npm start
cd
ansible
||
exit
_strip_wg_conf
()
{
sourcePath
=
$1
targetPath
=
$2
tmpFileName
=
/tmp/
$RANDOM
.conf
cp
-rf
$sourcePath
$tmpFileName
wg-quick strip
$tmpFileName
>
$targetPath
}
# _strip_wg_conf ./protocols/wg/wg.conf.j2 ./protocols/wg/wg-setconf.conf.j2
_strip_wg_conf ./protocols/wgfrp/wgfrp.conf.j2 ./protocols/wgfrp/wgfrp-setconf.conf.j2
# sed -r '/^(#.*)?$/d;/^reflect-kernel-metric/d;/^local-port-readwrite/d;/^redistribute/d' babeld.conf.j2 > babeld-reload.conf.j2
# echo 'quit' >> babeld-reload.conf.j2
ansible-playbook
-i
../result/inventory.yaml
"
$@
"
$PLAYBOOK
.yaml
||
true
cd
..
rsync
-4cavzP
./data/ nanahira@koishi.yuzurisa.com:~/nginx/railgun-data
ssh
-T
nanahira@koishi.yuzurisa.com
'cd ~/nginx ; docker-compose restart railgun-enterprise'
routing.sh
0 → 100755
View file @
aaee2431
#!/usr/bin/env bash
export
PLAYBOOK
=
routing
./process.sh
"
$@
"
update.sh
View file @
aaee2431
#!/usr/bin/env bash
#!/usr/bin/env bash
set
-e
export
PLAYBOOK
=
configure
./process.sh
"
$@
"
#echo "现在会真正去部署了,请务必带 --limit 运行。"
#echo "现在开放测试的节点:south.mycard.moe,yuzurisa.mycard.moe,hk-hkg-alql2.mycard.moe,ayane.mycard.moe,hk-hkg-alql3.mycard.moe,wg-router.mycard.moe,kuroko.mycard.moe"
#read -p '确认无误后按回车继续'
#cd lists
#./run.sh
#cd ..
mkdir
-p
result
npm run build
npm start
cd
ansible
||
exit
_strip_wg_conf
()
{
sourcePath
=
$1
targetPath
=
$2
tmpFileName
=
/tmp/
$RANDOM
.conf
cp
-rf
$sourcePath
$tmpFileName
wg-quick strip
$tmpFileName
>
$targetPath
}
# _strip_wg_conf ./protocols/wg/wg.conf.j2 ./protocols/wg/wg-setconf.conf.j2
_strip_wg_conf ./protocols/wgfrp/wgfrp.conf.j2 ./protocols/wgfrp/wgfrp-setconf.conf.j2
# sed -r '/^(#.*)?$/d;/^reflect-kernel-metric/d;/^local-port-readwrite/d;/^redistribute/d' babeld.conf.j2 > babeld-reload.conf.j2
# echo 'quit' >> babeld-reload.conf.j2
ansible-playbook
-i
../result/inventory.yaml
"
$@
"
configure.yaml
||
true
cd
..
rsync
-4cavzP
./data/ nanahira@koishi.yuzurisa.com:~/nginx/railgun-data
ssh
-T
nanahira@koishi.yuzurisa.com
'cd ~/nginx ; docker-compose restart railgun-enterprise'
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