This is an automated email from the ASF dual-hosted git repository.

maximebeauchemin pushed a commit to branch fire-alert
in repository https://gitbox.apache.org/repos/asf/superset.git

commit 9b387ba2daf95c7bc2d7c4be634fbed7717fdeb8
Author: Maxime Beauchemin <[email protected]>
AuthorDate: Mon Sep 8 22:11:50 2025 -0700

    Standardize webpack dev server host configuration and enable LAN access
    
    - Adds configurable devserverHost parameter with CLI and env var support
    - Supports WEBPACK_DEVSERVER_HOST and WEBPACK_DEVSERVER_PORT environment 
variables
    - Maintains CLI argument precedence: --devserverHost > 
WEBPACK_DEVSERVER_HOST > 127.0.0.1
    - Updates allowedHosts to support .local domains for LAN development
    - Removes docker-compose localhost binding restriction for external access
    - Follows 2025 framework standards: secure by default, easy opt-in for 
network access
    
    🤖 Generated with [Claude Code](https://claude.ai/code)
    
    Co-Authored-By: Claude <[email protected]>
---
 docker-compose-light.yml            |  5 ++++-
 superset-frontend/webpack.config.js | 10 +++++++++-
 2 files changed, 13 insertions(+), 2 deletions(-)

diff --git a/docker-compose-light.yml b/docker-compose-light.yml
index 1910699be4..b06be681af 100644
--- a/docker-compose-light.yml
+++ b/docker-compose-light.yml
@@ -162,8 +162,11 @@ services:
       SCARF_ANALYTICS: "${SCARF_ANALYTICS:-}"
       # configuring the dev-server to use the host.docker.internal to connect 
to the backend
       superset: "http://superset-light:8088";
+      # Webpack dev server configuration
+      WEBPACK_DEVSERVER_HOST: "${WEBPACK_DEVSERVER_HOST:-127.0.0.1}"
+      WEBPACK_DEVSERVER_PORT: "${WEBPACK_DEVSERVER_PORT:-9000}"
     ports:
-      - "127.0.0.1:${NODE_PORT:-9001}:9000"  # Parameterized port
+      - "${NODE_PORT:-9001}:9000"  # Parameterized port, accessible on all 
interfaces
     command: ["/app/docker/docker-frontend.sh"]
     env_file:
       - path: docker/.env # default
diff --git a/superset-frontend/webpack.config.js 
b/superset-frontend/webpack.config.js
index 94c0adf775..fb806e0cb6 100644
--- a/superset-frontend/webpack.config.js
+++ b/superset-frontend/webpack.config.js
@@ -51,11 +51,17 @@ const MINI_CSS_EXTRACT_PUBLICPATH = './';
 
 const {
   mode = 'development',
-  devserverPort = 9000,
+  devserverPort: cliPort,
+  devserverHost: cliHost,
   measure = false,
   nameChunks = false,
 } = parsedArgs;
 
+// Precedence: CLI args > env vars > defaults
+const devserverPort = cliPort || process.env.WEBPACK_DEVSERVER_PORT || 9000;
+const devserverHost =
+  cliHost || process.env.WEBPACK_DEVSERVER_HOST || '127.0.0.1';
+
 const isDevMode = mode !== 'production';
 const isDevServer = process.argv[1].includes('webpack-dev-server');
 
@@ -568,7 +574,9 @@ if (isDevMode) {
     },
     historyApiFallback: true,
     hot: true,
+    host: devserverHost,
     port: devserverPort,
+    allowedHosts: ['localhost', '.localhost', '127.0.0.1', '::1', '.local'],
     proxy: [() => proxyConfig],
     client: {
       overlay: {

Reply via email to