scratch3-ros-vm icon indicating copy to clipboard operation
scratch3-ros-vm copied to clipboard

Page offline

Open buchbergerd opened this issue 1 year ago • 7 comments

Thanks for this work! Unfortunately, it seems to be offline currently.

Expected Behavior

The link should lead to the online editor.

Actual Behavior

Error 404: There isn't a GitHub Pages site here.

Steps to Reproduce

Click on the link in the readme ()

Operating System and Browser

Doesn't matter.

Thanks in advance for fixing!

buchbergerd avatar Apr 12 '23 09:04 buchbergerd

Hello!

Actually our site just got hacked on Monday, so we took it down as an emergency measure. We are considering ways in which we can improve the security and avoid similar attacks, but this is challenging because:

  1. The connection with ROS depends on unsecure web sockets (aka http instead of https)
  2. I myself am not an expert in the field

If you have access to a computer, we recommend running the project on your local network. Try following the instructions below, and feel free to open new issues if that doesn't work. https://github.com/Affonso-Gui/scratch3-ros-vm#run-from-source

CC @k-okada

Affonso-Gui avatar Apr 12 '23 10:04 Affonso-Gui

Thanks for your explanation! What a pity :(

Do you have experience with running it under Linux / in a container? What exactly is your setup and which versions do you use?

I just tried, but with node 12 node install fails (after cloning the gui repo):

npm WARN read-shrinkwrap This version of npm is compatible with lockfileVersion@1, but package-lock.json was generated for lockfileVersion@2. I'll try to do my best with it!
npm WARN deprecated [email protected]: core-js@<3.23.3 is no longer maintained and not recommended for usage due to the number of issues. Because of the V8 engine whims, feature detection in old core-js versions could cause a slowdown up to 100x even if nothing is polyfilled. Some versions have web compatibility issues. Please, upgrade your dependencies to the actual version of core-js.

> [email protected] install /root/scratch3-ros-gui/node_modules/chromedriver
> node install.js

Current existing ChromeDriver binary is unavailable, proceeding with download and extraction.
Downloading from file:  https://chromedriver.storage.googleapis.com/107.0.5304.62/chromedriver_linux64.zip
Saving to file: /tmp/107.0.5304.62/chromedriver/chromedriver_linux64.zip
Received 1040K...
Received 2080K...
Received 3120K...
Received 4160K...
Received 5200K...
Received 6240K...
Received 7280K...
Received 7434K total.
Extracting zip contents to /tmp/107.0.5304.62/chromedriver.
ChromeDriver installation failed TypeError: fs.rmSync is not a function
    at copyIntoPlace (/root/scratch3-ros-gui/node_modules/chromedriver/install.js:314:6)
    at install (/root/scratch3-ros-gui/node_modules/chromedriver/install.js:73:11)
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/@babel/cli/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/watchpack/node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})
npm WARN optional SKIPPING OPTIONAL DEPENDENCY: [email protected] (node_modules/fsevents):
npm WARN notsup SKIPPING OPTIONAL DEPENDENCY: Unsupported platform for [email protected]: wanted {"os":"darwin","arch":"any"} (current: {"os":"linux","arch":"x64"})

npm ERR! code ELIFECYCLE
npm ERR! errno 1
npm ERR! [email protected] install: `node install.js`
npm ERR! Exit status 1
npm ERR! 
npm ERR! Failed at the [email protected] install script.
npm ERR! This is probably not a problem with npm. There is likely additional logging output above.

npm ERR! A complete log of this run can be found in:
npm ERR!     /root/.npm/_logs/2023-04-12T15_59_04_460Z-debug.log

Node 14 can install, but not run it:

    ERROR in ./node_modules/scratch-vm/src/blocks/scratch3_data.js
    Module not found: Error: Can't resolve 'circular-json' in '/root/scratch3-ros-gui/node_modules/scratch-vm/src/blocks'
     @ ./node_modules/scratch-vm/src/blocks/scratch3_data.js 9:11-35
     @ ./node_modules/scratch-vm/src/engine/runtime.js
     @ ./node_modules/scratch-vm/src/virtual-machine.js
     @ ./node_modules/scratch-vm/src/index.js
     @ ./src/containers/gui.jsx
     @ ./src/playground/player.jsx
    
    ERROR in ./node_modules/scratch-vm/src/extensions/scratch3_ros/index.js
    Module not found: Error: Can't resolve 'circular-json' in '/root/scratch3-ros-gui/node_modules/scratch-vm/src/extensions/scratch3_ros'
     @ ./node_modules/scratch-vm/src/extensions/scratch3_ros/index.js 27:11-35
     @ ./node_modules/scratch-vm/src/extension-support/extension-manager.js
     @ ./node_modules/scratch-vm/src/virtual-machine.js
     @ ./node_modules/scratch-vm/src/index.js
     @ ./src/containers/gui.jsx
     @ ./src/playground/player.jsx
