From 333b53caf567e860fd0fdecd39f509f3629cd48e Mon Sep 17 00:00:00 2001
From: Robert Fairburn <8029478+rfairburn@users.noreply.github.com>
Date: Tue, 19 Aug 2025 12:14:27 -0500
Subject: [PATCH] Remove extra copies of geolite2 module (#91)
---
addons/fleet-osquery/.header.md | 9 ----
addons/fleet-osquery/.terraform-docs.yml | 1 -
addons/fleet-osquery/Dockerfile | 15 ------
addons/fleet-osquery/README.md | 48 -------------------
addons/fleet-osquery/geolite2/.header.md | 9 ----
.../geolite2/.terraform-docs.yml | 1 -
addons/fleet-osquery/geolite2/Dockerfile | 17 -------
addons/fleet-osquery/geolite2/README.md | 48 -------------------
addons/fleet-osquery/geolite2/main.tf | 32 -------------
addons/fleet-osquery/geolite2/outputs.tf | 5 --
addons/fleet-osquery/geolite2/variables.tf | 11 -----
addons/fleet-osquery/main.tf | 32 -------------
addons/fleet-osquery/outputs.tf | 5 --
addons/fleet-osquery/variables.tf | 11 -----
14 files changed, 244 deletions(-)
delete mode 100644 addons/fleet-osquery/.header.md
delete mode 100644 addons/fleet-osquery/.terraform-docs.yml
delete mode 100644 addons/fleet-osquery/Dockerfile
delete mode 100644 addons/fleet-osquery/README.md
delete mode 100644 addons/fleet-osquery/geolite2/.header.md
delete mode 100644 addons/fleet-osquery/geolite2/.terraform-docs.yml
delete mode 100644 addons/fleet-osquery/geolite2/Dockerfile
delete mode 100644 addons/fleet-osquery/geolite2/README.md
delete mode 100644 addons/fleet-osquery/geolite2/main.tf
delete mode 100644 addons/fleet-osquery/geolite2/outputs.tf
delete mode 100644 addons/fleet-osquery/geolite2/variables.tf
delete mode 100644 addons/fleet-osquery/main.tf
delete mode 100644 addons/fleet-osquery/outputs.tf
delete mode 100644 addons/fleet-osquery/variables.tf
diff --git a/addons/fleet-osquery/.header.md b/addons/fleet-osquery/.header.md
deleted file mode 100644
index 89585fd..0000000
--- a/addons/fleet-osquery/.header.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Geoip Terraform module for Fleet
-
-This module adds Geoip data to the Fleet docker image for use with the Fleet Terraform module.
-
-See the [documentation](https://fleetdm.com/docs/configuration/fleet-server-configuration#geoip) for some basic information about what happens under the hood.
-
-You will need to supply a Maxmind license key and a destination docker registry (such as ECR) to hold the new image.
-
-Outputs will be added to the environment variables in Fleet via the `extra_environment_variables` list.
diff --git a/addons/fleet-osquery/.terraform-docs.yml b/addons/fleet-osquery/.terraform-docs.yml
deleted file mode 100644
index 1d139dd..0000000
--- a/addons/fleet-osquery/.terraform-docs.yml
+++ /dev/null
@@ -1 +0,0 @@
-header-from: .header.md
diff --git a/addons/fleet-osquery/Dockerfile b/addons/fleet-osquery/Dockerfile
deleted file mode 100644
index e17c595..0000000
--- a/addons/fleet-osquery/Dockerfile
+++ /dev/null
@@ -1,15 +0,0 @@
-ARG FLEET_IMAGE
-
-FROM ${FLEET_IMAGE}
-
-ARG LICENSE_KEY
-USER root
-
-RUN wget "https://github.com/osquery/osquery/releases/download/5.12.2/osquery-5.12.2_1.linux_x86_64.tar.gz" -O /tmp/osquery.tar.gz &&\
- [ "101b61d760d530be9e41165c858d40353e03412676824b9fb6847a9febaab853" == "$(sha256sum /tmp/osquery.tar.gz | awk '{ print $1 }')" ] &&\
- tar -xzvf /tmp/osquery.tar.gz -C / &&\
- rm /tmp/osquery.tar.gz
-
-USER fleet
-# Might not be needed again, but keep it just in case
-CMD ["fleet", "serve"]
diff --git a/addons/fleet-osquery/README.md b/addons/fleet-osquery/README.md
deleted file mode 100644
index 47c93f1..0000000
--- a/addons/fleet-osquery/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# Geoip Terraform module for Fleet
-
-This module adds Geoip data to the Fleet docker image for use with the Fleet Terraform module.
-
-See the [documentation](https://fleetdm.com/docs/configuration/fleet-server-configuration#geoip) for some basic information about what happens under the hood.
-
-You will need to supply a Maxmind license key and a destination docker registry (such as ECR) to hold the new image.
-
-Outputs will be added to the environment variables in Fleet via the `extra_environment_variables` list.
-
-## Requirements
-
-| Name | Version |
-|------|---------|
-| [docker](#requirement\_docker) | 3.0.2 |
-
-## Providers
-
-| Name | Version |
-|------|---------|
-| [docker](#provider\_docker) | 3.0.2 |
-| [local](#provider\_local) | 2.4.1 |
-
-## Modules
-
-No modules.
-
-## Resources
-
-| Name | Type |
-|------|------|
-| [docker_image.maxmind_fleet](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs/resources/image) | resource |
-| [docker_registry_image.maxmind_fleet](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs/resources/registry_image) | resource |
-| [local_file.dockerfile](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource |
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [destination\_image](#input\_destination\_image) | n/a | `string` | n/a | yes |
-| [fleet\_image](#input\_fleet\_image) | n/a | `string` | n/a | yes |
-| [license\_key](#input\_license\_key) | n/a | `string` | n/a | yes |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [extra\_environment\_variables](#output\_extra\_environment\_variables) | n/a |
diff --git a/addons/fleet-osquery/geolite2/.header.md b/addons/fleet-osquery/geolite2/.header.md
deleted file mode 100644
index 89585fd..0000000
--- a/addons/fleet-osquery/geolite2/.header.md
+++ /dev/null
@@ -1,9 +0,0 @@
-# Geoip Terraform module for Fleet
-
-This module adds Geoip data to the Fleet docker image for use with the Fleet Terraform module.
-
-See the [documentation](https://fleetdm.com/docs/configuration/fleet-server-configuration#geoip) for some basic information about what happens under the hood.
-
-You will need to supply a Maxmind license key and a destination docker registry (such as ECR) to hold the new image.
-
-Outputs will be added to the environment variables in Fleet via the `extra_environment_variables` list.
diff --git a/addons/fleet-osquery/geolite2/.terraform-docs.yml b/addons/fleet-osquery/geolite2/.terraform-docs.yml
deleted file mode 100644
index 1d139dd..0000000
--- a/addons/fleet-osquery/geolite2/.terraform-docs.yml
+++ /dev/null
@@ -1 +0,0 @@
-header-from: .header.md
diff --git a/addons/fleet-osquery/geolite2/Dockerfile b/addons/fleet-osquery/geolite2/Dockerfile
deleted file mode 100644
index 0f401cc..0000000
--- a/addons/fleet-osquery/geolite2/Dockerfile
+++ /dev/null
@@ -1,17 +0,0 @@
-ARG FLEET_IMAGE
-
-FROM ${FLEET_IMAGE}
-
-ARG LICENSE_KEY
-USER root
-
-RUN mkdir -p /opt/GeoLite2 && cd /opt/GeoLite2 &&\
- wget --max-redirect 10 "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz" -O GeoLite2-City.tar.gz &&\
- wget --max-redirect 10 "https://download.maxmind.com/app/geoip_download?edition_id=GeoLite2-City&license_key=${LICENSE_KEY}&suffix=tar.gz.sha256" -O GeoLite2-City.tar.gz.sha256 &&\
- [ "$(awk '{ print $1 }' GeoLite2-City.tar.gz.sha256)" == "$(sha256sum GeoLite2-City.tar.gz | awk '{ print $1 }')" ] &&\
- (tar -xzvf GeoLite2-City.tar.gz "*/GeoLite2-City.mmdb" --strip-components 1 2>/dev/null || true) &&\
- rm -f GeoLite2-City.tar.gz*
-
-USER fleet
-# Might not be needed again, but keep it just in case
-CMD ["fleet", "serve"]
diff --git a/addons/fleet-osquery/geolite2/README.md b/addons/fleet-osquery/geolite2/README.md
deleted file mode 100644
index 47c93f1..0000000
--- a/addons/fleet-osquery/geolite2/README.md
+++ /dev/null
@@ -1,48 +0,0 @@
-# Geoip Terraform module for Fleet
-
-This module adds Geoip data to the Fleet docker image for use with the Fleet Terraform module.
-
-See the [documentation](https://fleetdm.com/docs/configuration/fleet-server-configuration#geoip) for some basic information about what happens under the hood.
-
-You will need to supply a Maxmind license key and a destination docker registry (such as ECR) to hold the new image.
-
-Outputs will be added to the environment variables in Fleet via the `extra_environment_variables` list.
-
-## Requirements
-
-| Name | Version |
-|------|---------|
-| [docker](#requirement\_docker) | 3.0.2 |
-
-## Providers
-
-| Name | Version |
-|------|---------|
-| [docker](#provider\_docker) | 3.0.2 |
-| [local](#provider\_local) | 2.4.1 |
-
-## Modules
-
-No modules.
-
-## Resources
-
-| Name | Type |
-|------|------|
-| [docker_image.maxmind_fleet](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs/resources/image) | resource |
-| [docker_registry_image.maxmind_fleet](https://registry.terraform.io/providers/kreuzwerker/docker/3.0.2/docs/resources/registry_image) | resource |
-| [local_file.dockerfile](https://registry.terraform.io/providers/hashicorp/local/latest/docs/resources/file) | resource |
-
-## Inputs
-
-| Name | Description | Type | Default | Required |
-|------|-------------|------|---------|:--------:|
-| [destination\_image](#input\_destination\_image) | n/a | `string` | n/a | yes |
-| [fleet\_image](#input\_fleet\_image) | n/a | `string` | n/a | yes |
-| [license\_key](#input\_license\_key) | n/a | `string` | n/a | yes |
-
-## Outputs
-
-| Name | Description |
-|------|-------------|
-| [extra\_environment\_variables](#output\_extra\_environment\_variables) | n/a |
diff --git a/addons/fleet-osquery/geolite2/main.tf b/addons/fleet-osquery/geolite2/main.tf
deleted file mode 100644
index aef0bae..0000000
--- a/addons/fleet-osquery/geolite2/main.tf
+++ /dev/null
@@ -1,32 +0,0 @@
-terraform {
- required_providers {
- docker = {
- source = "kreuzwerker/docker"
- version = "3.0.2"
- }
- }
-}
-
-# Build the new image
-resource "docker_image" "maxmind_fleet" {
- name = var.destination_image
-
- build {
- context = path.module
- platform = "linux/amd64"
- build_args = {
- FLEET_IMAGE = var.fleet_image
- LICENSE_KEY = var.license_key
- }
- pull_parent = true
- }
-}
-
-# push it to the specified repo
-resource "docker_registry_image" "maxmind_fleet" {
- triggers = {
- fleet_digest = docker_image.maxmind_fleet.repo_digest
- }
- name = docker_image.maxmind_fleet.name
- keep_remotely = true
-}
diff --git a/addons/fleet-osquery/geolite2/outputs.tf b/addons/fleet-osquery/geolite2/outputs.tf
deleted file mode 100644
index 7c4e5d7..0000000
--- a/addons/fleet-osquery/geolite2/outputs.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-output "extra_environment_variables" {
- value = {
- FLEET_GEOIP_DATABASE_PATH = "/opt/GeoLite2/GeoLite2-City.mmdb"
- }
-}
diff --git a/addons/fleet-osquery/geolite2/variables.tf b/addons/fleet-osquery/geolite2/variables.tf
deleted file mode 100644
index cae84fc..0000000
--- a/addons/fleet-osquery/geolite2/variables.tf
+++ /dev/null
@@ -1,11 +0,0 @@
-variable "fleet_image" {
- type = string
-}
-
-variable "destination_image" {
- type = string
-}
-
-variable "license_key" {
- type = string
-}
diff --git a/addons/fleet-osquery/main.tf b/addons/fleet-osquery/main.tf
deleted file mode 100644
index aef0bae..0000000
--- a/addons/fleet-osquery/main.tf
+++ /dev/null
@@ -1,32 +0,0 @@
-terraform {
- required_providers {
- docker = {
- source = "kreuzwerker/docker"
- version = "3.0.2"
- }
- }
-}
-
-# Build the new image
-resource "docker_image" "maxmind_fleet" {
- name = var.destination_image
-
- build {
- context = path.module
- platform = "linux/amd64"
- build_args = {
- FLEET_IMAGE = var.fleet_image
- LICENSE_KEY = var.license_key
- }
- pull_parent = true
- }
-}
-
-# push it to the specified repo
-resource "docker_registry_image" "maxmind_fleet" {
- triggers = {
- fleet_digest = docker_image.maxmind_fleet.repo_digest
- }
- name = docker_image.maxmind_fleet.name
- keep_remotely = true
-}
diff --git a/addons/fleet-osquery/outputs.tf b/addons/fleet-osquery/outputs.tf
deleted file mode 100644
index 7c4e5d7..0000000
--- a/addons/fleet-osquery/outputs.tf
+++ /dev/null
@@ -1,5 +0,0 @@
-output "extra_environment_variables" {
- value = {
- FLEET_GEOIP_DATABASE_PATH = "/opt/GeoLite2/GeoLite2-City.mmdb"
- }
-}
diff --git a/addons/fleet-osquery/variables.tf b/addons/fleet-osquery/variables.tf
deleted file mode 100644
index cae84fc..0000000
--- a/addons/fleet-osquery/variables.tf
+++ /dev/null
@@ -1,11 +0,0 @@
-variable "fleet_image" {
- type = string
-}
-
-variable "destination_image" {
- type = string
-}
-
-variable "license_key" {
- type = string
-}