62d06ff fix: set secure permissions (600) on generated .env files
📊 Changes
1 file changed (+24 additions, -0 deletions)
View changed files
📝lib/environment/src/lib.rs (+24 -0)
📄 Description
Summary
Generated .env files now have permissions set to 600 (owner read/write only) instead of the default 644 (world-readable). This prevents potential exposure of secrets when the repository directory is accessible to other users on the host.
Changes
Added #[cfg(unix)] conditional code to set file permissions to 0600 after writing .env files
Uses okio::fs::set_permissions with PermissionsExt::from_mode(0o600) for async-compatible permission setting
Includes proper error handling and logging if permission setting fails
Testing
The change is Unix-specific (using #[cfg(unix)]) and will have no effect on Windows systems where file permissions work differently.
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.
## 📋 Pull Request Information
**Original PR:** https://github.com/moghtech/komodo/pull/1158
**Author:** [@litlmike](https://github.com/litlmike)
**Created:** 2/7/2026
**Status:** ❌ Closed
**Base:** `main` ← **Head:** `fix-issue-1056`
---
### 📝 Commits (1)
- [`62d06ff`](https://github.com/moghtech/komodo/commit/62d06ff4c48ec8768d68e44915ec4a121be26357) fix: set secure permissions (600) on generated .env files
### 📊 Changes
**1 file changed** (+24 additions, -0 deletions)
<details>
<summary>View changed files</summary>
📝 `lib/environment/src/lib.rs` (+24 -0)
</details>
### 📄 Description
## Summary
Generated .env files now have permissions set to 600 (owner read/write only) instead of the default 644 (world-readable). This prevents potential exposure of secrets when the repository directory is accessible to other users on the host.
## Changes
- Added #[cfg(unix)] conditional code to set file permissions to 0600 after writing .env files
- Uses okio::fs::set_permissions with PermissionsExt::from_mode(0o600) for async-compatible permission setting
- Includes proper error handling and logging if permission setting fails
## Testing
The change is Unix-specific (using #[cfg(unix)]) and will have no effect on Windows systems where file permissions work differently.
Closes #1056
---
<sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
📋 Pull Request Information
Original PR: https://github.com/moghtech/komodo/pull/1158
Author: @litlmike
Created: 2/7/2026
Status: ❌ Closed
Base:
main← Head:fix-issue-1056📝 Commits (1)
62d06fffix: set secure permissions (600) on generated .env files📊 Changes
1 file changed (+24 additions, -0 deletions)
View changed files
📝
lib/environment/src/lib.rs(+24 -0)📄 Description
Summary
Generated .env files now have permissions set to 600 (owner read/write only) instead of the default 644 (world-readable). This prevents potential exposure of secrets when the repository directory is accessible to other users on the host.
Changes
Testing
The change is Unix-specific (using #[cfg(unix)]) and will have no effect on Windows systems where file permissions work differently.
Closes #1056
🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.