Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge dev to master (release 1.3.0) #112

Merged
merged 35 commits into from
Sep 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
35 commits
Select commit Hold shift + click to select a range
ff23460
Add docker pulls badge
sverdlov93 Jun 27, 2022
0e26076
Add new docker theme and fix ddclient on development (#73)
sverdlov93 Jul 11, 2022
651e049
Move log level back to INFO and Fix lint errors (#72)
sverdlov93 Jul 11, 2022
85a00f6
Merge branch 'dev' of https://github.com/jfrog/jfrog-docker-desktop-e…
sverdlov93 Jul 11, 2022
58b8ae8
Add csv button
sverdlov93 Jul 12, 2022
32e661f
Fix impact path ui
sverdlov93 Jul 12, 2022
80edffe
Improve ddClient code and add error proxy
sverdlov93 Jul 12, 2022
190b6ca
Improve Settings pageand export csv
sverdlov93 Jul 26, 2022
a0e48af
Improve settings
sverdlov93 Jul 26, 2022
b739c41
fix connection details
sverdlov93 Jul 26, 2022
a86ae68
fix button loading
sverdlov93 Jul 26, 2022
3c2b8e9
fix scan policy settings
sverdlov93 Aug 16, 2022
52cda54
change log update
sverdlov93 Aug 16, 2022
2adfc18
remove log
sverdlov93 Aug 16, 2022
2bb90f9
New features (#78)
sverdlov93 Aug 30, 2022
b9d1b6b
Fix no vulns found view (#80)
sverdlov93 Aug 30, 2022
db30dd3
Merge remote-tracking branch 'origin/main' into dev
sverdlov93 Aug 30, 2022
20d6c41
merge
sverdlov93 Aug 30, 2022
4600afb
Fix login issue and improve errors
sverdlov93 Aug 31, 2022
6305fc4
fix login
sverdlov93 Aug 31, 2022
01cebbd
Fix windows issues
sverdlov93 Sep 1, 2022
2ea166f
update release notes
sverdlov93 Sep 1, 2022
bc16900
update yarn.lock
sverdlov93 Sep 1, 2022
44e7798
update dockerfile
sverdlov93 Sep 1, 2022
9ab74ad
Improve bugs reporting view to Github's new Issue Form UI
sverdlov93 Sep 12, 2022
dcd8675
Update bug_report.yml
sverdlov93 Sep 12, 2022
6e3cf54
Update bug_report.yml
sverdlov93 Oct 24, 2022
66a56f3
Merge Main to Dev (#104)
eyalk007 Aug 20, 2024
3401b8f
Main to dev (#106)
attiasas Aug 20, 2024
79f0797
improved makefile and added documentation (#105)
eyalk007 Aug 20, 2024
48b4021
upgraded cli version to include password encoding (#108)
eyalk007 Aug 25, 2024
2c70dc4
Redirected the url to the Jfrog sign up page. (#109)
eyalk007 Aug 25, 2024
bb84cc0
Bug fix/windows username not recognized (#107)
eyalk007 Aug 26, 2024
c82d488
Feature/update changelog (#110)
eyalk007 Aug 26, 2024
e5aa3f6
Merge branch 'main' into dev
eyalk007 Sep 3, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
```
6 changes: 4 additions & 2 deletions 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 Expand Up @@ -45,7 +45,9 @@ LABEL org.opencontainers.image.title="JFrog" \
com.docker.extension.detailed-description="<p>The JFrog Docker Desktop Extension scans any of your local Docker images for security vulnerabilities. The scanning process is based on JFrog Xray's 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.</p><h3>Deep recursive scanning</h3><p>When an image is scanned with the JFrog Extension, Xray recursively scans every package included in the Docker Image. Drilling down to analyze even the smallest binary component that affects your software. For example, when analyzing a Docker image, if Xray finds that it contains a Java application it will also analyze all the .jar files used in this application.</p><h3>Fixed versions</h3><p>The JFrog Extension not only allows the detection of vulnerable packages, but also displays the software versions that include the fixes, allowing you to upgrade the vulnerable packages and resolve the issue.</p><h3>Easy and intuitive interface</h3><p>When clicking on a specific vulnerability, the view is expanded, to also include the issue description, online references about the issue, and a graph showing the location of the vulnerability within the image.</p><h3>It is all available for free</h3><p>Using the JFrog Extension doesn't require a paid JFrog subscription. You can use your own existing JFrog environment, or set up a new one in just two steps.</p><video src=\"https://user-images.githubusercontent.com/29822394/167414572-df6b2d4f-9c77-4d93-9c82-500057e2ffda.mov\" controls=\"controls\" muted=\"muted\" style=\"max-width:100%;\"></video>" \
com.docker.extension.publisher-url="https://jfrog.com" \
com.docker.extension.additional-urls="[{\"title\":\"Documentation\",\"url\":\"https://github.com/jfrog/jfrog-docker-desktop-extension#readme\"},{\"title\":\"Source code\",\"url\":\"https://github.com/jfrog/jfrog-docker-desktop-extension\"},{\"title\":\"JFrog Xray documentation\",\"url\":\"https://www.jfrog.com/confluence/display/JFROG/JFrog+Xray\"}]" \
com.docker.extension.changelog="<p>Exciting New Features🎉</p><ul><li>Improve error and warning messages</li><li>Improve Scan page UI</li><li>Improve Setting page UI</li><li>Adjust App for small/large screens</li><li>Added Mac ARM64 CLI Support</li>/ul><p>Bug Fixes 🛠</p><ul><li>Fix scanning policy watches/project issue</li><li>Fix Windows permission issues</li><li>Fix 'Create one for FREE' link</li></ul>"
com.docker.extension.changelog="<p>New Improvements 📈</p><ul><li>Improved encryption for user credentials</li></ul><p>Bug Fixes 🛠</p><ul><li>Fixed login issues for Windows users</li><li>Fixed the free environment link</li></ul>"


COPY --from=client-builder /app/client/dist ui
COPY resources/icon.svg .
COPY metadata.json .
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 @@ -41,6 +41,6 @@ Using the JFrog Extension doesn't require a paid JFrog subscription.
Follow these directions to proceed, based on your use case:

- If you already have a JFrog environment which includes Xray, all you need to do is set the connection details through the UI.
- If you don't have a JFrog environment, JFrog supports setting up an environment for free. The extension will then connect to this environment automatically. Please note that this new JFrog environment will be available for you as long as you need it.
- If you don't have a JFrog environment, you can try it out with JFrog's free trial.

##
2 changes: 1 addition & 1 deletion client/src/api/config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { execOnHost, isWindows, throwErrorAsString, ddClient, ddToast } from './utils';
import { execOnHost, isWindows, throwErrorAsString, ddClient } from './utils';
import { ExtensionConfig } from '../types';
/**
* There are two kinds of configurations that are managed and used in the extension:
Expand Down
37 changes: 0 additions & 37 deletions client/src/api/setup-env.ts

This file was deleted.

2 changes: 1 addition & 1 deletion client/src/components/CredentialsForm/CredentialsForm.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const CredentialsForm = (
alignItems: 'center',
}}
>
Create one for FREE
Create a FREE TRIAL
<OpenInIcon sx={{ marginLeft: '3px', fontSize: '18px' }} />
</Link>
</Box>
Expand Down
2 changes: 1 addition & 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
46 changes: 7 additions & 39 deletions client/src/pages/SetupEnv.tsx
Original file line number Diff line number Diff line change
@@ -1,59 +1,34 @@
import { styled, Box, Button, Link, Stack } from '@mui/material';
import { useState } from 'react';
import { useNavigate } from 'react-router-dom';
import { setupEnv } from '../api/setup-env';
import { ddToast } from '../api/utils';
import { ddClient } from '../api/utils';
import { JfrogHeadline } from '../components/JfrogHeadline';

export const enum SetupStage {
Idle,
WaitingForUser,
PreparingEnv,
Done,
Error,
}
const FREE_TRIAL_LINK : string = "https://jfrog.com/start-free/";

export const SetupEnvPage = () => {
const navigate = useNavigate();
const [setupStage, setSetupStage] = useState<SetupStage>(SetupStage.Idle);

const setupEnvHandler = () => {
setSetupStage(SetupStage.WaitingForUser);
setupEnv(() => setSetupStage(SetupStage.PreparingEnv))
.then(() => {
setSetupStage(SetupStage.Done);
ddToast.success('Please verify your email address within the next 72 hours.');
navigate('/scan');
})
.catch(() => {
setSetupStage(SetupStage.Error);
console.error;
});
};

return (
<>
<JfrogHeadline headline="Create a FREE JFrog Environment" />
<JfrogHeadline headline="Create a FREE TRIAL JFrog Environment" />
<Stack direction="column" justifyContent="flex-start" alignItems="flex-start" spacing={0} margin={'50px'}>
<Box>You can set up a FREE JFrog Environment in the cloud.</Box>
<Box>You can set up a FREE TRIAL JFrog Environment.</Box>
<Box>
{'We invite you to '}
<Link
underline="hover"
fontWeight="700"
fontSize="16px"
onClick={setupEnvHandler}
onClick={() => ddClient?.host?.openExternal(FREE_TRIAL_LINK)}
sx={{
textDecoration: 'underline',
}}
>
sign in here
sign up here
</Link>
{' to create your environment.'}
</Box>
<Box> Docker Desktop will automatically connect to your environment once the setup is complete.</Box>

{(setupStage == SetupStage.WaitingForUser || setupStage == SetupStage.PreparingEnv) && (
<Box> Upon Completion, you will be able to sign in with your new environment and credentials </Box>
<Box width={1} marginTop="50px" display="flex" position="relative">
<video width={'100%'} muted autoPlay loop style={{ objectFit: 'cover', transform: 'scaleX(-1)' }}>
<source src={'https://media.jfrog.com/wp-content/uploads/2021/12/29120758/drop-1.mp4'} type="video/mp4" />
Expand All @@ -69,10 +44,8 @@ export const SetupEnvPage = () => {
fontWeight="600"
zIndex="1000"
>
{setupStage == SetupStage.WaitingForUser ? 'Waiting for you to sign in...' : 'Completing the setup...'}
</Box>
</Box>
)}
</Stack>
<DoneButton>
<Button type="submit" onClick={() => navigate(-1)} variant="outlined">
Expand All @@ -83,11 +56,6 @@ export const SetupEnvPage = () => {
);
};

const Title = styled(Box)`
display: flex;
align-items: flex-start;
`;

const DoneButton = styled(Box)`
position: absolute;
padding: 20px;
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
8 changes: 4 additions & 4 deletions host/windows/readconf.bat
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
@ECHO OFF

:: Prints the extension configuration to stdout (in JSON format).
set "HOME_DIR=%USERPROFILE%\.jfrog-docker-desktop-extension"
set "CONF_FILE=%HOME_DIR%\jfrog-docker-desktop-extension.conf"

set HOME_DIR=%USERPROFILE%\.jfrog-docker-desktop-extension
set CONF_FILE=%HOME_DIR%\jfrog-docker-desktop-extension.conf

type %CONF_FILE%
:: Use quotes around the CONF_FILE variable to handle paths with spaces.
type "%CONF_FILE%"
Loading
Loading