portless 0.15.2 → 0.15.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +4 -2
- package/dist/{chunk-T7CGCIRO.js → chunk-JSJUKQRJ.js} +34 -7
- package/dist/cli.js +372 -283
- package/dist/index.d.ts +13 -1
- package/dist/index.js +3 -1
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -153,6 +153,18 @@ declare class RouteStore {
|
|
|
153
153
|
removeRoute(hostname: string, ownerPid?: number): void;
|
|
154
154
|
}
|
|
155
155
|
|
|
156
|
+
type UserHomeOptions = {
|
|
157
|
+
platform?: NodeJS.Platform;
|
|
158
|
+
env?: NodeJS.ProcessEnv;
|
|
159
|
+
homedir?: string;
|
|
160
|
+
passwdHome?: (username: string) => string | null;
|
|
161
|
+
};
|
|
162
|
+
/**
|
|
163
|
+
* Resolve the home directory that owns portless state. When sudo changes the
|
|
164
|
+
* effective user to root, retain the invoking user's home so elevated proxy
|
|
165
|
+
* processes and unprivileged app processes share the same route store.
|
|
166
|
+
*/
|
|
167
|
+
declare function resolveUserHome(options?: UserHomeOptions): string;
|
|
156
168
|
/**
|
|
157
169
|
* Open a TCP connection to a local app port, trying both loopback families
|
|
158
170
|
* instead of hardcoding IPv4. Uses Node's Happy Eyeballs implementation
|
|
@@ -232,4 +244,4 @@ declare function getManagedHostnames(): string[];
|
|
|
232
244
|
*/
|
|
233
245
|
declare function checkHostResolution(hostname: string): Promise<boolean>;
|
|
234
246
|
|
|
235
|
-
export { DIR_MODE, FILE_MODE, PORTLESS_HEADER, type ProxyServer, type ProxyServerOptions, RouteConflictError, type RouteInfo, type RouteMapping, RouteStore, buildBlock, checkHostResolution, cleanHostsFile, createHttpRedirectServer, createLoopbackConnection, createProxyServer, escapeHtml, extractManagedBlock, fixOwnership, formatUrl, getManagedHostnames, isErrnoException, isProcessAlive, parseHostname, parseHostnames, removeBlock, shouldAutoSyncHosts, syncHostsFile };
|
|
247
|
+
export { DIR_MODE, FILE_MODE, PORTLESS_HEADER, type ProxyServer, type ProxyServerOptions, RouteConflictError, type RouteInfo, type RouteMapping, RouteStore, buildBlock, checkHostResolution, cleanHostsFile, createHttpRedirectServer, createLoopbackConnection, createProxyServer, escapeHtml, extractManagedBlock, fixOwnership, formatUrl, getManagedHostnames, isErrnoException, isProcessAlive, parseHostname, parseHostnames, removeBlock, resolveUserHome, shouldAutoSyncHosts, syncHostsFile };
|
package/dist/index.js
CHANGED
|
@@ -20,9 +20,10 @@ import {
|
|
|
20
20
|
parseHostname,
|
|
21
21
|
parseHostnames,
|
|
22
22
|
removeBlock,
|
|
23
|
+
resolveUserHome,
|
|
23
24
|
shouldAutoSyncHosts,
|
|
24
25
|
syncHostsFile
|
|
25
|
-
} from "./chunk-
|
|
26
|
+
} from "./chunk-JSJUKQRJ.js";
|
|
26
27
|
export {
|
|
27
28
|
DIR_MODE,
|
|
28
29
|
FILE_MODE,
|
|
@@ -45,6 +46,7 @@ export {
|
|
|
45
46
|
parseHostname,
|
|
46
47
|
parseHostnames,
|
|
47
48
|
removeBlock,
|
|
49
|
+
resolveUserHome,
|
|
48
50
|
shouldAutoSyncHosts,
|
|
49
51
|
syncHostsFile
|
|
50
52
|
};
|