Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Romain Courteaud
slapos
Commits
e63c9c59
Commit
e63c9c59
authored
May 07, 2021
by
Xavier Thompson
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
software/theia: Add frontend configuration options
parent
cb40e46f
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
69 additions
and
12 deletions
+69
-12
software/theia/buildout.hash.cfg
software/theia/buildout.hash.cfg
+2
-2
software/theia/instance-theia.cfg.jinja.in
software/theia/instance-theia.cfg.jinja.in
+40
-10
software/theia/instance.cfg.in
software/theia/instance.cfg.in
+11
-0
software/theia/test/test.py
software/theia/test/test.py
+16
-0
No files found.
software/theia/buildout.hash.cfg
View file @
e63c9c59
...
...
@@ -15,11 +15,11 @@
[instance-theia]
filename = instance-theia.cfg.jinja.in
md5sum =
a5a7db274eb11c022a12142fabc9a355
md5sum =
65c66a4cc4eb1d074dcafddf945a34d4
[instance]
filename = instance.cfg.in
md5sum =
eb4ee219603da65b748cb912685b9b17
md5sum =
43923e3e1f27c43696ecbca9ee147bdb
[yarn.lock]
filename = yarn.lock
...
...
software/theia/instance-theia.cfg.jinja.in
View file @
e63c9c59
{% set additional_frontend = slapconfiguration_section['configuration.additional-frontend-guid'] %}
[buildout]
extends =
${monitor-template:rendered}
...
...
@@ -33,7 +35,10 @@ offline = true
[publish-connection-parameter]
<= monitor-publish
recipe = slapos.cookbook:publish
url = $${apache-frontend:connection-secure_access}
url = $${remote-frontend:connection-secure_access}
{% if additional_frontend %}
additional-url = $${remote-additional-frontend:connection-secure_access}
{% endif %}
username = $${frontend-instance-password:username}
password = $${frontend-instance-password:passwd}
backend-url = $${frontend-instance:url}
...
...
@@ -68,7 +73,10 @@ recipe =
instance-promises =
$${theia-listen-promise:name}
$${frontend-listen-promise:name}
$${apache-frontend-url-available-promise:name}
$${remote-frontend-url-available-promise:name}
{% if additional_frontend %}
$${remote-additional-frontend-url-available-promise:name}
{% endif %}
$${slapos-standalone-listen-promise:name}
$${slapos-autorun-promise:name}
...
...
@@ -86,13 +94,22 @@ name = $${:_buildout_section_name_}.py
config-hostname = $${frontend-instance:ip}
config-port = $${frontend-instance:port}
[
apach
e-frontend-url-available-promise]
[
remot
e-frontend-url-available-promise]
<= monitor-promise-base
module = check_url_available
name = $${:_buildout_section_name_}.py
config-url = $${
apach
e-frontend:connection-secure_access}
config-url = $${
remot
e-frontend:connection-secure_access}
config-check-secure = 1
{% if additional_frontend %}
[remote-additional-frontend-url-available-promise]
<= monitor-promise-base
module = check_url_available
name = $${:_buildout_section_name_}.py
config-url = $${remote-additional-frontend:connection-secure_access}
config-check-secure = 1
{% endif %}
[slapos-standalone-listen-promise]
<= monitor-promise-base
module = check_port_listening
...
...
@@ -110,15 +127,12 @@ config-service = $${slapos-autorun:service-name}
config-expect = $${slapos-autorun:autorun}
# Remote
Apache
Frontend
# ---------------------
-
# Remote
Caddy
Frontend
# ---------------------
[
apache-frontend
]
[
remote-frontend-base
]
<= 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
...
...
@@ -126,6 +140,22 @@ config-type = websocket
config-websocket-path-list = /services /file-upload
return = domain secure_access
[remote-frontend]
<= remote-frontend-base
name = $${instance-parameter:configuration.frontend-name}
software-url = $${instance-parameter:configuration.frontend-sr}
software-type = $${instance-parameter:configuration.frontend-sr-type}
sla-instance_guid = $${instance-parameter:configuration.frontend-guid}
{% if additional_frontend %}
[remote-additional-frontend]
<= remote-frontend-base
name = $${instance-parameter:configuration.additional-frontend-name}
software-url = $${instance-parameter:configuration.additional-frontend-sr}
software-type = $${instance-parameter:configuration.additional-frontend-sr-type}
sla-instance_guid = $${instance-parameter:configuration.additional-frontend-guid}
{% endif %}
# Local Caddy Frontend
# --------------------
...
...
software/theia/instance.cfg.in
View file @
e63c9c59
...
...
@@ -12,9 +12,20 @@ partition = $${slap-connection:partition-id}
url = $${slap-connection:server-url}
key = $${slap-connection:key-file}
cert = $${slap-connection:cert-file}
;Theia default configuration
configuration.autorun = running
configuration.embedded-sr =
configuration.embedded-sr-type =
;Frontend default configuration
configuration.frontend-name = Theia Frontend
configuration.frontend-sr = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
configuration.frontend-sr-type = RootSoftwareInstance
configuration.frontend-guid =
;Additional frontend default configuration
configuration.additional-frontend-name = Theia Additional Frontend
configuration.additional-frontend-sr = http://git.erp5.org/gitweb/slapos.git/blob_plain/HEAD:/software/apache-frontend/software.cfg
configuration.additional-frontend-sr-type = RootSoftwareInstance
configuration.additional-frontend-guid =
[switch-softwaretype]
recipe = slapos.cookbook:switch-softwaretype
...
...
software/theia/test/test.py
View file @
e63c9c59
...
...
@@ -247,6 +247,22 @@ class TestTheiaWithSR(TheiaTestCase):
self
.
assertIsNotNone
(
re
.
search
(
r"%s\
s+%s
\s+%s"
%
(
self
.
sr_url
,
self
.
sr_type
,
instance_name
),
info
),
info
)
class
TestTheiaFrontend
(
TheiaTestCase
):
@
classmethod
def
getInstanceParameterDict
(
cls
):
return
{
'additional-frontend-guid'
:
'SOMETHING'
}
def
setUp
(
self
):
self
.
connection_parameters
=
self
.
computer_partition
.
getConnectionParameterDict
()
def
test_http_get
(
self
):
for
key
in
(
'url'
,
'additional-url'
):
resp
=
requests
.
get
(
self
.
connection_parameters
[
key
],
verify
=
False
)
self
.
assertEqual
(
requests
.
codes
.
unauthorized
,
resp
.
status_code
)
class
TestTheiaEnv
(
TheiaTestCase
):
dummy_software_path
=
os
.
path
.
abspath
(
'dummy/software.cfg'
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment