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

how to set THEIA_OPEN_EDITOR_TOKEN #4

Open
huanxu4 opened this issue Apr 13, 2021 · 1 comment
Open

how to set THEIA_OPEN_EDITOR_TOKEN #4

huanxu4 opened this issue Apr 13, 2021 · 1 comment

Comments

@huanxu4
Copy link

huanxu4 commented Apr 13, 2021

Hi all,
not sure this is the right place, but i am looking for a Theia terminal command to open a file. but could not figure out the THEIA_OPEN_EDITOR_TOKEN setting.
(https://community.theia-ide.org/t/how-to-open-a-file-through-terminal/1619/2)

wondering where i can find more information about THEIA_OPEN_EDITOR_TOKEN setting.

thank you!

@perrinjerome
Copy link
Owner

Hi !

The idea is that before starting theia server you should generate a token and set it as an environment variable for the theia start process, for example with using openssl:

export THEIA_OPEN_EDITOR_TOKEN=$(openssl rand -hex 32)
theia start

I just pushed a change ( 1118969 ) to document a bit more and make the yarn demo command from browser-app example set all environment variables so that everything work:

"demo": "THEIA_OPEN_EDITOR_TOKEN=test THEIA_URL=http://localhost:3000 EDITOR=\"node $(pwd)/node_modules/.bin/theia-open --wait\" GIT_EDITOR= theia start",

As you can see this demo uses a dummy "test" token, what matters is that the client and the server have the same token, because the token is used to authenticate the client. By setting the environment variable in the server process, it is inherited in the terminal processes.

Please let me know if you find this is still not clear enough.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants