-
Notifications
You must be signed in to change notification settings - Fork 26
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docs: Prepared Prerequisites, Command line mode and Configuration pag…
…es (#597) * docs: Add pages for Single scan for PR and local files Signed-off-by: Oleg Kopysov <[email protected]> * docs: Add Database description page Signed-off-by: Oleg Kopysov <[email protected]> * docs: Add Database customization and Config options pages Signed-off-by: Oleg Kopysov <[email protected]> * docs: Add Build and run, DB configuration, Scanner installation pages Signed-off-by: Oleg Kopysov <[email protected]> * fix: Fix Integration page Signed-off-by: Oleg Kopysov <[email protected]> --------- Signed-off-by: Oleg Kopysov <[email protected]>
- Loading branch information
Showing
12 changed files
with
657 additions
and
400 deletions.
There are no files selected for viewing
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,191 @@ | ||
/** | ||
* CSS for OpenAPI HTML generated with PyMdown Extensions option. | ||
* | ||
* This CSS file works when using the OAD plugin with pymdownx. | ||
* See here how to use it: | ||
* https://www.neoteroi.dev/mkdocs-plugins/web/oad/ | ||
* | ||
* https://github.com/Neoteroi/mkdocs-plugins | ||
**/ | ||
|
||
:root { | ||
--http-get-color: green; | ||
--http-delete-color: #dc0101; | ||
--http-head-color: slateblue; | ||
--http-options-color: steelblue; | ||
--http-patch-color: darkorange; | ||
--http-post-color: darkblue; | ||
--http-put-color: darkmagenta; | ||
--http-trace-color: darkcyan; | ||
--http-route-param-color: rgb(51, 128, 210); | ||
--oad-operation-separator-border-color: gray; | ||
--oad-block-border-color: #00bfa5; | ||
--oad-small-note-color: #666; | ||
--oad-indent-border-color: #c5c5c5; | ||
} | ||
|
||
@media screen { | ||
/* Slate theme, i.e. dark mode */ | ||
[data-md-color-scheme="slate"] { | ||
--http-get-color: #2ea82e; | ||
--http-post-color: #0093c0; | ||
--http-put-color: #c333c3; | ||
--oad-small-note-color: #afafaf; | ||
} | ||
} | ||
|
||
.api-tag { | ||
font-weight: bold; | ||
} | ||
|
||
span[class^="http-"] { | ||
font-weight: bold; | ||
color: #fff; | ||
padding: 4px 1rem; | ||
border-radius: 2px; | ||
margin-right: .5rem; | ||
} | ||
|
||
.http-get { | ||
background-color: var(--http-get-color); | ||
} | ||
|
||
.http-delete { | ||
background-color: var(--http-delete-color); | ||
} | ||
|
||
.http-post { | ||
background-color: var(--http-post-color); | ||
} | ||
|
||
.http-patch { | ||
background-color: var(--http-patch-color); | ||
} | ||
|
||
.http-trace { | ||
background-color: var(--http-trace-color); | ||
} | ||
|
||
.http-put { | ||
background-color: var(--http-put-color); | ||
} | ||
|
||
.http-head { | ||
background-color: var(--http-head-color); | ||
} | ||
|
||
.http-options { | ||
background-color: var(--http-options-color); | ||
} | ||
|
||
.route-param { | ||
color: var(--http-route-param-color); | ||
} | ||
|
||
.operation-separator + h3[id^="get"] .route-param { | ||
color: var(--http-get-color); | ||
} | ||
|
||
.operation-separator + h3[id^="delete"] .route-param { | ||
color: var(--http-delete-color); | ||
} | ||
|
||
|
||
.operation-separator + h3[id^="post"] .route-param { | ||
color: var(--http-post-color); | ||
} | ||
|
||
.operation-separator + h3[id^="patch"] .route-param { | ||
color: var(--http-patch-color); | ||
} | ||
|
||
.operation-separator + h3[id^="trace"] .route-param { | ||
color: var(--http-trace-color); | ||
} | ||
|
||
.operation-separator + h3[id^="put"] .route-param { | ||
color: var(--http-put-color); | ||
} | ||
|
||
.operation-separator + h3[id^="head"] .route-param { | ||
color: var(--http-head-color); | ||
} | ||
|
||
.operation-separator + h3[id^="options"] .route-param { | ||
color: var(--http-options-color); | ||
} | ||
|
||
.api-version { | ||
font-size: 1.2rem; | ||
} | ||
|
||
.operation-separator { | ||
margin: 0 !important; | ||
border-bottom: 2px dotted var(--oad-operation-separator-border-color) !important; | ||
padding-top: .5rem; | ||
} | ||
|
||
.operation-separator + h3 { | ||
margin-top: 1rem; | ||
} | ||
|
||
.string-type { | ||
color: var(--md-code-hl-string-color); | ||
} | ||
|
||
.integer-type, .number-type { | ||
color: var(--md-code-hl-number-color); | ||
} | ||
|
||
.boolean-type { | ||
color: var(--md-code-hl-keyword-color); | ||
} | ||
|
||
.format { | ||
color: var(--md-code-hl-name-color); | ||
} | ||
|
||
.null-type { | ||
color: var(--md-code-hl-keyword-color); | ||
} | ||
|
||
a.ref-link { | ||
color: var(--md-code-hl-special-color); | ||
} | ||
|
||
.request-block + div { | ||
padding-left: 1rem; | ||
border-left: 2px dashed var(--oad-block-border-color); | ||
} | ||
|
||
.small-note { | ||
font-size: 14px; | ||
color: var(--oad-small-note-color); | ||
} | ||
|
||
.request-body-title { | ||
margin-bottom: 4px; | ||
} | ||
|
||
.request-body-title + .tabbed-set, | ||
.response-title + .tabbed-set, | ||
.message-separator + .tabbed-set, | ||
.common-response, | ||
.response-section { | ||
margin-top: 2px; | ||
padding-left: 1rem; | ||
border-left: 2px dotted var(--oad-indent-border-color); | ||
} | ||
|
||
.info-data { | ||
font-size: .6rem; | ||
} | ||
|
||
.message-separator { | ||
visibility: hidden; | ||
} | ||
|
||
.sub-section-title { | ||
font-style: italic; | ||
font-size: 14px; | ||
} |
This file contains 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
This file contains 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
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Single scan of local files | ||
|
||
One-time scan on a specific local files from the command line. | ||
|
||
--- | ||
|
||
You can perform a one-time scan on a specific local file or folder using the single scan mode. | ||
LPVS should be compiled from the source code. Please refer to the [detailed guideline](../../user-guide/service/build-and-run.md). | ||
|
||
Follow the next steps: | ||
|
||
* Make sure that the ScanOSS scanner is installed. If not, please follow | ||
the [installation guide](../../user-guide/service/scanner.md). | ||
|
||
* Fill in all required properties in the profile file. Please refer to | ||
the [profile configuration guide](../config/options.md). | ||
|
||
* Build and install LPVS, navigate to the target directory. For more details, | ||
please refer to the [build instructions](../service/build-and-run.md). | ||
|
||
```bash | ||
mvn clean install | ||
cd target/ | ||
``` | ||
|
||
* Choose a specific local file or folder which is a target for the scan and run the command with flag `--local.path`: | ||
|
||
```bash | ||
java -jar lpvs-*.jar --local.path=</path/to/file/or/folder> | ||
``` | ||
|
||
Example: | ||
|
||
```bash | ||
-jar lpvs-*.jar --local.path=test.java | ||
``` | ||
|
||
!!! note | ||
|
||
By default, the above commands require a [pre-configured MySQL database](../../user-guide/service/database.md). | ||
Use the "singlescan" profile to skip setting up a pre-configured MySQL database: | ||
|
||
```bash | ||
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> | ||
``` | ||
|
||
* Optionally, generate an HTML report and save it in a specified folder using flag `--build.html.report`. | ||
Replace `path/to/your/folder` with the full path to the folder where you want to save the HTML report, | ||
and `your_report_filename.html` with the desired filename for the report. | ||
|
||
```bash | ||
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.html.report=<your_report_filename.html> | ||
``` | ||
|
||
!!! warning | ||
|
||
Ensure that the specified folder exists before generating the HTML report. | ||
|
||
Examples of the command: | ||
|
||
```bash | ||
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test.c | ||
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.html.report=test/report.html | ||
``` |
This file contains 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
# Single scan of the pull request | ||
|
||
One-time scan on a specific pull request from the command line. | ||
|
||
--- | ||
|
||
You can perform a one-time scan on a specific pull request using the single scan mode. | ||
LPVS should be compiled from the source code. Please refer to the [detailed guideline](../../user-guide/service/build-and-run.md). | ||
|
||
Follow the next steps: | ||
|
||
* Make sure that the ScanOSS scanner is installed. If not, please follow | ||
the [installation guide](../../user-guide/service/scanner.md). | ||
|
||
* Fill in all required properties in the profile file. Please refer to | ||
the [profile configuration guide](../config/options.md). | ||
|
||
* Build and install LPVS, navigate to the target directory. For more details, | ||
please refer to the [build instructions](../service/build-and-run.md). | ||
|
||
```bash | ||
mvn clean install | ||
cd target/ | ||
``` | ||
|
||
* Choose a specific pull request from GitHub which is a target for the scan and run the command with flag `--github.pull.request`: | ||
|
||
```bash | ||
java -jar -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL> | ||
``` | ||
|
||
Example: | ||
|
||
```bash | ||
-jar -Dgithub.token=your_personal_token lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/594 | ||
``` | ||
|
||
!!! note | ||
|
||
By default, the above commands require a [pre-configured MySQL database](../../user-guide/service/database.md). | ||
Use the "singlescan" profile to skip setting up a pre-configured MySQL database: | ||
|
||
```bash | ||
java -jar -Dspring.profiles.active=singlescan -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL> | ||
``` | ||
|
||
* Optionally, generate an HTML report and save it in a specified folder using flag `--build.html.report`. | ||
Replace `path/to/your/folder` with the full path to the folder where you want to save the HTML report, | ||
and `your_report_filename.html` with the desired filename for the report. | ||
|
||
```bash | ||
java -jar -Dspring.profiles.active=singlescan -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL> --build.html.report=</path/to/your/folder/your_report_filename.html> | ||
``` | ||
|
||
!!! warning | ||
|
||
Ensure that the specified folder exists before generating the HTML report. | ||
|
||
Examples of the command: | ||
|
||
```bash | ||
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2 | ||
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2 --build.html.report=report.html | ||
``` |
Oops, something went wrong.