Skip to content

Commit

Permalink
Release version 1.2.1 (#84)
Browse files Browse the repository at this point in the history
  • Loading branch information
sverdlov93 authored Sep 1, 2022
1 parent 63e84cb commit 39bc87f
Show file tree
Hide file tree
Showing 7 changed files with 2,166 additions and 2,109 deletions.
10 changes: 2 additions & 8 deletions Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ 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>New image scan animation</li><li>JFrog CLI version 2.25.1</li><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></ul><p>Bug Fixes 🛠</p><ul><li>Fix scanning policy watches/project issue</li></ul>"
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>"
COPY --from=client-builder /app/client/dist ui
COPY resources/icon.svg .
COPY metadata.json .
Expand All @@ -55,10 +55,4 @@ COPY --from=client-builder host/jf-darwin host/darwin/jf
COPY --from=client-builder host/jf-windows.exe host/windows/jf.exe
COPY --from=client-builder host/jf-linux host/linux/jf

CMD [ "sleep", "infinity" ]






CMD [ "sleep", "infinity" ]
2 changes: 1 addition & 1 deletion client/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
"url": "https://github.com/jfrog/jfrog-docker-desktop-extension",
"directory": "jfrog-docker-desktop-extension"
},
"homepage": "./",
"dependencies": {
"@docker/docker-mui-theme": "^0.0.7",
"@docker/extension-api-client": "^0.2.3",
Expand All @@ -28,7 +29,6 @@
"@types/react-csv": "^1.1.3",
"@types/react-dom": "^16.9.8",
"deepmerge": "^4.2.2",
"history": "^5.0.0",
"react": "^17.0.0",
"react-csv": "^2.2.2",
"react-dom": "^17.0.0",
Expand Down
16 changes: 12 additions & 4 deletions client/src/App.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,18 @@ export default function App() {
<CssBaseline />
<BrowserRouter>
<Routes>
<Route key={'scan'} path={'/scan'} element={<ScanPage />} />
<Route key={'login'} path={'/login'} element={<LoginPage />} />
<Route key={'setupenv'} path={'/setupenv'} element={<SetupEnvPage />} />
<Route key={'settings'} path={'/settings'} element={<SettingsPage />} />
<Route path={'/scan'} element={<ScanPage />} />
<Route path={'C:/scan'} element={<ScanPage />} />

<Route path={'/settings'} element={<SettingsPage />} />
<Route path={'C:/settings'} element={<SettingsPage />} />

<Route path={'/login'} element={<LoginPage />} />
<Route path={'C:/login'} element={<LoginPage />} />

<Route path={'/setupenv'} element={<SetupEnvPage />} />
<Route path={'C:/setupenv'} element={<SetupEnvPage />} />

<Route path="*" element={<LoginPage />} />
</Routes>
</BrowserRouter>
Expand Down
41 changes: 14 additions & 27 deletions client/src/api/config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -37,17 +37,13 @@ export class JfrogExtensionConfig {
* Imports the default configuration from JFrog CLI, if it's already installed and configured on the host.
*/
export async function importConfigFromHostCli(): Promise<void> {
try {
const exportResponse = await execOnHost('jf', 'jf.exe', ['config', 'export']);
const serverToken = exportResponse.stdout;
const importPromise = execOnHost('runcli.sh', 'runcli.bat', ['config', 'import', serverToken]);
const jfrogExtensionConf = new JfrogExtensionConfig();
jfrogExtensionConf.jfrogCliConfigured = true;
const saveExtensionPromise = editJfrogExtensionConfig(jfrogExtensionConf);
await Promise.all([importPromise, saveExtensionPromise]);
} catch (e) {
throwErrorAsString(e);
}
const exportResponse = await execOnHost('jf', 'jf.exe', ['config', 'export']);
const serverToken = exportResponse.stdout;
const importPromise = await execOnHost('runcli.sh', 'runcli.bat', ['config', 'import', serverToken]);
const jfrogExtensionConf = new JfrogExtensionConfig();
jfrogExtensionConf.jfrogCliConfigured = true;
const saveExtensionPromise = await editJfrogExtensionConfig(jfrogExtensionConf);
await [importPromise, saveExtensionPromise];
}

/**
Expand Down Expand Up @@ -77,13 +73,12 @@ export async function saveConfig(config: Config): Promise<void> {
* Password and access token are omitted.
*/
export async function getConfig(): Promise<Config> {
const jfrogExtensionConfPromise = getJfrogExtensionConfig();
const cliConfPromise = getJfrogCliConfig();
const jfrogExtensionConfPromise =await getJfrogExtensionConfig();
const cliConfPromise =await getJfrogCliConfig();
const config: Config = new Config();
try {
const results = await Promise.all([jfrogExtensionConfPromise, cliConfPromise]);
config.jfrogExtensionConfig = results[0];
config.jfrogCliConfig = results[1];
config.jfrogExtensionConfig = jfrogExtensionConfPromise;
config.jfrogCliConfig = cliConfPromise;
} catch (e) {
throwErrorAsString(e);
}
Expand Down Expand Up @@ -152,12 +147,8 @@ async function getJfrogCliConfigServerId(): Promise<string | undefined> {

async function getJfrogCliFullConfig(): Promise<any> {
let cliConfigRes;
try {
const cliConfResult = await execOnHost('runcli.sh', 'runcli.bat', ['config', 'export']);
cliConfigRes = JSON.parse(window.atob(cliConfResult.stdout));
} catch (e) {
throwErrorAsString(e);
}
const cliConfResult = await execOnHost('runcli.sh', 'runcli.bat', ['config', 'export']);
cliConfigRes = JSON.parse(window.atob(cliConfResult.stdout));
return cliConfigRes;
}

Expand Down Expand Up @@ -198,11 +189,7 @@ async function editCliConfig(cliConfig: JfrogCliConfig, serverId?: string) {

const validationConfigAddArgs = buildConfigImportCmd(cliConfig, validationServerId);
let curlResult;
try {
await execOnHost('runcli.sh', 'runcli.bat', validationConfigAddArgs);
} catch (e) {
throwErrorAsString(e);
}
await execOnHost('runcli.sh', 'runcli.bat', validationConfigAddArgs);

let errorCode: string, statusCode: string;
try {
Expand Down
18 changes: 8 additions & 10 deletions client/src/api/utils.ts
Original file line number Diff line number Diff line change
Expand Up @@ -29,14 +29,13 @@ export function getDockerDesktopClient() {
}

export function throwErrorAsString(e: any) {
ddToast.warning('You can find the logs in your home directory under ".jfrog-docker-desktop-extension/logs".');
ddToast.warning('You can find logs in your home directory under ".jfrog-docker-desktop-extension/logs".');
if (typeof e === 'string') {
throw e;
} else if (!e || e.stderr !== undefined) {
throw 'An error occurred';
} else if (e && e.stderr) {
throw e.stderr;
}

throw e.toString();
throw 'An error occurred';
}

/**
Expand Down Expand Up @@ -89,11 +88,10 @@ export class Versions {
export async function getVersions(): Promise<Versions> {
const versions: Versions = new Versions();
try {
const xrayVersionPromise = execOnHost('runcli.sh', 'runcli.bat', ['xr', 'curl', 'api/v1/system/version']);
const jfrogCliVersionPromise = execOnHost('runcli.sh', 'runcli.bat', ['-v']);
const results = await Promise.all([xrayVersionPromise, jfrogCliVersionPromise]);
const xrayResult = JSON.parse(results[0].stdout);
const jfrogCliResult = results[1].stdout.trim().split(' ');
const xrayVersionPromise = await execOnHost('runcli.sh', 'runcli.bat', ['xr', 'curl', 'api/v1/system/version']);
const jfrogCliVersionPromise = await execOnHost('runcli.sh', 'runcli.bat', ['-v']);
const xrayResult = JSON.parse(xrayVersionPromise.stdout);
const jfrogCliResult = jfrogCliVersionPromise.stdout.trim().split(' ');
versions.xrayVersion = xrayResult.xray_version;
versions.jfrogCliVersion = jfrogCliResult[jfrogCliResult.length - 1];
} catch (e) {
Expand Down
18 changes: 11 additions & 7 deletions client/src/pages/Login.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -13,24 +13,29 @@ import { LoadingButton } from '@mui/lab';
import { ddToast } from '../api/utils';

export const LoginPage = () => {
const [state, setState] = useState<ExtensionConfig>({ authType: BASIC_AUTH });
const [extensionConfig, setExtensionConfig] = useState<ExtensionConfig>({ authType: BASIC_AUTH });
const [isButtonLoading, setButtonLoading] = useState(false);
const [isLoading, setLoading] = useState(true);
const navigate = useNavigate();

const credentialsNotEmpty = state.url && ((state.username && state.password) || state.accessToken);
const credentialsNotEmpty =
extensionConfig.url && ((extensionConfig.username && extensionConfig.password) || extensionConfig.accessToken);

const HandleConnect = async () => {
setButtonLoading(true);
if (await Save(state)) {
if (extensionConfig.authType === BASIC_AUTH) {
extensionConfig.accessToken = undefined;
} else {
extensionConfig.username = undefined;
extensionConfig.password = undefined;
}
if (await Save(extensionConfig)) {
navigate('/scan');
ddToast.success("You're all set!");
}
setButtonLoading(false);
};

let myState = state;

useEffect(() => {
if (isLoading) {
isConfigured()
Expand Down Expand Up @@ -67,14 +72,13 @@ export const LoginPage = () => {
</Title>

<Box
sx={{ minHeight: '500px' }}
onKeyDown={(event) => {
if (credentialsNotEmpty && event.key === 'Enter') {
HandleConnect();
}
}}
>
{CredentialsForm(myState, setState, history, isButtonLoading)}
{CredentialsForm(extensionConfig, setExtensionConfig, navigate, isButtonLoading)}
<LoadingButton
sx={{ width: '100%' }}
disabled={!credentialsNotEmpty}
Expand Down
Loading

0 comments on commit 39bc87f

Please sign in to comment.