Updating DarkNet VPN setup
This commit is contained in:
parent
36d0be5f88
commit
c589f5ac55
@ -1,7 +1,7 @@
|
||||
#!/bin/bash
|
||||
|
||||
# Ignore Ansibilized templates.
|
||||
saferegex='\{\{.+\}\}'
|
||||
saferegex='\{\{.+\}\}|secrets\['
|
||||
# Ignore comments
|
||||
saferegex="$saferegex"'|^[a-z,A-Z,0-9,_,-,/,.]+:\s*;|^[a-z,A-Z,0-9,_,-,/,.]+:\s*#|^[a-z,A-Z,0-9,_,-,/,.]+:\s*//|\s+[/]?[*][/]?\s+'
|
||||
# AniNIX Constructs
|
||||
|
@ -12,6 +12,38 @@
|
||||
- torsocks
|
||||
- tor-browser-en
|
||||
|
||||
- name: OpenVPN config
|
||||
become: yes
|
||||
get_url:
|
||||
url: "{{ secrets.DarkNet.vpnserver }}"
|
||||
dest: /etc/openvpn/client/darknet.conf
|
||||
mode: 0600
|
||||
owner: openvpn
|
||||
group: network
|
||||
|
||||
- name: OpenVPN Auth part 1
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: /etc/openvpn/client/darknet.conf
|
||||
regexp: ^auth-user-pass
|
||||
line: auth-user-pass /etc/openvpn/client/darknet.auth
|
||||
|
||||
- name: OpenVPN Auth part 2
|
||||
become: yes
|
||||
lineinfile:
|
||||
path: /etc/openvpn/client/darknet.conf
|
||||
regexp: ^dev
|
||||
line: dev tun0
|
||||
|
||||
- name: OpenVPN Auth part 3
|
||||
become: yes
|
||||
copy:
|
||||
dest: /etc/openvpn/client/darknet.auth
|
||||
content: "{{ secrets.DarkNet.token }}"
|
||||
mode: 0600
|
||||
owner: openvpn
|
||||
group: network
|
||||
|
||||
- name: "Enable daemons"
|
||||
become: yes
|
||||
service:
|
||||
@ -19,16 +51,17 @@
|
||||
state: started
|
||||
enabled: yes
|
||||
loop:
|
||||
- tor
|
||||
- nordvpnd
|
||||
- deluged
|
||||
- tor.service
|
||||
- nordvpnd.service
|
||||
- deluged.service
|
||||
- openvpn-client@darknet.service
|
||||
|
||||
- debug:
|
||||
msg: "Remember to use the nordvpn-bin command to set up your account."
|
||||
|
||||
|
||||
# TODO Add yaml for OVPN file, user, pass to Vault
|
||||
# TODO Enforce vpn.service on server instead of nordvpnd.
|
||||
# TODO Add /etc/bashrc.d file for `alias torlynx='torsocks elinks https://check.torproject.org/'`
|
||||
# TODO Add monit checks for tor and openvpn services
|
||||
# TODO Shift deluged to WolfPack
|
||||
- name: BashRC customization
|
||||
become: yes
|
||||
copy:
|
||||
dest: /etc/profile.d/darknet
|
||||
content: |
|
||||
alias torlynx='torsocks elinks https://check.torproject.org/'
|
||||
mode: 0644
|
||||
owner: root
|
||||
group: root
|
||||
|
6
roles/ShadowArch/files/netctl-tun
Normal file
6
roles/ShadowArch/files/netctl-tun
Normal file
@ -0,0 +1,6 @@
|
||||
Description='tuntap connection'
|
||||
Interface=tun0
|
||||
Connection=tuntap
|
||||
Mode='tap'
|
||||
User='nobody'
|
||||
Group='nobody'
|
@ -21,6 +21,20 @@
|
||||
src: netctl-tap.j2
|
||||
dest: "/etc/netctl/{{ ipinterface }}"
|
||||
|
||||
- name: Bridge ArchLinux network config
|
||||
become: yes
|
||||
when: tap and not static
|
||||
template:
|
||||
src: netctl-bond.j2
|
||||
dest: "/etc/netctl/br0"
|
||||
|
||||
- name: Tunnel ArchLinux network config
|
||||
become: yes
|
||||
when: tap and not static
|
||||
copy:
|
||||
src: netctl-tun
|
||||
dest: "/etc/netctl/tun0"
|
||||
|
||||
- name: Dynamic ArchLinux network config
|
||||
become: yes
|
||||
when: not static and not tap
|
||||
|
5
roles/ShadowArch/templates/netctl-bond.j2
Normal file
5
roles/ShadowArch/templates/netctl-bond.j2
Normal file
@ -0,0 +1,5 @@
|
||||
Description="Bridge connection"
|
||||
Interface=br0
|
||||
Connection=bridge
|
||||
BindsToInterfaces=({{ ipinterface }} tun0)
|
||||
IP=dhcp
|
Loading…
Reference in New Issue
Block a user