mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Add docs link
This commit is contained in:
2
Makefile
2
Makefile
@@ -12,6 +12,7 @@ IMGFLOAT_ASSETS_PATH ?= ./assets
|
|||||||
IMGFLOAT_PREVIEWS_PATH ?= ./previews
|
IMGFLOAT_PREVIEWS_PATH ?= ./previews
|
||||||
IMGFLOAT_COMMIT_URL_PREFIX ?= https://github.com/imgfloat/server/commit/
|
IMGFLOAT_COMMIT_URL_PREFIX ?= https://github.com/imgfloat/server/commit/
|
||||||
IMGFLOAT_IS_STAGING ?= 0
|
IMGFLOAT_IS_STAGING ?= 0
|
||||||
|
IMGFLOAT_DOCS_URL ?= https://docs.imgflo.at
|
||||||
SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE ?= 10MB
|
SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE ?= 10MB
|
||||||
SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE ?= 10MB
|
SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE ?= 10MB
|
||||||
WATCHDIR = ./src/main
|
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_OWNER=$(IMGFLOAT_GITHUB_CLIENT_OWNER) \
|
||||||
IMGFLOAT_GITHUB_CLIENT_REPO=$(IMGFLOAT_GITHUB_CLIENT_REPO) \
|
IMGFLOAT_GITHUB_CLIENT_REPO=$(IMGFLOAT_GITHUB_CLIENT_REPO) \
|
||||||
IMGFLOAT_IS_STAGING=$(IMGFLOAT_IS_STAGING) \
|
IMGFLOAT_IS_STAGING=$(IMGFLOAT_IS_STAGING) \
|
||||||
|
IMGFLOAT_DOCS_URL=$(IMGFLOAT_DOCS_URL) \
|
||||||
IMGFLOAT_GITHUB_CLIENT_VERSION=$(IMGFLOAT_GITHUB_CLIENT_VERSION) \
|
IMGFLOAT_GITHUB_CLIENT_VERSION=$(IMGFLOAT_GITHUB_CLIENT_VERSION) \
|
||||||
IMGFLOAT_COMMIT_URL_PREFIX=$(IMGFLOAT_COMMIT_URL_PREFIX) \
|
IMGFLOAT_COMMIT_URL_PREFIX=$(IMGFLOAT_COMMIT_URL_PREFIX) \
|
||||||
IMGFLOAT_DB_PATH=$(IMGFLOAT_DB_PATH) \
|
IMGFLOAT_DB_PATH=$(IMGFLOAT_DB_PATH) \
|
||||||
|
|||||||
@@ -28,6 +28,7 @@ Optional:
|
|||||||
| Variable | Description | Example Value |
|
| 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_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_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_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 |
|
| `IMGFLOAT_SYSADMIN_CHANNEL_ACCESS_ENABLED` | Allow sysadmins to manage any channel without being listed as a channel admin | true |
|
||||||
|
|||||||
@@ -36,6 +36,7 @@ public class ViewController {
|
|||||||
private final SystemAdministratorService systemAdministratorService;
|
private final SystemAdministratorService systemAdministratorService;
|
||||||
private final long uploadLimitBytes;
|
private final long uploadLimitBytes;
|
||||||
private final boolean isStaging;
|
private final boolean isStaging;
|
||||||
|
private final String docsUrl;
|
||||||
|
|
||||||
public ViewController(
|
public ViewController(
|
||||||
ChannelDirectoryService channelDirectoryService,
|
ChannelDirectoryService channelDirectoryService,
|
||||||
@@ -47,7 +48,8 @@ public class ViewController {
|
|||||||
GithubReleaseService githubReleaseService,
|
GithubReleaseService githubReleaseService,
|
||||||
SystemAdministratorService systemAdministratorService,
|
SystemAdministratorService systemAdministratorService,
|
||||||
long uploadLimitBytes,
|
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.channelDirectoryService = channelDirectoryService;
|
||||||
this.versionService = versionService;
|
this.versionService = versionService;
|
||||||
@@ -59,6 +61,7 @@ public class ViewController {
|
|||||||
this.systemAdministratorService = systemAdministratorService;
|
this.systemAdministratorService = systemAdministratorService;
|
||||||
this.uploadLimitBytes = uploadLimitBytes;
|
this.uploadLimitBytes = uploadLimitBytes;
|
||||||
this.isStaging = "1".equals(isStagingFlag);
|
this.isStaging = "1".equals(isStagingFlag);
|
||||||
|
this.docsUrl = docsUrl;
|
||||||
}
|
}
|
||||||
|
|
||||||
@org.springframework.web.bind.annotation.GetMapping("/")
|
@org.springframework.web.bind.annotation.GetMapping("/")
|
||||||
@@ -127,6 +130,7 @@ public class ViewController {
|
|||||||
}
|
}
|
||||||
model.addAttribute("initialSysadmin", systemAdministratorService.getInitialSysadmin());
|
model.addAttribute("initialSysadmin", systemAdministratorService.getInitialSysadmin());
|
||||||
addStagingAttribute(model);
|
addStagingAttribute(model);
|
||||||
|
addDocsAttribute(model);
|
||||||
return "settings";
|
return "settings";
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -156,6 +160,7 @@ public class ViewController {
|
|||||||
throw new ResponseStatusException(INTERNAL_SERVER_ERROR, "Failed to serialize settings");
|
throw new ResponseStatusException(INTERNAL_SERVER_ERROR, "Failed to serialize settings");
|
||||||
}
|
}
|
||||||
addStagingAttribute(model);
|
addStagingAttribute(model);
|
||||||
|
addDocsAttribute(model);
|
||||||
|
|
||||||
return "admin";
|
return "admin";
|
||||||
}
|
}
|
||||||
@@ -196,9 +201,14 @@ public class ViewController {
|
|||||||
model.addAttribute("showCommitChip", gitInfoService.shouldShowCommitChip());
|
model.addAttribute("showCommitChip", gitInfoService.shouldShowCommitChip());
|
||||||
model.addAttribute("buildCommitShort", gitInfoService.getShortCommitSha());
|
model.addAttribute("buildCommitShort", gitInfoService.getShortCommitSha());
|
||||||
model.addAttribute("buildCommitUrl", gitInfoService.getCommitUrl());
|
model.addAttribute("buildCommitUrl", gitInfoService.getCommitUrl());
|
||||||
|
addDocsAttribute(model);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void addStagingAttribute(Model model) {
|
private void addStagingAttribute(Model model) {
|
||||||
model.addAttribute("isStaging", isStaging);
|
model.addAttribute("isStaging", isStaging);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void addDocsAttribute(Model model) {
|
||||||
|
model.addAttribute("docsUrl", docsUrl);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -44,6 +44,7 @@
|
|||||||
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
|
<i class="fa-solid fa-chevron-left" aria-hidden="true"></i>
|
||||||
<span class="sr-only">Back to dashboard</span>
|
<span class="sr-only">Back to dashboard</span>
|
||||||
</a>
|
</a>
|
||||||
|
<a class="button ghost" th:href="${docsUrl}" target="_blank" rel="noreferrer">Docs</a>
|
||||||
<a
|
<a
|
||||||
class="button ghost"
|
class="button ghost"
|
||||||
th:if="${#strings.equalsIgnoreCase(username, broadcaster)}"
|
th:if="${#strings.equalsIgnoreCase(username, broadcaster)}"
|
||||||
|
|||||||
@@ -31,6 +31,7 @@
|
|||||||
<span class="eyebrow subtle">Signed in as</span>
|
<span class="eyebrow subtle">Signed in as</span>
|
||||||
<span class="user-display" th:text="${username}">user</span>
|
<span class="user-display" th:text="${username}">user</span>
|
||||||
</div>
|
</div>
|
||||||
|
<a class="ghost" th:href="${docsUrl}" target="_blank" rel="noreferrer">Docs</a>
|
||||||
<form class="user-logout" th:action="@{/logout}" method="post">
|
<form class="user-logout" th:action="@{/logout}" method="post">
|
||||||
<button class="ghost" type="submit">Logout</button>
|
<button class="ghost" type="submit">Logout</button>
|
||||||
</form>
|
</form>
|
||||||
|
|||||||
@@ -45,6 +45,13 @@
|
|||||||
<a class="version-badge version-link" href="/terms">Terms</a>
|
<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="/privacy">Privacy</a>
|
||||||
<a class="version-badge version-link" href="/cookies">Cookies</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>
|
||||||
<div class="build-chip">
|
<div class="build-chip">
|
||||||
<span class="muted">License</span>
|
<span class="muted">License</span>
|
||||||
|
|||||||
Reference in New Issue
Block a user