Commit Graph

60 Commits

Author SHA1 Message Date
Andras Bacsai 1802522c60 fix(env-vars): treat search wildcards literally
Escape SQL LIKE wildcard characters in environment variable searches and hide production or preview sections when the filtered results are empty.
2026-06-03 13:43:26 +02:00
Andras Bacsai d7524a743d fix(env-vars): show single empty state for searches
Move the environment variable search field above the production section
and hide production and preview headings when a search has no results.
2026-06-03 12:54:50 +02:00
Andras Bacsai d525c12457 fix(env): keep dev view env saves independent of search
Search environment variables case-insensitively by key, add accessible search
labeling, and ensure switching to developer view after searching loads the full
variable set so non-matching entries are not removed on save.
2026-06-03 11:40:54 +02:00
Rohit Tiwari 07337d9df6 feat: add search functionality for environment variables 2026-05-26 15:19:32 +05:30
Andras Bacsai b5ff124446 fix(env): validate Docker-compatible variable keys
Add shared environment variable key validation and normalization for Livewire forms and models, allowing Docker-compatible keys while rejecting invalid entries such as keys containing equals signs. Also quote Railpack build environment and secret arguments safely.
2026-05-11 15:43:09 +02:00
Andras Bacsai d9e39ba211 Merge remote-tracking branch 'origin/next' into env-var-descriptions 2026-02-28 00:09:54 +01:00
peaklabs-dev 8ba30d75ea refactor: move all env sorting to one place 2026-01-06 16:19:38 +01:00
Andras Bacsai 208f0eac99 feat: add comprehensive environment variable parsing with nested resolution and hardcoded variable detection
This commit introduces advanced environment variable handling capabilities including:
- Nested environment variable resolution with circular dependency detection
- Extraction of hardcoded environment variables from docker-compose.yml
- New ShowHardcoded Livewire component for displaying detected variables
- Enhanced UI for better environment variable management

The changes improve the user experience by automatically detecting and displaying
environment variables that are hardcoded in docker-compose files, allowing users
to override them if needed. The nested variable resolution ensures complex variable
dependencies are properly handled.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:53 +01:00
Andras Bacsai e4cc5c1178 fix: update success message logic to only show when changes are made 2025-12-27 15:24:09 +01:00
Andras Bacsai d640911bb9 fix: preserve existing comments in bulk update and always show save notification
This commit fixes two UX issues with environment variable bulk updates:

