Skip to content

feat: integrate skyfence module and update dependencies #83

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .idea/caddy-defender.iml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 1 addition & 0 deletions .idea/modules.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

3 changes: 3 additions & 0 deletions .idea/vcs.xml

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

40 changes: 20 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -97,32 +97,32 @@ The plugin includes predefined IP ranges for popular AI services. These ranges a

| Service | Key | IP Ranges |
| :------------------------------------------------------------------: | :-----------------------------------------: | :------------------------------------------------: |
| Alibaba Cloud | aliyun | [aliyun.go](ranges/fetchers/aliyun.go) |
| VPNs | vpn | [vpn.go](ranges/fetchers/vpn.go) |
| AWS | aws | [aws.go](ranges/fetchers/aws/aws.go) |
| AWS Region | aws-us-east-1, aws-us-west-1, aws-eu-west-1 | [aws_region.go](ranges/fetchers/aws/aws_region.go) |
| DeepSeek | deepseek | [deepseek.go](ranges/fetchers/deepseek.go) |
| GitHub Copilot | githubcopilot | [github.go](ranges/fetchers/github.go) |
| Google Cloud Platform | gcloud | [gcloud.go](ranges/fetchers/gcloud.go) |
| Oracle Cloud Infrastructure | oci | [oracle.go](ranges/fetchers/oracle.go) |
| Microsoft Azure | azurepubliccloud | [azure.go](ranges/fetchers/azure.go) |
| OpenAI | openai | [openai.go](ranges/fetchers/openai.go) |
| Mistral | mistral | [mistral.go](ranges/fetchers/mistral.go) |
| Vultr | vultr | [vultr.go](ranges/fetchers/vultr.go) |
| Cloudflare | cloudflare | [cloudflare.go](ranges/fetchers/cloudflare.go) |
| Digital Ocean | digitalocean | [digitalocean.go](ranges/fetchers/digitalocean.go) |
| Linode | linode | [linode.go](ranges/fetchers/linode.go) |
| [Private](https://caddyserver.com/docs/caddyfile/matchers#remote-ip) | private | [private.go](ranges/fetchers/private.go) |
| All IP addresses | all | [all.go](ranges/fetchers/all.go) |
| Alibaba Cloud | aliyun | [aliyun.go](../skyfence/fetchers/aliyun.go) |
| VPNs | vpn | [vpn.go](../skyfence/fetchers/vpn.go) |
| AWS | aws | [aws.go](../skyfence/fetchers/aws/aws.go) |
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

need to fix these

| AWS Region | aws-us-east-1, aws-us-west-1, aws-eu-west-1 | [aws_region.go](../skyfence/fetchers/aws/aws_region.go) |
| DeepSeek | deepseek | [deepseek.go](../skyfence/fetchers/deepseek.go) |
| GitHub Copilot | githubcopilot | [github.go](../skyfence/fetchers/github.go) |
| Google Cloud Platform | gcloud | [gcloud.go](../skyfence/fetchers/gcloud.go) |
| Oracle Cloud Infrastructure | oci | [oracle.go](../skyfence/fetchers/oracle.go) |
| Microsoft Azure | azurepubliccloud | [azure.go](../skyfence/fetchers/azure.go) |
| OpenAI | openai | [openai.go](../skyfence/fetchers/openai.go) |
| Mistral | mistral | [mistral.go](../skyfence/fetchers/mistral.go) |
| Vultr | vultr | [vultr.go](../skyfence/fetchers/vultr.go) |
| Cloudflare | cloudflare | [cloudflare.go](../skyfence/fetchers/cloudflare.go) |
| Digital Ocean | digitalocean | [digitalocean.go](../skyfence/fetchers/digitalocean.go) |
| Linode | linode | [linode.go](../skyfence/fetchers/linode.go) |
| [Private](https://caddyserver.com/docs/caddyfile/matchers#remote-ip) | private | [private.go](../skyfence/fetchers/private.go) |
| All IP addresses | all | [all.go](../skyfence/fetchers/all.go) |

## Disabled by default (require manual inclusion at build time)

| Service | Key | IP Ranges |
| :-----------------------------: | :-: | :------------------------------: |
| Tor Exit Nodes | tor | [tor.go](ranges/fetchers/tor.go) |
| ASN (Autonomous System Numbers) | asn | [asn.go](ranges/fetchers/asn.go) |
| Tor Exit Nodes | tor | [tor.go](../skyfence/fetchers/tor.go) |
| ASN (Autonomous System Numbers) | asn | [asn.go](../skyfence/fetchers/asn.go) |

More are welcome! for a precompiled list, see the [embedded results](ranges/data/generated.go)
More are welcome! for a precompiled list, see the [embedded results](../skyfence/data/generated.go)

## **Contributing**

Expand Down
2 changes: 1 addition & 1 deletion config.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ import (
"encoding/json"
"errors"
"fmt"
"github.com/jasonlovesdoggo/skyfence/data"
"net"
"reflect"
"slices"
Expand All @@ -15,7 +16,6 @@ import (
"github.com/caddyserver/caddy/v2/caddyconfig/httpcaddyfile"
"github.com/caddyserver/caddy/v2/modules/caddyhttp"
"github.com/jasonlovesdoggo/caddy-defender/matchers/whitelist"
"github.com/jasonlovesdoggo/caddy-defender/ranges/data"
"github.com/jasonlovesdoggo/caddy-defender/responders"
"github.com/jasonlovesdoggo/caddy-defender/responders/tarpit"
)
Expand Down
3 changes: 2 additions & 1 deletion go.mod
Original file line number Diff line number Diff line change
@@ -1,10 +1,11 @@
module github.com/jasonlovesdoggo/caddy-defender

go 1.23.6
go 1.24.0

require (
github.com/caddyserver/caddy/v2 v2.9.1
github.com/gaissmai/bart v0.20.4
github.com/jasonlovesdoggo/skyfence v1.0.0
github.com/stretchr/testify v1.10.0
github.com/viccon/sturdyc v1.1.5
go.uber.org/zap v1.27.0
Expand Down
2 changes: 2 additions & 0 deletions go.sum
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,8 @@ github.com/jackc/pgx/v5 v5.7.3 h1:PO1wNKj/bTAwxSJnO1Z4Ai8j4magtqg2SLNjEDzcXQo=
github.com/jackc/pgx/v5 v5.7.3/go.mod h1:ncY89UGWxg82EykZUwSpUKEfccBGGYq1xjrOpsbsfGQ=
github.com/jackc/puddle/v2 v2.2.2 h1:PR8nw+E/1w0GLuRFSmiioY6UooMp6KJv0/61nB7icHo=
github.com/jackc/puddle/v2 v2.2.2/go.mod h1:vriiEXHvEE654aYKXXjOvZM39qJ0q+azkZFrfEOc3H4=
github.com/jasonlovesdoggo/skyfence v1.0.0 h1:BKPnnARl5WWKTsKwRcok/AlBo2pH/ZKYJNU0XfOFtEk=
github.com/jasonlovesdoggo/skyfence v1.0.0/go.mod h1:duE1FzyiLQMKWjo8q7Cfl8SsQe0bMdr155nDefBT/n4=
github.com/jellevandenhooff/dkim v0.0.0-20150330215556-f50fe3d243e1/go.mod h1:E0B/fFc00Y+Rasa88328GlI/XbtyysCtTHZS8h7IrBU=
github.com/jessevdk/go-flags v1.4.0/go.mod h1:4FA24M0QyGHXBuZZK/XkWh8h0e1EYbRYJSGM75WSRxI=
github.com/json-iterator/go v1.1.6/go.mod h1:+SdeFBvtyEkXs7REEP0seUULqWtbJapLOCVDaaPEHmU=
Expand Down
2 changes: 1 addition & 1 deletion matchers/ip/ip.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,12 @@ import (
"context"
"fmt"
Whitelist "github.com/jasonlovesdoggo/caddy-defender/matchers/whitelist"
"github.com/jasonlovesdoggo/skyfence/data"
"net"
"net/netip"
"time"

"github.com/gaissmai/bart"
"github.com/jasonlovesdoggo/caddy-defender/ranges/data"
"github.com/viccon/sturdyc"
"go.uber.org/zap"
)
Expand Down
2 changes: 1 addition & 1 deletion matchers/ip/ip_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@ package ip

import (
"context"
"github.com/jasonlovesdoggo/skyfence/data"
"net"
"testing"
"time"

"go.uber.org/zap/zapcore"

"github.com/jasonlovesdoggo/caddy-defender/ranges/data"
"github.com/stretchr/testify/assert"
"go.uber.org/zap"
)
Expand Down
Loading