Skip to content

Commit

Permalink
Block Claudebot (#263)
Browse files Browse the repository at this point in the history
  • Loading branch information
lens0021 authored Sep 27, 2024
1 parent c3e86dd commit c25c86c
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 24 deletions.
6 changes: 6 additions & 0 deletions caddy/Caddyfile
Original file line number Diff line number Diff line change
Expand Up @@ -50,10 +50,16 @@ rewrite /w/* /index.php
path /
vars_regexp {query} ^[A-Z]{5}=[A-Z]{3}$
}
@filter2 {
header User-Agent *ClaudeBot*
}

respond @filter0 200 {
close
}
respond @filter1 200 {
close
}
respond @filter2 200 {
close
}
29 changes: 5 additions & 24 deletions jobs/http.nomad
Original file line number Diff line number Diff line change
Expand Up @@ -26,41 +26,22 @@ job "http" {
}

dynamic "template" {
for_each = !var.test ? [] : [{
data = var.caddyfile_for_test
destination = "local.Caddyfile"
}]
for_each = !var.test ? [] : [{}]

content {
data = template.value.data
destination = template.value.destination
data = var.caddyfile_for_test
destination = "local.Caddyfile"
}
}
dynamic "artifact" {
for_each = var.test ? [] : [{
source = "https://github.com/femiwiki/nomad/raw/main/caddy/Caddyfile"
destination = "local/Caddyfile"
mode = "file"
}]
for_each = var.test ? [] : [{}]

content {
source = artifact.value.source
destination = artifact.value.destination
mode = artifact.value.mode
}
}

dynamic "artifact" {
for_each = var.test ? [] : [{
source = "https://github.com/femiwiki/nomad/raw/main/caddy/Caddyfile"
destination = "local/Caddyfile"
mode = "file"
}]
content {
source = artifact.value.source
destination = artifact.value.destination
mode = artifact.value.mode

options { checksum = "md5:ee0300e384afa6aca74f09a44323ee6e" }
}
}

Expand Down

0 comments on commit c25c86c

Please sign in to comment.