Commit Graph

56 Commits

Author SHA1 Message Date
Andras Bacsai 6325e41aec fix(ssh): handle chmod failures gracefully and simplify key management
- Log warnings instead of silently failing when chmod 0600 fails
- Remove redundant refresh() call before SSH key validation
- Remove storeInFileSystem() call from updatePrivateKey() transaction
- Remove @unlink() of lock file after filesystem store
- Refactor unit tests to use real temp disk and anonymous class stub
  instead of reflection-only checks
2026-03-16 21:27:10 +01:00
pannous 4bf94fac2d fix: prevent sporadic SSH permission denied by validating key content
The root cause of sporadic "Permission denied (publickey)" errors was
that validateSshKey() only checked if the key file existed on disk,
never verifying its content matched the database. When keys were rotated
or updated, the stale file persisted and SSH used the wrong key.

Changes:
- validateSshKey() now refreshes key from DB and compares file content
- Server saved event detects private_key_id changes to invalidate mux
- PrivateKey storeInFileSystem() uses file locking to prevent races
- PrivateKey saved event auto-resyncs file on key content changes
- Enforces 0600 permissions on key files

Fixes coollabsio/coolify#7724
2026-03-15 03:06:21 +01:00
Andras Bacsai 2b7e2ebafb chore: prepare for PR 2026-02-26 16:27:02 +01:00
Andras Bacsai 5e8d11f732 refactor: replace queries with cached versions for performance improvements 2025-12-08 13:39:33 +01:00
Andras Bacsai 188c86ca45 Improve SSH key filtering and datalist component
- Add ownedAndOnlySShKeys() method to filter out git-related keys
- Update Boarding component to use new filtering method
- Enhance datalist component with better multi-select and single-select handling
- Fix Alpine.js reactivity and improve UI interactions

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

