From 8c8cd0f42d4e2c41adce7810c680099772cadff0 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Andreas=20Kr=C3=BChlmann?= Date: Fri, 23 Jan 2026 17:03:47 +0100 Subject: [PATCH] Add docs link --- Makefile | 2 ++ README.md | 1 + .../imgfloat/controller/ViewController.java | 12 +++++++++++- src/main/resources/templates/admin.html | 1 + src/main/resources/templates/dashboard.html | 1 + src/main/resources/templates/index.html | 7 +++++++ 6 files changed, 23 insertions(+), 1 deletion(-) diff --git a/Makefile b/Makefile index 13f9d47..7cb1107 100644 --- a/Makefile +++ b/Makefile @@ -12,6 +12,7 @@ IMGFLOAT_ASSETS_PATH ?= ./assets IMGFLOAT_PREVIEWS_PATH ?= ./previews IMGFLOAT_COMMIT_URL_PREFIX ?= https://github.com/imgfloat/server/commit/ IMGFLOAT_IS_STAGING ?= 0 +IMGFLOAT_DOCS_URL ?= https://docs.imgflo.at SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE ?= 10MB SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE ?= 10MB WATCHDIR = ./src/main @@ -20,6 +21,7 @@ RUNTIME_ENV = IMGFLOAT_ASSETS_PATH=$(IMGFLOAT_ASSETS_PATH) \ IMGFLOAT_GITHUB_CLIENT_OWNER=$(IMGFLOAT_GITHUB_CLIENT_OWNER) \ IMGFLOAT_GITHUB_CLIENT_REPO=$(IMGFLOAT_GITHUB_CLIENT_REPO) \ IMGFLOAT_IS_STAGING=$(IMGFLOAT_IS_STAGING) \ + IMGFLOAT_DOCS_URL=$(IMGFLOAT_DOCS_URL) \ IMGFLOAT_GITHUB_CLIENT_VERSION=$(IMGFLOAT_GITHUB_CLIENT_VERSION) \ IMGFLOAT_COMMIT_URL_PREFIX=$(IMGFLOAT_COMMIT_URL_PREFIX) \ IMGFLOAT_DB_PATH=$(IMGFLOAT_DB_PATH) \ diff --git a/README.md b/README.md index f7aabf2..7858b48 100644 --- a/README.md +++ b/README.md @@ -28,6 +28,7 @@ Optional: | Variable | Description | Example Value | |----------|-------------|---------------| | `IMGFLOAT_COMMIT_URL_PREFIX` | Git commit URL prefix used for the build link badge (unset to hide the badge) | https://github.com/imgfloat/server/commit/ | +| `IMGFLOAT_DOCS_URL` | Base URL for Imgfloat documentation links | https://docs.imgflo.at | | `IMGFLOAT_IS_STAGING` | Show a staging warning banner on non-broadcast pages when set to `1` | 1 | | `IMGFLOAT_MARKETPLACE_SCRIPTS_PATH` | Filesystem path to marketplace script seed directories (each containing `metadata.json`, optional `source.js`, optional `logo.png`, and optional `attachments/`) | /var/imgfloat/marketplace-scripts | | `IMGFLOAT_SYSADMIN_CHANNEL_ACCESS_ENABLED` | Allow sysadmins to manage any channel without being listed as a channel admin | true | diff --git a/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java b/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java index 1468c00..19e0e4c 100644 --- a/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java +++ b/src/main/java/dev/kruhlmann/imgfloat/controller/ViewController.java @@ -36,6 +36,7 @@ public class ViewController { private final SystemAdministratorService systemAdministratorService; private final long uploadLimitBytes; private final boolean isStaging; + private final String docsUrl; public ViewController( ChannelDirectoryService channelDirectoryService, @@ -47,7 +48,8 @@ public class ViewController { GithubReleaseService githubReleaseService, SystemAdministratorService systemAdministratorService, long uploadLimitBytes, - @Value("${IMGFLOAT_IS_STAGING:0}") String isStagingFlag + @Value("${IMGFLOAT_IS_STAGING:0}") String isStagingFlag, + @Value("${IMGFLOAT_DOCS_URL:https://docs.imgflo.at}") String docsUrl ) { this.channelDirectoryService = channelDirectoryService; this.versionService = versionService; @@ -59,6 +61,7 @@ public class ViewController { this.systemAdministratorService = systemAdministratorService; this.uploadLimitBytes = uploadLimitBytes; this.isStaging = "1".equals(isStagingFlag); + this.docsUrl = docsUrl; } @org.springframework.web.bind.annotation.GetMapping("/") @@ -127,6 +130,7 @@ public class ViewController { } model.addAttribute("initialSysadmin", systemAdministratorService.getInitialSysadmin()); addStagingAttribute(model); + addDocsAttribute(model); return "settings"; } @@ -156,6 +160,7 @@ public class ViewController { throw new ResponseStatusException(INTERNAL_SERVER_ERROR, "Failed to serialize settings"); } addStagingAttribute(model); + addDocsAttribute(model); return "admin"; } @@ -196,9 +201,14 @@ public class ViewController { model.addAttribute("showCommitChip", gitInfoService.shouldShowCommitChip()); model.addAttribute("buildCommitShort", gitInfoService.getShortCommitSha()); model.addAttribute("buildCommitUrl", gitInfoService.getCommitUrl()); + addDocsAttribute(model); } private void addStagingAttribute(Model model) { model.addAttribute("isStaging", isStaging); } + + private void addDocsAttribute(Model model) { + model.addAttribute("docsUrl", docsUrl); + } } diff --git a/src/main/resources/templates/admin.html b/src/main/resources/templates/admin.html index 3ca7293..14d8375 100644 --- a/src/main/resources/templates/admin.html +++ b/src/main/resources/templates/admin.html @@ -44,6 +44,7 @@ Back to dashboard + Docs Signed in as user + Docs
diff --git a/src/main/resources/templates/index.html b/src/main/resources/templates/index.html index fe2eb39..d64e324 100644 --- a/src/main/resources/templates/index.html +++ b/src/main/resources/templates/index.html @@ -45,6 +45,13 @@ Terms Privacy Cookies + Docs
License