Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
e9bf3e8
chore(deps): bump org.jetbrains:annotations from 26.0.0 to 26.0.1
dependabot[bot] Oct 15, 2024
49a7358
chore(deps-dev): bump org.junit.jupiter:junit-jupiter-api
dependabot[bot] Oct 22, 2024
8f93fc7
chore(deps): bump com.fasterxml.jackson.core:jackson-databind
dependabot[bot] Oct 29, 2024
dc8ec92
chore(deps): bump com.fasterxml.jackson.dataformat:jackson-dataformat…
dependabot[bot] Oct 29, 2024
82fd9fc
Merge pull request #56 from networkfilter/dependabot/maven/develop/co…
nidotls Oct 30, 2024
1d3ba8f
Merge pull request #55 from networkfilter/dependabot/maven/develop/co…
nidotls Oct 30, 2024
a531835
Merge pull request #53 from networkfilter/dependabot/maven/develop/or…
nidotls Oct 30, 2024
a7910c4
Merge pull request #52 from networkfilter/dependabot/maven/develop/or…
nidotls Oct 30, 2024
c8579aa
chore(deps): bump org.projectlombok:lombok from 1.18.34 to 1.18.36
dependabot[bot] Apr 16, 2026
597267e
feat: make nf.ni.ls API key optional (#66)
nidotls Apr 16, 2026
b33ac83
chore(deps): bump org.jetbrains:annotations from 26.0.1 to 26.0.2 (#64)
dependabot[bot] Apr 16, 2026
4aa0882
chore(deps-dev): bump org.junit.jupiter:junit-jupiter-api (#62)
dependabot[bot] Apr 16, 2026
8c47edc
chore(deps): bump com.fasterxml.jackson.dataformat:jackson-dataformat…
dependabot[bot] Apr 16, 2026
149561c
chore(deps): bump com.fasterxml.jackson.core:jackson-databind (#60)
dependabot[bot] Apr 16, 2026
389a294
chore(deps): bump com.konghq:unirest-modules-gson from 4.4.4 to 4.4.5…
dependabot[bot] Apr 16, 2026
8b0d4a2
chore(deps): bump com.konghq:unirest-java-core from 4.4.4 to 4.4.5 (#57)
dependabot[bot] Apr 16, 2026
d0ab273
chore(deps): bump actions/checkout from 4 to 6 (#69)
dependabot[bot] Apr 16, 2026
3e83e2c
chore(deps): bump softprops/action-gh-release from 2 to 3 (#67)
dependabot[bot] Apr 16, 2026
8286f4d
chore(deps): bump thenilsdev/git-log-action from 1.0.5 to 2.0.3 (#72)
dependabot[bot] Apr 16, 2026
71f9e42
chore(deps): bump actions/setup-java from 4 to 5 (#71)
dependabot[bot] Apr 16, 2026
c2ad80f
chore(deps): bump org.projectlombok:lombok from 1.18.36 to 1.18.44 (#68)
dependabot[bot] Apr 16, 2026
3be89a7
chore(deps): bump com.velocitypowered:velocity-api (#73)
dependabot[bot] Apr 16, 2026
e5d5f8f
chore(deps): bump jakarta.validation:jakarta.validation-api (#74)
dependabot[bot] Apr 16, 2026
cac3b17
chore(deps): bump commons-net:commons-net from 3.11.1 to 3.13.0 (#76)
dependabot[bot] Apr 16, 2026
390dc7b
chore(deps-dev): bump org.apache.maven.plugins:maven-jar-plugin (#77)
dependabot[bot] Apr 16, 2026
f19532c
chore(deps): bump net.md-5:bungeecord-api from 1.21-R0.1 to 1.21-R0.4…
dependabot[bot] Apr 16, 2026
c73418a
chore(deps): bump org.apache.maven.plugins:maven-shade-plugin (#78)
dependabot[bot] Apr 16, 2026
98b5acf
chore(deps-dev): bump org.apache.maven.plugins:maven-compiler-plugin …
dependabot[bot] Apr 16, 2026
c8742a3
chore(deps): bump redis.clients:jedis from 5.2.0 to 7.4.1 (#75)
dependabot[bot] Apr 16, 2026
16afe77
chore: migrate @Nullable imports from Checker Framework to JSpecify (…
nidotls Apr 16, 2026
bd52c35
chore(deps): bump com.github.ben-manes.caffeine:caffeine (#70)
dependabot[bot] Apr 16, 2026
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
4 changes: 2 additions & 2 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
java: [ "17" ]
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up JDK ${{ matrix.java }}
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: ${{ matrix.java }}
distribution: "adopt"
Expand Down
8 changes: 4 additions & 4 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -12,12 +12,12 @@ jobs:
if: "!contains(github.event.head_commit.message, '[ci skip]') && !contains(github.event.head_commit.message, '[skip ci]')"
steps:
- name: Checkout repository
uses: actions/checkout@v4
uses: actions/checkout@v6
with:
fetch-depth: 0

- name: Set up JDK 17
uses: actions/setup-java@v4
uses: actions/setup-java@v5
with:
java-version: 17
distribution: "adopt"
Expand Down Expand Up @@ -52,7 +52,7 @@ jobs:

- name: Get Git Changelog
id: get_changelog
uses: thenilsdev/git-log-action@1.0.5
uses: thenilsdev/git-log-action@v2.0.3
if: steps.release.outcome == 'success' && steps.release.conclusion == 'success'

- name: Build with Maven
Expand All @@ -74,7 +74,7 @@ jobs:
# continue-on-error: true

- name: Create Release
uses: softprops/action-gh-release@v2
uses: softprops/action-gh-release@v3
id: create_release
with:
tag_name: ${{ steps.current_tag.outputs.tag }}
Expand Down
2 changes: 1 addition & 1 deletion bukkit/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.2</version>
<configuration>
<relocations>
<relocation>
Expand Down
11 changes: 2 additions & 9 deletions bungee/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -14,18 +14,11 @@
<name>NetworkFilterBungee</name>
<description/>

<repositories>
<repository>
<id>bungeecord-repo</id>
<url>https://oss.sonatype.org/content/repositories/snapshots</url>
</repository>
</repositories>

<dependencies>
<dependency>
<groupId>net.md-5</groupId>
<artifactId>bungeecord-api</artifactId>
<version>1.21-R0.1-SNAPSHOT</version>
<version>1.21-R0.4</version>
<scope>provided</scope>
</dependency>

Expand All @@ -48,7 +41,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.2</version>
<configuration>
<relocations>
<relocation>
Expand Down
22 changes: 14 additions & 8 deletions common/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -18,45 +18,51 @@
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>2.18.0</version>
<version>2.21.2</version>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.dataformat</groupId>
<artifactId>jackson-dataformat-yaml</artifactId>
<version>2.18.0</version>
<version>2.21.2</version>
</dependency>
<dependency>
<groupId>jakarta.validation</groupId>
<artifactId>jakarta.validation-api</artifactId>
<version>3.1.0</version>
<version>3.1.1</version>
</dependency>

<dependency>
<groupId>commons-net</groupId>
<artifactId>commons-net</artifactId>
<version>3.11.1</version>
<version>3.13.0</version>
</dependency>

<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-java-core</artifactId>
<version>4.4.4</version>
<version>4.8.1</version>
</dependency>
<dependency>
<groupId>com.konghq</groupId>
<artifactId>unirest-modules-gson</artifactId>
<version>4.4.4</version>
<version>4.8.1</version>
</dependency>

<dependency>
<groupId>org.jspecify</groupId>
<artifactId>jspecify</artifactId>
<version>1.0.0</version>
</dependency>

<dependency>
<groupId>com.github.ben-manes.caffeine</groupId>
<artifactId>caffeine</artifactId>
<version>3.1.8</version>
<version>3.2.3</version>
</dependency>
<dependency>
<groupId>redis.clients</groupId>
<artifactId>jedis</artifactId>
<version>5.2.0</version>
<version>7.4.1</version>
</dependency>

<dependency>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ls.ni.networkfilter.common;

import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.jetbrains.annotations.NotNull;

/**
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
package ls.ni.networkfilter.common.cache;

import ls.ni.networkfilter.common.filter.FilterResult;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.jetbrains.annotations.NotNull;

import java.util.function.Function;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.github.benmanes.caffeine.cache.Caffeine;
import ls.ni.networkfilter.common.cache.Cache;
import ls.ni.networkfilter.common.filter.FilterResult;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.jetbrains.annotations.NotNull;

import java.time.Duration;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
import com.fasterxml.jackson.databind.ObjectMapper;
import ls.ni.networkfilter.common.cache.Cache;
import ls.ni.networkfilter.common.filter.FilterResult;
import org.checkerframework.checker.nullness.qual.Nullable;
import org.jspecify.annotations.Nullable;
import org.jetbrains.annotations.NotNull;
import redis.clients.jedis.Jedis;
import redis.clients.jedis.JedisPool;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
package ls.ni.networkfilter.common.config.service.types;

import jakarta.validation.constraints.NotNull;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;
import org.jetbrains.annotations.Nullable;

@Data
@NoArgsConstructor
@AllArgsConstructor
public class NetworkFilterServiceSettings {

@NotNull
@Nullable
private String key;
}
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package ls.ni.networkfilter.common.filter.types;

import jakarta.validation.constraints.NotBlank;
import kong.unirest.core.HttpRequestWithBody;
import kong.unirest.core.HttpResponse;
import kong.unirest.core.JsonNode;
import kong.unirest.core.Unirest;
Expand All @@ -10,17 +10,18 @@
import ls.ni.networkfilter.common.filter.FilterResult;
import ls.ni.networkfilter.common.filter.FilterService;
import org.jetbrains.annotations.NotNull;
import org.jetbrains.annotations.Nullable;

import java.util.List;
import java.util.Optional;

public class NetworkFilterFilterService implements FilterService {

@NotNull
@Nullable
private final String apiKey;

public NetworkFilterFilterService(@NotNull @NotBlank String apiKey) {
this.apiKey = apiKey;
public NetworkFilterFilterService(@Nullable String apiKey) {
this.apiKey = apiKey != null && !apiKey.isBlank() ? apiKey : null;
}

@Override
Expand All @@ -30,9 +31,14 @@ public NetworkFilterFilterService(@NotNull @NotBlank String apiKey) {

@Override
public @NotNull FilterResult check(@NotNull String ip) {
HttpResponse<JsonNode> response = Unirest.post("https://nf.ni.ls/api/check")
.header("X-API-KEY", this.apiKey)
.header("Content-Type", "application/x-www-form-urlencoded")
HttpRequestWithBody request = Unirest.post("https://nf.ni.ls/api/check")
.header("Content-Type", "application/x-www-form-urlencoded");

if (this.apiKey != null) {
request.header("X-API-KEY", this.apiKey);
}

HttpResponse<JsonNode> response = request
.field("ip", ip)
.asJson();

Expand Down
2 changes: 1 addition & 1 deletion common/src/main/resources/config.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ caches:
services:
# https://nf.ni.ls
networkfilter:
# Required
# Optional, needed if rate-limited
key: ""

# https://ipapi.is
Expand Down
12 changes: 6 additions & 6 deletions pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -30,21 +30,21 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<version>1.18.34</version>
<version>1.18.44</version>
<scope>provided</scope>
</dependency>
<!-- annotations -->
<dependency>
<groupId>org.jetbrains</groupId>
<artifactId>annotations</artifactId>
<version>26.0.0</version>
<version>26.1.0</version>
<scope>compile</scope>
</dependency>
<!-- test -->
<dependency>
<groupId>org.junit.jupiter</groupId>
<artifactId>junit-jupiter-api</artifactId>
<version>5.11.2</version>
<version>6.0.3</version>
<scope>test</scope>
</dependency>
</dependencies>
Expand All @@ -58,7 +58,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-compiler-plugin</artifactId>
<version>3.13.0</version>
<version>3.15.0</version>
<configuration>
<source>17</source>
<target>17</target>
Expand Down Expand Up @@ -93,7 +93,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-jar-plugin</artifactId>
<version>3.4.2</version>
<version>3.5.0</version>
<configuration>
<outputDirectory>${project.parent.basedir}/artifacts/</outputDirectory>
</configuration>
Expand All @@ -104,7 +104,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.2</version>
<executions>
<execution>
<phase>package</phase>
Expand Down
4 changes: 2 additions & 2 deletions velocity/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@
<dependency>
<groupId>com.velocitypowered</groupId>
<artifactId>velocity-api</artifactId>
<version>3.3.0-SNAPSHOT</version>
<version>3.4.0</version>
<scope>provided</scope>
</dependency>

Expand Down Expand Up @@ -56,7 +56,7 @@
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-shade-plugin</artifactId>
<version>3.6.0</version>
<version>3.6.2</version>
<configuration>
<relocations>
<relocation>
Expand Down
Loading