Compare commits
No commits in common. "2ba076dee80ee8de58abc54e500f7785eed33548" and "26a834d3b5e2d1c7ea2af98c41b4e373824781ff" have entirely different histories.
2ba076dee8
...
26a834d3b5
|
|
@ -10,7 +10,6 @@ terraform {
|
|||
|
||||
locals {
|
||||
compose_file = templatefile("${path.module}/templates/docker-compose.yml.tftpl", {})
|
||||
crowdsec_acquis = templatefile("${path.module}/templates/crowdsec-acquis.yaml.tftpl", {})
|
||||
heimdall_server_name = "heimdall.${var.server_name}"
|
||||
heimdall_backend_host = var.heimdall_backend_host != "" ? var.heimdall_backend_host : var.gitea_backend_host
|
||||
server_names = distinct(concat([var.server_name, local.heimdall_server_name], var.additional_server_names))
|
||||
|
|
@ -52,7 +51,6 @@ locals {
|
|||
}) : ""
|
||||
config_hash = sha256(join("\n---\n", [
|
||||
local.compose_file,
|
||||
local.crowdsec_acquis,
|
||||
local.default_conf,
|
||||
local.default_vcl,
|
||||
local.haproxy_cfg,
|
||||
|
|
@ -107,11 +105,6 @@ resource "null_resource" "edge_services" {
|
|||
destination = "/tmp/homelab-edge/config_files/default.conf"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
content = local.crowdsec_acquis
|
||||
destination = "/tmp/homelab-edge/config_files/crowdsec-acquis.yaml"
|
||||
}
|
||||
|
||||
provisioner "file" {
|
||||
content = local.default_vcl
|
||||
destination = "/tmp/homelab-edge/config_files/default.vcl"
|
||||
|
|
@ -203,7 +196,6 @@ sudo mkdir -p \
|
|||
"$install_dir/certbot/www" \
|
||||
"$install_dir/letsencrypt"
|
||||
sudo cp /tmp/homelab-edge/docker-compose.yml "$install_dir/docker-compose.yml"
|
||||
sudo cp /tmp/homelab-edge/config_files/crowdsec-acquis.yaml "$install_dir/config_files/crowdsec-acquis.yaml"
|
||||
sudo cp /tmp/homelab-edge/config_files/default.conf "$install_dir/config_files/default.conf"
|
||||
sudo cp /tmp/homelab-edge/config_files/default.vcl "$install_dir/config_files/default.vcl"
|
||||
sudo cp /tmp/homelab-edge/config_files/haproxy.cfg "$install_dir/config_files/haproxy.cfg"
|
||||
|
|
|
|||
|
|
@ -1,7 +0,0 @@
|
|||
source: file
|
||||
filenames:
|
||||
- /var/log/nginx/access.log
|
||||
- /var/log/nginx/error.log
|
||||
labels:
|
||||
type: nginx
|
||||
force_inotify: true
|
||||
|
|
@ -3,19 +3,13 @@ map $request_uri $blocked_uris {
|
|||
~*(/\.env|/\.git|/\.aws|/wp-admin) 1;
|
||||
}
|
||||
|
||||
access_log /var/log/nginx/access.log;
|
||||
error_log /var/log/nginx/error.log warn;
|
||||
|
||||
limit_req_zone $binary_remote_addr zone=one:10m rate=10r/s;
|
||||
|
||||
proxy_cache_path /var/cache/nginx levels=1:2 keys_zone=static_assets:10m max_size=100m inactive=24h;
|
||||
proxy_cache_path /var/cache/nginx_dynamic levels=1:2 keys_zone=dynamic_content:5m max_size=50m inactive=1h;
|
||||
|
||||
upstream homelab_backend {
|
||||
# Public Kubernetes application traffic deliberately traverses the edge
|
||||
# learning chain: nginx -> HAProxy -> Varnish or Squid -> Traefik.
|
||||
# HAProxy is reachable only on the internal Compose network.
|
||||
server haproxy-dev:9000;
|
||||
server ${backend_host}:${backend_port};
|
||||
keepalive 16;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -14,22 +14,6 @@ services:
|
|||
- ./certbot/www:/var/www/certbot:ro
|
||||
- nginx_cache:/var/cache/nginx
|
||||
- nginx_dynamic_cache:/var/cache/nginx_dynamic
|
||||
- nginx_logs:/var/log/nginx
|
||||
|
||||
crowdsec:
|
||||
image: crowdsecurity/crowdsec:latest
|
||||
restart: unless-stopped
|
||||
depends_on:
|
||||
- nginx-dev
|
||||
ports:
|
||||
- "127.0.0.1:8080:8080"
|
||||
environment:
|
||||
COLLECTIONS: "crowdsecurity/nginx crowdsecurity/http-cve"
|
||||
volumes:
|
||||
- ./config_files/crowdsec-acquis.yaml:/etc/crowdsec/acquis.yaml:ro
|
||||
- nginx_logs:/var/log/nginx:ro
|
||||
- crowdsec_config:/etc/crowdsec
|
||||
- crowdsec_data:/var/lib/crowdsec/data
|
||||
|
||||
haproxy-dev:
|
||||
image: haproxy:alpine
|
||||
|
|
@ -72,8 +56,5 @@ services:
|
|||
volumes:
|
||||
nginx_cache:
|
||||
nginx_dynamic_cache:
|
||||
nginx_logs:
|
||||
crowdsec_config:
|
||||
crowdsec_data:
|
||||
squid_cache:
|
||||
squid_logs:
|
||||
|
|
|
|||
Loading…
Reference in New Issue