@pixelbyte-software/pixcode 1.54.3 → 1.54.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.
package/dist/index.html CHANGED
@@ -35,7 +35,7 @@
35
35
 
36
36
  <!-- Prevent zoom on iOS -->
37
37
  <meta name="format-detection" content="telephone=no" />
38
- <script type="module" crossorigin src="/assets/index-CwwdokVl.js"></script>
38
+ <script type="module" crossorigin src="/assets/index-C8DB6Dud.js"></script>
39
39
  <link rel="modulepreload" crossorigin href="/assets/vendor-react-DB6V5Fl1.js">
40
40
  <link rel="modulepreload" crossorigin href="/assets/vendor-codemirror-CIYNS698.js">
41
41
  <link rel="modulepreload" crossorigin href="/assets/vendor-xterm-C7tpxJl7.js">
@@ -125,7 +125,7 @@ import networkRoutes from './routes/network.js';
125
125
  import telegramRoutes from './routes/telegram.js';
126
126
  import { restoreRequestedTunnel } from './services/external-access.js';
127
127
  import { notifyTelegramTerminalAttached, restoreBotFromConfig } from './services/telegram/bot.js';
128
- import { ensurePortOpen } from './utils/port-access.js';
128
+ import { ensurePortOpen, getLanIps } from './utils/port-access.js';
129
129
  import { applyAllStoredCredentialsToEnv, } from './services/provider-credentials.js';
130
130
  import { primeCliBinPath } from './services/install-jobs.js';
131
131
  import { startEnabledPluginServers, stopAllPlugins, getPluginPort } from './utils/plugin-process-manager.js';
@@ -5022,12 +5022,23 @@ async function startServer() {
5022
5022
  }
5023
5023
  server.listen(SERVER_PORT, HOST, async () => {
5024
5024
  const appInstallPath = APP_ROOT;
5025
+ // Detect LAN/public IP for VPS/cloud display
5026
+ const lanIps = getLanIps();
5027
+ const displayUrl = lanIps.length > 0
5028
+ ? `http://${lanIps[0]}:${SERVER_PORT}`
5029
+ : `http://${DISPLAY_HOST}:${SERVER_PORT}`;
5025
5030
  console.log('');
5026
5031
  console.log(c.dim('═'.repeat(63)));
5027
5032
  console.log(` ${c.bright('Pixcode Server - Ready')}`);
5028
5033
  console.log(c.dim('═'.repeat(63)));
5029
5034
  console.log('');
5030
- console.log(`${c.info('[INFO]')} Server URL: ${c.bright('http://' + DISPLAY_HOST + ':' + SERVER_PORT)}`);
5035
+ console.log(`${c.info('[INFO]')} Server URL: ${c.bright(displayUrl)}`);
5036
+ if (lanIps.length > 1) {
5037
+ for (const extra of lanIps.slice(1)) {
5038
+ console.log(`${c.dim(' also:')} http://${extra}:${SERVER_PORT}`);
5039
+ }
5040
+ }
5041
+ console.log(`${c.info('[INFO]')} Local URL: ${c.dim(`http://localhost:${SERVER_PORT}`)}`);
5031
5042
  console.log(`${c.info('[INFO]')} Installed at: ${c.dim(appInstallPath)}`);
5032
5043
  // Print LAN IP + open inbound firewall port (Linux auto, Windows/Mac
5033
5044
  // ask interactively once, then persist the decision). Non-fatal on
@@ -5041,39 +5052,9 @@ async function startServer() {
5041
5052
  restoreRequestedTunnel({ port: Number(SERVER_PORT) }).catch((err) => {
5042
5053
  console.warn('[external-access] tunnel restore failed:', err?.message || err);
5043
5054
  });
5044
- // Auto-open browser unless explicitly disabled or headless
5045
- if (process.env.PIXCODE_NO_BROWSER !== '1') {
5046
- const openUrl = `http://${DISPLAY_HOST}:${SERVER_PORT}`;
5047
- // Skip browser opening on headless servers (no DISPLAY on Linux,
5048
- // or xdg-open not installed) — common for VPS/cloud deployments.
5049
- const isHeadless = process.platform === 'linux' && (!process.env.DISPLAY || process.env.DISPLAY === '' ||
5050
- !fs.existsSync('/usr/bin/xdg-open') && !fs.existsSync('/usr/local/bin/xdg-open'));
5051
- if (isHeadless) {
5052
- console.log(`${c.tip('[TIP]')} Open ${c.bright(openUrl)} in your browser to start using Pixcode.`);
5053
- }
5054
- else {
5055
- try {
5056
- const { spawn: spawnBrowser } = await import('node:child_process');
5057
- const browserBin = process.platform === 'darwin' ? 'open'
5058
- : process.platform === 'win32' ? 'cmd'
5059
- : 'xdg-open';
5060
- const browserArgs = process.platform === 'win32'
5061
- ? ['/c', 'start', '', openUrl]
5062
- : [openUrl];
5063
- const child = spawnBrowser(browserBin, browserArgs, {
5064
- stdio: 'ignore', timeout: 3000, detached: true, shell: false,
5065
- });
5066
- child.on('error', () => {
5067
- // Browser binary not found or failed — non-fatal
5068
- });
5069
- child.unref();
5070
- console.log(`${c.ok('[OK]')} Opening browser at ${c.bright(openUrl)}`);
5071
- }
5072
- catch {
5073
- console.log(`${c.tip('[TIP]')} Open ${c.bright(openUrl)} in your browser to start using Pixcode.`);
5074
- }
5075
- }
5076
- }
5055
+ // No auto browser opening headless servers don't have browsers
5056
+ // and desktop users can click the URL. This prevents xdg-open
5057
+ // ENOENT crashes on VPS/cloud deployments.
5077
5058
  console.log(`${c.tip('[TIP]')} Run "pixcode status" for full configuration details`);
5078
5059
  console.log('');
5079
5060
  // Start watching the projects folder for changes