Skip to content

fix multiupload and control incomplete pairs#38

Merged
jeffcaldwellca merged 1 commit into
jeffcaldwellca:mainfrom
ElGranLoky:main
Apr 6, 2026
Merged

fix multiupload and control incomplete pairs#38
jeffcaldwellca merged 1 commit into
jeffcaldwellca:mainfrom
ElGranLoky:main

Conversation

@ElGranLoky
Copy link
Copy Markdown
Contributor

Description

Upgrade the certificate upload system from handling single files to supporting multiple simultaneous uploads with built-in validation for certificate/key pairs.

Key Changes:

  • Support for Multiple Uploads: The /api/upload endpoint was updated to use upload.array('certificates'), allowing users to upload several files at once.
  • Automatic File Grouping: Added logic to group files by their base name. For example, if you upload domain.crt and domain.key, the system recognizes they belong together.
  • Type Identification: Files are now automatically categorized as cert, key, or p12 based on their extensions (.pem, .crt, .key, .p12, etc.).
  • Robust File Handling: Replaced simple file moving with a "copy and unlink" strategy. This prevents the EXDEV error that often occurs when moving files between different disk partitions (like from a /tmp folder to the storage directory).
  • Structured Results: The API now returns a detailed report instead of a simple success message, including counts of complete pairs, lists of incomplete pairs, and a summary of all files processed.

What This Solves

  • Incomplete Certificate Sets: It solves the issue of "orphaned" certificates. The system now detects if a certificate is missing its corresponding private key (or vice-versa) and alerts the user through the incompletePairs list.
  • Manual Effort: Users no longer need to upload files one by one; they can drag and drop all components of a certificate (and even multiple different certificates) in one go.
  • System Reliability: By ensuring the upload directory exists and using a more compatible file-moving method, the application is less likely to fail due to filesystem permissions or storage configurations.
  • Better Client Feedback: The frontend now receives precise information about what was saved successfully and what components are still missing to make a certificate functional.

@jeffcaldwellca jeffcaldwellca merged commit a87b239 into jeffcaldwellca:main Apr 6, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants