-
Notifications
You must be signed in to change notification settings - Fork 207
Support sandboxed environments #59
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
Adds `io.open` and `io.write` stubs when they are absent
|
@anonhostpi thanks, interesting. |
|
Happy to contribute. Will try to reply quickly, if you need any work done |
|
@anonhostpi, I am wondering what else in this library could be non-sandbox safe. Things like |
|
It depends on the sandbox. The majority of sandboxes are just IO isolated (Lua on WASM, Luau, embedded Lua, etc). Let me take another gander at it. |
|
So if we want to address all sandboxes (not just IO-sandboxes, but maybe security sandboxes too), we'd need to either annotate minimum requirements and/or make changes to the following
lua-resty-template/lib/resty/template.lua Lines 203 to 218 in 2822213
lua-resty-template/lib/resty/template.lua Lines 68 to 77 in 2822213
lua-resty-template/lib/resty/template.lua Lines 363 to 371 in 2822213
|
Updated README to clarify compilation and transpilation features, including sandboxing considerations and function descriptions.
|
In addition to adding minimum requirements and sandboxing notes to the README (load vs loadstring+setfenv), I also added more technical verbage such as JIT-compiling, AOT-compiling, bytecode (for |
|
Files changed tab looks a bit boggling now. I double-checked, but in case you want to look yourself, there should only be 3 pieces of removed code:
Only one type of sandbox can't be supported (for obvious reasons) and that is one that doesn't have JIT support ( |
|
I suppose looking back at the comment history of this thread, it might have made sense to add support for the other sandboxes as a secondary PR 😅. Oh well, here they are altogether. |
_VERSIONcheck fix for Luau (the targeted sandbox, which is 5.1 compliant)io.openio.write