Skip to content

Docker: Add browser selection to Fluxbox menu and lightweight terminal#3085

Merged
VietND96 merged 1 commit intotrunkfrom
fluxbox-menu
Feb 22, 2026
Merged

Docker: Add browser selection to Fluxbox menu and lightweight terminal#3085
VietND96 merged 1 commit intotrunkfrom
fluxbox-menu

Conversation

@VietND96
Copy link
Member

@VietND96 VietND96 commented Feb 22, 2026

User description

Thanks for contributing to the Docker-Selenium project!
A PR well described will help maintainers to quickly review and merge it

Before submitting your PR, please check our contributing guidelines, applied for this repository.
Avoid large PRs, help reviewers by making them as simple and short as possible.

Description

Fixes #3075
Fixes #3056
Add back browser selection to the Fluxbox menu
image

Also adding Xterm, a lightweight terminal that can open in Fluxbox during live preview or VNC access.
image

image

Motivation and Context

Types of changes

  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to change)

Checklist

  • I have read the contributing document.
  • My change requires a change to the documentation.
  • I have updated the documentation accordingly.
  • I have added tests to cover my changes.
  • All new and existing tests passed.

PR Type

Enhancement


Description

  • Add xterm lightweight terminal to base Docker image

  • Restore browser selection menu to Fluxbox desktop environment

  • Create architecture-specific Fluxbox menu configurations

  • Include browser-specific menu files for each node type


Diagram Walkthrough

flowchart LR
  Base["Base Dockerfile<br/>+ xterm package"]
  NodeBase["NodeBase Dockerfile<br/>+ fluxbox-menu config"]
  NodeChrome["NodeChrome<br/>+ browser menu"]
  NodeChromium["NodeChromium<br/>+ browser menu"]
  NodeEdge["NodeEdge<br/>+ browser menu"]
  NodeFirefox["NodeFirefox<br/>+ browser menu"]
  NodeAllBrowsers["NodeAllBrowsers<br/>+ arch-specific menus"]
  
  Base --> NodeBase
  NodeBase --> NodeChrome
  NodeBase --> NodeChromium
  NodeBase --> NodeEdge
  NodeBase --> NodeFirefox
  NodeBase --> NodeAllBrowsers
Loading

File Walkthrough

Relevant files
Dependencies
1 files
Dockerfile
Add xterm terminal package to base image                                 
+1/-0     
Configuration changes
6 files
Dockerfile
Copy Fluxbox menu configuration file                                         
+1/-0     
Dockerfile
Copy Chrome-specific browser menu                                               
+1/-0     
Dockerfile
Copy Chromium-specific browser menu                                           
+1/-0     
Dockerfile
Copy Microsoft Edge browser menu                                                 
+1/-0     
Dockerfile
Copy Firefox-specific browser menu                                             
+1/-0     
Dockerfile
Copy architecture-specific multi-browser menus                     
+9/-0     
Enhancement
7 files
fluxbox-menu
Create main Fluxbox menu with applications                             
+49/-0   
fluxbox-menu-browser
Define Google Chrome menu entry                                                   
+3/-0     
fluxbox-menu-browser
Define Chromium menu entry                                                             
+3/-0     
fluxbox-menu-browser
Define Microsoft Edge menu entry                                                 
+3/-0     
fluxbox-menu-browser
Define Mozilla Firefox menu entry                                               
+3/-0     
fluxbox-menu-browser-amd64
Define multi-browser menu for amd64 architecture                 
+6/-0     
fluxbox-menu-browser-aarch64
Define multi-browser menu for aarch64 architecture             
+4/-0     

@qodo-code-review
Copy link
Contributor

PR Compliance Guide 🔍

Below is a summary of compliance checks for this PR:

Security Compliance
Remote shell access

Description: Adding xterm launchers to the Fluxbox menu (e.g., Terminal and shells) enables interactive
shell access via VNC/noVNC, which can be an exploitable remote entry point if VNC/noVNC is
exposed without strong authentication/network restrictions. fluxbox-menu [16-19]

