Skip to content

env file template#11

Merged
KilianBoute merged 3 commits intomasterfrom
Stream-ui
Feb 4, 2025
Merged

env file template#11
KilianBoute merged 3 commits intomasterfrom
Stream-ui

Conversation

@KilianBoute
Copy link
Contributor

@KilianBoute KilianBoute commented Feb 4, 2025

Description

Pull Request: env file template

Motivation

The primary motivation for this pull request is to simplify the configuration process for developers by providing a template for environment variables. This change aims to enhance the developer experience by clearly defining the necessary environment variables required for the project to function correctly. Additionally, it ensures that sensitive information is not mistakenly committed to the repository by ignoring the actual environment configuration file.

Changes

  1. .gitignore Update:

    • Removed /public/assets/env.js from the .gitignore file to allow the template to be committed.
    @@ -19,7 +19,6 @@
     .env.test.local
     .env.production.local
     
    -/public/assets/env.js
     /public/output.css
     
     npm-debug.log*
  2. Template Addition:

    • Added a new file examples/livestream-hd/ui/public/assets/env.js which serves as a template for environment variables. This file contains placeholders for various configuration settings that developers need to replace with actual values.
    (function(window) {
        window["env"] = window["env"] || {};
    
        // Environment variables
        window["env"]["HUB_PUBLIC_KEY"] = "YOUR_HUB_PUBLIC_KEY";
        window["env"]["HUB_PRIVATE_KEY"] = "YOUR_HUB_PRIVATE_KEY";
    
        window["env"]["MQTT_URI"] = "YOUR_MQTT_URI";
        window["env"]["MQTT_USERNAME"] = "YOUR_MQTT_USERNAME";
        window["env"]["MQTT_PASSWORD"] = "YOUR_MQTT_PASSWORD";
    
        window["env"]["WEBRTC_USERNAME"] = "YOUR_WEBRTC_USERNAME";
        window["env"]["WEBRTC_PASSWORD"] = "YOUR_WEBRTC_PASSWORD";
    
        window["env"]["STUN_URI"] = "YOUR_STUN_URI";
        window["env"]["TURN_URI"] = "YOUR_TURN_URI";
    })(this);

Why This Improves the Project

  1. Ease of Configuration:

    • New developers can quickly understand what environment variables are needed and where to place them, reducing setup time and potential configuration errors.
  2. Security:

    • By providing a template and keeping actual configuration files out of version control, we minimize the risk of accidentally exposing sensitive information.
  3. Consistency:

    • Ensures that all contributors are aware of the required configuration settings and follow a standardized format.

In conclusion, this pull request significantly enhances the developer experience and security by providing a clear and standardized method for handling environment variables.

@KilianBoute KilianBoute merged commit f31ce69 into master Feb 4, 2025
2 checks passed
@KilianBoute KilianBoute deleted the Stream-ui branch February 4, 2025 09:08
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.

1 participant