Skip to content

Conversation

@ndrix
Copy link
Member

@ndrix ndrix commented Nov 28, 2025

Local development setup, Docker integration, UI enhancements, and minor code cleanups.

Local Development & Environment Setup

  • Added a generate_devenv.sh script that interactively sets up environment variables, generates TLS certificates, initializes MongoDB with secure credentials and collections, and creates .env files for backend and UI components.

UI Improvements

  • Enhanced API host resolution logic to prioritize REACT_APP_API_HOST, then localStorage, and finally default to "/api", * Increased the width of the divider in ResizableSplitPanel and cleaned up the split panel's rendering logic for a better user experience when resizing UI panels. [1] [2]

  • Minor documentation and code clarifications in DNS resolver logic and requirements update for compatibility. [1] [2] [3] [4]

ndrix and others added 8 commits November 28, 2025 13:26
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR implements DNS rebinding protection by introducing configurable API host resolution in the UI, and enhances user experience by widening the resizable split panel divider. The changes also include development environment setup improvements with Docker Compose configuration and dependency updates.

  • Implemented API host precedence: REACT_APP_API_HOST > localStorage['api_host'] > "/api" with proper error handling for localStorage access
  • Increased split panel divider width from 8px to 19px for improved usability
  • Added Docker Compose configuration and enhanced development environment setup script

Reviewed changes

Copilot reviewed 10 out of 10 changed files in this pull request and generated 4 comments.

Show a summary per file
File Description
dusseldorf/ui/src/DusseldorfConfig.ts Refactored API host resolution with proper precedence order and error handling for localStorage access in privacy mode
dusseldorf/ui/src/Components/Rules/RuleTable.tsx Removed unused ColumnManager and ColumnConfig imports
dusseldorf/ui/src/Components/ResizableSplitPanel.tsx Widened divider from 8px to 19px and applied code formatting improvements
dusseldorf/ui/src/Components/Requests/RequestTable.tsx Removed unused ColumnManager import and defaultColumnConfig constant
dusseldorf/ui/README.md Updated documentation with API host resolution information and added changelog entry
dusseldorf/listener.dns/src/dnsresolver.py Improved code comments and refactored TTL handling to read from response object
dusseldorf/generate_devenv.sh Enhanced script with input validation and default values, but contains critical duplication bug
dusseldorf/docker-compose.yml Added complete Docker Compose configuration for all services (mongodb, api-server, listener-http, listener-dns)
dusseldorf/api/src/api/requirements.txt Downgraded urllib3 from 2.5.0 to 2.0.4
.dockerignore Added comprehensive Docker ignore patterns for Python, Node, and development files

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

You can also share your feedback on Copilot code review for a chance to win a $100 gift card. Take the survey.

Comment on lines +74 to +146
echo "Environment setup complete. You can now start running Dusseldorf with docker compose up."#!/bin/bash
set -e

EXAMPLE_CLIENT_ID="dc1b6b75-8167-4baf-9e75-d3d1f755de1b"
EXAMPLE_TENANT_ID="72f988bf-86f1-41af-91ab-2d7cd011db47"

CLIENT_ID_DEFAULT="${AZURE_CLIENT_ID:-$EXAMPLE_CLIENT_ID}"
TENANT_ID_DEFAULT="${AZURE_TENANT_ID:-$EXAMPLE_TENANT_ID}"

read -p "Azure Client ID [$CLIENT_ID_DEFAULT]: " INPUT_CLIENT_ID || true
[[ -n "$INPUT_CLIENT_ID" && "$INPUT_CLIENT_ID" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ ]] && AZURE_CLIENT_ID="$INPUT_CLIENT_ID" || AZURE_CLIENT_ID="$CLIENT_ID_DEFAULT"

read -p "Azure Tenant ID [$TENANT_ID_DEFAULT]: " INPUT_TENANT_ID || true
[[ -n "$INPUT_TENANT_ID" && "$INPUT_TENANT_ID" =~ ^[0-9a-fA-F]{8}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{4}-[0-9a-fA-F]{12}$ ]] && AZURE_TENANT_ID="$INPUT_TENANT_ID" || AZURE_TENANT_ID="$TENANT_ID_DEFAULT"

echo "Using Client ID: $AZURE_CLIENT_ID"
echo "Using Tenant ID: $AZURE_TENANT_ID"

