-
Notifications
You must be signed in to change notification settings - Fork 25
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* feat: edit quick start guide Signed-off-by: Mykola Rudyk <m.rudyk@samsung.com> * fix: apply changes after review comments Signed-off-by: Mykola Rudyk <m.rudyk@samsung.com> * fix: Fix quick start guide and update readme file Signed-off-by: Oleg Kopysov <o.kopysov@samsung.com> --------- Signed-off-by: Mykola Rudyk <m.rudyk@samsung.com> Signed-off-by: Oleg Kopysov <o.kopysov@samsung.com> Co-authored-by: Oleg Kopysov <o.kopysov@samsung.com>
- Loading branch information
Showing
9 changed files
with
185 additions
and
57 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
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
File renamed without changes.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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 @@ | ||
# Quick Start Guide | ||
|
||
Minimal configuration to set up and run the LPVS service locally. | ||
|
||
--- | ||
|
||
## Configure the repository | ||
|
||
To enable LPVS license scanning for your repository, you need to set up GitHub Webhooks: | ||
|
||
* Create a personal GitHub access token (`personal-token`) according to the [GitHub webhook configuration guide](user-guide/service/webhook.md#create-a-personal-github-access-token). | ||
|
||
* Get a personal Ngrok authentication token (`auth-token`) to expose your local service on the [Ngrok portal](https://dashboard.ngrok.com/get-started/your-authtoken). | ||
|
||
* Configure the [webhook](user-guide/service/webhook.md#configure-the-webhook-in-your-github-repository-settings) in your GitHub repository settings. | ||
|
||
--- | ||
|
||
## Configure and run Docker images | ||
|
||
This section explains how to download and run pre-built LPVS Docker image with ngrok reverse proxy. | ||
|
||
### Set up LPVS Docker environment variables | ||
|
||
* Open `docker-compose-quick.yml` file. | ||
|
||
* In the `environment` part of `lpvs` section find and fill `github.login` and `github.token` (refer to the [guide](user-guide/service/docker.md#setting-up-lpvs-docker-environment-variables)). | ||
|
||
```yaml | ||
- github.login=<github-login> | ||
- github.token=<personal-token> | ||
``` | ||
* In the `environment` part of the `ngrok` section find and fill `auth-token` from [Ngrok portal](https://dashboard.ngrok.com/get-started/your-authtoken). | ||
|
||
```yaml | ||
- NGROK_AUTHTOKEN=<auth-token> | ||
``` | ||
|
||
### Run LPVS and MySQL Docker images with `docker compose` | ||
|
||
* Start the LPVS services: | ||
|
||
```bash | ||
docker compose -f docker-compose-quick.yml up -d | ||
``` | ||
|
||
* To stop the LPVS services: | ||
|
||
```bash | ||
docker compose -f docker-compose-quick.yml down | ||
``` | ||
|
||
Configuration is now completed! | ||
|
||
## Test your pull request | ||
|
||
You can now create a new pull request or update an existing one with new commits. | ||
|
||
LPVS will automatically start the scan and provide a comment about the licenses found in the project. | ||
|
||
Example of the LPVS comment on GitHub: | ||
|
||
![result](img/result.png){: style="height:350px"} |
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,72 @@ | ||
version: '3.4' | ||
|
||
services: | ||
|
||
lpvs: | ||
build: | ||
context: . | ||
image: ghcr.io/samsung/lpvs:latest | ||
restart: always | ||
ports: | ||
- "7896:7896" | ||
environment: | ||
## Required if frontend and backend are different | ||
## Database Configuration | ||
- spring.datasource.url=jdbc:mysql://mysqldb:3306/lpvs | ||
- spring.datasource.username=root | ||
- spring.datasource.password= | ||
- spring.jpa.properties.hibernate.default_schema=lpvs | ||
## Github data for fetching code | ||
- github.login= | ||
- github.token= | ||
- github.api.url=https://api.github.com | ||
- github.secret=LPVS | ||
## Google OAuth Login | ||
- spring.security.oauth2.client.registration.google.client-id=GOOGLE_CLIENT_ID | ||
- spring.security.oauth2.client.registration.google.client-secret=GOOGLE_CLIENT_SECRET | ||
- spring.security.oauth2.client.registration.google.redirect-uri=http://localhost:7896/login/oauth2/code/google | ||
- spring.security.oauth2.client.registration.google.scope=profile, email | ||
## Github OAuth Login | ||
- spring.security.oauth2.client.registration.github.client-id=GITHUB_CLIENT_ID | ||
- spring.security.oauth2.client.registration.github.client-secret=GITHUB_CLIENT_SECRET | ||
- spring.security.oauth2.client.registration.github.redirect-uri=http://localhost:7896/login/oauth2/code/github | ||
- spring.security.oauth2.client.registration.github.scope=user | ||
|
||
depends_on: | ||
mysqldb: | ||
condition: service_healthy | ||
networks: | ||
- lpvs | ||
|
||
mysqldb: | ||
image: mysql:latest | ||
restart: always | ||
ports: | ||
- "3306:3306" | ||
environment: | ||
MYSQL_ALLOW_EMPTY_PASSWORD: "yes" | ||
MYSQL_ROOT_PASSWORD: "" | ||
healthcheck: | ||
test: ["CMD", "mysqladmin" ,"ping", "-h", "localhost"] | ||
timeout: 20s | ||
retries: 10 | ||
volumes: | ||
- ./src/main/resources/database_dump.sql:/docker-entrypoint-initdb.d/init.sql # init for creating db lpvs with predifined tables | ||
networks: | ||
- lpvs | ||
|
||
ngrok: | ||
image: wernight/ngrok | ||
command: ngrok http lpvs:7896 | ||
## NGROK Auth token | ||
environment: | ||
- NGROK_AUTHTOKEN= | ||
ports: | ||
- "4040:4040" | ||
depends_on: | ||
- lpvs | ||
networks: | ||
- lpvs | ||
|
||
networks: | ||
lpvs: |