Commit 9792ce5b authored by Jérome Perrin's avatar Jérome Perrin

Merge remote-tracking branch 'upstream/master' into zope4py2

parents 6ee19990 b32e4991
...@@ -7,5 +7,5 @@ parts = ...@@ -7,5 +7,5 @@ parts =
[depot_tools] [depot_tools]
recipe = slapos.recipe.build:gitclone recipe = slapos.recipe.build:gitclone
repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git
revsion = e023d4482012d89690f6a483e877eceb47c4501e revision = e023d4482012d89690f6a483e877eceb47c4501e
git-executable = ${git:location}/bin/git git-executable = ${git:location}/bin/git
...@@ -110,6 +110,7 @@ environment = ...@@ -110,6 +110,7 @@ environment =
CXX="${:llvm-toolchain}/clang++" CXX="${:llvm-toolchain}/clang++"
AR="${:llvm-toolchain}/llvm-ar" AR="${:llvm-toolchain}/llvm-ar"
NM="${:llvm-toolchain}/llvm-nm" NM="${:llvm-toolchain}/llvm-nm"
DEPOT_TOOLS_UPDATE=0
# Fix permission for group, slapuserXX should be able to access subfolders # Fix permission for group, slapuserXX should be able to access subfolders
# in headless-chromium location. # in headless-chromium location.
......
...@@ -3,78 +3,65 @@ ...@@ -3,78 +3,65 @@
"description": "Parameters to instantiate coupler", "description": "Parameters to instantiate coupler",
"type": "object", "type": "object",
"configuration": { "configuration": {
"coupler_block_device": {
"coupler_block_device": {
"description": "The Linux block device using I2C protocol,", "description": "The Linux block device using I2C protocol,",
"type": "string", "type": "string",
"default": "/dev/i2c-1" "default": "/dev/i2c-1"
}, },
"coupler_i2c_slave_list": {
"coupler_i2c_slave_list": {
"description": "The list of comma separated addresses of I2C enabled devices on the I2C bus.", "description": "The list of comma separated addresses of I2C enabled devices on the I2C bus.",
"type": "string", "type": "string",
"default": "0x58" "default": "0x58"
}, },
"opc_ua_port": {
"opc_ua_port": {
"description": "The OPC UA server bind to bind to.", "description": "The OPC UA server bind to bind to.",
"type": "integer", "type": "integer",
"default": 4840 "default": 4840
}, },
"mode": {
"mode": { "description": "The operation mode of the coupler. By default 0 - i.e. control for real I2C devices attached. If 1 selected emulate them (useful for testing). ",
"description": "The operationg mode of the coupler. By default 0 - i.e. control for real I2C devices attached. If 1 selected emulate them (useful for testing). ",
"type": "integer", "type": "integer",
"default": 0 "default": 0
}, },
"id": {
"id": {
"description": "The numeric ID of the coupler", "description": "The numeric ID of the coupler",
"type": "integer", "type": "integer",
"default": 0 "default": 0
}, },
"username": {
"username": {
"description": "The username for OPC UA server.", "description": "The username for OPC UA server.",
"type": "string", "type": "string",
"default": "" "default": ""
}, },
"password": {
"password": {
"description": "The password for OPC UA server.", "description": "The password for OPC UA server.",
"type": "string", "type": "string",
"default": "" "default": ""
}, },
"heart_beat": {
"heart_beat": {
"description": "Indication if coupler should send heart beats over a keep-alive network.", "description": "Indication if coupler should send heart beats over a keep-alive network.",
"type": "boolean", "type": "boolean",
"default": 0 "default": 0
}, },
"heart_beat_interval": {
"heart_beat_interval": {
"description": "The heart beat interval (in ms)", "description": "The heart beat interval (in ms)",
"type": "integer", "type": "integer",
"default": 500 "default": 500
}, },
"heart_beat_id_list": {
"heart_beat_id_list": {
"description": "A comma separated list of couplers' IDs which should send to us keep-alive messages. ", "description": "A comma separated list of couplers' IDs which should send to us keep-alive messages. ",
"type": "string", "type": "string",
"default": "" "default": ""
}, },
"heart_beat_timeout_interval": {
"heart_beat_timeout_interval": {
"description": "The timeout (in ms) which when expired without a keep alive message will cause the coupler to go to a safe mode. ", "description": "The timeout (in ms) which when expired without a keep alive message will cause the coupler to go to a safe mode. ",
"type": "integer", "type": "integer",
"default": 2000 "default": 2000
}, },
"network_address_url_data_type": {
"network_address_url_data_type": {
"description": "Network address URL type used for Pub/Sub.", "description": "Network address URL type used for Pub/Sub.",
"type": "string", "type": "string",
"default": "opc.udp://224.0.0.22:4840/" "default": "opc.udp://224.0.0.22:4840/"
} }
} }
} }
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
[instance-theia] [instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in _update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 4b69822605e3f20fcec8f44a0bdf80bb md5sum = 8a6efc1054b60f3cbd114a9f6097bae5
[instance] [instance]
_update_hash_filename_ = instance.cfg.in _update_hash_filename_ = instance.cfg.in
......
...@@ -261,14 +261,13 @@ content = ...@@ -261,14 +261,13 @@ content =
log global log global
bind $${:ip}:$${:port} ssl crt $${frontend-instance-certificate:cert-file} alpn h2,http/1.1 bind $${:ip}:$${:port} ssl crt $${frontend-instance-certificate:cert-file} alpn h2,http/1.1
# writing twice the same ACL is doing OR # writing twice the same ACL is doing OR
acl is_public path_beg /public/
acl is_public path /$${frontend-instance-favicon.ico:filename} acl is_public path /$${frontend-instance-favicon.ico:filename}
acl is_public path /$${frontend-instance-theia.webmanifest:filename} acl is_public path /$${frontend-instance-theia.webmanifest:filename}
acl is_public path /$${frontend-instance-theia-serviceworker.js:filename} acl is_public path /$${frontend-instance-theia-serviceworker.js:filename}
acl auth_ok http_auth(basic-auth-list) acl auth_ok http_auth(basic-auth-list)
# No authentication for public folder # No authentication for some files
http-request auth unless auth_ok || is_public http-request auth unless auth_ok || is_public
use_backend static if { path_beg /$${frontend-instance-fonts:folder-name} } || { path_beg /$${frontend-instance-slapos.css:folder-name} } || { path /$${frontend-instance-logo:filename} } || is_public use_backend static if { path_beg /$${frontend-instance-fonts:folder-name} } || { path_beg /$${frontend-instance-slapos.css:folder-name} } || { path /$${frontend-instance-logo:filename} } || { path_beg /public/ } || is_public
default_backend nodejs default_backend nodejs
backend nodejs backend nodejs
......
...@@ -146,14 +146,16 @@ class TestTheia(TheiaTestCase): ...@@ -146,14 +146,16 @@ class TestTheia(TheiaTestCase):
)).geturl() )).geturl()
self.get(authenticated_url) self.get(authenticated_url)
# there's a public folder to serve file (no need for authentication) # there's a public folder to serve file
with open('{}/srv/frontend-static/public/test_file'.format( with open('{}/srv/frontend-static/public/test_file'.format(
self.getPath()), 'w') as f: self.getPath()), 'w') as f:
f.write("hello") f.write("hello")
resp = self.get(urljoin(url, '/public/')) resp = self.get(urljoin(authenticated_url, '/public/'))
self.assertIn('test_file', resp.text) self.assertIn('test_file', resp.text)
resp = self.get(urljoin(url, '/public/test_file')) resp = self.get(urljoin(authenticated_url, '/public/test_file'))
self.assertEqual('hello', resp.text) self.assertEqual('hello', resp.text)
# make sure public folder is protected
resp = self.get(urljoin(url, '/public/test_file'), requests.codes.unauthorized)
# there's a (not empty) favicon (no need for authentication) # there's a (not empty) favicon (no need for authentication)
resp = self.get(urljoin(url, '/favicon.ico')) resp = self.get(urljoin(url, '/favicon.ico'))
......
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