@jamiexiongr/panda 0.1.4 → 0.1.5

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.
Files changed (2) hide show
  1. package/dist/cli.mjs +48 -2
  2. package/package.json +3 -3
package/dist/cli.mjs CHANGED
@@ -4,7 +4,7 @@ var printUsage = () => {
4
4
 
5
5
  Commands:
6
6
  agent [tailscareserv] [--hub-url=<url>] Start the Panda agent service
7
- hub [tailscareserv] Start the Panda hub service with the bundled web UI
7
+ hub [tailscareserv|tailscareserv-pub] Start the Panda hub service with the bundled web UI
8
8
  help Show this message`);
9
9
  };
10
10
  var resolveCliOptionValue = (argv, aliases) => {
@@ -43,10 +43,56 @@ var resolveTailscaleServeArg = (argv) => {
43
43
  }
44
44
  return false;
45
45
  };
46
+ var resolveHubPublicationMode = (argv) => {
47
+ for (const arg of argv) {
48
+ const normalized = arg.trim().toLowerCase();
49
+ if ([
50
+ "tailscareserv-pub",
51
+ "--tailscareserv-pub",
52
+ "tailscale-serve-pub",
53
+ "--tailscale-serve-pub",
54
+ "tailscalefunnel",
55
+ "--tailscalefunnel",
56
+ "tailscale-funnel",
57
+ "--tailscale-funnel"
58
+ ].includes(normalized)) {
59
+ return "funnel";
60
+ }
61
+ if (["tailscareserv", "--tailscareserv", "tailscale-serve", "--tailscale-serve"].includes(
62
+ normalized
63
+ )) {
64
+ return "serve";
65
+ }
66
+ if ([
67
+ "no-tailscareserv",
68
+ "--no-tailscareserv",
69
+ "no-tailscale-serve",
70
+ "--no-tailscale-serve",
71
+ "no-tailscareserv-pub",
72
+ "--no-tailscareserv-pub",
73
+ "no-tailscale-funnel",
74
+ "--no-tailscale-funnel"
75
+ ].includes(normalized)) {
76
+ return "disabled";
77
+ }
78
+ }
79
+ const envMode = process.env.PANDA_HUB_TAILSCALE_PUBLISH_MODE?.trim().toLowerCase();
80
+ if (envMode && ["funnel", "public", "pub"].includes(envMode)) {
81
+ return "funnel";
82
+ }
83
+ if (envMode && ["serve", "private", "tailnet"].includes(envMode)) {
84
+ return "serve";
85
+ }
86
+ if (envMode && ["disabled", "none", "off"].includes(envMode)) {
87
+ return "disabled";
88
+ }
89
+ return resolveTailscaleServeArg(argv) ? "serve" : "disabled";
90
+ };
46
91
  var main = async () => {
47
92
  const command = process.argv[2]?.trim().toLowerCase() ?? "help";
48
93
  const commandArgs = process.argv.slice(3);
49
94
  const tailscaleServe = resolveTailscaleServeArg(commandArgs);
95
+ const hubPublicationMode = resolveHubPublicationMode(commandArgs);
50
96
  if (command === "help" || command === "--help" || command === "-h") {
51
97
  printUsage();
52
98
  return;
@@ -70,7 +116,7 @@ var main = async () => {
70
116
  if (command === "hub") {
71
117
  const { startJamiexiongrHub } = await import("@jamiexiongr/panda-hub");
72
118
  await startJamiexiongrHub({
73
- tailscaleServe
119
+ tailscalePublicationMode: hubPublicationMode
74
120
  });
75
121
  return;
76
122
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@jamiexiongr/panda",
3
- "version": "0.1.4",
3
+ "version": "0.1.5",
4
4
  "type": "module",
5
5
  "private": false,
6
6
  "description": "Panda combined installer",
@@ -8,8 +8,8 @@
8
8
  "panda": "./bin/panda.cjs"
9
9
  },
10
10
  "dependencies": {
11
- "@jamiexiongr/panda-agent": "0.1.4",
12
- "@jamiexiongr/panda-hub": "0.1.4"
11
+ "@jamiexiongr/panda-agent": "0.1.5",
12
+ "@jamiexiongr/panda-hub": "0.1.5"
13
13
  },
14
14
  "files": [
15
15
  "bin",