Commit 1f47afc7 authored by Xavier Thompson's avatar Xavier Thompson

software/theia: Select free ports

parent d0d2dc3a
...@@ -19,7 +19,7 @@ md5sum = df9548360119b698568694a037ec9c76 ...@@ -19,7 +19,7 @@ md5sum = df9548360119b698568694a037ec9c76
[instance-theia.cfg.jinja2.in] [instance-theia.cfg.jinja2.in]
filename = instance-theia.cfg.jinja2.in filename = instance-theia.cfg.jinja2.in
md5sum = 4feac5dbb3935ca878fe75a3620ec4ff md5sum = 59c2a5a061d8a2427d4e2d5d10780220
[instance-theia-import.cfg.in] [instance-theia-import.cfg.in]
filename = instance-theia-import.cfg.in filename = instance-theia-import.cfg.in
......
...@@ -145,6 +145,12 @@ recipe = slapos.cookbook:generate.password ...@@ -145,6 +145,12 @@ recipe = slapos.cookbook:generate.password
username = node username = node
bytes = 12 bytes = 12
[frontend-instance-port]
recipe = slapos.cookbook:free_port
minimum = 3000
maximum = 3499
ip = $${instance-parameter:ipv6-random}
[frontend-instance-certificate] [frontend-instance-certificate]
recipe = plone.recipe.command recipe = plone.recipe.command
command = command =
...@@ -194,9 +200,9 @@ template = inline: ...@@ -194,9 +200,9 @@ template = inline:
/ /
} }
} }
ip = $${instance-parameter:ipv6-random} ip = $${frontend-instance-port:ip}
hostname = [$${:ip}] hostname = [$${:ip}]
port = 3001 port = $${frontend-instance-port:port}
[frontend-instance] [frontend-instance]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
...@@ -280,6 +286,12 @@ filename = $${:_buildout_section_name_} ...@@ -280,6 +286,12 @@ filename = $${:_buildout_section_name_}
# Theia Backend # Theia Backend
# ------------- # -------------
[theia-service-port]
recipe = slapos.cookbook:free_port
minimum = 3500
maximum = 3999
ip = $${instance-parameter:ipv4-random}
[theia-service] [theia-service]
recipe = slapos.recipe.template:jinja2 recipe = slapos.recipe.template:jinja2
rendered = $${directory:bin}/$${:_buildout_section_name_} rendered = $${directory:bin}/$${:_buildout_section_name_}
...@@ -299,8 +311,8 @@ template = ...@@ -299,8 +311,8 @@ template =
export TERMINFO=${ncurses:location}/lib/terminfo/ export TERMINFO=${ncurses:location}/lib/terminfo/
export EDITOR="${python-language-server:location}/bin/python -m theia_open --wait" export EDITOR="${python-language-server:location}/bin/python -m theia_open --wait"
exec ${theia-wrapper:rendered} $@ exec ${theia-wrapper:rendered} $@
ip = $${instance-parameter:ipv4-random} ip = $${theia-service-port:ip}
port = 3000 port = $${theia-service-port:port}
base-url = http://$${:ip}:$${:port}/ base-url = http://$${:ip}:$${:port}/
[theia-instance] [theia-instance]
...@@ -354,10 +366,16 @@ command = ...@@ -354,10 +366,16 @@ command =
# SlapOS Standalone # SlapOS Standalone
# ----------------- # -----------------
[slapos-standalone-port]
recipe = slapos.cookbook:free_port
minimum = 4000
maximum = 4100
ip = $${instance-parameter:ipv4-random}
[slapos-standalone-config] [slapos-standalone-config]
ipv4 = $${instance-parameter:ipv4-random} ipv4 = $${instance-parameter:ipv4-random}
ipv6 = $${instance-parameter:ipv6-random} ipv6 = $${instance-parameter:ipv6-random}
port = 4000 port = $${slapos-standalone-port:port}
slapos-configuration = $${directory:runner}/etc/slapos.cfg slapos-configuration = $${directory:runner}/etc/slapos.cfg
computer-id = slaprunner computer-id = slaprunner
......
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