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_serverand run basic tests withingest_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
Metadata
Release files for code-ingest 0.7.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | Provenance | Actions |
|---|---|---|---|---|
| code-ingest-0.7.0.tar.gz | 23.5 kB | Without provenance | Details for code-ingest-0.7.0.tar.gz |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Actions Reset |
|---|---|---|---|---|
| code_ingest-0.7.0-py3-none-any.whl | Python 3 | none | any | Details for code_ingest-0.7.0-py3-none-any.whl |
Total release size: 48.8 kB
Release files / code-ingest-0.7.0.tar.gz
| Download URL | code-ingest-0.7.0.tar.gz |
|---|---|
| Size | 23.5 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
a6814ff28609ceade33ba58630f72d1c46be5b32c784bb81e7ac302b9abae000
|
|
BLAKE2b-256 checksum How to use checksums |
94d09d64d2aa5cb7720ff1787294c433285be226bdf407808305e8136f7e8c67
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-56-generic
|
Release files / code_ingest-0.7.0-py3-none-any.whl
| Download URL | code_ingest-0.7.0-py3-none-any.whl |
|---|---|
| Size | 25.4 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
8789e2b40a812fda79167227619f943ba1e70914a1019c33d8d80fb53abbb233
|
|
BLAKE2b-256 checksum How to use checksums |
e70826e58017531129dd9ac2a5763e143b5317502983eb07b95f2cecf53b803e
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
poetry/1.1.4 CPython/3.9.1 Linux/5.4.0-56-generic
|
Security for code-ingest 0.7.0
Provenance
Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.
No provenance found
None of the files in this release were uploaded with provenance metadata.
A note on package security
PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.
To learn more about protecting yourself from malicious actors, visit our package security documentation.