Closed davidpcaldwell closed 3 years ago
May want to try the rhino/tools/github/authorize.js
approach to disable HTTPS security for local usage; unclear whether that is the problem with the HTTPS setup but worth trying, should be quick.
Fully-local simulator still not working, but attempting to run against real GitHub started fine and ended up hitting rate limit. So it may be that the code is now correct. May need to use GitHub Pages as an alternative way to serve these files.
Given rate-limit issue, now implementing alternate version that uses available download. For this, should build an appropriate local mock for testing.
Created code to produce mocked GitHub ZIP distribution for local testing. File looks to be correct but jsh
plugins are not correctly loaded from it. Need to investigate further but attempting to push up changes as they are likely to pass existing tests.
Lots of commits in adding type checking and clarity to the jrunscript bootstrap and jsh launcher code. Still have at least two areas to modify:
GithubArchive object
, passed through $api
somehow, to implement slime.js
getSourceFilesUnder
in the URL case (where currently we use raw.githubusercontent.com
)javac.js
, need to check whether a source file URL is available via archive and create a different SourceFile
implementation if it is.That, along with a bit of scaffolding to provide GithubArchive
access via $api
, may be all that's left.
Got it down to this for launching the sample script:
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh.bash
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/rhino/jrunscript/api.js
Request: GET github.com davidpcaldwell/slime/archive/refs/heads/master.zip
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/launcher/main.js
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/launcher/slime.js
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/launcher/launcher.js
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/launcher/javac.js
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/launcher/jsh.jar
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/local/jsh/lib
Request: GET github.com davidpcaldwell/slime/archive/refs/heads/master.zip
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/test/jsh-data.jsh.js
Seems like it should be possible to short-circuit the load() calls (to jsh/launcher/main.js
, etc.) and maybe the local/jsh/lib
call as well. But the raw.githubusercontent.com
calls are still possibly rate-limited (according to some cursory Googling), so it may make sense to switch to GitHub Pages for master or something to serve these?
Still, probably could run a single script successfully now.
Script launched from GitHub still appears to provide no output; should maybe try a Hello, World rather than jsh-data.jsh.js
.
Removed jsh launcher accesses over HTTP, so all that seems to be left is in the loader:
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh.bash
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/rhino/jrunscript/api.js
Request: GET github.com davidpcaldwell/slime/archive/refs/heads/master.zip
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/launcher/jsh.jar
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/local/jsh/lib
Request: GET github.com davidpcaldwell/slime/archive/refs/heads/master.zip
Request: GET raw.githubusercontent.com davidpcaldwell/slime/master/jsh/test/jsh-data.jsh.js
The bottom four are believed to be within the loader; it'd be good to get rid of the requests for jsh.jar
and local/jsh/lib
if possible.
We'll close this ticket leaving the others in place, pending a possible move to GitHub Pages, which would only support serving a single directory (perhaps master
or some kind of released
branch).
after the coming commit, the only remaining question is, does the code work? Why has it produced no output on the client?
Still need to:
jsh.bash
request to use HTTPS, by changing PROTOCOL in jsh.jsh.js, setting uphttps.proxyHost
andhttps.proxyPort
correctly (and passing them through correctly; seehttp.proxyHost
andhttp.proxyPort
JSH_OPTIMIZE_REMOTE_SHELL
optional when doing remote testing, and give it a better name