Skip to content

Commit 5485f13

Browse files
authored
docs: Prepared Prerequisites, Command line mode and Configuration pages (#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]>
1 parent 99b2fb7 commit 5485f13

File tree

12 files changed

+657
-400
lines changed

12 files changed

+657
-400
lines changed

doc/docs/css/mkdocsoad.css

Lines changed: 191 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,191 @@
1+
/**
2+
* CSS for OpenAPI HTML generated with PyMdown Extensions option.
3+
*
4+
* This CSS file works when using the OAD plugin with pymdownx.
5+
* See here how to use it:
6+
* https://www.neoteroi.dev/mkdocs-plugins/web/oad/
7+
*
8+
* https://github.com/Neoteroi/mkdocs-plugins
9+
**/
10+
11+
:root {
12+
--http-get-color: green;
13+
--http-delete-color: #dc0101;
14+
--http-head-color: slateblue;
15+
--http-options-color: steelblue;
16+
--http-patch-color: darkorange;
17+
--http-post-color: darkblue;
18+
--http-put-color: darkmagenta;
19+
--http-trace-color: darkcyan;
20+
--http-route-param-color: rgb(51, 128, 210);
21+
--oad-operation-separator-border-color: gray;
22+
--oad-block-border-color: #00bfa5;
23+
--oad-small-note-color: #666;
24+
--oad-indent-border-color: #c5c5c5;
25+
}
26+
27+
@media screen {
28+
/* Slate theme, i.e. dark mode */
29+
[data-md-color-scheme="slate"] {
30+
--http-get-color: #2ea82e;
31+
--http-post-color: #0093c0;
32+
--http-put-color: #c333c3;
33+
--oad-small-note-color: #afafaf;
34+
}
35+
}
36+
37+
.api-tag {
38+
font-weight: bold;
39+
}
40+
41+
span[class^="http-"] {
42+
font-weight: bold;
43+
color: #fff;
44+
padding: 4px 1rem;
45+
border-radius: 2px;
46+
margin-right: .5rem;
47+
}
48+
49+
.http-get {
50+
background-color: var(--http-get-color);
51+
}
52+
53+
.http-delete {
54+
background-color: var(--http-delete-color);
55+
}
56+
57+
.http-post {
58+
background-color: var(--http-post-color);
59+
}
60+
61+
.http-patch {
62+
background-color: var(--http-patch-color);
63+
}
64+
65+
.http-trace {
66+
background-color: var(--http-trace-color);
67+
}
68+
69+
.http-put {
70+
background-color: var(--http-put-color);
71+
}
72+
73+
.http-head {
74+
background-color: var(--http-head-color);
75+
}
76+
77+
.http-options {
78+
background-color: var(--http-options-color);
79+
}
80+
81+
.route-param {
82+
color: var(--http-route-param-color);
83+
}
84+
85+
.operation-separator + h3[id^="get"] .route-param {
86+
color: var(--http-get-color);
87+
}
88+
89+
.operation-separator + h3[id^="delete"] .route-param {
90+
color: var(--http-delete-color);
91+
}
92+
93+
94+
.operation-separator + h3[id^="post"] .route-param {
95+
color: var(--http-post-color);
96+
}
97+
98+
.operation-separator + h3[id^="patch"] .route-param {
99+
color: var(--http-patch-color);
100+
}
101+
102+
.operation-separator + h3[id^="trace"] .route-param {
103+
color: var(--http-trace-color);
104+
}
105+
106+
.operation-separator + h3[id^="put"] .route-param {
107+
color: var(--http-put-color);
108+
}
109+
110+
.operation-separator + h3[id^="head"] .route-param {
111+
color: var(--http-head-color);
112+
}
113+
114+
.operation-separator + h3[id^="options"] .route-param {
115+
color: var(--http-options-color);
116+
}
117+
118+
.api-version {
119+
font-size: 1.2rem;
120+
}
121+
122+
.operation-separator {
123+
margin: 0 !important;
124+
border-bottom: 2px dotted var(--oad-operation-separator-border-color) !important;
125+
padding-top: .5rem;
126+
}
127+
128+
.operation-separator + h3 {
129+
margin-top: 1rem;
130+
}
131+
132+
.string-type {
133+
color: var(--md-code-hl-string-color);
134+
}
135+
136+
.integer-type, .number-type {
137+
color: var(--md-code-hl-number-color);
138+
}
139+
140+
.boolean-type {
141+
color: var(--md-code-hl-keyword-color);
142+
}
143+
144+
.format {
145+
color: var(--md-code-hl-name-color);
146+
}
147+
148+
.null-type {
149+
color: var(--md-code-hl-keyword-color);
150+
}
151+
152+
a.ref-link {
153+
color: var(--md-code-hl-special-color);
154+
}
155+
156+
.request-block + div {
157+
padding-left: 1rem;
158+
border-left: 2px dashed var(--oad-block-border-color);
159+
}
160+
161+
.small-note {
162+
font-size: 14px;
163+
color: var(--oad-small-note-color);
164+
}
165+
166+
.request-body-title {
167+
margin-bottom: 4px;
168+
}
169+
170+
.request-body-title + .tabbed-set,
171+
.response-title + .tabbed-set,
172+
.message-separator + .tabbed-set,
173+
.common-response,
174+
.response-section {
175+
margin-top: 2px;
176+
padding-left: 1rem;
177+
border-left: 2px dotted var(--oad-indent-border-color);
178+
}
179+
180+
.info-data {
181+
font-size: .6rem;
182+
}
183+
184+
.message-separator {
185+
visibility: hidden;
186+
}
187+
188+
.sub-section-title {
189+
font-style: italic;
190+
font-size: 14px;
191+
}

doc/docs/dev-guide/integration.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ Use of LPVS JAR in your project
44

55
---
66

7-
## 1. Authenticating with a personal access token
7+
## Authenticating with a personal access token
88

99
You can authenticate to GitHub Packages with Apache Maven by editing your
1010
`~/.m2/settings.xml` file to include your personal access token.
@@ -60,12 +60,12 @@ Example `settings.xml`:
6060

6161
!!! note
6262

63-
if your `settings.xml` file is not located in `~/.m2/settings.xml`, then you need
63+
If your `settings.xml` file is not located in `~/.m2/settings.xml`, then you need
6464
to add the `-s path/to/file/settings.xml` option to `mvn` command
6565

6666
---
6767

68-
## 2 Installing a package
68+
## Installing a package
6969

7070
Edit the `<dependencies>` element of the `pom.xml` file located in your project directory.
7171

doc/docs/user-guide/README.md

Lines changed: 10 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -14,26 +14,18 @@ There are 2 modes of LPVS operation:
1414

1515
## Service mode
1616

17-
- [GitHub webhook configuration]
18-
- [Run service using pre-built Docker image]
19-
- [Build and run service from the source code]
17+
- [GitHub webhook configuration](service/webhook.md)
18+
- [Run service using pre-built Docker image](service/docker.md)
19+
- [Scanner installation](service/scanner.md)
20+
- [Database configuration](service/database.md)
21+
- [Build and run service from the source code](service/build-and-run.md)
2022

2123
## Command line mode
2224

23-
- [Single scan of the pull request]
24-
- [Single scan of local files]
25+
- [Single scan of the pull request](cli/cli_pr.md)
26+
- [Single scan of local files](cli/cli_file.md)
2527

26-
## Configuration options
28+
## Configuration
2729

28-
- [Possible configuration options]
29-
- [Database with licenses and license conflicts]
30-
31-
[GitHub webhook configuration]: service/webhook.md
32-
[Run service using pre-built Docker image]: service/docker.md
33-
[Build and run service from the source code]: service/source_code.md
34-
35-
[Single scan of the pull request]: cli/cli_pr.md
36-
[Single scan of local files]: cli/cli_file.md
37-
38-
[Possible configuration options]: config/options.md
39-
[Database with licenses and license conflicts]: config/database.md
30+
- [Configuration options](config/options.md)
31+
- [Database customization](config/database.md)
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Single scan of local files
2+
3+
One-time scan on a specific local files from the command line.
4+
5+
---
6+
7+
You can perform a one-time scan on a specific local file or folder using the single scan mode.
8+
LPVS should be compiled from the source code. Please refer to the [detailed guideline](../../user-guide/service/build-and-run.md).
9+
10+
Follow the next steps:
11+
12+
* Make sure that the ScanOSS scanner is installed. If not, please follow
13+
the [installation guide](../../user-guide/service/scanner.md).
14+
15+
* Fill in all required properties in the profile file. Please refer to
16+
the [profile configuration guide](../config/options.md).
17+
18+
* Build and install LPVS, navigate to the target directory. For more details,
19+
please refer to the [build instructions](../service/build-and-run.md).
20+
21+
```bash
22+
mvn clean install
23+
cd target/
24+
```
25+
26+
* Choose a specific local file or folder which is a target for the scan and run the command with flag `--local.path`:
27+
28+
```bash
29+
java -jar lpvs-*.jar --local.path=</path/to/file/or/folder>
30+
```
31+
32+
Example:
33+
34+
```bash
35+
-jar lpvs-*.jar --local.path=test.java
36+
```
37+
38+
!!! note
39+
40+
By default, the above commands require a [pre-configured MySQL database](../../user-guide/service/database.md).
41+
Use the "singlescan" profile to skip setting up a pre-configured MySQL database:
42+
43+
```bash
44+
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder>
45+
```
46+
47+
* Optionally, generate an HTML report and save it in a specified folder using flag `--build.html.report`.
48+
Replace `path/to/your/folder` with the full path to the folder where you want to save the HTML report,
49+
and `your_report_filename.html` with the desired filename for the report.
50+
51+
```bash
52+
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=</path/to/file/or/folder> --build.html.report=<your_report_filename.html>
53+
```
54+
55+
!!! warning
56+
57+
Ensure that the specified folder exists before generating the HTML report.
58+
59+
Examples of the command:
60+
61+
```bash
62+
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test.c
63+
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --local.path=test_folder --build.html.report=test/report.html
64+
```

doc/docs/user-guide/cli/cli_pr.md

Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
# Single scan of the pull request
2+
3+
One-time scan on a specific pull request from the command line.
4+
5+
---
6+
7+
You can perform a one-time scan on a specific pull request using the single scan mode.
8+
LPVS should be compiled from the source code. Please refer to the [detailed guideline](../../user-guide/service/build-and-run.md).
9+
10+
Follow the next steps:
11+
12+
* Make sure that the ScanOSS scanner is installed. If not, please follow
13+
the [installation guide](../../user-guide/service/scanner.md).
14+
15+
* Fill in all required properties in the profile file. Please refer to
16+
the [profile configuration guide](../config/options.md).
17+
18+
* Build and install LPVS, navigate to the target directory. For more details,
19+
please refer to the [build instructions](../service/build-and-run.md).
20+
21+
```bash
22+
mvn clean install
23+
cd target/
24+
```
25+
26+
* Choose a specific pull request from GitHub which is a target for the scan and run the command with flag `--github.pull.request`:
27+
28+
```bash
29+
java -jar -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL>
30+
```
31+
32+
Example:
33+
34+
```bash
35+
-jar -Dgithub.token=your_personal_token lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/594
36+
```
37+
38+
!!! note
39+
40+
By default, the above commands require a [pre-configured MySQL database](../../user-guide/service/database.md).
41+
Use the "singlescan" profile to skip setting up a pre-configured MySQL database:
42+
43+
```bash
44+
java -jar -Dspring.profiles.active=singlescan -Dgithub.token=<my-token> lpvs-*.jar --github.pull.request=<PR URL>
45+
```
46+
47+
* Optionally, generate an HTML report and save it in a specified folder using flag `--build.html.report`.
48+
Replace `path/to/your/folder` with the full path to the folder where you want to save the HTML report,
49+
and `your_report_filename.html` with the desired filename for the report.
50+
51+
```bash
52+
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>
53+
```
54+
55+
!!! warning
56+
57+
Ensure that the specified folder exists before generating the HTML report.
58+
59+
Examples of the command:
60+
61+
```bash
62+
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2
63+
java -jar -Dspring.profiles.active=singlescan lpvs-*.jar --github.pull.request=https://github.com/Samsung/LPVS/pull/2 --build.html.report=report.html
64+
```

0 commit comments

Comments
 (0)