From c2a8d0c91ed7bee87f986a8f5700af174ba237a6 Mon Sep 17 00:00:00 2001 From: Michael Kuzmin Date: Tue, 24 Apr 2018 22:11:33 +0300 Subject: [PATCH] VPN to the test lab --- .gitignore | 1 - clone/builder_acc_test.go | 2 +- teamcity-services.yml | 4 ++-- test/lab.ovpn | 38 ++++++++++++++++++++++++++++++ test/lab.p12 | Bin 0 -> 4141 bytes test-key.pem => test/test-key.pem | 0 test-key.pub => test/test-key.pub | 0 7 files changed, 41 insertions(+), 4 deletions(-) create mode 100644 test/lab.ovpn create mode 100644 test/lab.p12 rename test-key.pem => test/test-key.pem (100%) rename test-key.pub => test/test-key.pub (100%) diff --git a/.gitignore b/.gitignore index 95ba90c78..ecf9eb819 100644 --- a/.gitignore +++ b/.gitignore @@ -4,4 +4,3 @@ packer-builder-vsphere* bin/ test*.json crash.log -vpn/ diff --git a/clone/builder_acc_test.go b/clone/builder_acc_test.go index 6b2015c8f..dfece3151 100644 --- a/clone/builder_acc_test.go +++ b/clone/builder_acc_test.go @@ -441,7 +441,7 @@ func sshKeyConfig() string { config := defaultConfig() config["communicator"] = "ssh" config["ssh_username"] = "root" - config["ssh_private_key_file"] = "../test-key.pem" + config["ssh_private_key_file"] = "../test/test-key.pem" return commonT.RenderConfig(config) } diff --git a/teamcity-services.yml b/teamcity-services.yml index ab018745f..dfdc70f83 100644 --- a/teamcity-services.yml +++ b/teamcity-services.yml @@ -4,10 +4,10 @@ services: container_name: vpn image: jetbrainsinfra/openvpn volumes: - - ./vpn:/vpn:ro + - ./test:/vpn:ro cap_add: - NET_ADMIN devices: - /dev/net/tun:/dev/net/tun dns: 10.0.0.1 - command: --config /vpn/jetbrains-vsphere-lab.ovpn --script-security 2 --auth-user-pass /vpn/creds.txt + entrypoint: "sh -c 'echo ${VPN_PASSWORD} | openvpn --cd /vpn/ --config lab.ovpn --askpass /dev/stdin'" diff --git a/test/lab.ovpn b/test/lab.ovpn new file mode 100644 index 000000000..313d027f5 --- /dev/null +++ b/test/lab.ovpn @@ -0,0 +1,38 @@ +dev tun +persist-tun +persist-key +cipher AES-256-CBC +ncp-ciphers AES-256-GCM:AES-128-GCM +auth SHA1 +tls-client +client +resolv-retry infinite +remote 81.3.129.9 2000 tcp-client +remote-cert-tls server + +pkcs12 lab.p12 + + +# +# 2048 bit OpenVPN static key +# +-----BEGIN OpenVPN Static key V1----- +6c9efab783fc2ee1a558bcedeaf92f8d +85322bc05432fbb00745fcd00bb48857 +77cbf0c82462726a848657c56b62f6fd +b9b1622c633188e848ce78c1b4476e9f +938338532c79784f36d80156e3b29bcf +493e64c393ee216b776c7a5d62c03aa8 +5fc5fea73990612f07660988da133b61 +34c847e67f65b8af407ae0b2761de402 +49ede990747659a878acaaf8fa1a6201 +1aa8ec5aeb01ccf50d1dc6e675dea291 +8d4c199c1c126fee9c112ce16c736159 +3234d5eaea167f5e60d01ad618fd33bb +c262fb3d5227933d6149e45ab0246d58 +5f5d66d835fbfc8e8d51e0462194d835 +8f66f166ccef5616abba26dd38046a87 +9476359e2dc7a5b4dc045e3fbe39d6e6 +-----END OpenVPN Static key V1----- + +key-direction 1 diff --git a/test/lab.p12 b/test/lab.p12 new file mode 100644 index 0000000000000000000000000000000000000000..e628d471c1566966c8d66deadfa728888015faa6 GIT binary patch literal 4141 zcmY+GXD}R!yN4}yb?&-xtUMASfjvv75f3hPq__Pkel0ybvU* zrhdePU;}`9{#T!3#&oK)7T&z^(xaluj26y5kDkijX*4k~6rjN`3D&yZZp!V@G9?Xh zIVc%-yJhu%JF}`J7iD{_w&}Fy<-GWkA}e8=R2{~qn(m&aBC0D8mzp36uz#c;&I_rZeXm9!MhHvmUvONG-Ns& z3?3eC9*$8f2K`p1>+2Vr+xi5Nx3f2y(B#xsfOA&oVcfHDANv2k<{uDg-5|{UD@A6S ze>Ps5p3PWTs#UbRxK{UFVn0VjRt zcn->rxZAwG_4gU48;c$MF5&PE;vyW)+Aw=~8^Uga|4OKAy(6AIrAFduV2TiyAjh9C zZNndCd#WjSi4W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G$r&eW0KRwCLi z!hVJlvhAl-4}f7e2~pb&9SL6g2{DS=F3OdiA#-@CRg7x}Ch*1~JquBSH8%%lSkvJ4 zD_-QLZh8_>PA z_bH29MB1Gb=9b;PGRAoO((GHwkD%;ihnFj-!O_ zndGkfe+mSOq)PA>nROv0p+JhA>9)m3x5DG3@}pFTJYzA9510h9Eqjuis{Td{LZA8( zRr|RAE_DxikV68H$x-G6T*U`p|dAKQ;C+xcT^gDy`PGmyi4f(z)V@EQ<0sDYPAS z=fzeKSg{bi&WKyVackG#%f5^CcGkgT5)Tqi|4II8-8ITFDWd^lgixG>x+&$Iphr}c9Gyz3J> zlK|fEE^!_x*Z;O737t4SAuX#d%Tm|*Y5Q5Z;UJ2p^nfLGMII^+<$#iafI^f6_z)l- nA#J|)!OE23(Ua}T!MlHm;~}uz(myQ;uh8C`^y9()+minU{|(y8 literal 0 HcmV?d00001 diff --git a/test-key.pem b/test/test-key.pem similarity index 100% rename from test-key.pem rename to test/test-key.pem diff --git a/test-key.pub b/test/test-key.pub similarity index 100% rename from test-key.pub rename to test/test-key.pub