-
Notifications
You must be signed in to change notification settings - Fork 26
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add haproxy and Prio #446
Draft
FedericoCeratto
wants to merge
4
commits into
master
Choose a base branch
from
haproxy-prio
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Add haproxy and Prio #446
Changes from all commits
Commits
Show all changes
4 commits
Select commit
Hold shift + click to select a range
File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,6 @@ | ||
--- | ||
# See roles/haproxy/README.adoc | ||
- hosts: have_haproxy | ||
roles: | ||
- role: haproxy | ||
tags: haproxy |
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,18 @@ | ||
--- | ||
# See roles/haproxy/README.adoc | ||
- hosts: have_prio | ||
tasks: | ||
- name: Add bintray pull-request repository | ||
apt_repository: | ||
repo: deb [trusted=yes] https://dl.bintray.com/ooni/internal-pull-requests unstable main | ||
state: present | ||
update_cache: yes | ||
|
||
- name: install prio | ||
tags: prio | ||
apt: | ||
pkg: | ||
- prio | ||
install_recommends: yes | ||
state: latest | ||
update_cache: 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
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,12 @@ | ||
|
||
HAproxy used for Orchestra / Prio | ||
|
||
The [] box is the PS host | ||
probe --> [ nginx:443 --test-list--> haproxy:9972 --> orchestra ] | ||
[ ⤷ --> prio ] | ||
|
||
Currently used only for /api/v1/test-list/urls | ||
Monitor with: | ||
ssh <probe service> -L 9972:127.0.0.1:9972 | ||
browse http://localhost:9972/haproxy?stats | ||
|
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,5 @@ | ||
--- | ||
- name: reload haproxy | ||
systemd: | ||
name: haproxy | ||
state: reloaded |
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,29 @@ | ||
--- | ||
- name: install haproxy | ||
tags: haproxy | ||
apt: | ||
pkg: | ||
- haproxy | ||
- hatop | ||
- prometheus-haproxy-exporter | ||
install_recommends: no | ||
state: latest | ||
update_cache: yes | ||
|
||
- name: Install haproxy dhparam file | ||
# curl https://ssl-config.mozilla.org/ffdhe2048.txt > dhparam | ||
template: | ||
src: dhparam | ||
dest: /etc/haproxy/dhparam | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
|
||
- name: Install haproxy config file | ||
template: | ||
src: haproxy.cfg.j2 | ||
dest: /etc/haproxy/haproxy.cfg | ||
owner: root | ||
group: root | ||
mode: 0644 | ||
notify: reload haproxy |
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,8 @@ | ||
-----BEGIN DH PARAMETERS----- | ||
MIIBCAKCAQEA//////////+t+FRYortKmq/cViAnPTzx2LnFg84tNpWp4TZBFGQz | ||
+8yTnc4kmz75fS/jY2MMddj2gbICrsRhetPfHtXV/WVhJDP1H18GbtCFY2VVPe0a | ||
87VXE15/V8k1mE8McODmi3fipona8+/och3xWKE2rec1MKzKT0g6eXq8CrGCsyT7 | ||
YdEIqUuyyOP7uWrat2DX9GgdT0Kj3jlN9K5W7edjcrsZCwenyO4KbXCeAvzhzffi | ||
7MA0BM0oNC9hkXL+nOmFg/+OTxIy7vKBg8P+OxtMb61zO7X8vC7CIAXFjvGDfRaD | ||
ssbzSibBsu/6iGtCOGEoXJf//////////wIBAg== | ||
-----END DH PARAMETERS----- |
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,67 @@ | ||
# | ||
# Deployed on {{ ansible_hostname }} by ansible | ||
# See roles/haproxy/templates/haproxy.conf | ||
# | ||
|
||
global | ||
log /dev/log local0 | ||
log /dev/log local1 notice | ||
chroot /var/lib/haproxy | ||
stats socket /run/haproxy/admin.sock mode 660 level admin expose-fd listeners | ||
stats timeout 30s | ||
user haproxy | ||
group haproxy | ||
daemon | ||
|
||
# Default SSL material locations | ||
ca-base /etc/ssl/certs | ||
crt-base /etc/ssl/private | ||
|
||
# intermediate configuration | ||
# generated 2020-06-05, Mozilla Guideline v5.4, HAProxy 2.1, OpenSSL 1.1.1d, intermediate configuration | ||
# https://ssl-config.mozilla.org/#server=haproxy&version=2.1&config=intermediate&openssl=1.1.1d&guideline=5.4 | ||
ssl-default-bind-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 | ||
ssl-default-bind-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 | ||
ssl-default-bind-options no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets | ||
|
||
ssl-default-server-ciphers ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:DHE-RSA-AES128-GCM-SHA256:DHE-RSA-AES256-GCM-SHA384 | ||
ssl-default-server-ciphersuites TLS_AES_128_GCM_SHA256:TLS_AES_256_GCM_SHA384:TLS_CHACHA20_POLY1305_SHA256 | ||
ssl-default-server-options no-sslv3 no-tlsv10 no-tlsv11 no-tls-tickets | ||
|
||
ssl-dh-param-file /etc/haproxy/dhparam | ||
|
||
|
||
defaults | ||
log global | ||
mode http | ||
option httplog | ||
option dontlognull | ||
timeout connect 5000 | ||
timeout client 50000 | ||
timeout server 50000 | ||
errorfile 400 /etc/haproxy/errors/400.http | ||
errorfile 403 /etc/haproxy/errors/403.http | ||
errorfile 408 /etc/haproxy/errors/408.http | ||
errorfile 500 /etc/haproxy/errors/500.http | ||
errorfile 502 /etc/haproxy/errors/502.http | ||
errorfile 503 /etc/haproxy/errors/503.http | ||
errorfile 504 /etc/haproxy/errors/504.http | ||
|
||
|
||
# See roles/haproxy/README.adoc | ||
|
||
frontend frontend_test_list_urls_forwarding | ||
mode http | ||
bind 127.0.0.1:9972 | ||
#http-response set-header Strict-Transport-Security max-age=63072000 | ||
stats refresh 5s | ||
stats uri /haproxy_stats | ||
default_backend test_list_urls | ||
|
||
backend test_list_urls | ||
balance roundrobin | ||
# Check only on TCP level until /check or /health is implemented | ||
# option httpchk GET /check | ||
# http-check expect status 200 | ||
server orchestra::{{ ansible_hostname }} 127.0.0.1:{{ orchestrate_port }} check weight 99 | ||
server prio::{{ ansible_hostname }} 127.0.0.1:8788 check weight 1 |
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
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
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is it OK for this endpoint to be publicly visible or might it present security concerns?