Skip to content

Commit

Permalink
Fix cloud-init setup of ooni_backendproxy
Browse files Browse the repository at this point in the history
* Drop unattended upgrades from config since it comes with the base
  image
  • Loading branch information
hellais committed Sep 17, 2024
1 parent f08c93f commit 348a8a9
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 28 deletions.
29 changes: 15 additions & 14 deletions tf/modules/ooni_backendproxy/templates/cloud-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,42 +2,43 @@ package_update: true

packages:
- nginx
- libnginx-mod-stream

write_files:
- path: /etc/nginx/sites-available/default
content: |
%{ if length(wcth_addresses) > 0 }
upstream wcths {
%{ for address in wcth_addresses }
server ${ address };
%{ endfor }
}
server {
server_name *.${ wcth_domain_suffix };
listen 80;
server_name _;
location / {
proxy_pass http://wcths;
proxy_pass ${backend_url};
proxy_http_version 1.1;
proxy_set_header Host \$host;
}
error_log /var/log/nginx/error.log;
}
%{ endif }
%{ if length(wcth_addresses) > 0 }
upstream wcths {
%{ for address in wcth_addresses }
server ${ address };
%{ endfor }
}
server {
server_name *.${ wcth_domain_suffix };
listen 80;
server_name _;
location / {
proxy_pass ${backend_url};
proxy_pass http://wcths;
proxy_http_version 1.1;
proxy_set_header Host \$host;
}
error_log /var/log/nginx/error.log;
}
%{ endif }
- path: /etc/nginx/modules-enabled/stream.conf
- path: /etc/nginx/modules-enabled/99-stream.conf
content: |
stream {
upstream clickhouse_backend {
Expand Down
14 changes: 0 additions & 14 deletions tf/modules/ooni_th_droplet/templates/cloud-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,22 +21,8 @@ package_update: true
packages:
- oohelperd
- nginx
#- unattended-upgrades

write_files:
# - path: /etc/apt/apt.conf.d/20auto-upgrades
# content: |
# APT::Periodic::Update-Package-Lists "1";
# APT::Periodic::Unattended-Upgrade "1";

# - path: /etc/apt/apt.conf.d/50unattended-upgrades
# content: |
# Unattended-Upgrade::Allowed-Origins {
# //"${distro_id} stable";
# "${distro_id} ${distro_codename}-security";
# "${distro_id} ${distro_codename}-updates";
# };

- path: /etc/nginx/sites-available/default
content: |
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=thcache:100M
Expand Down

0 comments on commit 348a8a9

Please sign in to comment.