aboutsummaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeLines
...
| | * Fix venv being included in coverage when testing in a containerGravatar MarkKoz2019-06-22-4/+7
| | | | | | | | | | | | * Exclude DEBUG checks from coverage reports
| | * Add a NsJail log parser testGravatar MarkKoz2019-06-22-3/+33
| | | | | | | | | | | | | | | * Add support for debug level to log regex * Change type annotation of log_parse to Iterable
| | * Rewrite NsJail testsGravatar MarkKoz2019-06-22-58/+80
| | | | | | | | | | | | | | | | | | * Fix SIGSEGV test * Add embedded null byte test * Return None for stderr when there's a ValueError
| | * Capture NsJail logs from stdout if NsJail fails to parse cmd argsGravatar MarkKoz2019-06-22-3/+9
| | | | | | | | | | | | Fixes #30
| | * Use IDs for user and group for consistency across distrosGravatar MarkKoz2019-06-22-2/+2
| | |
| | * Fix coverage not finding sourcesGravatar MarkKoz2019-06-22-8/+17
| | | | | | | | | | | | | | | | | | * Mount volume to the same path as the source directory on the host * Keep the container up in the background so it doesn't have to be restarted or the ownership fix
| | * Fix ownership of coverage fileGravatar MarkKoz2019-06-22-1/+10
| | | | | | | | | | | | | | | | | | When coverage runs in a container, it is ran under root so the resulting coverage file is owned by root. chown is used to change ownership to be the same as the folder it is in.
| | * Use dev.sh script for running tests and coverageGravatar MarkKoz2019-06-22-94/+20
| | | | | | | | | | | | * Use unittest and directly use coverage.py instead of pytest
| | * Create shell script for building a dev image and running a shellGravatar MarkKoz2019-06-22-23/+46
| | | | | | | | | | | | * Put scripts in a new scripts folder
| | * Add NsJail alias and switch to ashGravatar MarkKoz2019-06-22-1/+28
| | |
| | * Add support for development to Docker imagesGravatar MarkKoz2019-06-22-7/+34
| | | | | | | | | | | | | | | | | | | | | * Venv image can sync dev dependencies * Copy tests to image * Add a Pipenv script for running a development shell in a container * Add Pipenv scripts for building dev images
| * | Merge pull request #29 from python-discord/api-adjustmentsGravatar Leon Sandøy2019-06-22-22/+29
| |\| | | | | | | API Adjustments
| | * Use a custom Gunicorn access log formatGravatar MarkKoz2019-06-15-4/+18
| | | | | | | | | | | | | | | | | | | | | | | | The handler now shares formats with the rest of the handlers. The message is formatted to show the request method, URL + query, response code, response size in bytes, and the request time in seconds. * Use the default ISO 8601 date format for all handlers
| | * Use system site instead of relying on virtual environment activationGravatar MarkKoz2019-06-15-14/+4
| | | | | | | | | | | | | | | | | | | | | * Remove -S option from Python to re-enable importing of site module * Add environment variable NSJAIL_PATH * Remove environment variables that were passed to NsJail subprocess * Add type annotations to NsJail.__init__()
| | * Merge stdout and stderrGravatar MarkKoz2019-06-15-5/+8
| |/ | | | | | | | | | | Removes the need for redirecting stderr using contextlib in the input. Furthermore, it captures errors which don't directly come from the input, such as SyntaxErrors.
| * Merge pull request #24 from python-discord/refactor/nsjailGravatar Leon Sandøy2019-06-09-148/+254
| |\ | | | | | | Improve NsJail
| | * Respond to eval with stdout, stderr, and the return codeGravatar MarkKoz2019-06-05-32/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | The previous implementation limited the client's flexibility in presenting the results of the process. A process can write to both stdout and stderr and do so even when the return code is not 0 or 1. * Return a CompletedProcess from NsJail * Don't check the return code; this should be done client-side now
| | * Revert "Add basic logger for responses"Gravatar MarkKoz2019-06-05-16/+1
| | | | | | | | | | | | | | | Gunicorn's access logger makes the middleware redundant. This reverts commit c1c854e0ad4deb5c4fa8eb2a35b43a042f15255c.
| | * Add logging for NsJailGravatar MarkKoz2019-06-05-28/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NsJail's is configured to log to a temporary file rather than stderr. The contents of the file are parsed using regex after the process exits. When not debugging, some blacklisted messages and most info-level messages are skipped. * Add a snekbox logger * Log the Python code being executed if debugging * Use nested single quotes in a test to fix a linter error
| | * Merge remote-tracking branch 'origin/revitalisation' into refactor/nsjailGravatar MarkKoz2019-06-05-136/+257
| | |\ | | |/ | |/|
| * | Merge pull request #23 from python-discord/falconGravatar Leon Sandøy2019-06-02-163/+278
| |\ \ | | | | | | | | Replace Flask with Falcon
| | * | Revise docstrings for SnekAPI & EvalResourceGravatar MarkKoz2019-05-29-9/+9
| | | |
| | * | Add basic logger for responsesGravatar MarkKoz2019-05-29-1/+16
| | | |
| | * | Document the APIGravatar MarkKoz2019-05-29-0/+50
| | | |
| | * | Move SnekAPI import back to top of moduleGravatar MarkKoz2019-05-29-1/+2
| | | |
| | * | Enable branch coverage & disable app.py coverageGravatar MarkKoz2019-05-29-9/+5
| | | |
| | * | Add API tests for eval resourceGravatar MarkKoz2019-05-29-1/+65
| | | |
| | * | Separate application instance from definitionGravatar MarkKoz2019-05-29-6/+16
| | | | | | | | | | | | | | | | | | | | This way, it is easier for tests to use the application because they can instead create their own instances after patching.
| | * | Validate request's inputGravatar MarkKoz2019-05-28-2/+46
| | | |
| | * | Create falcon APIGravatar MarkKoz2019-05-28-59/+36
| | | |
| | * | Replace flask dependency with falconGravatar MarkKoz2019-05-28-99/+57
| |/ /
| | * Configure gunicorn loggingGravatar MarkKoz2019-06-04-10/+24
| | |
| | * Lint testsGravatar MarkKoz2019-05-30-6/+4
| | | | | | | | | | | | | | | * Ignore D1xx for tests because they shouldn't require docstrings * Update pre-commit-hooks repo to v2.2.3
| | * Revert "Run flake8 via pre-commit for the pipenv lint script"Gravatar MarkKoz2019-05-30-7/+1
| | | | | | | | | | | | This reverts commit c2416eb672afc80476fe2da1b364af5d018a16b0.
| | * Revert "Lint tests"Gravatar MarkKoz2019-05-30-30/+1
| | | | | | | | | | | | This reverts commit e75c764f693c3688a59af0d679e0d3e94f003503.
| | * Refactor NsJailGravatar MarkKoz2019-05-30-67/+74
| | |
| | * Run flake8 via pre-commit for the pipenv lint scriptGravatar MarkKoz2019-05-30-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | Pre-commit is a nice wrapper for this particularily because it allows both the snekbox and tests to be linted with a single command while clearly distinguishing their results. The Python script is a cross-platform implementation of the following: git ls-files -- '*.py' | xargs pre-commit run flake8 --files
| | * Lint testsGravatar MarkKoz2019-05-30-1/+30
| | | | | | | | | | | | | | | Tests ignore all D1xx warnings because tests shouldn't require docstrings.
| | * Fix pre-commit configurationGravatar MarkKoz2019-05-30-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Excluded files and directories in the flake8 config file are overwritten by the --files argument, which is considered intended behaviour. However, this is problematic due to pre-commit's reliance on the --files argument. Therefore, pre-commit's own exclude config option must be leveraged. * Properly exclude tests directory * Add flake8 plugins as dependencies so that they are actually used
| | * Add flake8 plugin to only allow double quotesGravatar MarkKoz2019-05-29-103/+119
| |/
| * Merge branch 'master' into revitalisationGravatar MarkKoz2019-05-28-9/+58
| |\
| * \ Merge pull request #17 from python-discord/dockerGravatar Mark2019-05-28-65/+109
| |\ \ | | | | | | | | Restructure Docker Images
| | * | Revert "Always build images if they do not exist"Gravatar MarkKoz2019-05-28-6/+2
| | | | | | | | | | | | | | | | This reverts commit 02e348ac249c1aba2d378ecda9af2a9a8ac1c894.
| | * | Build venv image in PRs when Pipfiles changeGravatar MarkKoz2019-05-28-13/+5
| | | |
| | * | Don't install dev dependencies in Docker imageGravatar MarkKoz2019-05-13-1/+1
| | | |
| | * | Exlcude everything, then make exceptions in dockerignoreGravatar MarkKoz2019-05-13-18/+8
| | | |
| | * | Never build the final image in a PRGravatar MarkKoz2019-05-13-0/+1
| | | |
| | * | Disable pip cacheGravatar MarkKoz2019-05-13-2/+5
| | | |
| | * | Always build images if they do not existGravatar MarkKoz2019-05-13-9/+15
| | | |
| | * | Build images if their Dockerfiles change even in PRsGravatar MarkKoz2019-05-13-6/+12
| | | | | | | | | | | | | | | | The venv image will still not be built in a PR if a Pipfile changes.