aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
* Merge PR #100 - avoid decoding of invalid Unicode outputGravatar Mark2021-04-08-2/+28
|\ | | | | | | Use PYTHONIOENCODING to enable utf-8 stdout for the nsjail pipe, and handle the potential case where this is bypassable.
| * Clarify documentation of None return codeGravatar Mark2021-04-08-1/+1
| |
| * Note new return case in eval api fileGravatar Bast2021-04-08-1/+1
| |
| * Match new unicode eval tests and output to the format and functions of othersGravatar Bast2021-04-08-13/+9
| |
| * Use PYTHONIOENCODING to enable utf-8 stdout for the nsjail pipe, and handle ↵Gravatar Bast2021-04-06-1/+31
|/ | | | | | | | | | the potential case where this is bypassable Since snekbox does not run with a tty, stdout is technically raw bytes, and thus incomplete surrogate pairs can be printed without the client application erroring, and instead fail within _consume_stdout when we attempt to decode it to a str. This commit sets the PYTHONIOENCODING environment variable to inform python to open the pipe in utf-8 mode. However, clever use of execl and os.unsetenv() can unset this environment variable, so we add a safety check to _consume_stdout to fail out of parsing output if it contains invalid unicode. This should only happen in deliberate cases, or significant bugs in python or a c library where output is printed to stdout ignoring the python stdout encoding.
* Bump urllib3 from 1.26.3 to 1.26.4Gravatar dependabot[bot]2021-04-06-6/+6
| | | | | | | | Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.3 to 1.26.4. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.3...1.26.4) Signed-off-by: dependabot[bot] <[email protected]>
* Move from GHCR_TOKEN to GITHUB_TOKEN in Docker publish stageGravatar Joe Banks2021-04-05-1/+1
|
* Merge PR #98 - update policy documentsGravatar Mark2021-04-01-121/+8
|\
| * Update policy documentsGravatar Matteo Bertucci2021-04-01-121/+8
|/
* Remove binarytree packageGravatar Mark2021-03-23-1/+0
| | | | | It needs setuptools which requires --ignore-installed to be used. That causes all dependencies to be re-installed and therefore always invalidates the cache. Not worth it.
* Add binarytree package to eval environmentGravatar Mark2021-03-23-0/+1
|
* Merge pull request #97 from python-discord/dependabot/pip/urllib3-1.26.3Gravatar Joe Banks2021-03-19-39/+44
|\ | | | | Bump urllib3 from 1.26.2 to 1.26.3
| * Bump urllib3 from 1.26.2 to 1.26.3Gravatar dependabot[bot]2021-03-19-39/+44
|/ | | | | | | | Bumps [urllib3](https://github.com/urllib3/urllib3) from 1.26.2 to 1.26.3. - [Release notes](https://github.com/urllib3/urllib3/releases) - [Changelog](https://github.com/urllib3/urllib3/blob/main/CHANGES.rst) - [Commits](https://github.com/urllib3/urllib3/compare/1.26.2...1.26.3) Signed-off-by: dependabot[bot] <[email protected]>
* Merge PR #96 - nsjail SIGKILL to SIGTERMGravatar Mark2021-03-16-16/+5
|\
| * Update flooding test to expect code 143Gravatar Joe Banks2021-03-16-1/+1
| | | | | | | | Test was relying on 137 which is SIGKILL, when instead it would receive 143, or SIGTERM.
| * Remove logic for removing remnant cgroupsGravatar Joe Banks2021-03-16-12/+0
| | | | | | | | This should be addressed by sending SIGTERM to nsjail instead of SIGKILL, since nsjail then gets an opportunity to run clean-up logic which includes removing cgroups.
| * Change SIGKILL to SIGTERMGravatar Joe Banks2021-03-16-3/+4
|/
* Remove the mixed line endings pre-commit hook because it is obsolete.Gravatar MarkKoz2021-03-13-2/+1
| | | | | | | | Relying on git to handle line endings means contributors have more flexibility with which line endings they want to use on check-out. The settings in .gitattributes only impose which line endings will be used upon check-in (LF), which should not impact local development; git will still respect the core.eol and core.autocrlf settings.
* master => mainGravatar Joe Banks2021-03-13-14/+14
|
* Merge PR #93 - fix NsJail testsGravatar Mark2021-03-08-30/+39
|\ | | | | | | A test is still broken, but it's due to a bug in the code being tested rather than in the test itself. It'll be fixed separately.
| * Merge master into bug/tests/nsjailGravatar MarkKoz2021-03-07-8/+34
| |\ | |/ |/| | | The branch needs the fixes from #94 to make the tests pass.
* | Merge pull request #94 from python-discord/recursive-remove-cgroupsGravatar Matteo Bertucci2021-02-26-0/+12
|\ \ | | | | | | Remove all child cgroups before removing parents
| * | Remove all child cgroups before removing parentsGravatar Joe Banks2021-02-26-0/+12
|/ /
* | Merge pull request #91 from python-discord/dynamic-parent-cgroupsGravatar Matteo Bertucci2021-02-25-8/+22
|\ \ | | | | | | Dynamically create parent cgroups
| * \ Merge branch 'master' into dynamic-parent-cgroupsGravatar Joe Banks2021-02-07-217/+246
| |\ \ | |/ / |/| |
| * | Remove cgroup parent constants from config fileGravatar Joe Banks2021-02-03-2/+0
| | |
| * | Dynamically create parent cgroups for nsjailGravatar Joe Banks2021-02-03-6/+22
| | |
| | * Docker: improve caching & install numpy in containerGravatar MarkKoz2021-03-07-9/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | CI was building the image twice: once with dev dependencies and again without. Separating the pipenv command into separate layers allows the second build in CI to take advantage of the cache for the base dependencies that it will share across both builds. Install numpy along with the dev dependencies within the container. Previously it was installed in CI only, but this meant extra work for those running tests locally. Install numpy to the correct site.
| | * Fix patch for DEBUG value during testingGravatar MarkKoz2021-02-04-1/+1
| | |
| | * Fix the memory limit test and the import errorGravatar MarkKoz2021-02-04-2/+2
| | |
| | * Close file descriptors when subprocess endsGravatar MarkKoz2021-02-04-15/+14
| | |
| | * Suppress NsJail info logs during testsGravatar MarkKoz2021-02-04-0/+1
| | | | | | | | | | | | The logs clutter up the test output way too much.
| | * CI: fix test step not failing when tests failGravatar MarkKoz2021-02-04-3/+6
| |/ |/| | | | | | | Generating the report in the same step resulted in the report exit code overriding the exit code of the test runner.
* | Merge PR #92 - replace shell scripts with Python scriptsGravatar Mark2021-02-04-217/+246
|\ \ | |/ |/|
| * CI: use Docker Compose to run the containerGravatar MarkKoz2021-02-04-19/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Avoid redundant specification of Docker settings. The compose file is set up to build all stages. This makes sense for local development; both an interactive shell and running the webserver are useful. Therefore, the image built is tagged "snekbox:dev". However, CI does not need to run a webserver. It is therefore sufficient for it to only build to the venv stage, and it does exactly that. The image in CI is tagged as "snekbox-venv:<git sha>". To facilitate the discrepancy in image tags, the suffix for the image tag can be set with the new IMAGE_SUFFIX environment variable. Docker Compose will use this to determine the image from which to create a container. A TTY needs to be allocated to prevent the container from exiting immediately after starting. This is probably because the entrypoint is Python (inherited from the base image), and the REPL relies on a TTY.
| * Document configuration thoroughlyGravatar MarkKoz2021-02-04-1/+41
| |
| * Fix coverage ownership when running testsGravatar MarkKoz2021-02-04-1/+2
| |
| * Document how to update NsJailGravatar MarkKoz2021-02-04-0/+10
| |
| * Replace protoc shell script with a Python oneGravatar MarkKoz2021-02-04-15/+63
| |
| * Rename "snekbox" script to "webserver" in PipfileGravatar MarkKoz2021-02-04-1/+1
| | | | | | | | The new name better conveys what the script does.
| * Replace dev.sh with Docker ComposeGravatar MarkKoz2021-02-04-106/+38
| | | | | | | | | | | | | | | | | | | | Managing development containers through Docker Compose is convenient. However, it isn't quite flexible enough to facilitate both development and normal use. It's not really worth accommodating the latter since the container gets pushed to a registry and that's the intended way to run the service. Anyone that is checking out the repository and therefore has access to the compose file is likely a developer, not a user.
| * Categorise and sort scripts in PipfileGravatar MarkKoz2021-02-04-12/+14
| |
| * Move development environment guide to a separate fileGravatar MarkKoz2021-02-04-94/+99
|/ | | | | | The information is only relevant to developers. The README is what all users will read; they shouldn't be subject to information that isn't necessarily relevant to them.
* Merge PR #88 - use protobuf to parse configGravatar Mark2021-02-02-55/+1377
|\
| * Fix typo in error messageGravatar Mark2021-02-02-1/+1
| |
| * Fix typo in READMEGravatar Mark2021-01-14-1/+1
| |
| * Replace nsjpy alias with a Python scriptGravatar MarkKoz2021-01-10-27/+33
| | | | | | | | | | | | | | | | | | The Python script uses the same underlying code Falcon uses to invoke nsjail. It allows for the omission of redundant shell code that set up cgroups and nsjail args. This is also a step towards removing dependence on shell scripts and thus resolving #73.
| * Support overriding nsjail config values with additional argumentsGravatar MarkKoz2021-01-10-2/+8
| |
| * Add comments to justify why cgroup limits are set manuallyGravatar MarkKoz2021-01-10-1/+7
| |
| * Add error handling to reading of the nsjail configGravatar MarkKoz2021-01-10-2/+16
| |