From 554fb2e6d0653ea4b80c05ce7c6ebca9aaf49811 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kr=C3=BChlmann?= Date: Fri, 9 Jan 2026 02:12:08 +0100 Subject: [PATCH] Add terms and policies --- .../imgfloat/config/SecurityConfig.java | 5 +- .../imgfloat/controller/ViewController.java | 21 ++++ src/main/resources/templates/channels.html | 6 ++ src/main/resources/templates/cookies.html | 55 ++++++++++ src/main/resources/templates/index.html | 6 ++ src/main/resources/templates/privacy.html | 68 ++++++++++++ src/main/resources/templates/terms.html | 102 ++++++++++++++++++ 7 files changed, 262 insertions(+), 1 deletion(-) create mode 100644 src/main/resources/templates/cookies.html create mode 100644 src/main/resources/templates/privacy.html create mode 100644 src/main/resources/templates/terms.html diff --git a/src/main/java/dev/kruhlmann/imgfloat/config/SecurityConfig.java b/src/main/java/dev/kruhlmann/imgfloat/config/SecurityConfig.java index 8407889..2c9b49d 100644 --- a/src/main/java/dev/kruhlmann/imgfloat/config/SecurityConfig.java +++ b/src/main/java/dev/kruhlmann/imgfloat/config/SecurityConfig.java @@ -59,7 +59,10 @@ public class SecurityConfig { "/v3/api-docs/**", "/swagger-ui.html", "/swagger-ui/**", - "/channels" + "/channels", + "/terms", + "/privacy", + "/cookies" ) .permitAll() .requestMatchers(HttpMethod.GET, "/view/*/broadcast") diff --git a/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java b/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java index 7668164..7292de9 100644 --- a/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java +++ b/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java @@ -76,6 +76,27 @@ public class ViewController { return "channels"; } + @org.springframework.web.bind.annotation.GetMapping("/terms") + public String termsOfUse(Model model) { + LOG.info("Rendering terms of use"); + addVersionAttributes(model); + return "terms"; + } + + @org.springframework.web.bind.annotation.GetMapping("/privacy") + public String privacyPolicy(Model model) { + LOG.info("Rendering privacy policy"); + addVersionAttributes(model); + return "privacy"; + } + + @org.springframework.web.bind.annotation.GetMapping("/cookies") + public String cookiePolicy(Model model) { + LOG.info("Rendering cookie policy"); + addVersionAttributes(model); + return "cookies"; + } + @org.springframework.web.bind.annotation.GetMapping("/settings") public String settingsView(OAuth2AuthenticationToken oauthToken, Model model) { String sessionUsername = OauthSessionUser.from(oauthToken).login(); diff --git a/src/main/resources/templates/channels.html b/src/main/resources/templates/channels.html index 0abfcef..e4eb38e 100644 --- a/src/main/resources/templates/channels.html +++ b/src/main/resources/templates/channels.html @@ -43,6 +43,12 @@