Refactor: Moving environment variables of docker-compose.yml to .dockercompose_env file
Move Environment Variables to env File
Refactored the setup to move environment variables from docker-compose.yml to a .dockercompose_env file for better maintainability. This makes managing secrets easier and keeps the docker-compose.yml cleaner.
⚠️ GitGuardian has uncovered 1 secret following the scan of your pull request.
Please consider investigating the findings and remediating the incidents. Failure to do so may lead to compromising the associated services or software components.
Since your pull request originates from a forked repository, GitGuardian is not able to associate the secrets uncovered with secret incidents on your GitGuardian dashboard. Skipping this check run and merging your pull request will create secret incidents on your GitGuardian dashboard.
🔎 Detected hardcoded secret in your pull request
| GitGuardian id | GitGuardian status | Secret | Commit | Filename | |
|---|---|---|---|---|---|
| 10005301 | Triggered | Generic Password | 2da3c5503419ca6953e27f78f8d432230f857d26 | docker-compose.yml | View secret |
🛠 Guidelines to remediate hardcoded secrets
- Understand the implications of revoking this secret by investigating where it is used in your code.
- Replace and store your secret safely. Learn here the best practices.
- Revoke and rotate this secret.
- If possible, rewrite git history. Rewriting git history is not a trivial act. You might completely break other contributing developers' workflow and you risk accidentally deleting legitimate data.
To avoid such incidents in the future consider
- following these best practices for managing and storing secrets including API keys and other credentials
- install secret detection on pre-commit to catch secret before it leaves your machine and ease remediation.
🦉 GitGuardian detects secrets in your source code to help developers and security teams secure the modern development process. You are seeing this because you or someone else with access to this repository has authorized GitGuardian to scan your pull request.
@sabaimran / @debanjum This will improve user experience for self hosting options .
Hi @DharunKumar04 thanks for the PR. It was a good idea to try handle all the environment in a separate file for maintainability.
But the .dockercompose_env doesn't seem to allow specifying which environment variables to share with which containers. Sharing all those environment variables with all the Khoj microservices seems unnecessarily risky. We don't want to expose the KHOJ_ADMIN_PASSWORD environment variable to the other containers. It breaks privilege minimization (requires more trust in the other containers than necessary). It'd be ideal if the environment variables could be specified in a single separate.
Let me know if you have other thoughts or ideas but I'll close this PR for now.