generated from aboutcode-org/skeleton
-
Notifications
You must be signed in to change notification settings - Fork 2
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2 from ziadhany/main
- Loading branch information
Showing
308 changed files
with
29,453 additions
and
111 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
FEDERATED_CODE_HOST=127.0.0.1 | ||
FEDERATED_CODE_PORT=8000 | ||
FEDERATED_CODE_DOMAIN=${FEDERATED_CODE_HOST}:${FEDERATED_CODE_PORT} | ||
|
||
POSTGRES_HOST=127.0.0.1 | ||
POSTGRES_DB=federatedcode | ||
POSTGRES_USER=federatedcode | ||
POSTGRES_PASSWORD=federatedcode | ||
|
||
FEDERATED_CODE_GIT_PATH=/home/ziad/new_vul | ||
FEDERATED_CODE_CLIENT_ID=4SDoNYvLfOG2h8LNt1ksIwZ4BSx8fZPmPar8SXKJ | ||
FEDERATED_CODE_CLIENT_SECRET=OrzhuzFcxeoaQ8wf1kXPyczmsh6DL10A3duTz1CuSxktvAxKlsjjiGqWUafbovZip75Kt7GmHIOouveRDER7bc41IVq29SvnTqUkFtJKCXcYArQf7WY3BiSPEOBwlw5F | ||
FEDERATED_CODE_STATIC_ROOT=/var/federatedcode/static/ | ||
STATIC_ROOT=/var/federatedcode/static/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,6 @@ jobs: | |
runs-on: ubuntu-20.04 | ||
|
||
strategy: | ||
max-parallel: 4 | ||
matrix: | ||
python-version: [3.9] | ||
|
||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,51 @@ | ||
name: run tests | ||
|
||
on: [push, pull_request] | ||
|
||
env: | ||
FEDERATED_CODE_HOST: 127.0.0.1 | ||
FEDERATED_CODE_PORT: 8000 | ||
FEDERATED_CODE_DOMAIN: 127.0.0.1:8000 | ||
POSTGRES_HOST: 127.0.0.1 | ||
POSTGRES_DB: federatedcode | ||
POSTGRES_USER: federatedcode | ||
POSTGRES_PASSWORD: federatedcode | ||
|
||
jobs: | ||
build: | ||
runs-on: ubuntu-20.04 | ||
|
||
services: | ||
postgres: | ||
image: postgres:latest | ||
env: | ||
POSTGRES_DB: ${{ env.POSTGRES_DB }} | ||
POSTGRES_USER: ${{ env.POSTGRES_USER }} | ||
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | ||
ports: | ||
- 5432:5432 | ||
|
||
steps: | ||
- name: Checkout code | ||
uses: actions/checkout@v4 | ||
|
||
- name: Set up Python ${{ matrix.python-version }} | ||
uses: actions/setup-python@v5 | ||
with: | ||
python-version: '3.10' | ||
|
||
- name: Install dependencies | ||
run: make dev | ||
|
||
- name: Run tests | ||
run: make test | ||
env: | ||
GH_TOKEN: 1 | ||
FEDERATED_CODE_HOST: ${{ env.FEDERATED_CODE_HOST }} | ||
FEDERATED_CODE_PORT: ${{ env.FEDERATED_CODE_PORT }} | ||
FEDERATED_CODE_DOMAIN: ${{ env.FEDERATED_CODE_DOMAIN }} | ||
POSTGRES_HOST: ${{ env.POSTGRES_HOST }} | ||
POSTGRES_DB: ${{ env.POSTGRES_DB }} | ||
POSTGRES_USER: ${{ env.POSTGRES_USER }} | ||
POSTGRES_PASSWORD: ${{ env.POSTGRES_PASSWORD }} | ||
POSTGRES_PORT: ${{ env.POSTGRES_PORT }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -72,3 +72,4 @@ tcl | |
|
||
# Ignore Jupyter Notebook related temp files | ||
.ipynb_checkpoints/ | ||
.env |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
# | ||
# Copyright (c) nexB Inc. and others. All rights reserved. | ||
# VulnerableCode is a trademark of nexB Inc. | ||
# SPDX-License-Identifier: Apache-2.0 | ||
# See http://www.apache.org/licenses/LICENSE-2.0 for the license text. | ||
# See https://github.com/nexB/vulnerablecode for support or download. | ||
# See https://aboutcode.org for more information about nexB OSS projects. | ||
# | ||
FROM python:3.10 | ||
# Python settings: Force unbuffered stdout and stderr (i.e. they are flushed to terminal immediately) | ||
ENV PYTHONUNBUFFERED 1 | ||
# Python settings: do not write pyc files | ||
ENV PYTHONDONTWRITEBYTECODE 1 | ||
|
||
RUN pip install --upgrade pip | ||
|
||
WORKDIR /federatedcode | ||
|
||
COPY requirements.txt pyproject.toml /federatedcode/ | ||
|
||
RUN pip install -r requirements.txt | ||
|
||
COPY . /federatedcode |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,62 +1,24 @@ | ||
A Simple Python Project Skeleton | ||
FederatedCode | ||
================================ | ||
This repo attempts to standardize the structure of the Python-based project's | ||
repositories using modern Python packaging and configuration techniques. | ||
Using this `blog post`_ as inspiration, this repository serves as the base for | ||
all new Python projects and is mergeable in existing repositories as well. | ||
|
||
.. _blog post: https://blog.jaraco.com/a-project-skeleton-for-python-projects/ | ||
|
||
FederatedCode is a decentralized, federated metadata about software applications | ||
|
||
Usage | ||
===== | ||
|
||
A brand new project | ||
------------------- | ||
.. code-block:: bash | ||
git init my-new-repo | ||
cd my-new-repo | ||
git pull [email protected]:nexB/skeleton | ||
# Create the new repo on GitHub, then update your remote | ||
git remote set-url origin [email protected]:nexB/your-new-repo.git | ||
From here, you can make the appropriate changes to the files for your specific project. | ||
|
||
Update an existing project | ||
--------------------------- | ||
.. code-block:: bash | ||
cd my-existing-project | ||
git remote add skeleton [email protected]:nexB/skeleton | ||
git fetch skeleton | ||
git merge skeleton/main --allow-unrelated-histories | ||
This is also the workflow to use when updating the skeleton files in any given repository. | ||
|
||
More usage instructions can be found in ``docs/skeleton-usage.rst``. | ||
|
||
|
||
Release Notes | ||
============= | ||
|
||
- 2023-07-18: | ||
- Add macOS-13 job in azure-pipelines.yml | ||
|
||
- 2022-03-04: | ||
- Synchronize configure and configure.bat scripts for sanity | ||
- Update CI operating system support with latest Azure OS images | ||
- Streamline utility scripts in etc/scripts/ to create, fetch and manage third-party dependencies | ||
There are now fewer scripts. See etc/scripts/README.rst for details | ||
|
||
- 2021-09-03: | ||
- ``configure`` now requires pinned dependencies via the use of ``requirements.txt`` and ``requirements-dev.txt`` | ||
- ``configure`` can now accept multiple options at once | ||
- Add utility scripts from scancode-toolkit/etc/release/ for use in generating project files | ||
- Rename virtual environment directory from ``tmp`` to ``venv`` | ||
- Update README.rst with instructions for generating ``requirements.txt`` and ``requirements-dev.txt``, | ||
as well as collecting dependencies as wheels and generating ABOUT files for them. | ||
|
||
- 2021-05-11: | ||
- Adopt new configure scripts from ScanCode TK that allows correct configuration of which Python version is used. | ||
Getting started | ||
----------------- | ||
|
||
Quick Installation | ||
=================== | ||
On a Debian system, use this:: | ||
sudo apt-get install python3-venv python3-dev postgresql libpq-dev build-essential | ||
git clone https://github.com/nexB/federatedcode.git && cd federatedcode | ||
make dev envfile postgres | ||
make test | ||
source venv/bin/activate | ||
make run | ||
|
||
Acknowledgements | ||
^^^^^^^^^^^^^^^^ | ||
This project was funded through the NGI0 Entrust Fund, a fund established by NLnet with financial support from the European Commission's Next Generation Internet programme, under the aegis of DG Communications Networks, Content and Technology under grant agreement No 101069594. | ||
|
||
https://nlnet.nl/project/FederatedSoftwareMetadata/ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
version: '3' | ||
|
||
services: | ||
db: | ||
image: postgres:16 | ||
env_file: | ||
- docker.env | ||
volumes: | ||
- db_data:/var/lib/postgresql/data/ | ||
federatedcode: | ||
build: . | ||
command: /bin/sh -c " | ||
apt-get update && apt-get install -y gunicorn && | ||
python manage.py collectstatic --no-input --verbosity 0 --clear && | ||
python manage.py migrate && | ||
gunicorn federatedcode.wsgi:application -u nobody -g nogroup --bind :8000 --timeout 600 --workers 8" | ||
env_file: | ||
- docker.env | ||
expose: | ||
- 8000 | ||
ports: | ||
- "8000:8000" | ||
volumes: | ||
- static:/var/federatedcode/static/ | ||
- /etc/federatedcode/:/etc/federatedcode/ | ||
depends_on: | ||
- db | ||
nginx: | ||
image: nginx | ||
env_file: | ||
- docker.env | ||
volumes: | ||
- ./etc/nginx/conf.d/:/etc/nginx/conf.d | ||
depends_on: | ||
- federatedcode | ||
volumes: | ||
db_data: | ||
static: | ||
federatedcode: | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
FEDERATED_CODE_HOST=127.0.0.1 | ||
FEDERATED_CODE_PORT=8080 | ||
FEDERATED_CODE_DOMAIN=${FEDERATED_CODE_HOST}:${FEDERATED_CODE_PORT} | ||
|
||
POSTGRES_HOST=db | ||
POSTGRES_DB=purl-sync | ||
POSTGRES_USER=purl-sync | ||
POSTGRES_PASSWORD=purl-sync | ||
|
||
FEDERATED_CODE_GIT_PATH=/ | ||
FEDERATED_CODE_CLIENT_ID="" | ||
FEDERATED_CODE_CLIENT_SECRET="" | ||
FEDERATED_CODE_STATIC_ROOT=/var/federatedcode/static/ | ||
STATIC_ROOT=/var/federatedcode/static/ | ||
NGINX_PORT=8080 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.