Skip to content

Add remote command line#349

Open
edwardcrichton wants to merge 1 commit intodevelopfrom
feature/remoteCommandLine
Open

Add remote command line#349
edwardcrichton wants to merge 1 commit intodevelopfrom
feature/remoteCommandLine

Conversation

@edwardcrichton
Copy link
Copy Markdown
Collaborator

Add tool for finding Picocli defined command lines that are Beans and run them

They can be run locally, in a local ApplicationContext, or remotely via Admin endpoints

Remote command does this:

  • Ask endpoint to prepare for the command to be run by accounting for any input or output files
  • Transfer any input files
  • Call the command with file parameters substituted for server-local ones
  • Write any stdout/stderr to the caller
  • Transfer any output files back, saving to the originally specified locations

Can also ask for the list of available commands, and ask each command for its help / usage message

The CLITool is itself a Picocli command line tool

Add tool for finding Picocli defined command lines that are Beans and run them

They can be run locally, in a local ApplicationContext, or remotely via Admin endpoints

Remote command does this:
 * Ask endpoint to prepare for the command to be run by accounting for any input or output files
 * Transfer any input files
 * Call the command with file parameters substituted for server-local ones
 * Write any stdout/stderr to the caller
 * Transfer any output files back, saving to the originally specified locations
@github-actions
Copy link
Copy Markdown

github-actions bot commented Mar 19, 2026

⚠️MegaLinter analysis: Success with warnings

Descriptor Linter Files Fixed Errors Warnings Elapsed time
✅ ACTION actionlint 1 0 0 0.04s
⚠️ API spectral 1 0 1 2.58s
⚠️ BASH bash-exec 10 9 0 0.03s
⚠️ BASH shellcheck 10 21 0 0.46s
⚠️ BASH shfmt 10 10 0 0.01s
⚠️ COPYPASTE jscpd yes 467 no 62.75s
⚠️ GROOVY npm-groovy-lint 562 3 13351 441.9s
✅ JSON jsonlint 11 0 0 0.15s
⚠️ JSON prettier 11 1 0 1.75s
✅ JSON v8r 11 0 0 6.44s
⚠️ MARKDOWN markdownlint 6 27 0 0.93s
✅ MARKDOWN markdown-table-formatter 6 0 0 0.34s
⚠️ REPOSITORY checkov yes 5 no 64.03s
⚠️ REPOSITORY gitleaks yes 1 8 301.09s
✅ REPOSITORY git_diff yes no no 0.05s
⚠️ REPOSITORY grype yes 3 1 89.88s
✅ REPOSITORY secretlint yes no no 6.7s
✅ REPOSITORY syft yes no no 11.35s
⚠️ REPOSITORY trivy yes 1 no 16.72s
✅ REPOSITORY trivy-sbom yes no no 0.61s
✅ REPOSITORY trufflehog yes no no 15.72s
⚠️ SPELL cspell 645 7507 0 248.83s
⚠️ SPELL lychee 30 74 0 92.06s
⚠️ XML xmllint 7 1 0 1.31s
⚠️ YAML prettier 13 1 11 1.01s
✅ YAML v8r 13 0 0 4.63s
⚠️ YAML yamllint 13 38 0 0.81s

Detailed Issues

⚠️ BASH / bash-exec - 9 errors
Results of bash-exec linter (version 5.3.3)
See documentation on https://megalinter.io/9.4.0/descriptors/bash_bash_exec/
-----------------------------------------------

✅ [SUCCESS] gradlew
❌ [ERROR] mauro-api/docker/all/micronaut/micronaut-startup.sh
    Error: File:[mauro-api/docker/all/micronaut/micronaut-startup.sh] is not executable

❌ [ERROR] mauro-api/docker/all/postgres/micronaut-config-for-postgres.sh
    Error: File:[mauro-api/docker/all/postgres/micronaut-config-for-postgres.sh] is not executable

❌ [ERROR] mauro-api/docker/all/postgres/postgres-shutdown.sh
    Error: File:[mauro-api/docker/all/postgres/postgres-shutdown.sh] is not executable

❌ [ERROR] mauro-api/docker/all/postgres/postgres-startup.sh
    Error: File:[mauro-api/docker/all/postgres/postgres-startup.sh] is not executable

