snekbox icon indicating copy to clipboard operation
snekbox copied to clipboard

Multiple binary support api

Open ChrisLovering opened this issue 2 years ago • 3 comments

This allows setting a binary_path key in the request body to /eval to specify which binary to run under.

If not supplied, it defaults to "/lang/python/default/bin/python" if supplied, snekbox ensures that the path is within /lang (to avoid executing arbitrary binaries on the fs) and that the file exists.

This PR also comes with two unrelated changes

  1. https://github.com/python-discord/snekbox/pull/196/commits/07ddd848fd1d72feb72578d68416fc74e18a197f was needed as previous we were dropping the text after the last period when creating the path to install Python to. However, for 3.13-dev this would result in it being installed into /lang/3. Instead, we now split on the last . or the last -
  2. https://github.com/python-discord/snekbox/pull/196/commits/84b5928f95f09a5798e1a404e8f82c5392227c28 which is required when building 3.13-dev right now.
  3. https://github.com/python-discord/snekbox/pull/196/commits/5f67817e1314f429007ffd1efad53495f5c09e85 which was needed to get pre-commit running on my local machine

ChrisLovering avatar Oct 10 '23 13:10 ChrisLovering

Coverage Status

coverage: 89.158% (-1.7%) from 90.826% when pulling b58f98bd5127cac43cba4dcff66f9d7a01527576 on multi-version-api into b276a04f2cb9b2e974b84b66719b2b0984f3a800 on main.

coveralls avatar Oct 10 '23 13:10 coveralls

I plan to pick this PR up soon just had time to rebase this evening

ChrisLovering avatar Jan 24 '24 20:01 ChrisLovering

Hey how's this PR going? It would be very useful for a project I'm working on.

HassanAbouelela avatar Jul 30 '24 03:07 HassanAbouelela

Now ready for (re)review

ChrisLovering avatar Oct 03 '24 21:10 ChrisLovering