Git Product home page Git Product logo

find-hosted-oss-components's Introduction

Open source components don't belong in hosted repos!

This repository contains a script to check if you have open source (components) artifacts stored in your hosted repositories. The generated file can then be used to evaluate the components using the Nexus Platform.

Requirements

  • Python3
  • GoLang
  • NXRM3 OSS or PRO
  • Local build of Sonatype Hashbrowns.
    Hashbrowns is a utility for scanning sha1 sums with Sonatype's Nexus IQ Server.

โ€ผ - Large registries with NX3 might cause an orient error. If you run into this contact your Sonatype CS for help

Instructions

Download and build Sonatype Hashbrowns from source - https://github.com/sonatype-nexus-community/hashbrowns

git clone https://github.com/sonatype-nexus-community/hashbrowns.git
cd hashbrowns
make

If make causes this error:

xcrun error: invalid active developer path...
missing xcrun at: ...

Run: xcode-select --install

Step 1: Clone this repo and customise values in hashbrowns-order.py

You'll need to modify the script to include

  1. Auth creds or tokens from your NXRM. (USER and TOKEN)
  2. URL to your Nexus (REPO_HOSTNAME)
  3. Hosted Repository to evaluateREPO

You'll find examples of all in the script.

Step 2: Create new virtual environment

python3 -m venv venv

Step 3: Activate your virtual environment

Do this in your terminal or by using your favorite IDE

Windows

venv\Scripts\activate.bat

MacOs *NIX Linux

source venv/bin/activate
source venv/bin/activate.fish

Step 4: Install dependencies

pip install -r requirements.txt

If error make sure pip is updated: pip install --upgrade pip

Step 5: Run script

To run the script simply type - results will be piped to the file specified.

 python3 ./hashbrowns-order.py > hashbrowns-order.txt

Step 6: Run hashbrowns with the generated file

  • The application ID must exist in the IQ server before running the following.
cd <hashbrowns directory>
./hashbrowns fry --application hosted-nxrm  --token "Nexus!23"  --server-url "http://localhost:8070" --user "admin" --stage stage-release --path <path>/hashbrowns-order.txt

Step 7: Review the report in Nexus IQ Server

The report URL is printed after the report runs. Prepend the report url with the IQ server hostname and port.

  • The report will list public open source components found in the hosted repositories. These components should be removed from the hosted repositories and served by proxy repositories.

find-hosted-oss-components's People

Contributors

acpcreation avatar maurycupitt avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.