❌ [ERROR] mauro-api/docker/all/startup/docker-environment.sh
    Error: File:[mauro-api/docker/all/startup/docker-environment.sh] is not executable

❌ [ERROR] mauro-api/docker/all/startup/docker-startup.sh
    Error: File:[mauro-api/docker/all/startup/docker-startup.sh] is not executable

❌ [ERROR] mauro-api/docker/noDB/micronaut/micronaut-startup.sh
    Error: File:[mauro-api/docker/noDB/micronaut/micronaut-startup.sh] is not executable

❌ [ERROR] mauro-api/docker/noDB/startup/docker-environment.sh
    Error: File:[mauro-api/docker/noDB/startup/docker-environment.sh] is not executable

❌ [ERROR] mauro-api/docker/noDB/startup/docker-startup.sh
    Error: File:[mauro-api/docker/noDB/startup/docker-startup.sh] is not executable
⚠️ REPOSITORY / checkov - 5 errors
0

Check: CKV_DOCKER_3: "Ensure that a user for the container has been created"
	FAILED for resource: /mauro-api/build/docker/main/Dockerfile.
	File: /mauro-api/build/docker/main/Dockerfile:1-56
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/docker-policies/docker-policy-index/ensure-that-a-user-for-the-container-has-been-created

		Code lines for this resource are too many. Please use IDE of your choice to review the file.
secrets scan results:

Passed checks: 0, Failed checks: 1, Skipped checks: 0

Check: CKV_SECRET_6: "Base64 High Entropy String"
	FAILED for resource: HIDDEN_BY_MEGALINTER	File: /keycloak/docker-compose.yml:14-15
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/secrets-policies/secrets-policy-index/git-secrets-6

		14 |       KC_CLIENT_SECRET: ZBXabk**********

github_actions scan results:

Passed checks: 64, Failed checks: 0, Skipped checks: 0

openapi scan results:

Passed checks: 2, Failed checks: 3, Skipped checks: 0

Check: CKV_OPENAPI_21: "Ensure that arrays have a maximum number of items"
	FAILED for resource: paths
	File: /mauro-api/build/classes/groovy/main/META-INF/swagger/mauro-0.0.yml:206-210
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/api-policies/openapi-policies/bc-openapi-21

		206 |               type: array
		207 |               items:
		208 |                 type: string
		209 |         required: true
		210 |       responses:

Check: CKV_OPENAPI_4: "Ensure that the global security field has rules defined"
	FAILED for resource: security
	File: /mauro-api/build/classes/groovy/main/META-INF/swagger/mauro-0.0.yml:1-15587
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/api-policies/openapi-policies/ensure-that-the-global-security-field-has-rules-defined

		Code lines for this resource are too many. Please use IDE of your choice to review the file.
Check: CKV_OPENAPI_5: "Ensure that security operations is not empty."
	FAILED for resource: security
	File: /mauro-api/build/classes/groovy/main/META-INF/swagger/mauro-0.0.yml:1-15587
	Guide: https://docs.prismacloud.io/en/enterprise-edition/policy-reference/api-policies/openapi-policies/ensure-that-security-operations-is-not-empty

		Code lines for this resource are too many. Please use IDE of your choice to review the file.

