mirror of
https://github.com/imgfloat/server.git
synced 2026-02-05 03:39:26 +00:00
Add missing references
This commit is contained in:
@@ -14,6 +14,8 @@ Define the following required environment variables:
|
|||||||
| `IMGFLOAT_PREVIEWS_PATH` | Filesystem path to store generated image previews | /var/imgfloat/previews |
|
| `IMGFLOAT_PREVIEWS_PATH` | Filesystem path to store generated image previews | /var/imgfloat/previews |
|
||||||
| `IMGFLOAT_DB_PATH` | Filesystem path to the SQLite database file | /var/imgfloat/imgfloat.db |
|
| `IMGFLOAT_DB_PATH` | Filesystem path to the SQLite database file | /var/imgfloat/imgfloat.db |
|
||||||
| `IMGFLOAT_INITIAL_TWITCH_USERNAME_SYSADMIN` | Twitch username of the initial sysadmin user | example_broadcaster |
|
| `IMGFLOAT_INITIAL_TWITCH_USERNAME_SYSADMIN` | Twitch username of the initial sysadmin user | example_broadcaster |
|
||||||
|
| `IMGFLOAT_GITHUB_OWNER` | Github user or org which has the client repository | Kruhlmann |
|
||||||
|
| `IMGFLOAT_GITHUB_REPO` | Client repository name | imgfloat-j |
|
||||||
| `SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE` | Maximum upload file size | 10MB |
|
| `SPRING_SERVLET_MULTIPART_MAX_FILE_SIZE` | Maximum upload file size | 10MB |
|
||||||
| `SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE` | Maximum upload request size | 10MB |
|
| `SPRING_SERVLET_MULTIPART_MAX_REQUEST_SIZE` | Maximum upload request size | 10MB |
|
||||||
| `IMGFLOAT_GITHUB_OWNER` | GitHub owner used to build desktop download links | Kruhlmann |
|
| `IMGFLOAT_GITHUB_OWNER` | GitHub owner used to build desktop download links | Kruhlmann |
|
||||||
@@ -34,5 +36,7 @@ If you want to use the default development setup your `.env` file should look li
|
|||||||
```sh
|
```sh
|
||||||
TWITCH_CLIENT_ID=...
|
TWITCH_CLIENT_ID=...
|
||||||
TWITCH_CLIENT_SECRET=...
|
TWITCH_CLIENT_SECRET=...
|
||||||
|
IMGFLOAT_GITHUB_OWNER=...
|
||||||
|
IMGFLOAT_GITHUB_REPO=...
|
||||||
IMGFLOAT_INITIAL_TWITCH_USERNAME_SYSADMIN=...
|
IMGFLOAT_INITIAL_TWITCH_USERNAME_SYSADMIN=...
|
||||||
```
|
```
|
||||||
|
|||||||
@@ -2,6 +2,7 @@ package dev.kruhlmann.imgfloat.service;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
import java.io.FileNotFoundException;
|
||||||
import java.nio.charset.StandardCharsets;
|
import java.nio.charset.StandardCharsets;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Path;
|
import java.nio.file.Path;
|
||||||
@@ -22,7 +23,7 @@ public class VersionService {
|
|||||||
private final String clientVersion;
|
private final String clientVersion;
|
||||||
private final String releaseVersion;
|
private final String releaseVersion;
|
||||||
|
|
||||||
public VersionService() {
|
public VersionService() throws IOException {
|
||||||
this.serverVersion = resolveServerVersion();
|
this.serverVersion = resolveServerVersion();
|
||||||
this.clientVersion = resolveClientVersion();
|
this.clientVersion = resolveClientVersion();
|
||||||
this.releaseVersion = normalizeReleaseVersion(this.clientVersion);
|
this.releaseVersion = normalizeReleaseVersion(this.clientVersion);
|
||||||
@@ -61,14 +62,6 @@ public class VersionService {
|
|||||||
return "unknown";
|
return "unknown";
|
||||||
}
|
}
|
||||||
|
|
||||||
private String resolveClientVersion() {
|
|
||||||
try {
|
|
||||||
return getPackageJsonVersion();
|
|
||||||
} catch (IOException e) {
|
|
||||||
throw new IllegalStateException("Client manifest is missing", e);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
private String normalizeReleaseVersion(String baseVersion) throws IllegalStateException {
|
private String normalizeReleaseVersion(String baseVersion) throws IllegalStateException {
|
||||||
String normalized = baseVersion.trim();
|
String normalized = baseVersion.trim();
|
||||||
normalized = normalized.replaceFirst("(?i)^v", "");
|
normalized = normalized.replaceFirst("(?i)^v", "");
|
||||||
@@ -154,10 +147,10 @@ public class VersionService {
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
private String getPackageJsonVersion() throws IOException {
|
private String resolveClientVersion() throws IOException {
|
||||||
Path packageJsonPath = Paths.get("package.json");
|
Path packageJsonPath = Paths.get("package.json");
|
||||||
if (!Files.exists(packageJsonPath) || !Files.isRegularFile(packageJsonPath)) {
|
if (!Files.exists(packageJsonPath) || !Files.isRegularFile(packageJsonPath)) {
|
||||||
return null;
|
throw new FileNotFoundException("package.json not found at " + packageJsonPath.toAbsolutePath());
|
||||||
}
|
}
|
||||||
|
|
||||||
String packageJson = Files.readString(packageJsonPath, StandardCharsets.UTF_8);
|
String packageJson = Files.readString(packageJsonPath, StandardCharsets.UTF_8);
|
||||||
@@ -169,6 +162,6 @@ public class VersionService {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return null;
|
throw new IllegalStateException("Version not found or invalid in package.json");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -10,7 +10,7 @@
|
|||||||
<div class="channels-shell">
|
<div class="channels-shell">
|
||||||
<header class="channels-header">
|
<header class="channels-header">
|
||||||
<div class="brand">
|
<div class="brand">
|
||||||
<div class="brand-mark">IF</div>
|
<img class="brand-mark" alt="brand" src="/img/brand.png" />
|
||||||
<div>
|
<div>
|
||||||
<div class="brand-title">Imgfloat</div>
|
<div class="brand-title">Imgfloat</div>
|
||||||
<div class="brand-subtitle">Twitch overlay manager</div>
|
<div class="brand-subtitle">Twitch overlay manager</div>
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
<div class="settings-shell">
|
<div class="settings-shell">
|
||||||
<header class="settings-header">
|
<header class="settings-header">
|
||||||
<div class="brand">
|
<div class="brand">
|
||||||
<div class="brand-mark">IF</div>
|
<img class="brand-mark" alt="brand" src="/img/brand.png" />
|
||||||
<div>
|
<div>
|
||||||
<div class="brand-title">Imgfloat</div>
|
<div class="brand-title">Imgfloat</div>
|
||||||
<div class="brand-subtitle">Twitch overlay manager</div>
|
<div class="brand-subtitle">Twitch overlay manager</div>
|
||||||
|
|||||||
Reference in New Issue
Block a user