mkdir -p env/certs env/mongo-data env/mongo-scripts ui
openssl req -newkey rsa:2048 -nodes -keyout "env/certs/tls.key" -x509 -days 365 -out "env/certs/tls.crt" -subj "/CN=localhost" >/dev/null 2>&1 || { echo "openssl not found" >&2; exit 1; }

MONGO_PASSWORD=$(openssl rand -hex 12)
cat <<EOF > env/mongo-scripts/init.js
db = db.getSiblingDB("dusseldorf");
db.createUser({
user: "admin",
pwd: "$MONGO_PASSWORD",
roles: [{ role: "readWrite", db: "dusseldorf" }]
});
db.createCollection("domains");
db.createCollection("zones");
db.createCollection("requests");
db.createCollection("rules");
db.domains.createIndex({domain: 1}, { unique: true });
db.zones.createIndex({fqdn: 1}, { unique: true });
db.requests.createIndex({
"zone": 1,
"time": 1
});
db.domains.insertOne({"domain": "dusseldorf.local", "public_ips": ["172.18.0.9"], "owner": "dusseldorf"});
EOF

cat <<EOF > .env
# Dusseldorf Environment Variables
API_VERSION=1
ENVIRONMENT=development
AZURE_CLIENT_ID=$AZURE_CLIENT_ID
AZURE_TENANT_ID=$AZURE_TENANT_ID
MONGO_USERNAME=admin
MONGO_PASSWORD=$MONGO_PASSWORD
MONGO_DB_NAME=dusseldorf
MONGODB_DB_NAME=dusseldorf
DSSLDRF_TLS_CRT_FILE=./env/certs/tls.crt
DSSLDRF_TLS_KEY_FILE=./env/certs/tls.key
LSTNER_HTTP_PORT=443
LSTNER_HTTP_INTERFACE=0.0.0.0
LSTNER_DNS_PORT=10053
LSTNER_DNS_INTERFACE=0.0.0.0
LSTNER_DNS_UDP=false
EOF

cat <<EOF > ui/.env
REACT_APP_CLIENT_ID=$AZURE_CLIENT_ID
REACT_APP_TENANT_ID=$AZURE_TENANT_ID
REACT_APP_API_HOST=http://localhost:8080/api
EOF

echo "Environment setup complete. Run: docker compose up"
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The entire script appears to be duplicated. Line 74 ends without a newline and is immediately followed by #!/bin/bash on the same line, then the script content repeats from lines 74-146. This will cause the script to fail at line 74 when it tries to execute docker compose up."#!/bin/bash as a command.

The echo statement on line 74 should end with a newline, and the duplicate script content (lines 74-146) should be removed.

Copilot uses AI. Check for mistakes.

This is the graphical user interface for Dusseldorf, which provides an easy graphical human way to interface with Dusseldorf's API.

This runs as its own component, it's a static web page build in the React Framework, hosted as a static component within the API repository.
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "build" should be "built".

Suggested change
This runs as its own component, it's a static web page build in the React Framework, hosted as a static component within the API repository.
This runs as its own component, it's a static web page built in the React Framework, hosted as a static component within the API repository.

Copilot uses AI. Check for mistakes.
in the console of the DevTools in your favourite browser to any value to change which API endpoint you talk to.

# Design
This UI is build upon the amazing [Fluent2](https://fluent2.microsoft.design/) design framework.
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Typo: "build" should be "built".

Suggested change
This UI is build upon the amazing [Fluent2](https://fluent2.microsoft.design/) design framework.
This UI is built upon the amazing [Fluent2](https://fluent2.microsoft.design/) design framework.

Copilot uses AI. Check for mistakes.
cat <<EOF > ui/.env
REACT_APP_CLIENT_ID=$AZURE_CLIENT_ID
REACT_APP_TENANT_ID=$AZURE_TENANT_ID
REACT_APP_API_HOST=http://localhost:8080/api
Copy link

Copilot AI Nov 28, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

REACT_APP_API_HOST is set to http://localhost:8080/api, which enforces unencrypted HTTP for the UI’s API calls. If the UI transmits authentication tokens (e.g., Azure OAuth flows) or sensitive data, this can be intercepted or modified on the network. Use HTTPS (e.g., https://localhost:8080/api with a trusted certificate) and ensure TLS is enforced in both client and server configs.

Suggested change
REACT_APP_API_HOST=http://localhost:8080/api
REACT_APP_API_HOST=https://localhost:8080/api

Copilot uses AI. Check for mistakes.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants