Coder Social home page Coder Social logo

scancode-server's Introduction

scancode-server

Codacy Badge

This is a server for the ScanCode toolkit(https://github.com/nexB/scancode-toolkit).

This is a work-in-progress...

The goal is to provide a minimal web UI and a comprehensive REST API to:

  • scan code for origin, licensing and dependencies for a remote URL, a remote repo or a file upload.
  • store scan results and eventually offer a central storage place for ScanCode scans even when done using the ScanCode CLI app.
  • offer some Travis and/or Github integration to scan on commit with webhooks.
  • eventually offer extra goodies such as scan based on a received tweet of similar IRC or IM integration.

Installation

Note: these instructions are tested only for now only on Debian and Debian derivative Linux distros.

The ScanCode server is designed to run on POSIX (Linux, Mac, etc). Windows is not tested and not supported for now.

  1. System requirements
  • Get Python 2.7.x installed first and pip (pip is included in the Python.org downloads since Python 2.7.9)

  • Install PostgreSQL 9.5.x of later. (9.6 preferred) On Debian distros use: sudo apt-get install postgresql-9.5-dev

  • Install extra utilities if needed: sudo apt-get install wget build-essential redis-server

  1. Configure a local test database
  • Create a local test scancode database user. Use scancode as password when prompted (otherwise use any password and update your settings locally). sudo -u postgres createuser --no-createrole --no-superuser --login --inherit --createdb --pwprompt scancode

  • Create a local testscancode database. createdb --encoding=utf-8 --owner=scancode --user=scancode --password --host=localhost --port=5432 scancode

  1. Install and configure the ScanCode server
  • Get a clone or archive for the code from https://github.com/nexB/scancode-server

  • cd to the cloned or extracted archive directory

  • Create a local virtual environment with virtualenv . and activate this with source bin/activate

  • Install the required dependencies with pip install -r requirements.txt

  • Create the db schema python manage.py migrate

  • Create a local admin user with python manage.py createsuperuser

  • Run a local test server with python manage.py runserver

  • Run redis-server

  • Run a local celery worker in a separate shell with celery -A scanapp worker -l info

  • Fire a browser at http://127.0.0.1:8000/admin/ to access the admin

Extras

  • If virtualenv is not available use these commands first to install it:
    • mkdir -p tmp && cd tmp
    • wget https://github.com/pypa/virtualenv/archive/15.1.0.tar.gz
    • tar -xf 15.1.0.tar.gz
    • cd ..
    • python2 tmp/virtualenv-15.1.0/virtualenv.py .
    • source bin/activate

scancode-server's People

Contributors

codacy-badger avatar jonoyang avatar monal5031 avatar pgier avatar pombredanne avatar rajukoushik avatar singh1114 avatar srbcheema1 avatar

Stargazers

 avatar  avatar  avatar

Watchers

 avatar  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.