Skip to content

Commit b5a163a

Browse files
committed
chore: robots.txt and sentry logging
1 parent f382615 commit b5a163a

File tree

5 files changed

+21
-1
lines changed

5 files changed

+21
-1
lines changed

build.gradle.kts

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ plugins {
1212
alias(libs.plugins.indra.checkstyle)
1313
alias(libs.plugins.indra.git)
1414
alias(libs.plugins.jib)
15+
alias(libs.plugins.sentry)
1516
alias(libs.plugins.spotless)
1617
alias(libs.plugins.spring.boot)
1718
alias(libs.plugins.spring.deps)
@@ -81,6 +82,11 @@ spotless {
8182
}
8283
}
8384

85+
tasks.named("sourcesJar") {
86+
dependsOn(tasks.named("collectExternalDependenciesForSentry"))
87+
dependsOn(tasks.named("generateSentryDebugMetaPropertiesjava"))
88+
}
89+
8490
repositories {
8591
mavenCentral()
8692
maven("https://central.sonatype.com/repository/maven-snapshots/") {

gradle/libs.versions.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ indra = { id = "net.kyori.indra", version.ref = "indra" }
77
indra-checkstyle = { id = "net.kyori.indra.checkstyle", version.ref = "indra" }
88
indra-git = { id = "net.kyori.indra.git", version.ref = "indra" }
99
jib = { id = "com.google.cloud.tools.jib", version = "3.5.1" }
10+
sentry = { id = "io.sentry.jvm.gradle", version = "5.12.2" }
1011
spotless = { id = "com.diffplug.spotless", version = "7.2.1" }
1112
spring-boot = { id = "org.springframework.boot", version = "3.5.8" }
1213
spring-deps = { id = "io.spring.dependency-management", version = "1.1.7" }

src/main/java/io/papermc/fill/configuration/WebConfiguration.java

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,10 +22,12 @@
2222
import org.springframework.web.filter.OncePerRequestFilter;
2323
import org.springframework.web.filter.ShallowEtagHeaderFilter;
2424
import org.springframework.web.filter.UrlHandlerFilter;
25+
import org.springframework.web.servlet.config.annotation.ResourceHandlerRegistry;
26+
import org.springframework.web.servlet.config.annotation.WebMvcConfigurer;
2527

2628
@Configuration
2729
@NullMarked
28-
public class WebConfiguration {
30+
public class WebConfiguration implements WebMvcConfigurer {
2931
@Bean
3032
public ShallowEtagHeaderFilter shallowEtagHeaderFilter() {
3133
return new ShallowEtagHeaderFilter();
@@ -41,4 +43,9 @@ public FilterRegistrationBean<OncePerRequestFilter> trailingSlashUrlHandlerFilte
4143
bean.setFilter(filter);
4244
return bean;
4345
}
46+
47+
@Override
48+
public void addResourceHandlers(final ResourceHandlerRegistry registry) {
49+
registry.addResourceHandler("/robots.txt").addResourceLocations("classpath:/static/");
50+
}
4451
}
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
logging:
2+
level:
3+
org.springframework.web.servlet.PageNotFound: error
Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
User-agent: *
2+
Disallow: /
3+
Allow: /swagger-ui/index.html

0 commit comments

Comments
 (0)