Referred Code
[exec] (Terminal) { xterm} <>
[exec] (Bash) { x-terminal-emulator -T "Bash" -e /bin/bash --login} <>
[exec] (Dash) { x-terminal-emulator -T "Dash" -e /bin/dash -i} <>
[exec] (Sh) { x-terminal-emulator -T "Sh" -e /bin/sh --login} <>
Ticket Compliance
🟡
🎫 #3056
Restore the ability to manually open a visible Chrome browser session via noVNC/VNC when
using selenium/node-chrome:142 (behavior parity with selenium/node-chrome:134).
Codebase Duplication Compliance
Codebase context is not defined

Follow the guide to enable codebase context checks.

Custom Compliance
🟢
Generic: Comprehensive Audit Trails

Objective: To create a detailed and reliable record of critical system actions for security analysis
and compliance.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Meaningful Naming and Self-Documenting Code

Objective: Ensure all identifiers clearly express their purpose and intent, making code
self-documenting

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Error Handling

Objective: To prevent the leakage of sensitive system information through error messages while
providing sufficient detail for internal debugging.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Secure Logging Practices

Objective: To ensure logs are useful for debugging and auditing without exposing sensitive
information like PII, PHI, or cardholder data.

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Security-First Input Validation and Data Handling

Objective: Ensure all data inputs are validated, sanitized, and handled securely to prevent
vulnerabilities

Status: Passed

Learn more about managing compliance generic rules or creating your own custom rules

Generic: Robust Error Handling and Edge Case Management

Objective: Ensure comprehensive error handling that provides meaningful context and graceful
degradation

Status:
Arch mapping edge case: The ARCH mapping in the RUN step may select a value without a corresponding
fluxbox-menu-browser-${ARCH} file (e.g., non-amd64/arm64 architectures), causing an
unhandled build-time failure without an explicit, actionable error message.

Referred Code
RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64"; else echo "$(dpkg --print-architecture)"; fi) \
    && mv /etc/X11/fluxbox/fluxbox-menu-browser-${ARCH} /etc/X11/fluxbox/fluxbox-menu-browser

Learn more about managing compliance generic rules or creating your own custom rules

Compliance status legend 🟢 - Fully Compliant
🟡 - Partial Compliant
🔴 - Not Compliant
⚪ - Requires Further Human Verification
🏷️ - Compliance label

@VietND96 VietND96 changed the title Docker: Add browser to Fluxbox menu and lightweight terminal Docker: Add browser selection to Fluxbox menu and lightweight terminal Feb 22, 2026
@qodo-code-review
Copy link
Contributor

PR Code Suggestions ✨

Explore these optional code suggestions:

CategorySuggestion                                                                                                                                    Impact
General
use full path for terminal

In the fluxbox-menu, change the xterm command from { xterm} to the absolute path
{/usr/bin/xterm} for better consistency and reliability.

NodeBase/fluxbox-menu [16]

-[exec] (Terminal) { xterm} <>
+[exec] (Terminal) {/usr/bin/xterm} <>
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why: The suggestion correctly points out that using an absolute path for the xterm executable is more robust and consistent, and it also removes a leading space which is good practice.

Low
remove unused arch menu files

Remove all original architecture-specific menu files after renaming the correct
one to keep the Docker image lean.

NodeAllBrowsers/Dockerfile [12-13]

 RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64"; else echo "$(dpkg --print-architecture)"; fi) \
-    && mv /etc/X11/fluxbox/fluxbox-menu-browser-${ARCH} /etc/X11/fluxbox/fluxbox-menu-browser
+    && mv /etc/X11/fluxbox/fluxbox-menu-browser-${ARCH} /etc/X11/fluxbox/fluxbox-menu-browser \
+    && rm -f /etc/X11/fluxbox/fluxbox-menu-browser-*
  • Apply / Chat
Suggestion importance[1-10]: 5

__

Why: This suggestion correctly identifies that unused files should be removed to optimize the Docker image size, and it provides a more concise and robust solution than the other overlapping suggestion.

Low
Remove unused files after selection

After renaming the architecture-specific menu file, remove the original amd64
and aarch64 files to reduce Docker image size.

