- Add account, JWT session, revocation, cookie and bearer handling. - Protect server surfaces while preserving public health, manifest and disabled mode. - Add SQLite migration and focused server regression coverage.
33 lines
1.1 KiB
TypeScript
33 lines
1.1 KiB
TypeScript
import { Controller, Get, Header } from "@nestjs/common";
|
|
import { ConfigService } from "@nestjs/config";
|
|
import { ApiOkResponse, ApiOperation, ApiTags } from "@nestjs/swagger";
|
|
import { AppConfig } from "../config/app.config";
|
|
import { Public } from "../auth/public.decorator";
|
|
import { ManifestDto } from "./manifest.dto";
|
|
|
|
@ApiTags("manifest")
|
|
@Controller()
|
|
export class ManifestController {
|
|
constructor(private readonly config: ConfigService<AppConfig, true>) {}
|
|
|
|
@Get("manifest.json")
|
|
@Public()
|
|
// Clients cache the manifest themselves; the browser just revalidates it (ETag)
|
|
@Header("Cache-Control", "no-cache")
|
|
@ApiOperation({ summary: "Public client configuration and app version" })
|
|
@ApiOkResponse({ type: ManifestDto })
|
|
manifest(): ManifestDto {
|
|
return {
|
|
name: this.config.get("APP_NAME"),
|
|
version: this.config.get("APP_VERSION"),
|
|
auth: { enabled: this.config.get("AUTH_ENABLED") },
|
|
runLogs: {
|
|
dataLimits: {
|
|
bytes: this.config.get("RUN_LOG_DATA_COLLAPSE_BYTES"),
|
|
lines: this.config.get("RUN_LOG_DATA_COLLAPSE_LINES"),
|
|
},
|
|
},
|
|
};
|
|
}
|
|
}
|