-
Notifications
You must be signed in to change notification settings - Fork 0
/
.travis.yml
91 lines (85 loc) · 1.87 KB
/
.travis.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
dist: trusty
sudo: required
language: python
python:
- "3.4"
- "3.5"
- "3.6"
addons:
apt:
packages:
- strongswan
- xl2tpd
install: pip install tox-travis
before_script:
- |
sudo cat > /etc/ipsec.conf <<EOF
# ipsec.conf - strongSwan IPsec configuration file
# basic configuration
config setup
# strictcrlpolicy=yes
# uniqueids = no
# Add connections here.
# Sample VPN connections
conn %default
ikelifetime=60m
keylife=20m
rekeymargin=3m
keyingtries=1
keyexchange=ikev1
authby=secret
ike=aes128-sha1-modp1024,3des-sha1-modp1024!
esp=aes128-sha1-modp1024,3des-sha1-modp1024!
conn myvpn
keyexchange=ikev1
left=%defaultroute
auto=add
authby=secret
type=transport
leftprotoport=17/1701
rightprotoport=17/1701
right=$VPN_SERVER_IP
EOF
- |
sudo cat > /etc/ipsec.secrets <<EOF
: PSK "$VPN_IPSEC_PSK"
EOF
- sudo chmod 600 /etc/ipsec.secrets
- |
sudo cat > /etc/xl2tpd/xl2tpd.conf <<EOF
[lac myvpn]
lns = $VPN_SERVER_IP
ppp debug = yes
pppoptfile = /etc/ppp/options.l2tpd.client
length bit = yes
EOF
- |
sudo cat > /etc/ppp/options.l2tpd.client <<EOF
ipcp-accept-local
ipcp-accept-remote
refuse-eap
require-chap
noccp
noauth
mtu 1280
mru 1280
noipdefault
defaultroute
usepeerdns
connect-delay 5000
name $VPN_USER
password $VPN_PASSWORD
EOF
- sudo chmod 600 /etc/ppp/options.l2tpd.client
- sudo mkdir -p /var/run/xl2tpd
- sudo touch /var/run/xl2tpd/l2tp-control
- sudo service strongswan restart
- sudo service xl2tpd restart
- sudo ipsec up myvpn
- sudo echo "c myvpn" > /var/run/xl2tpd/l2tp-control
script: tox
after_script:
- echo "d myvpn" > /var/run/xl2tpd/l2tp-control
- ipsec down myvpn
notifications:
email: false