Skip to content
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

Gitpod doesn't work well with jekyll #1553

Closed
Kreyren opened this issue May 27, 2020 · 9 comments
Closed

Gitpod doesn't work well with jekyll #1553

Kreyren opened this issue May 27, 2020 · 9 comments
Labels
meta: stale This issue/PR is stale and will be closed soon user experience

Comments

@Kreyren
Copy link

Kreyren commented May 27, 2020

Describe the bug

Using JEKYLL_ENV=development bundle exec jekyll serve to provide a theia preview of the website causes 404, because gitpod is using localhost:4000 that is not accesible to gitpod user.

This can either be workedaround using:

  • Firefox in noVNC
  • Rewriting the whole repository to accept special gitpod environment
  • Weird hack alike cat _config.yml | sed -E "s#^(url:\s{1})(\").*(\").*#\1\2$(gp url)\3#gm" > _config_gitpod.yml && JEKYLL_ENV=production bundle exec jekyll serve --config _config_gitpod.yml which is not acceptable for gitpod users.

Expected behavior

We need some way to display localhost:4000 in theia's preview, maybe some wrapper for theia's preview that points to $(gp url) everytime localhost is called on it?

Additional information

Blocks gidpodifying of CircuitVerse/Interactive-Book#374

Example repository

https://gitpod.io#snapshot/d3a9516c-4be3-47b2-81dc-df4020ff4f57

@RDIL
Copy link

RDIL commented May 27, 2020

This is a problem on Jekyll's end for forcibly using localhost instead of the dynamic public address

@Kreyren
Copy link
Author

Kreyren commented May 27, 2020

@RDIL Possible i guess, what do you propose then?

@Kreyren
Copy link
Author

Kreyren commented May 28, 2020

cc @ChristinFrohne @Uniminin @htes9

@Kreyren Kreyren added type: bug Something isn't working editor: theia labels May 28, 2020
@qnm
Copy link

qnm commented Jun 3, 2020

Maybe you’ve already tried this, but Jekyll accepts a bind param eg

jekyll serve —host=0.0.0.0

That should listen on all interfaces.

@Kreyren
Copy link
Author

Kreyren commented Jun 5, 2020

@qnm Already tried.. The host can only point to localhost it seems even when i parsed an IPv4 of the workspace to it.

@svenefftinge
Copy link
Member

I don't see how this could be solved in the frontend. As long as the preview is running as an iframe (webview), we would need to intercept the requests to localhost which is not possible.
Therefore running a browser in the remote container and somehow showing the rendered ui in the browser seems to be the only generic solution. There is https://github.com/auchenberg/vscode-browser-preview based on chrome headless but also your VNC proposal seems similar.

FWIW I think patching the config in a gitpod config is not too bad either, but for instance the livereload would not work that way.

@Kreyren
Copy link
Author

Kreyren commented Jun 7, 2020

Trying the extension which on gitpod results in
image

trying to install chrome..

UPDATE: We can't install google chrome on crap 'o buntu without root

Setting up libappindicator3-1 (12.10.1+20.04.20200408.1-0ubuntu1) ...
Setting up google-chrome-stable (83.0.4103.97-1) ...
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/x-www-browser (x-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/gnome-www-browser (gnome-www-browser) in auto mode
update-alternatives: using /usr/bin/google-chrome-stable to provide /usr/bin/google-chrome (google-chrome) in auto mode
Processing triggers for libc-bin (2.31-0ubuntu7) ...
N: Download is performed unsandboxed as root as file '/workspace/gitpod-jekyll-test/google-chrome-stable_current_amd64.deb' couldn't be accessed by user '_apt'. - pkgAcquire::Run (13: Permission denied)
gitpod /workspace/gitpod-jekyll-test $ sudo apt-get install ./google-chrome-stable_current_amd64.deb ^C
gitpod /workspace/gitpod-jekyll-test $ chrome
bash: chrome: command not found
gitpod /workspace/gitpod-jekyll-test $ google-chrome-stable
[19580:19580:0607/113948.053323:ERROR:browser_main_loop.cc(1473)] Unable to open X display.
[0607/113948.069215:ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
gitpod /workspace/gitpod-jekyll-test $ sudo google-chrome-stable
[19675:19675:0607/113956.872857:ERROR:zygote_host_impl_linux.cc(89)] Running as root without --no-sandbox is not supported. See https://crbug.com/638180.
gitpod /workspace/gitpod-jekyll-test $ sudo google-chrome-stable --no-sandbox
[19749:19749:0607/114005.130425:ERROR:browser_main_loop.cc(1473)] Unable to open X display.
[0607/114005.144311:ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly
[0607/114005.144462:ERROR:nacl_helper_linux.cc(308)] NaCl helper process running without a sandbox!
Most likely you need to configure your SUID sandbox correctly

and even with that it doesn't work, because theia wants to use it's preview at all cost
image


Checking if vnc helps~

UPDATE: Seems that i've provided dependencies for the browser preview which now results in:

image

Provided snapshot to staging in developer chat

@Kreyren
Copy link
Author

Kreyren commented Jun 23, 2020

heads-up: activity in jekyll/jekyll#8229

@Kreyren Kreyren added networking user experience and removed type: bug Something isn't working labels Jun 23, 2020
@stale
Copy link

stale bot commented Oct 4, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the meta: stale This issue/PR is stale and will be closed soon label Oct 4, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
meta: stale This issue/PR is stale and will be closed soon user experience
Projects
None yet
Development

No branches or pull requests

6 participants