Skip to content

Conversation

Copy link

Copilot AI commented Nov 6, 2025

Hardcoded URLs, ports, API keys, and service endpoints across the Bot/ and attendee/ directories prevented flexible deployment and posed security risks.

Changes

Bot Directory

  • Created Bot/app/core/config.py - Centralized configuration module with error-handling for type conversions
  • Replaced hardcoded values in:
    • Redis connection parameters (host='redis', port=6379, db=0)
    • Server binding (host="0.0.0.0", port=8001)
    • API endpoints (Lingo callback URL, join meeting URL, schedule URL)
    • OAuth credentials and webhook addresses
  • Updated Bot/env.sample with 22 environment variables

Attendee Directory

  • Replaced hardcoded Lingo callback URL in bot_controller.py:
    # Before
    url = "http://lingo-bot:8001/meetings/call-to-lingo"
    
    # After
    url = os.environ.get("LINGO_CALLBACK_URL", "http://lingo-bot:8001/meetings/call-to-lingo")
  • Updated attendee/env.sample with LINGO_CALLBACK_URL

Configuration Pattern

All numeric environment variables include try-except blocks to prevent ValueError on invalid input:

try:
    REDIS_PORT = int(os.getenv("REDIS_PORT", "6379"))
except (ValueError, TypeError):
    REDIS_PORT = 6379

New Environment Variables

  • Infrastructure: REDIS_HOST, REDIS_PORT, REDIS_DB, BOT_SERVER_HOST, BOT_SERVER_PORT
  • API endpoints: JOIN_MEETING_URL, SCHEDULE_JOIN_BOT_URL, GET_MEETING_URL, LINGO_CALLBACK_URL, LINGO_SAVE_TRANSCRIPTION_URL
  • Auth/Webhook: CLIENT_ID, CLIENT_SECRET, TOKEN_URI, WEBHOOK_ADDR, USER_ID
Original prompt

This section details on the original issue you should resolve

<issue_title>Add Environment Variables Instead of Hardcoded Values</issue_title>
<issue_description>- Review the bot/ and attendee/ directories.

  • Identify and remove all hardcoded values (e.g., URLs, API keys, bucket names, ports, etc.).
  • Replace them with environment variables for better configurability and security.
  • Update .env.example and related documentation accordingly.</issue_description>

Comments on the Issue (you are @copilot in this section)


💡 You can make Copilot smarter by setting up custom instructions, customizing its development environment and configuring Model Context Protocol (MCP) servers. Learn more Copilot coding agent tips in the docs.

Copilot AI changed the title [WIP] Add environment variables to replace hardcoded values Replace hardcoded values with environment variables in Bot and attendee directories Nov 6, 2025
Copilot finished work on behalf of Ashviniv November 6, 2025 06:52
Copilot AI requested a review from Ashviniv November 6, 2025 06:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Add Environment Variables Instead of Hardcoded Values

2 participants