forked from openai/SWELancer-Benchmark
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup_mitmproxy.yml
More file actions
56 lines (47 loc) · 1.64 KB
/
setup_mitmproxy.yml
File metadata and controls
56 lines (47 loc) · 1.64 KB
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
---
- hosts: localhost
become: true
tasks:
- name: Create a new log directory for the ISSUE_ID
file:
path: "/app/tests/logs/{{ lookup('env', 'ISSUE_ID') }}"
state: directory
mode: '0755'
- name: Start mitmdump in the background
shell: |
nohup mitmdump --mode transparent --showhost 2>&1 & echo $! > /tmp/mitmdump.pid
async: 1
poll: 0
- name: Wait for mitmdump to start
pause:
seconds: 10
- name: Stop mitmdump
shell: "kill `cat /tmp/mitmdump.pid`"
ignore_errors: yes
- name: Ensure mitmproxy-ca-cert.pem is present
assert:
that:
- lookup('file', '/root/.mitmproxy/mitmproxy-ca-cert.pem') is not none
fail_msg: "mitmproxy-ca-cert.pem is not present."
- name: Create directory for mitmproxy certificates
file:
path: /usr/local/share/ca-certificates/extra
state: directory
mode: '0755'
- name: Install mitmproxy certificates to system's trusted certificates
shell: |
cp mitmproxy-ca-cert.pem /usr/local/share/ca-certificates/extra/mitmproxy-ca-cert.crt
update-ca-certificates
args:
chdir: /root/.mitmproxy/
- name: Ensure libnss3-tools is installed
apt:
name: libnss3-tools
state: present
- name: Install mitmproxy generated certificates to browser's trusted certificates
shell: |
certfile="/root/.mitmproxy/mitmproxy-ca-cert.pem"
certname="mitmproxy-ca-cert"
certutil --empty-password -d sql:/root/.pki/nssdb -A -t "C,," -n $certname -i $certfile
args:
chdir: /root/.mitmproxy/