COSC-499-W2023 / year-long-project-team-12

year-long-project-team-12 created by GitHub Classroom
0 stars 1 forks source link

Hide the email public keys #311

Open yemoski opened 6 months ago

yemoski commented 6 months ago

Hide the public key of the email from the github.

yemoski commented 6 months ago

To hide sensitive information, such as API keys or passwords, when pushing code to GitHub, you can use environment variables or configuration files.

Here's how you can do it:

Environment Variables: Set your sensitive information as environment variables on your local machine or your deployment environment. Then, in your code, access these variables using process.env.MY_VARIABLE. This way, you don't include the actual values in your code.

Configuration Files: Create a configuration file (e.g., config.js or config.json) and store your sensitive information there. Then, add this file to your .gitignore to prevent it from being pushed to GitHub. Instead, provide a sample or template configuration file with placeholders for the sensitive information.

Here's an example of how you might structure your configuration file:

json Copy code // config.json { "apiKey": "YOUR_API_KEY_HERE", "database": { "username": "DB_USERNAME", "password": "DB_PASSWORD" } } Then, in your code, you can read the configuration file like this:

javascript Copy code // Load the configuration file const config = require('./config.json');

// Access the sensitive information const apiKey = config.apiKey; const dbUsername = config.database.username; const dbPassword = config.database.password; Ensure that you add config.json to your .gitignore file to prevent it from being pushed to GitHub.

Remember not to include any sensitive information directly in your code or commit it to your repository. Always use secure methods like environment variables or configuration files to manage sensitive data.