[...]

Node 19.9.0 can install the dependencies, but fails to start for a different reason:

npm start

> [email protected] start
> webpack-dev-server

10% building 6/6 modules 0 activeℹ 「wds」: Project is running at http://0.0.0.0:8601/
ℹ 「wds」: webpack output is served from /
ℹ 「wds」: Content not from webpack is served from /root/scratch3-ros-gui/build
10% building 6/7 modules 1 active ...server/client/index.js?http://0.0.0.0:8601node:internal/crypto/hash:71
  this[kHandle] = new _Hash(algorithm, xofLen);
                  ^

Error: error:0308010C:digital envelope routines::unsupported
    at new Hash (node:internal/crypto/hash:71:19)
    at Object.createHash (node:crypto:140:10)
    at module.exports (/root/scratch3-ros-gui/node_modules/webpack/lib/util/createHash.js:135:53)
    at NormalModule._initBuildHash (/root/scratch3-ros-gui/node_modules/webpack/lib/NormalModule.js:417:16)
    at handleParseError (/root/scratch3-ros-gui/node_modules/webpack/lib/NormalModule.js:471:10)
    at /root/scratch3-ros-gui/node_modules/webpack/lib/NormalModule.js:503:5
    at /root/scratch3-ros-gui/node_modules/webpack/lib/NormalModule.js:358:12
    at /root/scratch3-ros-gui/node_modules/loader-runner/lib/LoaderRunner.js:373:3
    at iterateNormalLoaders (/root/scratch3-ros-gui/node_modules/loader-runner/lib/LoaderRunner.js:214:10)
    at Array.<anonymous> (/root/scratch3-ros-gui/node_modules/loader-runner/lib/LoaderRunner.js:205:4)
    at Storage.finished (/root/scratch3-ros-gui/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:55:16)
    at /root/scratch3-ros-gui/node_modules/webpack/node_modules/enhanced-resolve/lib/CachedInputFileSystem.js:91:9
    at /root/scratch3-ros-gui/node_modules/graceful-fs/graceful-fs.js:115:16
    at FSReqCallback.readFileAfterClose [as oncomplete] (node:internal/fs/read_file_context:68:3) {
  opensslErrorStack: [ 'error:03000086:digital envelope routines::initialization error' ],
  library: 'digital envelope routines',
  reason: 'unsupported',
  code: 'ERR_OSSL_EVP_UNSUPPORTED'
}

Thanks in advance for any help.

buchbergerd avatar Apr 12 '23 16:04 buchbergerd

Enabling the following option should be able to handle the errors in node versions 17+

export NODE_OPTIONS=--openssl-legacy-provider

ref. https://qiita.com/kamada_math/items/4df6f153bb2d0159a4ff (japanese page)

Then, access the site at http://localhost:8601 .

(checked with node v18.15.0 and npm 9.5.0 in WSL)

Affonso-Gui avatar Apr 12 '23 22:04 Affonso-Gui

I am also pasting my notes on publishing the site via github pages, in case e.g. you want to add a custom extension for your robot and publish it in your own domain. If everything seems to roll out fine I'll add them to the README as well.

DEPLOY REMARKS
 - check that gui has vm and vm has parser installed correctly under node_modules/
     scratch3-ros-gui/node_modules/scratch-vm/node_modules/scratch-parser
 - check that the scratch packages in packages.json point to github:...
 - if the address gets corrected as https, try clearing the browser cache and manually typing `http://`

DEPLOY
How to publish to github-pages:
1. cd scratch3-ros-gui
2. make sure that `origin` points to the LLK git
3. npm run build
4. npm run deploy
5. go to github.com/<profile>/scratch3-ros-gui -> Settings -> Page and change domain to http://<your-custom-domain> 
6. uncheck `enforce https`
7. Wait until deploy (few minutes)

Affonso-Gui avatar Apr 12 '23 22:04 Affonso-Gui

I got it working locally with node v18.15.0, thanks! A small remark: I first build the parser, then the vm and then the gui; linking each with npm link.

buchbergerd avatar Apr 17 '23 10:04 buchbergerd

Great!

I sporadically had some troubles with the parser before too, but not on this time. If you can load the turtlesim tutorial in the samples without crashing then everything should be fine in relation to the parser.

https://github.com/Affonso-Gui/scratch3-ros-vm/blob/jsk_robots/src/extensions/scratch3_ros/examples/turtlesim.sb3

Affonso-Gui avatar Apr 17 '23 11:04 Affonso-Gui

I'm leaving this open until we get the site back online, just in case.

Affonso-Gui avatar Apr 17 '23 11:04 Affonso-Gui

Successfully moved to the following domain: http://www.scratch3ros.com/

Affonso-Gui avatar Jun 08 '24 03:06 Affonso-Gui