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
2a4bb72c
Commit
2a4bb72c
authored
Feb 13, 2020
by
nanahira
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
smart reload
parent
4dcbe93b
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
75 additions
and
15 deletions
+75
-15
.gitignore
.gitignore
+1
-0
ansible/protocols/wg/configure.yaml
ansible/protocols/wg/configure.yaml
+10
-0
ansible/protocols/wgfrp/configure.yaml
ansible/protocols/wgfrp/configure.yaml
+32
-14
ansible/protocols/wgfrp/frps.yaml
ansible/protocols/wgfrp/frps.yaml
+8
-1
update.sh
update.sh
+24
-0
No files found.
.gitignore
View file @
2a4bb72c
...
@@ -109,3 +109,4 @@ dist
...
@@ -109,3 +109,4 @@ dist
/result/
/result/
*.retry
*.retry
*-setconf.conf.j2
ansible/protocols/wg/configure.yaml
View file @
2a4bb72c
...
@@ -22,3 +22,13 @@
...
@@ -22,3 +22,13 @@
name
:
'
wg-quick@{{conn.name}}'
name
:
'
wg-quick@{{conn.name}}'
state
:
started
state
:
started
enabled
:
yes
enabled
:
yes
register
:
'
wg_enable_result'
-
name
:
config for setconf
template
:
src
:
wg-setconf.conf.j2
dest
:
'
/tmp/{{conn.name}}-setconf.conf'
register
:
'
wg_setconf_result'
when
:
'
not
wg_enable_result.changed'
-
name
:
setconf
shell
:
'
wg
setconf
{{conn.name}}
/tmp/{{conn.name}}-setconf.conf'
when
:
'
not
wg_enable_result.changed
and
wg_setconf_result.changed'
ansible/protocols/wgfrp/configure.yaml
View file @
2a4bb72c
-
name
:
stop,测试用。
# frpc
systemd
:
name
:
'
wg-quick@{{conn.name}}'
state
:
stopped
-
name
:
conf
template
:
src
:
wgfrp.conf.j2
dest
:
'
/etc/wireguard/{{conn.name}}.conf'
-
name
:
enable
systemd
:
name
:
'
wg-quick@{{conn.name}}'
state
:
started
enabled
:
yes
-
name
:
frpc template
-
name
:
frpc template
template
:
template
:
src
:
'
frpc.ini.j2'
src
:
'
frpc.ini.j2'
dest
:
'
/etc/frp/{{conn.name}}.ini'
dest
:
'
/etc/frp/{{conn.name}}.ini'
when
:
'
conn.frpType
==
"frpc"'
when
:
'
conn.frpType
==
"frpc"'
register
:
frpc_config_result
-
name
:
start frpc
-
name
:
start frpc
systemd
:
systemd
:
name
:
'
frpc@{{conn.name}}'
name
:
'
frpc@{{conn.name}}'
state
:
re
started
state
:
started
enabled
:
true
enabled
:
true
register
:
frpc_launch_result
when
:
'
conn.frpType
==
"frpc"'
when
:
'
conn.frpType
==
"frpc"'
-
name
:
reload frpc
systemd
:
name
:
'
frpc@{{conn.name}}'
state
:
reloaded
when
:
'
conn.frpType
==
"frpc"
and
frpc_config_result.changed
and
not
frpc_launch_result.changed'
# frps
-
name
:
register frps
-
name
:
register frps
set_fact
:
set_fact
:
frps_needed
:
1
frps_needed
:
1
when
:
'
conn.frpType
==
"frps"'
when
:
'
conn.frpType
==
"frps"'
# wg
-
name
:
wg conf
template
:
src
:
wgfrp.conf.j2
dest
:
'
/etc/wireguard/{{conn.name}}.conf'
-
name
:
enable
systemd
:
name
:
'
wg-quick@{{conn.name}}'
state
:
started
enabled
:
yes
register
:
wg_enable_result
-
name
:
config for setconf
template
:
src
:
wgfrp-setconf.conf.j2
dest
:
'
/tmp/{{conn.name}}-setconf.conf'
register
:
'
wg_setconf_result'
when
:
'
not
wg_enable_result.changed'
-
name
:
setconf
shell
:
'
wg
setconf
{{conn.name}}
/tmp/{{conn.name}}-setconf.conf'
when
:
'
not
wg_enable_result.changed
and
wg_setconf_result.changed'
ansible/protocols/wgfrp/frps.yaml
View file @
2a4bb72c
...
@@ -2,8 +2,15 @@
...
@@ -2,8 +2,15 @@
template
:
template
:
src
:
'
frps.ini.j2'
src
:
'
frps.ini.j2'
dest
:
'
/etc/frp/frps.ini'
dest
:
'
/etc/frp/frps.ini'
register
:
frps_config_result
-
name
:
start frps
-
name
:
start frps
systemd
:
systemd
:
name
:
'
frps'
name
:
'
frps'
state
:
re
started
state
:
started
enabled
:
true
enabled
:
true
register
:
frps_launch_result
-
name
:
start frps
systemd
:
name
:
'
frps'
state
:
reloaded
when
:
'
frps_config_result.changed
and
not
frps_launch_result.changed'
update.sh
View file @
2a4bb72c
...
@@ -6,7 +6,31 @@ echo "现在开放测试的节点:south.mycard.moe,yuzurisa.mycard.moe,hk-hkg-
...
@@ -6,7 +6,31 @@ echo "现在开放测试的节点:south.mycard.moe,yuzurisa.mycard.moe,hk-hkg-
read
-p
'确认无误后按回车继续'
read
-p
'确认无误后按回车继续'
mkdir
-p
result
mkdir
-p
result
npm run inventory
npm run inventory
cd
ansible
||
exit
cd
ansible
||
exit
sed
-r
-e
's/Address/#Address/g'
\
-e
's/Fwmark/#Fwmark/g'
\
-e
's/Table/#Table/g'
\
-e
's/DNS/#DNS/g'
\
-e
's/MTU/#MTU/g'
\
-e
's/PostUp/#PostUp/g'
\
-e
's/PostDown/#PostDown/g'
\
-e
's/PreUp/#PreUp/g'
\
-e
's/PreDown/#PreDown/g'
\
./protocols/wg/wg.conf.j2
>
./protocols/wg/wg-setconf.conf.j2
sed
-r
-e
's/Address/#Address/g'
\
-e
's/Fwmark/#Fwmark/g'
\
-e
's/Table/#Table/g'
\
-e
's/DNS/#DNS/g'
\
-e
's/MTU/#MTU/g'
\
-e
's/PostUp/#PostUp/g'
\
-e
's/PostDown/#PostDown/g'
\
-e
's/PreUp/#PreUp/g'
\
-e
's/PreDown/#PreDown/g'
\
./protocols/wgfrp/wgfrp.conf.j2
>
./protocols/wgfrp/wgfrp-setconf.conf.j2
ansible-playbook
-i
../result/inventory.yaml
"
$@
"
configure.yaml
ansible-playbook
-i
../result/inventory.yaml
"
$@
"
configure.yaml
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