evalpark is an AJAX service which runs a given shell script.
The result is returned in JSON with
Access-Control-Allow-Origin: *
.
http://eval.dan.co.jp/park.cgi?s=source https://eval.dan.co.jp/park.cgi?s=source
Your script is run in a fully-featured FreeBSD 13 jail with
resources capped by RACCT/RCTL. Unlike many web services like this,
Evalpark lets you run fully-featured shell scripts with
pipe(), fork()
and exec()
. Thanks to
RACCT which now comes standard with FreeBSD 9, This degree of
freedom was made possible safely and securely.
<<HERE_DOCUMENT
).#!/bin/sh
fetch -o - https://example.com
/bin/sh
, Just use shebang.
#!/usr/local/bin/perl
use strict;
use warnings;
use Data::Dumper;
print Dumper \%ENV;
/usr/local
, not /usr
. You
can use which mylang
to find the
path. #!/usr/bin/env mylang
also works.pkg
. You can easily check installed packages via pkg info
.
Available in /friends/
. You can also rerun the script by prepending /park.cgi
. For example:
/friends/sample/boilerplate.sh
/park.cgi/friends/sample/boilerplate.sh
In fact, any submitted scripts are stored
in /friends/yyyy/mm/dd/${sha256_hash_of_the_content}
. You
can get the path via path
field of the JSON.
jQuery plugin is available so you can easily run your scripts in your web page like so:
<script src="//ajax.googleapis.com/ajax/libs/jquery/3.6.0/jquery.min.js"></script>
<script src="//eval.dan.co.jp/jquery-runpark.js"></script>
<div>
<textarea id="src" rows="4">
#!/bin/sh -v
pkg info | awk '{print $1}'
</textarea>
<div>
<input type="submit" value="run" onclick="$('#src').runPark('#dst')">
<input type="submit" value="rerun" onclick="$('#dst').rerunPark('/friends/sample/pkg.sh')">
<input type="submit" value="clear" onclick="$('#dst').html('')">
</div>
<div id="dst"></div>
</div>
jquery-runpark.js source is as follows:
Whatsoever.
Enjoy!
Dan the Park Ranger