NodeAllBrowsers/Dockerfile [12-13]

 RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64"; else echo "$(dpkg --print-architecture)"; fi) \
-    && mv /etc/X11/fluxbox/fluxbox-menu-browser-${ARCH} /etc/X11/fluxbox/fluxbox-menu-browser
+    && mv /etc/X11/fluxbox/fluxbox-menu-browser-${ARCH} /etc/X11/fluxbox/fluxbox-menu-browser \
+    && rm -f /etc/X11/fluxbox/fluxbox-menu-browser-aarch64 /etc/X11/fluxbox/fluxbox-menu-browser-amd64
  • Apply / Chat
Suggestion importance[1-10]: 4

__

Why: This is a valid optimization to reduce image size by removing unused files, but it overlaps with another suggestion that achieves the same with a more concise command.

Low
Learned
best practice
Quote variables and paths

Store the architecture value once and quote ${ARCH} and file paths so the
command is safe if values ever contain unexpected characters; fail early if the
expected file is missing.

NodeAllBrowsers/Dockerfile [12-13]

-RUN ARCH=$(if [ "$(dpkg --print-architecture)" = "arm64" ]; then echo "aarch64"; else echo "$(dpkg --print-architecture)"; fi) \
-    && mv /etc/X11/fluxbox/fluxbox-menu-browser-${ARCH} /etc/X11/fluxbox/fluxbox-menu-browser
+RUN dpkg_arch="$(dpkg --print-architecture)" \
+    && if [ "${dpkg_arch}" = "arm64" ]; then ARCH="aarch64"; else ARCH="${dpkg_arch}"; fi \
+    && src="?url=https%3A%2F%2Fgithub.com%2Fetc%2FX11%2Ffluxbox%2Ffluxbox-menu-browser-%24%7BARCH%7D" \
+    && test -f "${src}" \
+    && mv "${src}" "?url=https%3A%2F%2Fgithub.com%2Fetc%2FX11%2Ffluxbox%2Ffluxbox-menu-browser"
  • Apply / Chat
Suggestion importance[1-10]: 6

__

Why:
Relevant best practice - In shell/Docker RUN commands, quote variables and paths to avoid word-splitting/globbing and make logic more robust.

Low
High-level
Simplify Fluxbox menu configuration files

To reduce duplication, move the [submenu] and [end] directives from the
individual fluxbox-menu-browser files into the main NodeBase/fluxbox-menu file.
The browser-specific files should then only contain the [exec] lines.

Examples:

NodeChrome/fluxbox-menu-browser [1-3]
[submenu] (Web Browsing) {}
   [exec] (Google Chrome) { /usr/bin/google-chrome } <>
[end]
NodeFirefox/fluxbox-menu-browser [1-3]
[submenu] (Web Browsing) {}
   [exec] (Mozilla Firefox) { /usr/bin/firefox } <>
[end]

Solution Walkthrough:

Before:

# In NodeBase/fluxbox-menu:
...
   [submenu] (Network) {}
      [include] (/etc/X11/fluxbox/fluxbox-menu-browser)
   [end]
...

# In NodeChrome/fluxbox-menu-browser:
[submenu] (Web Browsing) {}
   [exec] (Google Chrome) { /usr/bin/google-chrome } <>
[end]

# In NodeFirefox/fluxbox-menu-browser:
[submenu] (Web Browsing) {}
   [exec] (Mozilla Firefox) { /usr/bin/firefox } <>
[end]

After:

# In NodeBase/fluxbox-menu:
...
   [submenu] (Network) {}
      [submenu] (Web Browsing) {}
         [include] (/etc/X11/fluxbox/fluxbox-menu-browser)
      [end]
   [end]
...

# In NodeChrome/fluxbox-menu-browser:
[exec] (Google Chrome) { /usr/bin/google-chrome } <>

# In NodeFirefox/fluxbox-menu-browser:
[exec] (Mozilla Firefox) { /usr/bin/firefox } <>
Suggestion importance[1-10]: 5

__

Why: The suggestion correctly identifies duplicated [submenu] and [end] directives across multiple new configuration files and proposes a valid structural improvement to enhance maintainability.

Low
  • More

@VietND96 VietND96 merged commit bc1e6fd into trunk Feb 22, 2026
29 checks passed
@VietND96 VietND96 deleted the fluxbox-menu branch February 22, 2026 14:20
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment