Skip to content

Commit

Permalink
Dev (#1)
Browse files Browse the repository at this point in the history
  • Loading branch information
eyalk007 authored Sep 2, 2024
1 parent 39bc87f commit 8ebc972
Show file tree
Hide file tree
Showing 11 changed files with 162 additions and 10 deletions.
76 changes: 76 additions & 0 deletions .github/ISSUE_TEMPLATE/bug_report.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
---
name: "🐛 Bug Report"
description: Create a report to help us improve
labels: [ bug ]
body:
- type: textarea
id: description
attributes:
label: Describe the bug
description: What is the problem? A clear and concise description of the bug.
validations:
required: true

- type: textarea
id: current
attributes:
label: Current behavior
description: |
Please include full errors, uncaught exceptions, screenshots, and relevant logs.
Logs can be found under '/Users/<user>/.jfrog-docker-desktop-extension/logs'
validations:
required: true

- type: textarea
id: reproduction
attributes:
label: Reproduction steps
description: |
Provide steps to reproduce the behavior.
validations:
required: false

- type: textarea
id: expected
attributes:
label: Expected behavior
description: |
What did you expect to happen?
validations:
required: false

- type: input
id: docker-version
attributes:
label: Docker Client and Desktop info
description: using 'docker version' command on your CLI
validations:
required: true

- type: input
id: jfrog-docker-version
attributes:
label: JFrog Docker Desktop Extension version
validations:
required: true

- type: input
id: os-version
attributes:
label: Operating system type, architecture and version
validations:
required: true

- type: input
id: cli-version
attributes:
label: JFrog CLI version
validations:
required: false

- type: input
id: xr-version
attributes:
label: JFrog Xray version
validations:
required: false
5 changes: 5 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
- [ ] All [tests](https://github.com/jfrog/jfrog-docker-desktop-extension#tests) passed. If this feature is not already covered by the tests, I added new tests.
- [ ] This pull request is on the dev branch.
- [ ] I used "yarn lint" for formatting the code before submitting the pull request.
- [ ] Update [documentation](https://github.com/jfrog/documentation) about new features / new supported technologies
---
56 changes: 56 additions & 0 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
# Guidelines
## Prerequisites
Make sure you have these tools on your computer:
- yarn 1.x.x
- docker
- docker for windows

#### Make sure to run the all the "make" commands from the root directory of the project repository.

### Adding Tests

If the existing tests do not already cover your changes, please add tests.

## Building and running the project locally
To build and run the plugin, follow these steps:
1. Clone the code from this git repository https://github.com/jfrog/jfrog-docker-desktop-extension
2. Run this command to build the image locally:
```bash
make build-extension
```
3. Run this command to install the extension on your docker desktop:

```bash
make install-extension
```
4. Make sure the checkbox labeled "Allow only extensions distributed through Docker Marketplace" is unchecked:
![Alt text](resources/screenshots/7.png)
5. Go to "My Extensions" tab on docker desktop and press Open":
![Alt text](resources/screenshots/8.png)
You can now use the extension locally on your docker desktop!
## Updating and debugging code
- To update the extension to include new code run:
```bash
make update
```
- To debug the code run:
```bash
make debug
```
- To stop debugging run:
```bash
make stop-debug
```
## Publishing
To publish new code run this command:
- Pushes the image with the latest tag:
```bash
make release
```
2 changes: 1 addition & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ RUN curl -sL https://deb.nodesource.com/setup_16.x | bash -
RUN apt-get install -y nodejs
RUN npm install -g yarn
WORKDIR /host
ARG jfrogCliVersion=2.25.1
ARG jfrogCliVersion=2.64.0
ARG TARGETARCH
RUN if [ "$TARGETARCH" = "arm64" ]; then \
curl -XGET "https://releases.jfrog.io/artifactory/jfrog-cli/v2-jf/$jfrogCliVersion/jfrog-cli-mac-arm64/jf" -L -k -g > jf-darwin; \
Expand Down
24 changes: 19 additions & 5 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -2,14 +2,28 @@ IMAGE?=jfrog/jfrog-docker-desktop-extension

BUILDER=buildx-multi-arch

extension: ## Build service image to be deployed as a desktop extension
build-extension: ## Build service image to be deployed as a desktop extension
docker build --tag=$(IMAGE) .

install-extension: ## installs the extension on docker desktop with the local image
yes | docker extension install $(IMAGE)

update: ## update the extension locally to include new changes
docker build --tag=$(IMAGE) . && yes | docker extension update $(IMAGE)

debug: ## opens the devtools tab
docker extension dev debug $(IMAGE)

stop-debug: ## closes devtools tab
docker extension dev reset $(IMAGE)

prepare-buildx: ## Create buildx builder for multi-arch build, if not exists
docker buildx inspect $(BUILDER) || docker buildx create --name=$(BUILDER) --driver=docker-container --driver-opt=network=host

push-extension: prepare-buildx ## Build & Upload extension image to hub. Do not push if tag already exists: make push-extension tag=0.1
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=${tag)} --tag=$(IMAGE):$(tag) .
push-extension: prepare-buildx ## Build & upload extension image to hub. Do not push if tag already exists.
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --build-arg TAG=$(tag) --tag=$(IMAGE):$(tag) .

release: prepare-buildx ## Build & Upload extension image to hub with the given tag and the 'latest' tag.
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --tag=$(IMAGE):$(tag) --tag=$(IMAGE):latest .
# Build & upload extension image to hub with the given tag and the 'latest' tag.
# Usage: make release tag=0.1
release: prepare-buildx ## Build & upload extension image to hub with the given tag and the 'latest' tag.
docker pull $(IMAGE):$(tag) && echo "Failure: Tag already exists" || docker buildx build --push --builder=$(BUILDER) --platform=linux/amd64,linux/arm64 --tag=$(IMAGE):$(tag) --tag=$(IMAGE):latest .
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ Any image, after it has been built or pulled locally, can be scanned immediately
The scanning process is based on [JFrog Xray's](https://jfrog.com/xray/) vast vulnerabilities database, which is continuously updated with the latest vulnerabilities.
In addition, a dedicated Security Research Team within JFrog, continuously improves the JFrog Xray's detection methods, ensuring that Xray continues to be a leading security solution in the market.

https://user-images.githubusercontent.com/29822394/187473890-69c4788f-23fa-47f3-90c0-fbcb02439ace.mov
https://user-images.githubusercontent.com/29822394/167414572-df6b2d4f-9c77-4d93-9c82-500057e2ffda.mov

## Deep recursive scanning

Expand Down
3 changes: 2 additions & 1 deletion client/src/pages/Scan.tsx
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { Box, styled, Typography, SelectChangeEvent, CircularProgress, Button, useTheme } from '@mui/material';
import { Box, styled, Typography, CircularProgress, Button, useTheme } from '@mui/material';
import { useEffect, useState } from 'react';

import Select from '../components/Select';
Expand Down Expand Up @@ -103,6 +103,7 @@ export const ScanPage = () => {
saveScanResults(scanId, results);
} catch (e: any) {
setScanData({ ...scanData, [scanId]: {} });

ddToast.error(e.toString());
}
};
Expand Down
2 changes: 1 addition & 1 deletion host/unix/runcli.sh
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ LOG_FILE_PATH=$LOGS_DIR/jfrog-docker-desktop-extension.$(date -n +"%Y-%m-%d.%H-%

export JFROG_CLI_HOME_DIR=$HOME_DIR
export JFROG_CLI_USER_AGENT=jfrog-docker-extension
export JFROG_CLI_LOG_LEVEL=INFO
export JFROG_CLI_LOG_LEVEL=DEBUG
export CI=true

if [ ! -d $LOGS_DIR ]
Expand Down
2 changes: 1 addition & 1 deletion host/windows/runcli.bat
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ set LOGS_DIR=%HOME_DIR%\logs

set JFROG_CLI_HOME_DIR=%HOME_DIR%
set JFROG_CLI_USER_AGENT=jfrog-docker-extension
set JFROG_CLI_LOG_LEVEL=INFO
set JFROG_CLI_LOG_LEVEL=DEBUG
set CI=true

if not exist %LOGS_DIR% mkdir %LOGS_DIR%
Expand Down
Binary file added resources/screenshots/7.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added resources/screenshots/8.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 8ebc972

Please sign in to comment.