Skip to main content

This runs code in a time-limited, offline docker container and returns the results.

Project description

RACTF Code Ingest server

This is the code ingest and execution server for RACTF.

This runs code in a time-limited, offline docker container and returns the results.

It's written to meet a specific set of requirements and work in conjunction with a webapp front end.

Prerequsites & Setup

  • Python 3.9.1 or above with pip
  • Pyenv installed (optional)
  • Poetry installed
  • Linux distro, ideally something Debian/Ubuntu based
  • Docker installed on host

If you don't have the required python version (3.9.1 as of writing), install pyenv with basic checkout. Then install the build dependencies, which is listed on the wiki

Add the following lines to your ~/.bashrc file (assuming you haven't done so from the pyenv guide):

# Pyenv installation

if [[ -z "$VIRTUAL_ENV" ]]; then
    export PATH="$HOME/.pyenv/bin:$PATH"
    eval "$(pyenv init -)"
fi

If you have a different shell, follow the pyenv install guide. Pyenv isn't mandatory if you have the correct version.

Next, install poetry with their suggested way, as this is necessary for the installation.

curl -sSL https://raw.githubusercontent.com/python-poetry/poetry/master/get-poetry.py | python

Note: Poetry requires python so if you don't have python2 you can soft link python3: sudo ln -sf $(which python3) /usr/local/bin/python

Installation & Deployment

Clone the repo and change directory into it:

Builds are available from PyPi, just do python3 -m pip install code-ingest.

Deploy with ingest_server and run basic tests with ingest_tests.

Alternatively if you want to install inside an env:

git clone https://gitlab.com/ractf/code-ingest.git
cd code-ingest

# If you're deploying for production.
poetry install --no-dev
poetry shell

# <Set your environment variables here>
# Remove the docker image every time you want it to be rebuilt.
docker rmi sh3llcod3/code-ingest # If you've not deployed in a while.
ingest_server

# If you're interested in making changes.
poetry install
poetry shell
python -m code_ingest

You should be able to use any virtualenv realistically.

The full documentation of environment variables, endpoints, etc can be found in the docs

Issues

If you encounter a bug, please create an issue stating with as much possible detail:

  • Your set-up
  • The bug
  • Any steps taken

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

code-ingest-0.6.0.tar.gz (20.9 kB view details)

Uploaded Source

Built Distribution

code_ingest-0.6.0-py3-none-any.whl (21.8 kB view details)

Uploaded Python 3

File details

Details for the file code-ingest-0.6.0.tar.gz.

File metadata

  • Download URL: code-ingest-0.6.0.tar.gz
  • Upload date:
  • Size: 20.9 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-56-generic

File hashes

Hashes for code-ingest-0.6.0.tar.gz
Algorithm Hash digest
SHA256 ab7c67edab79673ea785cf50dba0a35451bf00724b035985ed13cf7f2c1f741f
MD5 88f0f396f827198f695f0c812069e171
BLAKE2b-256 23b718cbb821ee198fc00ce45a9a415428750cbeb4a011a1d00d8997eb0ded4a

See more details on using hashes here.

File details

Details for the file code_ingest-0.6.0-py3-none-any.whl.

File metadata

  • Download URL: code_ingest-0.6.0-py3-none-any.whl
  • Upload date:
  • Size: 21.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-56-generic

File hashes

Hashes for code_ingest-0.6.0-py3-none-any.whl
Algorithm Hash digest
SHA256 b9e1e1e1b83a6aa4f282d8f6f7805ad2cfe02057168d4e2de5df69710bfdf3af
MD5 9111f8eeeab01fe78eb27c4afad378ca
BLAKE2b-256 5d74dacc07e87e098128e91ffaf26f0123f0c4b4bbdfd3ef7e76b6db4d195fff

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page