(Truncated to last 2352 characters out of 2432)
⚠️ SPELL / cspell - 7507 errors
",
        "opencontainers",
        "openidprovider",
        "openxmlformats",
        "organisation",
        "overriden",
        "passwordless",
        "pathable",
        "pathsstring",
        "persistencetest",
        "picocli",
        "pkce",
        "pkgs",
        "preparadas",
        "primitivetype",
        "primitivetypes",
        "println",
        "psql",
        "rable",
        "rables",
        "rchen",
        "rcio",
        "reactivestreams",
        "readarray",
        "readlink",
        "recaptcha",
        "redirector",
        "referencefile",
        "referencetype",
        "referencetypes",
        "refreshable",
        "replstate",
        "researcherone",
        "restauration",
        "resteasy",
        "rhus",
        "rique",
        "rkte",
        "robj",
        "rosas",
        "rrez",
        "sarif",
        "sausgs",
        "sdkman",
        "sdkmanrc",
        "seladen",
        "serialisation",
        "serialising",
        "setcap",
        "setgid",
        "setuid",
        "setweight",
        "shellcheck",
        "shellness",
        "siastiques",
        "sicas",
        "slurper",
        "slurpersupport",
        "smalldatetime",
        "smallint",
        "smallmoney",
        "snabbk",
        "snakeyaml",
        "softeng",
        "soluta",
        "sonarlint",
        "spnego",
        "spockframework",
        "spreadsheetml",
        "ssle",
        "stackdump",
        "starttls",
        "stica",
        "subfolders",
        "suklaa",
        "teborg",
        "temurin",
        "terminnology",
        "termsby",
        "threadname",
        "timemachine",
        "tinyint",
        "tlps",
        "tomillo",
        "totp",
        "tsquery",
        "tsvector",
        "tsvectors",
        "turage",
        "ugcu",
        "unauthorised",
        "uncapitalize",
        "unde",
        "unlogged",
        "usermodel",
        "vanniktech",
        "varbinary",
        "varchar",
        "versionable",
        "versionedfolder",
        "versionedfolders",
        "verte",
        "webauthn",
        "websearch",
        "whatisthis",
        "whichs",
        "wrappper",
        "xico",
        "zaxxer",
        "zoneinfo",
        "zulip"
    ]
}


You can also copy-paste megalinter-reports/.cspell.json at the root of your repository

(Truncated to last 2352 characters out of 1724162)
⚠️ REPOSITORY / gitleaks - 1 error
^^^^^^^^^^^^^^^^^^^^^

warning: 8 warnings emitted

(Truncated to last 2352 characters out of 2213700)
⚠️ REPOSITORY / grype - 3 errors
note: A low vulnerability in java-archive package: logback-core, version 1.5.19 was found at: /mauro-api/build/docker/main/layers/libs/logback-core-1.5.19.jar

error: A high vulnerability in java-archive package: jackson-core, version 2.19.2 was found at: /mauro-api/build/docker/main/layers/libs/jackson-core-2.19.2.jar

error: A high vulnerability in java-archive package: micronaut-http-server, version 4.10.13 was found at: /mauro-api/build/docker/main/layers/libs/micronaut-http-server-4.10.13.jar

error: A high vulnerability in java-archive package: micronaut-json-core, version 4.10.13 was found at: /mauro-api/build/docker/main/layers/libs/micronaut-json-core-4.10.13.jar

error: 3 errors emitted
⚠️ COPYPASTE / jscpd - 467 errors
[118:1 - 134:5] (16 lines, 99 tokens)
   mauro-persistence/build.gradle [62:1 - 58:5]

┌────────────┬────────────────┬─────────────┬──────────────┬──────────────┬──────────────────┬───────────────────┐
│ Format     │ Files analyzed │ Total lines │ Total tokens │ Clones found │ Duplicated lines │ Duplicated tokens │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ groovy     │ 553            │ 57063       │ 473699       │ 457          │ 5199 (9.11%)     │ 52913 (11.17%)    │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ sql        │ 17             │ 915         │ 9262         │ 6            │ 108 (11.8%)      │ 1059 (11.43%)     │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ bash       │ 9              │ 510         │ 2921         │ 4            │ 127 (24.9%)      │ 740 (25.33%)      │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ properties │ 1              │ 5           │ 16           │ 0            │ 0 (0%)           │ 0 (0%)            │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ markdown   │ 1              │ 643         │ 12232        │ 0            │ 0 (0%)           │ 0 (0%)            │
├────────────┼────────────────┼─────────────┼──────────────┼──────────────┼──────────────────┼───────────────────┤
│ Total:     │ 581            │ 59136       │ 498130       │ 467          │ 5434 (9.19%)     │ 54712 (10.98%)    │
└────────────┴────────────────┴─────────────┴──────────────┴──────────────┴──────────────────┴───────────────────┘
Found 467 clones.
HTML report saved to megalinter-reports/copy-paste/html/
ERROR: jscpd found too many duplicates (9.19%) over threshold (0%)
Error: ERROR: jscpd found too many duplicates (9.19%) over threshold (0%)
    at ThresholdReporter.report (/node-deps/node_modules/@jscpd/finder/dist/index.js:615:13)
    at /node-deps/node_modules/@jscpd/finder/dist/index.js:109:18
    at Array.forEach (<anonymous>)
    at /node-deps/node_modules/@jscpd/finder/dist/index.js:108:22
    at async /node-deps/node_modules/jscpd/dist/bin/jscpd.js:9:5

(Truncated to last 2352 characters out of 122975)
⚠️ SPELL / lychee - 74 errors
ficate error?
[ERROR] http://accweb/emmployees/fuller.bmp/ | Network error: error sending request for url (http://accweb/emmployees/fuller.bmp/) Maybe a certificate error?
[ERROR] http://accweb/emmployees/davolio.bmp/ | Network error: error sending request for url (http://accweb/emmployees/davolio.bmp/) Maybe a certificate error?
[ERROR] http://accweb/emmployees/leverling.bmp/ | Network error: error sending request for url (http://accweb/emmployees/leverling.bmp/) Maybe a certificate error?

Errors in mauro-api/src/test/resources/publishedModels.json
[TIMEOUT] http://modelcatalogue.cs.ox.ac.uk/sandbox | Timeout
[TIMEOUT] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.plugins.fhir.datamodel/FhirDataModelExporterProviderService/2.4.0-SNAPSHOT | Timeout
[TIMEOUT] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.plugins.excel.datamodel/ExcelDataModelExporterProviderService/5.3.0-SNAPSHOT | Timeout
[TIMEOUT] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.plugins.explorer.provider.exporter/DataModelPdfExporterService/1.0 | Timeout
[TIMEOUT] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.datamodel.provider.exporter/DataModelJsonExporterService/3.2 | Timeout
[400] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.plugins.excel.openclinica/OpenClinicaV3CrfDataModelExporterProviderService/1.0.0-SNAPSHOT | Network error: Bad Request
[TIMEOUT] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.plugins.excel.datamodel/SimpleExcelDataModelExporterProviderService/5.3.0-SNAPSHOT | Timeout
[TIMEOUT] https://maurosandbox.com/sandbox/api/dataModels/0b97751d-b6bf-476c-a9e6-95d3352e8008/export/uk.ac.ox.softeng.maurodatamapper.datamodel.provider.exporter/DataModelXmlExporterService/5.2 | Timeout

Errors in mauro-api/src/main/resources/application-test.yml
[ERROR] http://localhost:2345/ | Network error: error sending request for url (http://localhost:2345/) Maybe a certificate error?

(Truncated to last 2352 characters out of 41223)
⚠️ MARKDOWN / markdownlint - 27 errors
Actual: 1]
README.md:2:1 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:3:59 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:7:68 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:8:74 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:13:92 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:16:86 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:18:94 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:20:88 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:22:90 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:24:86 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:34:90 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:36:87 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:38:95 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:40:86 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:45:89 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:46:96 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:49:100 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:52:93 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
README.md:55 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
README.md:61 error MD040/fenced-code-language Fenced code blocks should have a language specified [Context: "```"]
README.md:64:91 error MD009/no-trailing-spaces Trailing spaces [Expected: 0 or 2; Actual: 1]
ready-configuration/index.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "| Configuration | Description ..."]
ready-configuration/README.md:1 error MD041/first-line-heading/first-line-h1 First line in a file should be a top-level heading [Context: "Docker configurations are held..."]

(Truncated to last 2352 characters out of 2770)
⚠️ GROOVY / npm-groovy-lint - 3 errors
finition is preceded by javadoc. Enum definitions are not checked, due to strange behavior in the Groovy AST.

note: The opening brace for interface org.maurodata.persistence.SecuredContainerizedTest is not followed by a space or whitespace
   ┌─ mauro-persistence/src/testFixtures/groovy/org/maurodata/persistence/SecuredContainerizedTest.groovy:16:37
   │
16 │ @interface SecuredContainerizedTest {}
   │                                     ^
   │
   = Check that there is at least one space (blank) or whitespace after each opening brace ("{") for method/class/interface declarations, closure expressions and block statements.

note: The closing brace for interface org.maurodata.persistence.SecuredContainerizedTest is not preceded by a space or whitespace
   ┌─ mauro-persistence/src/testFixtures/groovy/org/maurodata/persistence/SecuredContainerizedTest.groovy:16:38
   │
16 │ @interface SecuredContainerizedTest {}
   │                                      ^
   │
   = Check that there is at least one space (blank) or whitespace before each closing brace ("}") for method/class/interface declarations, closure expressions and block statements.

warning: Class should be marked with one of @GrailsCompileStatic, @CompileStatic or @CompileDynamic
 = Check that classes are explicitely annotated with either @GrailsCompileStatic, @CompileStatic or @CompileDynamic

note: The operator "=" within class None is not preceded by a space or whitespace
  ┌─ settings.gradle:2:17
  │
2 │ rootProject.name="mauro-micronaut"
  │                 ^
  │
  = Check that there is at least one space (blank) or whitespace around each binary operator.

note: The operator "=" within class None is not followed by a space or whitespace
  ┌─ settings.gradle:2:17
  │
2 │ rootProject.name="mauro-micronaut"
  │                 ^
  │
  = Check that there is at least one space (blank) or whitespace around each binary operator.

note: The String 'mauro-micronaut' can be wrapped in single quotes instead of double quotes
  ┌─ settings.gradle:2:19
  │
2 │ rootProject.name="mauro-micronaut"
  │                   ^^^^^^^^^^^^^^^
  │
  = String objects should be created with single quotes, and GString objects created with double quotes. Creating normal String objects with double quotes is confusing to readers.

warning: 5377 warnings emitted
error: 3 errors emitted

(Truncated to last 2352 characters out of 5620698)
⚠️ JSON / prettier - 1 error
Checking formatting...
[warn] .groovylintrc.json
[warn] mauro-api/src/test/resources/federatedPublishedModelsBytesAsText.json
[warn] mauro-api/src/test/resources/keycloak/realm.json
[warn] mauro-api/src/test/resources/mauroJsonPublishedModels.json
[warn] mauro-api/src/test/resources/publishedModels.json
[warn] mauro-api/src/test/resources/publishedModelsNewerVersions.json
[warn] mauro-api/src/test/resources/subscribedCataloguePublishedModels.json
[warn] mauro-api/src/test/resources/subscribedCataloguePublishedModelsNewerVersions.json
[warn] mauro-domain/src/main/resources/ProfileSpecificationFieldProfile.json
[warn] Code style issues found in 9 files. Run Prettier with --write to fix.
⚠️ YAML / prettier - 1 error
Checking formatting...
[warn] .github/workflows/gradle.yml
[warn] keycloak/docker-compose.yml
[warn] mauro-api/micronaut-cli.yml
[warn] mauro-api/src/main/resources/application-docker.yml
[warn] mauro-api/src/main/resources/application-test.yml
[warn] mauro-api/src/main/resources/application.yml
[warn] mauro-api/src/test/resources/application-secured.yml
[warn] mauro-client/src/main/resources/application.yml
[warn] mauro-persistence/src/test/resources/application-test.yml
[warn] ready-configuration/quick-start/init/micronaut/application-mauro.yml
[warn] Code style issues found in 10 files. Run Prettier with --write to fix.
⚠️ BASH / shellcheck - 21 errors
fy location.


In mauro-api/docker/noDB/micronaut/micronaut-startup.sh line 19:
                    . "${f}"
                      ^----^ SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.


In mauro-api/docker/noDB/micronaut/micronaut-startup.sh line 24:
              cp -pf ${f} /home/app/plugins/.
                     ^--^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
              cp -pf "${f}" /home/app/plugins/.


In mauro-api/docker/noDB/micronaut/micronaut-startup.sh line 77:
echo ${JAVA_BIN} "${JAVA_OPTS}" -cp "/home/app/application.jar" "${APPLICATION_MAIN_CLASS}"
     ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
echo "${JAVA_BIN}" "${JAVA_OPTS}" -cp "/home/app/application.jar" "${APPLICATION_MAIN_CLASS}"


In mauro-api/docker/noDB/micronaut/micronaut-startup.sh line 78:
gosu micronaut ${JAVA_BIN} ${JAVA_OPTS} -cp /home/app/application.jar "${APPLICATION_MAIN_CLASS}"
               ^---------^ SC2086 (info): Double quote to prevent globbing and word splitting.
                           ^----------^ SC2086 (info): Double quote to prevent globbing and word splitting.

Did you mean:
gosu micronaut "${JAVA_BIN}" "${JAVA_OPTS}" -cp /home/app/application.jar "${APPLICATION_MAIN_CLASS}"


In mauro-api/docker/noDB/startup/docker-environment.sh line 24:
export CPU_COUNT=$(nproc --all)
       ^-------^ SC2155 (warning): Declare and assign separately to avoid masking return values.


In mauro-api/docker/noDB/startup/docker-environment.sh line 27:
export DOCKER_SUBNET="$(ip -o -4 addr show 2>/dev/null | awk '/scope global/ {split($4,a,"/");split(a[1],b,".");printf "%d.%d.%d.0/%s\n",b[1],b[2],b[3],a[2];exit}')"
       ^-----------^ SC2155 (warning): Declare and assign separately to avoid masking return values.


In mauro-api/docker/noDB/startup/docker-startup.sh line 32:
source "$(which docker-environment.sh)"
       ^-- SC1090 (warning): ShellCheck can't follow non-constant source. Use a directive to specify location.

For more information:
  https://www.shellcheck.net/wiki/SC1087 -- Use braces when expanding arrays,...
  https://www.shellcheck.net/wiki/SC1090 -- ShellCheck can't follow non-const...
  https://www.shellcheck.net/wiki/SC2155 -- Declare and assign separately to ...

(Truncated to last 2352 characters out of 6255)
⚠️ BASH / shfmt - 10 errors
+4,20 @@
 # The actual maximum memory allowed is controlled by the
 # docker engine VM's limit
 
-if [ -f /sys/fs/cgroup/memory.max ];
-then
-    MEM_LIMIT=$(cat /sys/fs/cgroup/memory.max)
+if [ -f /sys/fs/cgroup/memory.max ]; then
+	MEM_LIMIT=$(cat /sys/fs/cgroup/memory.max)
 elif [ -f /sys/fs/cgroup/memory/memory.limit_in_bytes ]; then
-    MEM_LIMIT=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
+	MEM_LIMIT=$(cat /sys/fs/cgroup/memory/memory.limit_in_bytes)
 else
-    MEM_LIMIT="max"
-fi
-
-if [ "$MEM_LIMIT" = "max" ];
-then
-    MEM_LIMIT_KB=$(grep MemTotal /proc/meminfo | awk '{print $2}')
-    MEM_LIMIT=$((MEM_LIMIT_KB * 1024))
-fi
-
-export MEMORY_AVAILABLE_GB=$(( ( MEM_LIMIT + (1024 * 1024 * 1024) - 1 ) / 1024 / 1024 / 1024 ))
+	MEM_LIMIT="max"
+fi
+
+if [ "$MEM_LIMIT" = "max" ]; then
+	MEM_LIMIT_KB=$(grep MemTotal /proc/meminfo | awk '{print $2}')
+	MEM_LIMIT=$((MEM_LIMIT_KB * 1024))
+fi
+
+export MEMORY_AVAILABLE_GB=$(((MEM_LIMIT + (1024 * 1024 * 1024) - 1) / 1024 / 1024 / 1024))
 echo "Detected memory limit: ${MEMORY_AVAILABLE_GB}GB"
 export CPU_COUNT=$(nproc --all)
 echo "Detected ${CPU_COUNT} cores"
diff mauro-api/docker/noDB/startup/docker-startup.sh.orig mauro-api/docker/noDB/startup/docker-startup.sh
--- mauro-api/docker/noDB/startup/docker-startup.sh.orig
+++ mauro-api/docker/noDB/startup/docker-startup.sh
@@ -2,31 +2,31 @@
 set -e
 
 if ! capsh --print | awk '/^Current:/ {print}' | grep -q cap_net_bind_service; then
-  echo "ERROR: CAP_NET_BIND_SERVICE is required"
-  echo
-  capsh --print
-  exit 1
+	echo "ERROR: CAP_NET_BIND_SERVICE is required"
+	echo
+	capsh --print
+	exit 1
 fi
 
 if ! capsh --print | awk '/^Current:/ {print}' | grep -q cap_setuid; then
-  echo "ERROR: CAP_SETUID is required"
-  echo
-  capsh --print
-  exit 1
+	echo "ERROR: CAP_SETUID is required"
+	echo
+	capsh --print
+	exit 1
 fi
 
 if ! capsh --print | awk '/^Current:/ {print}' | grep -q cap_setgid; then
-  echo "ERROR: CAP_SETGID is required"
-  echo
-  capsh --print
-  exit 1
+	echo "ERROR: CAP_SETGID is required"
+	echo
+	capsh --print
+	exit 1
 fi
 
 if ! capsh --print | awk '/^Current:/ {print}' | grep -q cap_chown; then
-  echo "ERROR: CAP_CHOWN is required"
-  echo
-  capsh --print
-  exit 1
+	echo "ERROR: CAP_CHOWN is required"
+	echo
+	capsh --print
+	exit 1
 fi
 
 source "$(which docker-environment.sh)"

(Truncated to last 2352 characters out of 41873)
⚠️ API / spectral - 1 warning
warning: The provided document does not match any of the registered formats [AsyncAPI 2.0.x, AsyncAPI 2.1.x, AsyncAPI 2.2.x, AsyncAPI 2.3.x, AsyncAPI 2.4.x, AsyncAPI 2.5.x, AsyncAPI 2.6.x, AsyncAPI 3.0.x, AsyncAPI 2.x, AsyncAPI 3.x, OpenAPI 2.0 (Swagger), OpenAPI 3.x, OpenAPI 3.0.x, OpenAPI 3.1.x]
    ┌─ mauro-api/src/main/resources/application.yml:1:1
    │  
  1 │ ╭ micronaut:
  2 │ │   application:
  3 │ │     name: sandbox
  4 │ │     client:
    · │
118 │ │   audit:
119 │ │     scope: ALL
    │ ╰──────────────^

warning: 1 warnings emitted
⚠️ REPOSITORY / trivy - 1 error
error: Artifact: mauro-api/build/docker/main/Dockerfile
Type: dockerfile
Vulnerability DS-0002
Severity: HIGH
Message: Specify at least 1 USER command in Dockerfile with non-root user as argument
Link: [DS-0002](https://avd.aquasec.com/misconfig/ds-0002)
  ┌─ mauro-api/build/docker/main/Dockerfile:1:1
  │
1 │ FROM eclipse-temurin:21-jre-noble
  │ ^
  │
  = Image user should not be 'root'
  = Running containers with 'root' user can lead to a container escape situation. It is a best practice to run containers as non-root users, which can be done by adding a 'USER' statement to the Dockerfile.

error: 1 errors emitted
⚠️ XML / xmllint - 1 error
blished>2024-11-01T12:08:51Z</published>
		<summary>test summary</summary>
		<link href="https//localhost:8088/test/entry/D77476A1-8654-4B69-B579-93DB3467FDC1/artefact.json" rel="alternate" type="application/fhir+json"/>

		<onto:permission code="restricted.read"/>
		<source>
			<title>NHS Digital data load feed</title>
			<id>urn:uuid:b4484456-366a-4430-a8ae-56248003fc5a</id>
			<link href="https://ontology.nhs.uk/syndication/feed/20241101_001_EXT_RC/syndication.xml" length="0" rel="alternate"/>
		</source>
	</entry>
</feed>
<?xml version="1.0"?>
<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!--<withJansi>true</withJansi>-->
        <!-- encoders are assigned the type
             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder>
            <pattern>%cyan(%d{HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="debug">
        <appender-ref ref="STDOUT"/>
    </root>

    <logger name="io.micronaut.cache" level="info"/>
</configuration>
<?xml version="1.0"?>
<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!--<withJansi>true</withJansi>-->
        <!-- encoders are assigned the type
             ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
        <encoder>
            <pattern>%cyan(%d{HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="warn">
        <appender-ref ref="STDOUT"/>
    </root>

<!--    <logger name="io.micronaut.cache" level="info" /> -->

</configuration>
<?xml version="1.0"?>
<configuration>

    <appender name="STDOUT" class="ch.qos.logback.core.ConsoleAppender">
        <!--<withJansi>true</withJansi>-->
      <!-- encoders are assigned the type
           ch.qos.logback.classic.encoder.PatternLayoutEncoder by default -->
      <encoder>
            <pattern>%cyan(%d{HH:mm:ss.SSS}) %green([%thread]) %highlight(%-5level) %magenta(%logger{36}) - %msg%n</pattern>
        </encoder>
    </appender>

    <root level="warn">
        <appender-ref ref="STDOUT"/>
    </root>

<!--    <logger name="io.micronaut.cache" level="info" /> -->

</configuration>

(Truncated to last 2352 characters out of 22666)
⚠️ YAML / yamllint - 38 errors
32:80    error    trailing spaces  (trailing-spaces)
  152:258   error    no new line character at the end of file  (new-line-at-end-of-file)

keycloak/docker-compose.yml
  1:1       warning  missing document start "---"  (document-start)
  29:1      error    too many blank lines (1 > 0)  (empty-lines)

mauro-api/micronaut-cli.yml
  1:1       warning  missing document start "---"  (document-start)

mauro-api/src/main/resources/application-docker.yml
  1:1       warning  missing document start "---"  (document-start)

mauro-api/src/main/resources/application-test.yml
  1:1       warning  missing document start "---"  (document-start)
  8:1       warning  comment not indented like content  (comments-indentation)

mauro-api/src/main/resources/application.yml
  1:1       warning  missing document start "---"  (document-start)
  47:1      warning  comment not indented like content  (comments-indentation)

mauro-api/src/test/resources/application-secured.yml
  1:1       warning  missing document start "---"  (document-start)
  34:33     error    no new line character at the end of file  (new-line-at-end-of-file)

mauro-client/src/main/resources/application.yml
  1:1       warning  missing document start "---"  (document-start)
  8:24      error    no new line character at the end of file  (new-line-at-end-of-file)

mauro-persistence/src/main/resources/application.yml
  1:1       warning  missing document start "---"  (document-start)

mauro-persistence/src/test/resources/application-test.yml
  1:1       warning  missing document start "---"  (document-start)
  19:1      warning  comment not indented like content  (comments-indentation)
  21:31     error    no new line character at the end of file  (new-line-at-end-of-file)

ready-configuration/quick-start/init/micronaut/application-datasources.yml
  1:1       warning  missing document start "---"  (document-start)

ready-configuration/quick-start/init/micronaut/application-javamail.yml
  1:1       warning  missing document start "---"  (document-start)

ready-configuration/quick-start/init/micronaut/application-mauro.yml
  1:1       warning  missing document start "---"  (document-start)
  3:8       error    too many spaces after hyphen  (hyphens)
  8:8       error    too many spaces after hyphen  (hyphens)
  13:8      error    too many spaces after hyphen  (hyphens)

(Truncated to last 2352 characters out of 3392)

See detailed reports in MegaLinter artifacts

You could have the same capabilities but better runtime performances if you use a MegaLinter flavor:

Your project could benefit from a custom flavor, which would allow you to run only the linters you need, and thus improve runtime performances. (Skip this info by defining FLAVOR_SUGGESTIONS: false)

  • Documentation: Custom Flavors
  • Command: npx mega-linter-runner@9.4.0 --custom-flavor-setup --custom-flavor-linters ACTION_ACTIONLINT,API_SPECTRAL,BASH_EXEC,BASH_SHELLCHECK,BASH_SHFMT,COPYPASTE_JSCPD,GROOVY_NPM_GROOVY_LINT,JSON_JSONLINT,JSON_V8R,JSON_PRETTIER,MARKDOWN_MARKDOWNLINT,MARKDOWN_MARKDOWN_TABLE_FORMATTER,REPOSITORY_CHECKOV,REPOSITORY_GIT_DIFF,REPOSITORY_GITLEAKS,REPOSITORY_GRYPE,REPOSITORY_SECRETLINT,REPOSITORY_SYFT,REPOSITORY_TRIVY,REPOSITORY_TRIVY_SBOM,REPOSITORY_TRUFFLEHOG,SPELL_CSPELL,SPELL_LYCHEE,XML_XMLLINT,YAML_PRETTIER,YAML_YAMLLINT,YAML_V8R

MegaLinter is graciously provided by OX Security
Show us your support by starring ⭐ the repository

Copy link
Copy Markdown

@github-advanced-security github-advanced-security bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

npm-groovy-lint (MegaLinter GROOVY_NPM_GROOVY_LINT) found more than 20 potential problems in the proposed changes. Check the Files changed tab for more details.

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