Co-Authored-By: Claude <noreply@anthropic.com>
2025-10-23 16:18:20 +02:00
Andras Bacsai f7427fdea0 Changes auto-committed by Conductor 2025-10-17 23:04:24 +02:00
Andras Bacsai 215301fa8f basics of adding / removing hetzner servers 2025-10-09 10:41:29 +02:00
Andras Bacsai cead87d650 refactor(private-key): remove debugging statement from storeInFileSystem method for cleaner code 2025-09-10 08:19:25 +02:00
Andras Bacsai a60d6dadc7 fix(private-key): implement transaction handling and error verification for private key storage operations 2025-09-09 16:46:38 +02:00
Andras Bacsai 38c0641734 feat(validation): centralize validation patterns for names and descriptions
- Introduced `ValidationPatterns` class to standardize validation rules and messages for name and description fields across the application.
- Updated various components and models to utilize the new validation patterns, ensuring consistent sanitization and validation logic.
- Replaced the `HasSafeNameAttribute` trait with `HasSafeStringAttribute` to enhance attribute handling and maintain consistency in name sanitization.
- Enhanced the `CleanupNames` command to align with the new validation rules, allowing for a broader range of valid characters in names.
2025-08-19 12:14:48 +02:00
Andras Bacsai e958b3761d feat(cleanup): add command for sanitizing name fields across models
- Introduced `CleanupNames` command to sanitize name fields by removing invalid characters, ensuring only letters, numbers, spaces, dashes, underscores, and dots are retained.
- Implemented options for dry run, model-specific cleaning, database backup, and forced execution.
- Updated `Init` command to call the new `cleanup:names` command.
- Enhanced project and environment validation to enforce name sanitization rules.
- Added `HasSafeNameAttribute` trait to relevant models for consistent name handling.
2025-08-19 11:04:23 +02:00
Andras Bacsai 0dceb40a6e feat(api): add HTTP Basic Authentication fields to OpenAPI specifications and enhance PrivateKey model descriptions 2025-04-23 11:59:01 +02:00
Laurence 44e96e032f enhance: Add missing openapi items to PrivateKey 2025-04-11 20:37:54 +01:00
Andras Bacsai c891102db6 fix: add public key attribute to privatekey model 2025-01-20 13:59:02 +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 0eab7f78ff version++ and fix private key saving 2024-11-15 21:22:11 +01:00
peaklabs-dev 2932d9a6e0 fix ssh key migration broken with the new team check 2024-11-15 12:10:39 +01:00
peaklabs-dev a58125cbfe fix same ssh key in different teams 2024-11-14 21:53:38 +01:00
Andras Bacsai 760cf8aeb5 refactor: Update PrivateKey model to use ownedByCurrentTeam() scope for cleanupUnusedKeys() 2024-09-20 13:05:51 +02:00
Andras Bacsai f9238ce263 Merge pull request #3509 from coollabsio/delete-unused-ssh-keys
Feat: Delete unused ssh keys button
2024-09-20 13:00:54 +02:00
Andras Bacsai c0898f0568 refactor: Remove unnecessary code in PrivateKey model 2024-09-20 12:51:02 +02:00
Andras Bacsai 5b00b66f24 refactor: Update PrivateKey model to improve code readability and maintainability 2024-09-20 12:27:55 +02:00
peaklabs-dev dbc723089b Feat: Delete unused private keys button 2024-09-19 19:27:25 +02:00
peaklabs-dev d9181bd00b Fix: Multiplexing do not write file manually 2024-09-17 16:22:53 +02:00
peaklabs-dev 175f4b9ae1 use shared functions when possible 2024-09-17 14:47:02 +02:00
peaklabs-dev 2bc74c75e1 Remove duplicated code 2024-09-17 14:43:02 +02:00
peaklabs-dev 6a6b947fba Fix: Make sure in use private keys are not deleted 2024-09-17 14:32:44 +02:00
peaklabs-dev 43895419ff Remove unused code 2024-09-17 13:45:05 +02:00
peaklabs-dev 871d09bd96 Feat: Move more functions to the PrivateKey Model 2024-09-17 13:20:27 +02:00
peaklabs-dev 2d8bda4fa6 Fix: Private key with ID 2 on dev 2024-09-17 13:06:50 +02:00
peaklabs-dev 70b757df5b remove old function 2024-09-16 19:53:45 +02:00
peaklabs-dev b09017ea46 Feat: new ssh key file name on disk 2024-09-16 18:11:37 +02:00
peaklabs-dev ba636a95dc Refactor SSH Keys 2024-09-16 17:24:42 +02:00
peaklabs-dev 3aee8e030e Fix: Encrypt private SSH keys in the DB 2024-09-16 13:17:39 +02:00
peaklabs-dev 02017334e5 Fix: Make sure invalid private keys can not be added 2024-09-16 13:02:48 +02:00
peaklabs-dev f9b7841572 Feat: Add a fingerprint to every private key on save, create... 2024-09-16 12:54:48 +02:00
Andras Bacsai 2d3a6a4528 openapi work work 2024-07-09 10:45:10 +02:00
Andras Bacsai 311c118834 fix: Add newline character to private key before saving 2024-07-05 13:35:51 +02:00
Thijmen d86274cc37 Fix styling 2024-06-10 20:43:34 +00:00
Andras Bacsai 64a65e2018 fix: errors 2023-09-11 17:36:30 +02:00
Andras Bacsai 02f6673345 feat: generate public key from private keys 2023-09-11 10:15:45 +02:00
Andras Bacsai b39ca51d41 wip: boarding 2023-08-22 17:44:49 +02:00
Andras Bacsai 833e45155d switch to auth()->user from session 2023-08-11 17:31:53 +02:00
Andras Bacsai f2228cec7b testing php storm code cleanup and styling 2023-08-08 11:51:36 +02:00
Andras Bacsai 7ce1dc0d48 fixes 2023-06-22 20:52:49 +02:00
Andras Bacsai 448182497f updates 2023-06-19 10:58:00 +02:00
Andras Bacsai 7bcbfc13b0 updates 2023-06-19 09:44:39 +02:00
Andras Bacsai 0123ae97a1 fixes 2023-06-16 13:13:09 +02:00
Andras Bacsai 7456fc1ac7 fix 2023-06-16 12:05:52 +02:00