-
Notifications
You must be signed in to change notification settings - Fork 81
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #190 from Cadasta/bugfix/squid-for-testing
Squid setup for functional testing
- Loading branch information
Showing
4 changed files
with
63 additions
and
2 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,33 @@ | ||
acl SSL_ports port 443 | ||
acl Safe_ports port 80 # http | ||
acl Safe_ports port 21 # ftp | ||
acl Safe_ports port 443 # https | ||
acl Safe_ports port 70 # gopher | ||
acl Safe_ports port 210 # wais | ||
acl Safe_ports port 1025-65535 # unregistered ports | ||
acl Safe_ports port 280 # http-mgmt | ||
acl Safe_ports port 488 # gss-http | ||
acl Safe_ports port 591 # filemaker | ||
acl Safe_ports port 777 # multiling http | ||
acl CONNECT method CONNECT | ||
|
||
http_access deny !Safe_ports | ||
http_access deny CONNECT !SSL_ports | ||
http_access allow localhost manager | ||
http_access deny manager | ||
http_access allow localhost | ||
http_access deny all | ||
|
||
http_port 3128 | ||
|
||
coredump_dir /var/spool/squid3 | ||
|
||
refresh_pattern ^http://?.tile.openstreetmap.org 1440 20% 10080 ignore-reload | ||
refresh_pattern ^ftp: 1440 20% 10080 | ||
refresh_pattern ^gopher: 1440 0% 1440 | ||
refresh_pattern -i (/cgi-bin/|\?) 0 0% 0 | ||
refresh_pattern (Release|Packages(.gz)*)$ 0 20% 2880 | ||
refresh_pattern . 0 20% 4320 | ||
|
||
acl local dstdomain localhost | ||
always_direct allow local |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
- name: Restart Squid | ||
become: yes | ||
become_user: root | ||
service: name=squid3 state=restarted enabled=yes |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,13 +1,33 @@ | ||
- name: Install Firefox and Xvfb | ||
- name: Install Firefox, Xvfb and Squid | ||
become: yes | ||
become_user: root | ||
apt: pkg={{ item }} state=installed update_cache=yes | ||
with_items: | ||
- firefox | ||
- xvfb | ||
- squid3 | ||
|
||
- name: Install Python Selenium driver | ||
become: yes | ||
become_user: "{{ app_user }}" | ||
pip: virtualenv="{{ virtualenv_path }}" | ||
name=selenium | ||
|
||
- name: Set up Squid configuration | ||
become: yes | ||
become_user: root | ||
copy: src=squid.conf dest=/etc/squid3/squid.conf owner=root mode=644 | ||
notify: | ||
- Restart Squid | ||
|
||
- name: Set up HTTP proxy | ||
become: yes | ||
become_user: "{{ app_user }}" | ||
lineinfile: dest=/home/vagrant/.bashrc | ||
line="export http_proxy=http://localhost:3128/" | ||
|
||
- name: Set up HTTPS proxy | ||
become: yes | ||
become_user: "{{ app_user }}" | ||
lineinfile: dest=/home/vagrant/.bashrc | ||
line="export https_proxy=https://localhost:3128/" |