You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@superset.apache.org by "bschreder (via GitHub)" <gi...@apache.org> on 2026/03/07 21:14:34 UTC

[PR] fix(docker-compose-light): revert/light-compose and fix init scripts (examples & cy… [superset]

bschreder opened a new pull request, #38492:
URL: https://github.com/apache/superset/pull/38492

   …press init)
   
   - restore expected EXAMPLES env usage in docker-compose-light.yml
   - ensure psql uses -d "" in cypress-init.sh and examples-init.sh
   
   <!---
   Please write the PR title following the conventions at https://www.conventionalcommits.org/en/v1.0.0/
   Example:
   fix(dashboard): load charts correctly
   -->
   
   ### SUMMARY
   <!--- Describe the change below, including rationale and design decisions -->
   
   ### BEFORE/AFTER SCREENSHOTS OR ANIMATED GIF
   <!--- Skip this if not applicable -->
   
   ### TESTING INSTRUCTIONS
   <!--- Required! What steps can be taken to manually verify the changes? -->
   
   ### ADDITIONAL INFORMATION
   <!--- Check any relevant boxes with "x" -->
   <!--- HINT: Include "Fixes #nnn" if you are fixing an existing issue -->
   - [ ] Has associated issue:
   - [ ] Required feature flags:
   - [ ] Changes UI
   - [ ] Includes DB Migration (follow approval process in [SIP-59](https://github.com/apache/superset/issues/13351))
     - [ ] Migration is atomic, supports rollback & is backwards-compatible
     - [ ] Confirm DB migration upgrade and downgrade tested
     - [ ] Runtime estimates and downtime expectations provided
   - [ ] Introduces new feature or API
   - [ ] Removes existing feature or API
   
   Fixes #38491 
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(docker-compose-light): revert/light-compose and fix init scripts (examples & cy… [superset]

Posted by "bito-code-review[bot] (via GitHub)" <gi...@apache.org>.
bito-code-review[bot] commented on PR #38492:
URL: https://github.com/apache/superset/pull/38492#issuecomment-4017386587

   AI Code Review is in progress (usually takes 3 to 15 minutes unless it's a very large PR).


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(docker-compose-light): revert/light-compose and fix init scripts (examples & cy… [superset]

Posted by "Copilot (via GitHub)" <gi...@apache.org>.
Copilot commented on code in PR #38492:
URL: https://github.com/apache/superset/pull/38492#discussion_r2900570193


##########
docker-compose-light.yml:
##########
@@ -87,6 +87,8 @@ services:
         required: false
     image: postgres:17
     restart: unless-stopped
+    ports:
+      - "${DATABASE_PORT:-5432}:5432"  # Parameterized port, accessible on all interfaces

Review Comment:
   Publishing the DB port using `${DATABASE_PORT}` is potentially misleading here because `DATABASE_PORT` is also used by Superset to build its in-network SQLAlchemy URI (where `db-light` is still reachable on container port 5432 regardless of the published host port). If someone changes `DATABASE_PORT` to avoid a host port collision, Superset will likely try connecting to `db-light:${DATABASE_PORT}` and fail. Consider using a separate variable for the published host port (or hardcoding `:5432` for container-to-container traffic and only parameterizing the host side).
   ```suggestion
         - "${HOST_DATABASE_PORT:-5432}:5432"  # Host-published port; container always listens on 5432
   ```



##########
docker-compose-light.yml:
##########
@@ -87,6 +87,8 @@ services:
         required: false
     image: postgres:17
     restart: unless-stopped
+    ports:
+      - "${DATABASE_PORT:-5432}:5432"  # Parameterized port, accessible on all interfaces

Review Comment:
   `db-light` now publishes Postgres on all interfaces (no `127.0.0.1` bind). This is inconsistent with `docker-compose.yml` (which binds `127.0.0.1:${DATABASE_PORT:-5432}:5432`) and can unintentionally expose the database when running on a shared/remote host. Consider binding to localhost (or making the bind address configurable) to keep the default safer.
   ```suggestion
         - "${DATABASE_BIND_ADDRESS:-127.0.0.1}:${DATABASE_PORT:-5432}:5432"  # Bind Postgres to localhost by default
   ```



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(docker-compose-light): revert/light-compose and fix init scripts (examples & cy… [superset]

Posted by "codeant-ai-for-open-source[bot] (via GitHub)" <gi...@apache.org>.
codeant-ai-for-open-source[bot] commented on code in PR #38492:
URL: https://github.com/apache/superset/pull/38492#discussion_r2900567013


##########
docker/docker-entrypoint-initdb.d/examples-init.sh:
##########
@@ -23,7 +23,7 @@
 # ------------------------------------------------------------------------
 set -e
 
-psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER}" <<-EOSQL
+psql -v ON_ERROR_STOP=1 --username "${POSTGRES_USER}" -d "${POSTGRES_DB}" <<-EOSQL

Review Comment:
   **Suggestion:** Environment variables for database user, password, and name are interpolated directly into SQL without proper quoting/escaping, so if they contain quotes or special characters the SQL will break or could be leveraged for SQL injection; instead, escape dangerous characters in the shell and use quoted identifiers/strings in the SQL. [security]
   
   <details>
   <summary><b>Severity Level:</b> Major ⚠️</summary>
   
   ```mdx
   - ❌ Examples database initialization fails with quoted EXAMPLES_* values.
   - ⚠️ Docker-compose-light demo may start without examples database.
   - ⚠️ SQL injection risk if environment variables externally controlled.
   ```
   </details>
   
   



-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org


Re: [PR] fix(docker-compose-light): revert/light-compose and fix init scripts (examples & cy… [superset]

Posted by "bschreder (via GitHub)" <gi...@apache.org>.
bschreder closed pull request #38492: fix(docker-compose-light): revert/light-compose and fix init scripts (examples & cy…
URL: https://github.com/apache/superset/pull/38492


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org


---------------------------------------------------------------------
To unsubscribe, e-mail: notifications-unsubscribe@superset.apache.org
For additional commands, e-mail: notifications-help@superset.apache.org