Files
1Panel/frontend/src/api/interface/nginx.ts
T
Kadxy 37170ae81a fix(openresty): report brotli as pending when the http.d include can be added (#14285)
Installs that enabled ngx_brotli before v2.3.0 have no http.d include in
nginx.conf, because the include is only inserted when a module is toggled
or built. The settings page reported this as "cannot write the managed
configuration" and skipped the brotli save, so the save path that inserts
the include was never reached, even on a stock nginx.conf.

The settings response now tells the two cases apart with an in-memory
insertion check that writes nothing:

- include missing but insertable, or managed file missing: managedPending,
  the page explains the values take effect after saving and saves normally
- no safe insertion point: managedUnavailable, unchanged

The save path now inserts the include through ensureNginxHTTPIncludeActive,
the same function module activation uses, so both produce identical
results. A sentinel error keeps "no insertion point" mapped to
ErrBrotliUnsupported while I/O failures are still returned as-is.
2026-11-03 18:58:24 +08:00

99 lines
2.2 KiB
Go

export namespace Nginx {
export interface NginxScopeReq {
scope: string;
}
export interface NginxParam {
name: string;
params: string[];
}
export interface NginxBrotliRes {
params: NginxParam[];
managedExternally: boolean;
managedPending: boolean;
managedUnavailable: boolean;
}
export interface NginxConfigReq {
operate: string;
websiteId?: number;
scope: string;
params?: any;
}
export interface NginxStatus {
accepts: number;
handled: number;
active: number;
requests: number;
reading: number;
writing: number;
waiting: number;
}
export interface NginxFileUpdate {
content: string;
backup: boolean;
}
export interface NginxBuildReq {
taskID: string;
mirror: string;
modules?: string[];
force?: boolean;
}
export interface NginxModuleArtifact {
name: string;
path: string;
checksum: string;
}
export interface NginxModule {
name: string;
custom: boolean;
script?: string;
packages?: string;
enable: boolean;
params: string;
buildMode: 'dynamic' | 'static';
provider: 'local' | 'prebuilt';
loadOrder: number;
buildStatus: 'pending' | 'ready' | 'failed';
loadStatus: 'enabled' | 'disabled';
artifacts?: NginxModuleArtifact[];
lastError?: string;
}
export interface NginxBuildConfig {
mirror: string;
modules: NginxModule[];
dynamicSupported: boolean;
}
export interface NginxModuleUpdate {
operate: string;
name: string;
script?: string;
packages?: string;
enable?: boolean;
params?: string;
buildMode?: 'dynamic' | 'static';
provider?: 'local' | 'prebuilt';
loadOrder?: number;
}
export interface NginxHttpsStatus {
https: boolean;
sslRejectHandshake: boolean;
}
export interface NginxOperateReq {
operate: string;
}
export interface NginxHttpsOperateReq extends NginxOperateReq {
sslRejectHandshake: boolean;
}
}