Skip to content

Commit

Permalink
add auto-update to th host
Browse files Browse the repository at this point in the history
  • Loading branch information
DecFox committed Sep 17, 2024
1 parent a1cf80a commit 3f7dbf7
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
7 changes: 5 additions & 2 deletions tf/modules/ooni_th_droplet/main.tf
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,11 @@ data "cloudinit_config" "ooni_th" {
part {
filename = "init.cfg"
content_type = "text/cloud-config"
content = file("${path.module}/templates/cloud-init.yml")
}
content = templatefile("${path.module}/templates/cloud-init.yml", {
distro_id = "ubuntu",
distro_codename = "jammy"
})
}

}

Expand Down
14 changes: 14 additions & 0 deletions tf/modules/ooni_th_droplet/templates/cloud-init.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,8 +21,22 @@ 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 3f7dbf7

Please sign in to comment.