export interface AppVersion { major: number; minor: number; revision: number; } export interface UserPermissions { id?: number; createdOn?: string; modifiedOn?: string; userId?: number; visibility: string; proxyHosts: string; redirectionHosts: string; deadHosts: string; streams: string; accessLists: string; certificates: string; } export interface User { id: number; createdOn: string; modifiedOn: string; isDisabled: boolean; email: string; name: string; nickname: string; avatar: string; roles: string[]; permissions?: UserPermissions; } export interface AuditLog { id: number; createdOn: string; modifiedOn: string; userId: number; objectType: string; objectId: number; action: string; meta: Record; // Expansions: user?: User; } export type LogSourceType = "system" | "letsencrypt" | "host"; export type LogHostType = "proxy" | "redirection" | "dead" | "stream"; // Which of the two files nginx writes per host - named "channel", not "stream", // to avoid confusion with the "stream" LogHostType (TCP/UDP stream hosts). export type LogChannel = "access" | "error"; export interface LogHostOption { id: number; label: string; } export interface LogSources { system: { label: string }; letsencrypt: { label: string }; hosts: Record; } export interface LogTail { lines: string[]; size: number; truncated: boolean; exists: boolean; } export interface AccessList { id?: number; createdOn?: string; modifiedOn?: string; ownerUserId: number; name: string; meta: Record; satisfyAny: boolean; passAuth: boolean; proxyHostCount?: number; // Expansions: owner?: User; items?: AccessListItem[]; clients?: AccessListClient[]; } export interface AccessListItem { id?: number; createdOn?: string; modifiedOn?: string; accessListId?: number; username: string; password: string; meta?: Record; hint?: string; } export type AccessListClient = { id?: number; createdOn?: string; modifiedOn?: string; accessListId?: number; address: string; directive: "allow" | "deny"; meta?: Record; }; export interface Certificate { id: number; createdOn: string; modifiedOn: string; ownerUserId: number; provider: string; niceName: string; domainNames: string[]; expiresOn: string; meta: Record; owner?: User; proxyHosts?: ProxyHost[]; deadHosts?: DeadHost[]; redirectionHosts?: RedirectionHost[]; } export interface ProxyLocation { path: string; advancedConfig: string; forwardScheme: string; forwardHost: string; forwardPort: number; accessListId?: number; accessList?: AccessList; } export interface ProxyHost { id: number; createdOn: string; modifiedOn: string; ownerUserId: number; domainNames: string[]; forwardScheme: string; forwardHost: string; forwardPort: number; accessListId: number; certificateId: number; sslForced: boolean; cachingEnabled: boolean; blockExploits: boolean; advancedConfig: string; meta: Record; allowWebsocketUpgrade: boolean; http2Support: boolean; enabled: boolean; locations?: ProxyLocation[]; hstsEnabled: boolean; hstsSubdomains: boolean; trustForwardedProto: boolean; // Expansions: owner?: User; accessList?: AccessList; certificate?: Certificate; } export interface DeadHost { id: number; createdOn: string; modifiedOn: string; ownerUserId: number; domainNames: string[]; certificateId: number; sslForced: boolean; advancedConfig: string; meta: Record; http2Support: boolean; enabled: boolean; hstsEnabled: boolean; hstsSubdomains: boolean; // Expansions: owner?: User; certificate?: Certificate; } export interface RedirectionHost { id: number; createdOn: string; modifiedOn: string; ownerUserId: number; domainNames: string[]; forwardDomainName: string; preservePath: boolean; certificateId: number; sslForced: boolean; blockExploits: boolean; advancedConfig: string; meta: Record; http2Support: boolean; forwardScheme: string; forwardHttpCode: number; enabled: boolean; hstsEnabled: boolean; hstsSubdomains: boolean; // Expansions: owner?: User; certificate?: Certificate; } export interface Stream { id: number; createdOn: string; modifiedOn: string; ownerUserId: number; incomingPort: number; forwardingHost: string; forwardingPort: number; tcpForwarding: boolean; udpForwarding: boolean; meta: Record; enabled: boolean; certificateId: number; // Expansions: owner?: User; certificate?: Certificate; } export interface Setting { id: string; name?: string; description?: string; value: string; meta?: Record; } export interface DNSProvider { id: string; name: string; credentials: string; }