Add docs link

This commit is contained in:
2026-01-23 17:03:47 +01:00
parent 6ee91c8b0c
commit 8c8cd0f42d
6 changed files with 23 additions and 1 deletions

View File

@@ -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) \

View File

@@ -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 |

View File

@@ -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);
}
}

View File

@@ -44,6 +44,7 @@
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
<span class="sr-only">Back to dashboard</span>
</a>
<a class="button ghost" th:href="${docsUrl}" target="_blank" rel="noreferrer">Docs</a>
<a
class="button ghost"
th:if="${#strings.equalsIgnoreCase(username, broadcaster)}"

View File

@@ -31,6 +31,7 @@
<span class="eyebrow subtle">Signed in as</span>
<span class="user-display" th:text="${username}">user</span>
</div>
<a class="ghost" th:href="${docsUrl}" target="_blank" rel="noreferrer">Docs</a>
<form class="user-logout" th:action="@{/logout}" method="post">
<button class="ghost" type="submit">Logout</button>
</form>

View File

@@ -45,6 +45,13 @@
<a class="version-badge version-link" href="/terms">Terms</a>
<a class="version-badge version-link" href="/privacy">Privacy</a>
<a class="version-badge version-link" href="/cookies">Cookies</a>
<a
class="version-badge version-link"
th:href="${docsUrl}"
rel="noreferrer"
target="_blank"
>Docs</a
>
</div>
<div class="build-chip">
<span class="muted">License</span>