Commit e6265b6f authored by Jérome Perrin's avatar Jérome Perrin

Update Theia to 1.0

Update Thiea to 1.0, described a bit on :
 https://dev.to/svenefftinge/theia-1-0-finally-a-good-browser-ide-3ok0

Add by default some extensions for python and buildout. Also request a frontend so that we can access over IPv4

See merge request !725
parents 7919c834 7316ad33
...@@ -15,6 +15,12 @@ parts = ...@@ -15,6 +15,12 @@ parts =
[nodejs] [nodejs]
<= nodejs-8.9.4 <= nodejs-8.9.4
[nodejs-10.19.0]
<= nodejs-base
openssl_location = ${openssl:location}
version = v10.19.0
md5sum = 9e433c753d839d2d2a6341861501674f
[nodejs-10.6.0] [nodejs-10.6.0]
<= nodejs-base <= nodejs-base
openssl_location = ${openssl:location} openssl_location = ${openssl:location}
......
...@@ -5,15 +5,6 @@ Theia is a cloud (and desktop) IDE https://www.theia-ide.org ...@@ -5,15 +5,6 @@ Theia is a cloud (and desktop) IDE https://www.theia-ide.org
This version comes pre-configured with a few plugins, but does not come with python plugin, to let This version comes pre-configured with a few plugins, but does not come with python plugin, to let
you choose between theia and vscode one. you choose between theia and vscode one.
## Installing vscode extensions
To install vscode's python plugin ( https://code.visualstudio.com/docs/languages/python ):
<key>F1</key> `Deploy plugin by id` and enter `vscode:extension/ms-python.python` and wait for a while.
Check theia's log files in case of issues.
see https://github.com/theia-ide/theia/wiki/Testing-VS-Code-extensions for more details.
## jedi ## jedi
[jedi](https://github.com/davidhalter/jedi) which is used by both thiea and vscode python plugins has [jedi](https://github.com/davidhalter/jedi) which is used by both thiea and vscode python plugins has
...@@ -23,4 +14,4 @@ in bin directory, with maybe 30 eggs in each scripts, so this makes jedi so slow ...@@ -23,4 +14,4 @@ in bin directory, with maybe 30 eggs in each scripts, so this makes jedi so slow
an error occurs parsing these scripts, jedi won't be usable. This issue is tracked in an error occurs parsing these scripts, jedi won't be usable. This issue is tracked in
https://github.com/davidhalter/jedi/issues/1325 https://github.com/davidhalter/jedi/issues/1325
A simple workaround is to create and empty `buildout.cfg` file at the root of project folder. A simple workaround is to create and empty `buildout.cfg` file at the root of project folder.
\ No newline at end of file
...@@ -15,12 +15,12 @@ ...@@ -15,12 +15,12 @@
[instance] [instance]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 7c9444fbe8dc8faea67ede2b77e188ed md5sum = 21735765808aac82fb91d53341a3c0d6
[yarn.lock] [yarn.lock]
filename = yarn.lock filename = yarn.lock
md5sum = b63a993a13e7c3b16b66c25fac5ac8b9 md5sum = c2523a5c832f617c374ee621d50d9e52
[python-language-server-requirements.txt] [python-language-server-requirements.txt]
filename = python-language-server-requirements.txt filename = python-language-server-requirements.txt
md5sum = 6c940b7015f45de6e679fc44807e5220 md5sum = 6db2a484cac19787fecd87fffefa4aa9
...@@ -17,13 +17,31 @@ recipe = slapos.cookbook:generate.password ...@@ -17,13 +17,31 @@ recipe = slapos.cookbook:generate.password
username = node username = node
bytes = 12 bytes = 12
[frontend-instance-certificate]
recipe = plone.recipe.command
command =
if [ ! -e $${:key-file} ]
then
${openssl-output:openssl} req -x509 -nodes -days 3650 \
-subj "/C=AA/ST=X/L=X/O=Dis/CN=$${:common-name}" \
-newkey rsa:1024 -keyout $${:key-file} \
-out $${:cert-file}
fi
update-command = $${:command}
key-file = $${directory:etc}/$${:_buildout_section_name_}.key
cert-file = $${directory:etc}/$${:_buildout_section_name_}.crt
common-name = $${frontend-instance-config:ip}
location =
$${:key-file}
$${:cert-file}
[frontend-instance-config] [frontend-instance-config]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:etc}/$${:_buildout_section_name_} rendered = $${directory:etc}/$${:_buildout_section_name_}
template = inline: template = inline:
https://$${:hostname}:$${:port} { :$${:port} {
bind $${:ip} bind $${:ip}
tls self_signed # TODO tls $${frontend-instance-certificate:cert-file} $${frontend-instance-certificate:key-file}
log stdout log stdout
errors stderr errors stderr
gzip gzip
...@@ -57,7 +75,7 @@ ip = $${frontend-instance-config:ip} ...@@ -57,7 +75,7 @@ ip = $${frontend-instance-config:ip}
hostname = $${frontend-instance-config:hostname} hostname = $${frontend-instance-config:hostname}
port = $${frontend-instance-config:port} port = $${frontend-instance-config:port}
pidfile = $${directory:pidfiles}/$${:_buildout_section_name_}.pid pidfile = $${directory:pidfiles}/$${:_buildout_section_name_}.pid
url = https://$${frontend-instance-password:username}:$${frontend-instance-password:passwd}@$${:hostname}:$${:port}/ url = https://$${:hostname}:$${:port}/
[frontend-reload] [frontend-reload]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -108,10 +126,24 @@ name = $${:_buildout_section_name_}.py ...@@ -108,10 +126,24 @@ name = $${:_buildout_section_name_}.py
config-hostname = $${frontend-instance:ip} config-hostname = $${frontend-instance:ip}
config-port = $${frontend-instance:port} config-port = $${frontend-instance:port}
[apache-frontend]
<= slap-connection
recipe = slapos.cookbook:requestoptional
name = Theia Frontend
# XXX We have hardcoded SR URL here.
software-url = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
slave = true
config-url = $${frontend-instance:url}
config-https-only = true
config-type = websocket
config-websocket-path-list = /services
return = domain secure_access
[publish-connection-parameter] [publish-connection-parameter]
recipe = slapos.cookbook:publish recipe = slapos.cookbook:publish
url = $${frontend-instance:url} url = $${apache-frontend:connection-secure_access}
username = $${frontend-instance-password:username}
password = $${frontend-instance-password:passwd}
[instance-parameter] [instance-parameter]
recipe = slapos.cookbook:slapconfiguration recipe = slapos.cookbook:slapconfiguration
......
appdirs==1.4.3 appdirs==1.4.3
astroid==2.3.3
attrs==18.2.0 attrs==18.2.0
black==18.9b0 black==18.9b0
Click==7.0 Click==7.0
future==0.17.1 future==0.17.1
isort==4.3.4 isort==4.3.21
jedi==0.13.2 jedi==0.13.2
lazy-object-proxy==1.4.3
mccabe==0.6.1 mccabe==0.6.1
mypy==0.660 mypy==0.770
mypy-extensions==0.4.1 mypy-extensions==0.4.3
parso==0.3.2 parso==0.3.2
pluggy==0.8.1 pluggy==0.8.1
pydocstyle==3.0.0 pydocstyle==3.0.0
pyflakes==2.1.0 pyflakes==2.1.0
pygls==0.8.1
pylint==2.4.4
python-jsonrpc-server==0.1.2 python-jsonrpc-server==0.1.2
-e git+https://github.com/palantir/python-language-server@50d03d5931d564e9908292ccfa21dd629ee817ba#egg=python_language_server -e git+https://github.com/palantir/python-language-server@50d03d5931d564e9908292ccfa21dd629ee817ba#egg=python_language_server
rope==0.11.0 rope==0.11.0
six==1.12.0 six==1.12.0
snowballstemmer==1.2.1 snowballstemmer==1.2.1
toml==0.10.0 toml==0.10.0
typed-ast==1.2.0 typed-ast==1.4.1
yapf==0.28.0 typing-extensions==3.7.4.2
wrapt==1.11.2
yapf==0.29.0
zc.buildout.languageserver==0.2.0
This diff is collapsed.
...@@ -44,19 +44,20 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass( ...@@ -44,19 +44,20 @@ setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
class TestTheia(SlapOSInstanceTestCase): class TestTheia(SlapOSInstanceTestCase):
def setUp(self): def setUp(self):
self.theia_url = self.computer_partition.getConnectionParameterDict( self.connection_parameters = self.computer_partition.getConnectionParameterDict()
)['url']
def test_http_get(self): def test_http_get(self):
resp = requests.get(self.theia_url, verify=False) resp = requests.get(self.connection_parameters['url'], verify=False)
self.assertEqual(requests.codes.ok, resp.status_code) self.assertEqual(requests.codes.unauthorized, resp.status_code)
# without login/password, this is unauthorized # with login/password, this is allowed
parsed_url = urlparse(self.theia_url) parsed_url = urlparse(self.connection_parameters['url'])
resp = requests.get( resp = requests.get(
parsed_url._replace( parsed_url._replace(
netloc='[{}]:{}'.format( netloc='{}:{}@[{}]:{}'.format(
self.connection_parameters['username'],
self.connection_parameters['password'],
parsed_url.hostname, parsed_url.hostname,
parsed_url.port)).geturl(), parsed_url.port)).geturl(),
verify=False) verify=False)
self.assertEqual(requests.codes.unauthorized, resp.status_code) self.assertEqual(requests.codes.ok, resp.status_code)
This diff is collapsed.
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment