unplugin-https-reverse-proxy 1.0.0-beta.9 → 2.0.0
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 +17 -3
- package/dist/chunk-2P7SUCQ3.js +63 -0
- package/dist/{chunk-ZSHTX2B6.js → chunk-SO2FMQ2Q.js} +324 -135
- package/dist/esbuild.cjs +352 -160
- package/dist/esbuild.js +2 -2
- package/dist/index.cjs +352 -160
- package/dist/index.js +2 -2
- package/dist/nuxt.cjs +325 -142
- package/dist/nuxt.d.cts +1 -1
- package/dist/nuxt.d.ts +1 -1
- package/dist/nuxt.js +7 -7
- package/dist/rollup.cjs +352 -160
- package/dist/rollup.js +2 -2
- package/dist/rspack.cjs +352 -160
- package/dist/rspack.js +2 -2
- package/dist/types.cjs +1 -1
- package/dist/utils.cjs +26 -6
- package/dist/utils.d.cts +6 -4
- package/dist/utils.d.ts +6 -4
- package/dist/utils.js +5 -1
- package/dist/vite.cjs +352 -160
- package/dist/vite.d.cts +2 -1
- package/dist/vite.d.ts +2 -1
- package/dist/vite.js +2 -2
- package/dist/webpack.cjs +352 -160
- package/dist/webpack.js +2 -2
- package/package.json +38 -32
- package/scripts/postinstall.cjs +314 -0
- package/src/caddy/constants.ts +3 -2
- package/src/caddy/index.ts +254 -102
- package/src/caddy/utils.ts +24 -6
- package/src/host/index.ts +18 -23
- package/src/index.ts +68 -25
- package/src/nuxt.ts +10 -8
- package/src/utils.ts +33 -6
- package/dist/chunk-RUJE3YFB.js +0 -63
- package/scripts/postinstall.ts +0 -19
package/dist/rspack.js
CHANGED
package/dist/types.cjs
CHANGED
|
@@ -16,4 +16,4 @@ var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: tru
|
|
|
16
16
|
// src/types.ts
|
|
17
17
|
var types_exports = {};
|
|
18
18
|
module.exports = __toCommonJS(types_exports);
|
|
19
|
-
exports.default = module.exports;
|
|
19
|
+
module.exports = module.exports;exports.default = module.exports;
|
package/dist/utils.cjs
CHANGED
|
@@ -32,15 +32,20 @@ var utils_exports = {};
|
|
|
32
32
|
__export(utils_exports, {
|
|
33
33
|
chmodRecursive: () => chmodRecursive,
|
|
34
34
|
consola: () => consola,
|
|
35
|
+
generateQrcode: () => generateQrcode,
|
|
36
|
+
getIpv4List: () => getIpv4List,
|
|
35
37
|
isAdmin: () => isAdmin,
|
|
36
38
|
once: () => once
|
|
37
39
|
});
|
|
38
40
|
module.exports = __toCommonJS(utils_exports);
|
|
39
|
-
var import_node_process = __toESM(require("process"), 1);
|
|
40
|
-
var import_node_path = __toESM(require("path"), 1);
|
|
41
|
-
var import_promises = require("fs/promises");
|
|
42
41
|
var import_node_child_process = require("child_process");
|
|
42
|
+
var import_promises = require("fs/promises");
|
|
43
|
+
var import_node_os = require("os");
|
|
44
|
+
var import_node_path = __toESM(require("path"), 1);
|
|
45
|
+
var import_node_process = __toESM(require("process"), 1);
|
|
43
46
|
var import_consola = require("consola");
|
|
47
|
+
var import_picocolors = __toESM(require("picocolors"), 1);
|
|
48
|
+
var import_qrcode_terminal = __toESM(require("qrcode-terminal"), 1);
|
|
44
49
|
var consola = (0, import_consola.createConsola)({
|
|
45
50
|
level: 3
|
|
46
51
|
}).withTag("reverse-proxy");
|
|
@@ -66,18 +71,33 @@ function isAdmin() {
|
|
|
66
71
|
try {
|
|
67
72
|
(0, import_node_child_process.execSync)("net session", { stdio: "ignore" });
|
|
68
73
|
return true;
|
|
69
|
-
} catch
|
|
74
|
+
} catch {
|
|
70
75
|
return false;
|
|
71
76
|
}
|
|
72
77
|
} else {
|
|
73
|
-
return import_node_process.default.getuid && import_node_process.default.getuid() === 0;
|
|
78
|
+
return !!(import_node_process.default.getuid && import_node_process.default.getuid() === 0);
|
|
74
79
|
}
|
|
75
80
|
}
|
|
81
|
+
function getIpv4List() {
|
|
82
|
+
const interfaces = (0, import_node_os.networkInterfaces)();
|
|
83
|
+
return Object.values(interfaces).flatMap((nInterface) => nInterface ?? []).filter(
|
|
84
|
+
(detail) => detail.address && (detail.family === "IPv4" || detail.family === 4)
|
|
85
|
+
).filter((detail) => detail.family === "IPv4" && !detail.internal).map((detail) => detail.address);
|
|
86
|
+
}
|
|
87
|
+
async function generateQrcode(input) {
|
|
88
|
+
return new Promise((resolve) => {
|
|
89
|
+
import_qrcode_terminal.default.generate(input, { small: true }, (code) => {
|
|
90
|
+
resolve(code.split("\n").map((line) => import_picocolors.default.bgBlack(import_picocolors.default.white(line))).join("\n"));
|
|
91
|
+
});
|
|
92
|
+
});
|
|
93
|
+
}
|
|
76
94
|
// Annotate the CommonJS export names for ESM import in node:
|
|
77
95
|
0 && (module.exports = {
|
|
78
96
|
chmodRecursive,
|
|
79
97
|
consola,
|
|
98
|
+
generateQrcode,
|
|
99
|
+
getIpv4List,
|
|
80
100
|
isAdmin,
|
|
81
101
|
once
|
|
82
102
|
});
|
|
83
|
-
exports.default = module.exports;
|
|
103
|
+
module.exports = module.exports;exports.default = module.exports;
|
package/dist/utils.d.cts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _consola from 'consola';
|
|
2
2
|
|
|
3
|
-
declare const consola:
|
|
3
|
+
declare const consola: _consola.ConsolaInstance;
|
|
4
4
|
declare function chmodRecursive(_path: string, mode: number): Promise<void>;
|
|
5
5
|
declare function once<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => ReturnType<T>;
|
|
6
|
-
declare function isAdmin(): boolean
|
|
6
|
+
declare function isAdmin(): boolean;
|
|
7
|
+
declare function getIpv4List(): string[];
|
|
8
|
+
declare function generateQrcode(input: string): Promise<string>;
|
|
7
9
|
|
|
8
|
-
export { chmodRecursive, consola, isAdmin, once };
|
|
10
|
+
export { chmodRecursive, consola, generateQrcode, getIpv4List, isAdmin, once };
|
package/dist/utils.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
|
-
import * as
|
|
1
|
+
import * as _consola from 'consola';
|
|
2
2
|
|
|
3
|
-
declare const consola:
|
|
3
|
+
declare const consola: _consola.ConsolaInstance;
|
|
4
4
|
declare function chmodRecursive(_path: string, mode: number): Promise<void>;
|
|
5
5
|
declare function once<T extends (...args: any[]) => any>(fn: T): (...args: Parameters<T>) => ReturnType<T>;
|
|
6
|
-
declare function isAdmin(): boolean
|
|
6
|
+
declare function isAdmin(): boolean;
|
|
7
|
+
declare function getIpv4List(): string[];
|
|
8
|
+
declare function generateQrcode(input: string): Promise<string>;
|
|
7
9
|
|
|
8
|
-
export { chmodRecursive, consola, isAdmin, once };
|
|
10
|
+
export { chmodRecursive, consola, generateQrcode, getIpv4List, isAdmin, once };
|
package/dist/utils.js
CHANGED
|
@@ -1,12 +1,16 @@
|
|
|
1
1
|
import {
|
|
2
2
|
chmodRecursive,
|
|
3
3
|
consola,
|
|
4
|
+
generateQrcode,
|
|
5
|
+
getIpv4List,
|
|
4
6
|
isAdmin,
|
|
5
7
|
once
|
|
6
|
-
} from "./chunk-
|
|
8
|
+
} from "./chunk-2P7SUCQ3.js";
|
|
7
9
|
export {
|
|
8
10
|
chmodRecursive,
|
|
9
11
|
consola,
|
|
12
|
+
generateQrcode,
|
|
13
|
+
getIpv4List,
|
|
10
14
|
isAdmin,
|
|
11
15
|
once
|
|
12
16
|
};
|