feat: setup check implementation#7070
Open
guilhermercarvalho wants to merge 10 commits intoLibreSign:mainfrom
Open
feat: setup check implementation#7070guilhermercarvalho wants to merge 10 commits intoLibreSign:mainfrom
guilhermercarvalho wants to merge 10 commits intoLibreSign:mainfrom
Conversation
Adds trait with verifyResourceIntegrity and getErrorAndTipFromVerify methods used by multiple setup checks. Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Add verifyResourceIntegrity method - [x] Add getErrorAndTipFromVerify method with translated messages - [x] Declare required properties (signSetupService, urlGenerator, appManager, logger) - [x] Use IL10N for all user-facing strings Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds ExecMock, FileSystemMock, SetupCheckFunctions to mock system calls, and updates bootstrap.php to load them. Related issue: LibreSign#6590 Type: Test Checklist: - [x] Create ExecMock class - [x] Create FileSystemMock class - [x] Create SetupCheckFunctions with file_exists and exec overrides - [x] Update bootstrap.php to include new files Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds JavaSetupCheck to verify Java installation, path, version and encoding. Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Implement ISetupCheck interface - [x] Use SetupCheckUtils trait - [x] Verify Java path exists - [x] Check Java version matches required version - [x] Check native.encoding for UTF-8 - [x] Return SetupResult with appropriate severity and translated messages - [x] Add unit tests covering all scenarios Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds JSignPdfSetupCheck to verify JSignPdf binary, integrity, Java dependency and version. Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Implement ISetupCheck interface - [x] Use SetupCheckUtils trait - [x] Verify JSignPdf path is configured and exists - [x] Verify Java is available - [x] Check JSignPdf version against required version - [x] Return SetupResult with appropriate severity and translated messages - [x] Add unit tests covering all scenarios Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds PDFtkSetupCheck to verify PDFtk binary, integrity, Java dependency and version. Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Implement ISetupCheck interface - [x] Use SetupCheckUtils trait - [x] Verify PDFtk path is configured and exists - [x] Verify Java is available - [x] Check PDFtk version matches required version - [x] Return SetupResult with appropriate severity and translated messages - [x] Add unit tests covering all scenarios Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds PopplerSetupCheck to verify pdfsig and pdfinfo utilities (optional). Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Implement ISetupCheck interface - [x] Check pdfsig installation and version - [x] Check pdfinfo installation and version - [x] Return info severity when missing (optional check) - [x] Return success when both tools are working - [x] Add unit tests covering all scenarios Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds ImagickSetupCheck to verify imagick PHP extension (optional). Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Implement ISetupCheck interface - [x] Check if imagick extension is loaded - [x] Return info severity when not loaded (optional check) - [x] Return success when loaded - [x] Add unit tests covering both states Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds CertificateEngineSetupCheck to process certificate engine configuration results. Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Implement ISetupCheck interface - [x] Use CertificateEngineFactory to get current engine - [x] Process ConfigureCheckHelper results from engine - [x] Convert to SetupResult with aggregated messages and tips - [x] Handle engine not defined (error) - [x] Add unit tests covering success, warning, error, and mixed results Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Registers all six setup check classes in Application.php. Related issue: LibreSign#6590 Type: Feature Checklist: - [x] Add registerSetupCheck for JavaSetupCheck - [x] Add registerSetupCheck for JSignPdfSetupCheck - [x] Add registerSetupCheck for PDFtkSetupCheck - [x] Add registerSetupCheck for PopplerSetupCheck - [x] Add registerSetupCheck for ImagickSetupCheck - [x] Add registerSetupCheck for CertificateEngineSetupCheck Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
Adds @deprecated annotation to ConfigureCheckService pointing to the new individual setup checks. Related issue: LibreSign#6590 Type: Maintenance Checklist: - [x] Add @deprecated tag with version 13.0.4 - [x] Mention replacement classes (JavaSetupCheck, JSignPdfSetupCheck, etc.) Signed-off-by: Guilherme Carvalho <dev.gcarvalho@gmail.com>
3015ad8 to
2b31973
Compare
vitormattos
requested changes
Mar 4, 2026
Member
vitormattos
left a comment
There was a problem hiding this comment.
Run the command at LibreSign folder inside container:
composer cs:fix
Some files have a wrong indent pattern.
Comment on lines
+23
to
+26
| /** | ||
| * @deprecated 13.0.4 Use the individual SetupCheck classes instead | ||
| * (JavaSetupCheck, JSignPdfSetupCheck, etc.). | ||
| */ |
Member
There was a problem hiding this comment.
Why this, and why not solve?
vitormattos
reviewed
Mar 4, 2026
| use OCA\Libresign\Service\Install\InstallService; | ||
| use OCA\Libresign\SetupCheck\JavaSetupCheck; | ||
| use OCA\Libresign\SetupCheck\FileSystemMock; | ||
| use OCA\Libresign\SetupCheck\ExecMock; |
Member
There was a problem hiding this comment.
I think that by this way, moving the mock to be an external file of test class, isn't good. Maybe would be best to move the mock files to a new namespace before the row 8 with the mocks.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Related Issue
Issue Number: #6590
Pull Request Type
Pull request checklist
Summary of Changes
This PR refactors the old
ConfigureCheckService.phpinto six specialized classes that implement Nextcloud'sISetupCheckinterface. This improves the admin experience by showing detailed setup checks directly in the Nextcloud administration overview and makes them available viaocc setupchecks.The following checks were created:
JavaSetupCheckConfigureCheckService::checkJava()JSignPdfSetupCheckConfigureCheckService::checkJSignPdf()PDFtkSetupCheckConfigureCheckService::checkPdftk()CertificateEngineSetupCheckConfigureCheckService::checkCertificate()PopplerSetupCheckConfigureCheckService::checkPoppler()ImagickSetupCheckConfigureCheckService::checkImagick()Screenshots
All checks are registered in
Application.phpand the oldConfigureCheckServicehas been marked as deprecated with a@deprecatedannotation pointing to the new classes.How to Test
Via the web interface:
Via CLI:
You should see the results for all LibreSign checks.
Run unit tests:
All tests should pass.