1. Comment Preservation (High Priority Bug):
   - When bulk updating environment variables via Developer view, existing
     manually-entered comments are now preserved when no inline comment is provided
   - Only overwrites existing comments when an inline comment (#comment) is explicitly
     provided in the pasted content
   - Previously: pasting "KEY=value" would erase existing comment to null
   - Now: pasting "KEY=value" preserves existing comment, "KEY=value #new" overwrites it

2. Save Notification (UX Improvement):
   - "Save all Environment variables" button now always shows success notification
   - Previously: only showed notification when changes were detected
   - Now: provides feedback even when no changes were made
   - Consistent with other save operations in the codebase

Changes:
- Modified updateOrCreateVariables() to only update comment field when inline comment
  is provided (null check prevents overwriting existing comments)
- Modified handleBulkSubmit() to always dispatch success notification unless error occurred
- Added comprehensive test coverage for bulk update comment preservation scenarios

Tests:
- Added 4 new feature tests covering comment preservation edge cases
- All 22 existing unit tests for parseEnvFormatToArray pass
- Code formatted with Pint

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:09 +01:00
Andras Bacsai 0eb0dbef02 fix: save comment field when creating application environment variables
The comment field was not being saved when creating environment variables from applications, even though it worked for shared environment variables. The issue was in the createEnvironmentVariable method which was missing the comment assignment.

Added: $environment->comment = $data['comment'] ?? null;

The comment is already dispatched from the Add component and now it's properly saved to the database for application environment variables.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-12-27 15:24:09 +01:00
Andras Bacsai ab472bf5ed feat: enhance environment variable handling to support mixed formats and add comprehensive tests 2025-12-27 15:24:09 +01:00
Andras Bacsai e33558488e feat: add comment field to environment variables
- Add comment field to EnvironmentVariable model and database
- Update parseEnvFormatToArray to extract inline comments from env files
- Update Livewire components to handle comment field
- Add UI for displaying and editing comments
- Add tests for comment parsing functionality
2025-12-27 15:24:09 +01:00
Andras Bacsai eb1f16b62e fix(environment): clear computed property cache after adding environment variables
- Added cache clearing for environment variables and their preview after a new variable is added to ensure the UI reflects the latest data.
- Updated the refreshEnvs method to include cache clearing, enhancing the responsiveness of the environment variable display.
2025-10-07 13:57:59 +02:00
Andras Bacsai f33df13c4e feat(environment): replace is_buildtime_only with is_runtime and is_buildtime flags for environment variables, updating related logic and views 2025-09-18 18:14:54 +02:00
Andras Bacsai c1bee32f09 feat(deployment): introduce 'use_build_secrets' setting for enhanced security during Docker builds and update related logic in deployment process 2025-09-17 10:34:38 +02:00
Andras Bacsai 8e155f25b3 refactor(environment): streamline environment variable handling by replacing sorting methods with direct property access and enhancing query ordering for improved performance 2025-09-12 12:09:03 +02:00
Andras Bacsai 20ad2165e7 feat(environment): introduce 'is_buildtime_only' attribute to environment variables for improved build-time configuration 2025-09-11 17:38:16 +02:00
Andras Bacsai 5b3b4bbc43 refactor(environment): remove 'is_build_time' attribute from environment variable handling across the application to simplify configuration 2025-09-11 16:51:56 +02:00
Arnaud B e23ab1e621 feat(deployment): add SERVICE_NAME variables for service discovery
This change introduces automatically generated `SERVICE_NAME_<SERVICE>`
environment variables for each service within a Docker Compose deployment.
This allows services to reliably reference each other by name, which is particularly
useful in pull request environments where container names are dynamically suffixed.

- The application parser now generates and injects these `SERVICE_NAME` variables
   into the environment of all services in the compose file.
- `ApplicationDeploymentJob` is updated to correctly handle and filter these
  new variables during deployment.
- UI components and the `EnvironmentVariableProtection` trait have been updated
to make these generated variables read-only, preventing accidental modification.

This commit introduces two new helper functions to standardize resource naming
for pull request deployments:

-  `addPreviewDeploymentSuffix()`: Generates a consistent suffix format (-pr-{id})
   for resource names in preview deployments
-  `generateDockerComposeServiceName()`: Creates SERVICE_NAME environment variables
   for Docker Compose services
2025-09-08 15:22:44 +02:00
Andras Bacsai adb8f9d88e feat(auth): implement authorization checks for database management 2025-08-23 18:50:35 +02:00
Andras Bacsai 40f108d6e1 feat(auth): implement authorization checks for application management 2025-08-22 16:47:59 +02:00
Andras Bacsai 9480fc2b2f refactor(environment-variables): remove debug logging from bulk submit handling for cleaner code 2025-05-30 09:11:40 +02:00
Andras Bacsai 00fe6e9003 refactor(environment-variables): remove protected variable checks from delete methods for cleaner logic 2025-04-22 11:40:35 +02:00
Andras Bacsai f63415f027 feat(EnvironmentVariable): implement protection for critical environment variables and enhance deletion logic 2025-04-07 22:57:26 +02:00
Andras Bacsai 0ff7c468c8 fix(ui): skip SERVICE_FQDN and SERVICE_URL variables during update 2025-02-03 15:44:15 +01:00
Andras Bacsai 1fe4dd722b Revert "rector: arrrrr"
This reverts commit 16c0cd10d8.
2025-01-07 15:31:43 +01:00
Andras Bacsai 16c0cd10d8 rector: arrrrr 2025-01-07 14:52:08 +01:00
Andras Bacsai 2a9d499251 feat: migrate env variables to polymorphic relationship
fix: proxy status query ui
2024-12-17 10:38:42 +01:00
Lucas Michot c5403b0b3f Always prefer ::class notation 2024-10-28 14:56:13 +01:00
Andras Bacsai c2c0afa0ba fix: service env orders, application env orders 2024-10-04 12:08:57 +02:00
Andras Bacsai bfeaae9caa fix: env variable in value parsed 2024-09-04 14:33:16 +02:00
Andras Bacsai 2227858f58 refactor: Load environment variables based on resource type in sortEnvironmentVariables() 2024-08-16 12:23:31 +02:00
Andras Bacsai 9864d380a3 fix: sync fqdn change on the UI 2024-08-15 11:23:44 +02:00
ayntk-ai 4d12447715 order column added to track order of env in the UI 2024-08-14 20:35:08 +02:00
ayntk-ai fbde257166 fix disable/enable environment variabel sorting 2024-08-12 23:00:08 +02:00
ayntk-ai e28289ce1e cleanup all.php 2024-08-12 14:46:30 +02:00
ayntk-ai 122491808c fix env deletion and sorting of locked envs 2024-08-12 14:44:18 +02:00
ayntk-ai 1d7c833b7c fix sort alphabetically 2024-08-12 14:13:03 +02:00
ayntk-ai 93444ea872 fix manual safe button and few simplifications 2024-08-12 14:06:00 +02:00
ayntk-ai c5aba34a6f new submit logic 2024-08-12 13:23:36 +02:00
Andras Bacsai d7350fad76 fix: several shared environment variables in one value, parsed correctly 2024-07-26 13:22:44 +02:00
andrasbacsai 96c4f5b8da Fix styling 2024-07-25 11:31:59 +00:00
Andras Bacsai 6a4aa492c0 fix: random generated uuid will be full length (not 7 characters) 2024-07-25 13:31:01 +02:00
andrasbacsai 613830e6a6 Fix styling 2024-07-24 19:11:12 +00:00
Andras Bacsai e4ee149085 refactor: Remove debug code for saving environment variables 2024-06-13 13:37:19 +02:00
Thijmen d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai fec98f45ce feat: Improve sorting of environment variables in the All component 2024-05-17 11:40:32 +02:00
Andras Bacsai 431cc796d8 feat: sort envs alphabetically and creation date 2024-05-17 11:10:57 +02:00
Andras Bacsai 35b07a9c18 Refactor code to add sudo prefix for certain commands in multiple files 2024-04-17 10:49:34 +02:00