mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-02 15:33:32 +00:00
Certificates Renewal + SSE
- Certificate renewal is just a re-request as it's forced already - Rejig the routes for readability - Added Server Side Events so that the UI would invalidate the cache when changes happen on the backend, such as certs being provided or failing - Added a SSE Token, which has the same shelf life as normal token but can't be used interchangeably. The reason for this is, the SSE endpoint needs a token for auth as a Query param, so it would be stored in log files. If someone where to get a hold of that, it's pretty useless as it can't be used to change anything, only to listen for events until it expires - Added test endpoint for SSE testing only availabe in debug mode
This commit is contained in:
14
frontend/src/api/npm/getSSEToken.ts
Normal file
14
frontend/src/api/npm/getSSEToken.ts
Normal file
@@ -0,0 +1,14 @@
|
||||
import * as api from "./base";
|
||||
import { TokenResponse } from "./responseTypes";
|
||||
|
||||
export async function getSSEToken(
|
||||
abortController?: AbortController,
|
||||
): Promise<TokenResponse> {
|
||||
const { result } = await api.post(
|
||||
{
|
||||
url: "/tokens/sse",
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
return result;
|
||||
}
|
@@ -14,6 +14,7 @@ export * from "./getHealth";
|
||||
export * from "./getHosts";
|
||||
export * from "./getNginxTemplates";
|
||||
export * from "./getSettings";
|
||||
export * from "./getSSEToken";
|
||||
export * from "./getToken";
|
||||
export * from "./getUpstreamNginxConfig";
|
||||
export * from "./getUpstreams";
|
||||
@@ -22,6 +23,7 @@ export * from "./getUsers";
|
||||
export * from "./helpers";
|
||||
export * from "./models";
|
||||
export * from "./refreshToken";
|
||||
export * from "./renewCertificate";
|
||||
export * from "./responseTypes";
|
||||
export * from "./setAuth";
|
||||
export * from "./setCertificate";
|
||||
|
@@ -165,3 +165,10 @@ export interface Upstream {
|
||||
advancedConfig: string;
|
||||
isDisabled: boolean;
|
||||
}
|
||||
|
||||
export interface SSEMessage {
|
||||
lang?: string;
|
||||
langParams?: string;
|
||||
type?: "info" | "warning" | "success" | "error" | "loading";
|
||||
affects?: string | string[];
|
||||
}
|
||||
|
15
frontend/src/api/npm/renewCertificate.ts
Normal file
15
frontend/src/api/npm/renewCertificate.ts
Normal file
@@ -0,0 +1,15 @@
|
||||
import * as api from "./base";
|
||||
import { Certificate } from "./models";
|
||||
|
||||
export async function renewCertificate(
|
||||
id: number,
|
||||
abortController?: AbortController,
|
||||
): Promise<Certificate> {
|
||||
const { result } = await api.post(
|
||||
{
|
||||
url: `/certificates/${id}/renew`,
|
||||
},
|
||||
abortController,
|
||||
);
|
||||
return result;
|
||||
}
|
Reference in New Issue
Block a user