Commit bf56808b authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼 Committed by Xavier Thompson

software/theia: give ipv6 range to standalone

parent 12b0e7d0
...@@ -15,11 +15,11 @@ ...@@ -15,11 +15,11 @@
[instance-theia] [instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in _update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = a9d4ace568acdd5002d587816ab91737 md5sum = d8fa4bed6b7d7c77b0aec53abae32426
[instance] [instance]
_update_hash_filename_ = instance.cfg.in _update_hash_filename_ = instance.cfg.in
md5sum = 08b8aa2b7f59ac0e4e5d4ca180054937 md5sum = f322033a7670b9be29b1bf1bf9024b87
[instance-import] [instance-import]
_update_hash_filename_ = instance-import.cfg.jinja.in _update_hash_filename_ = instance-import.cfg.jinja.in
...@@ -35,7 +35,7 @@ md5sum = ad9499e7355ded4975ad313442cecb7a ...@@ -35,7 +35,7 @@ md5sum = ad9499e7355ded4975ad313442cecb7a
[slapos-standalone-script] [slapos-standalone-script]
_update_hash_filename_ = slapos_standalone_script.py.jinja _update_hash_filename_ = slapos_standalone_script.py.jinja
md5sum = 6792d29057db35ea69b01e72a5c913e3 md5sum = 93c492cc5c186989f104f37de43f25c5
[theia-common] [theia-common]
_update_hash_filename_ = theia_common.py _update_hash_filename_ = theia_common.py
......
...@@ -38,7 +38,7 @@ additional-url = $${remote-additional-frontend:connection-secure_access} ...@@ -38,7 +38,7 @@ additional-url = $${remote-additional-frontend:connection-secure_access}
username = $${frontend-instance-password:username} username = $${frontend-instance-password:username}
password = $${frontend-instance-password:passwd} password = $${frontend-instance-password:passwd}
backend-url = $${frontend-instance:url} backend-url = $${frontend-instance:url}
ipv6 = {{ ipv6_random }} ipv6 = {{ ipv6_theia }}
[directory] [directory]
recipe = slapos.cookbook:mkdirectory recipe = slapos.cookbook:mkdirectory
...@@ -227,7 +227,7 @@ storage-path = $${buildout:parts-directory}/.$${:_buildout_section_name_} ...@@ -227,7 +227,7 @@ storage-path = $${buildout:parts-directory}/.$${:_buildout_section_name_}
recipe = slapos.cookbook:free_port recipe = slapos.cookbook:free_port
minimum = 3000 minimum = 3000
maximum = 3100 maximum = 3100
ip = {{ ipv6_random }} ip = {{ ipv6_theia }}
[frontend-instance-certificate] [frontend-instance-certificate]
recipe = plone.recipe.command recipe = plone.recipe.command
...@@ -421,7 +421,7 @@ inline = ...@@ -421,7 +421,7 @@ inline =
#!/bin/sh #!/bin/sh
export HOME=$${directory:home} export HOME=$${directory:home}
export PATH=${cli-utilities:PATH}:$HOME/.cargo/bin:$HOME/.local/bin:$PATH export PATH=${cli-utilities:PATH}:$HOME/.cargo/bin:$HOME/.local/bin:$PATH
export IPV6_SLAPRUNNER={{ ipv6_random }} export IPV6_SLAPRUNNER={{ ipv6_theia }}
# Theia Backend # Theia Backend
# ------------- # -------------
...@@ -566,7 +566,7 @@ ip = {{ ipv4_random }} ...@@ -566,7 +566,7 @@ ip = {{ ipv4_random }}
[slapos-standalone-config] [slapos-standalone-config]
ipv4 = {{ ipv4_random }} ipv4 = {{ ipv4_random }}
ipv6 = {{ ipv6_random }} ipv6 = {{ slap_resource.get('ipv6-range-network') or ipv6_theia }}
port = $${slapos-standalone-port:port} port = $${slapos-standalone-port:port}
base-directory = $${directory:runner} base-directory = $${directory:runner}
software-root = $${directory:runner}/software software-root = $${directory:runner}/software
...@@ -603,7 +603,7 @@ context = ...@@ -603,7 +603,7 @@ context =
key home_path directory:home key home_path directory:home
key forward_frontend_requests :forward-frontend-requests key forward_frontend_requests :forward-frontend-requests
section slap_connection slap-connection section slap_connection slap-connection
section slapos_standalone_config slapos-standalone-config section config slapos-standalone-config
forward-frontend-requests = {{ parameter_dict['forward-slapos-frontend-requests'] }} forward-frontend-requests = {{ parameter_dict['forward-slapos-frontend-requests'] }}
url = ${slapos-standalone-script:output} url = ${slapos-standalone-script:output}
......
...@@ -37,8 +37,9 @@ context = ...@@ -37,8 +37,9 @@ context =
key parameter_dict slap-configuration:configuration key parameter_dict slap-configuration:configuration
key root_title slap-configuration:root-instance-title key root_title slap-configuration:root-instance-title
key partition_root_path buildout:directory key partition_root_path buildout:directory
key ipv6_random slap-configuration:ipv6-random key ipv6_theia slap-configuration:ipv6-random
key ipv4_random slap-configuration:ipv4-random key ipv4_random slap-configuration:ipv4-random
section slap_resource slap-configuration
import os os import os os
import json json import json json
default-parameters = default-parameters =
......
...@@ -70,23 +70,23 @@ def setupStandalone(): ...@@ -70,23 +70,23 @@ def setupStandalone():
shared_parts = {{ repr(shared_part_list) }} shared_parts = {{ repr(shared_part_list) }}
shared_part_list = [x.strip() for x in shared_parts.splitlines() if x.strip()] shared_part_list = [x.strip() for x in shared_parts.splitlines() if x.strip()]
standalone = slapos.slap.standalone.StandaloneSlapOS( standalone = slapos.slap.standalone.StandaloneSlapOS(
{{ repr(slapos_standalone_config['base-directory']) }}, {{ repr(config['base-directory']) }},
{{ repr(slapos_standalone_config['ipv4']) }}, {{ repr(config['ipv4']) }},
{{ slapos_standalone_config['port'] }}, {{ config['port'] }},
computer_id={{ repr(slapos_standalone_config['computer-id']) }}, computer_id={{ repr(config['computer-id']) }},
shared_part_list=shared_part_list, shared_part_list=shared_part_list,
software_root={{ repr(slapos_standalone_config['software-root']) }}, software_root={{ repr(config['software-root']) }},
instance_root={{ repr(slapos_standalone_config['instance-root']) }}, instance_root={{ repr(config['instance-root']) }},
partition_forward_configuration=partition_forward_configuration, partition_forward_configuration=partition_forward_configuration,
slapos_bin={{ repr(slapos_standalone_config['slapos-bin']) }}, slapos_bin={{ repr(config['slapos-bin']) }},
local_software_release_root={{ repr(slapos_standalone_config['local-software-release-root']) }}, local_software_release_root={{ repr(config['local-software-release-root']) }},
) )
standalone.start() standalone.start()
try: try:
partition_count = 20 partition_count = 20
logging.info("Standalone SlapOS: Formatting %d partitions", partition_count) logging.info("Standalone SlapOS: Formatting %d partitions", partition_count)
standalone.format(partition_count, {{ repr(slapos_standalone_config['ipv4']) }}, {{ repr(slapos_standalone_config['ipv6']) }}) standalone.format(partition_count, {{ repr(config['ipv4']) }}, {{ repr(config['ipv6']) }})
logging.info("Standalone SlapOS for computer `%s` started", {{ repr(slapos_standalone_config['computer-id']) }}) logging.info("Standalone SlapOS for computer `%s` started", {{ repr(config['computer-id']) }})
# Run instance at least once, to start the supervisor managing instances. # Run instance at least once, to start the supervisor managing instances.
try: try:
standalone.waitForInstance(max_retry=0) standalone.waitForInstance(max_retry=0)
...@@ -179,7 +179,7 @@ def main(): ...@@ -179,7 +179,7 @@ def main():
s = socket.socket(socket.AF_UNIX) s = socket.socket(socket.AF_UNIX)
s.bind({{ repr('\0' + slapos_standalone_config['abstract-socket-path']) }}) s.bind({{ repr('\0' + config['abstract-socket-path']) }})
s.listen(5) s.listen(5)
logging.info("Standalone SlapOS ready") logging.info("Standalone SlapOS ready")
......
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