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

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

parents 6ee19990 b32e4991
Pipeline #26397 failed with stage
in 0 seconds
......@@ -7,5 +7,5 @@ parts =
[depot_tools]
recipe = slapos.recipe.build:gitclone
repository = https://chromium.googlesource.com/chromium/tools/depot_tools.git
revsion = e023d4482012d89690f6a483e877eceb47c4501e
revision = e023d4482012d89690f6a483e877eceb47c4501e
git-executable = ${git:location}/bin/git
......@@ -110,6 +110,7 @@ environment =
CXX="${:llvm-toolchain}/clang++"
AR="${:llvm-toolchain}/llvm-ar"
NM="${:llvm-toolchain}/llvm-nm"
DEPOT_TOOLS_UPDATE=0
# Fix permission for group, slapuserXX should be able to access subfolders
# in headless-chromium location.
......
......@@ -3,78 +3,65 @@
"description": "Parameters to instantiate coupler",
"type": "object",
"configuration": {
"coupler_block_device": {
"coupler_block_device": {
"description": "The Linux block device using I2C protocol,",
"type": "string",
"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.",
"type": "string",
"default": "0x58"
},
"opc_ua_port": {
"opc_ua_port": {
"description": "The OPC UA server bind to bind to.",
"type": "integer",
"default": 4840
},
"mode": {
"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). ",
},
"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). ",
"type": "integer",
"default": 0
},
"id": {
},
"id": {
"description": "The numeric ID of the coupler",
"type": "integer",
"default": 0
},
"username": {
},
"username": {
"description": "The username for OPC UA server.",
"type": "string",
"default": ""
},
"password": {
"password": {
"description": "The password for OPC UA server.",
"type": "string",
"default": ""
},
"heart_beat": {
"heart_beat": {
"description": "Indication if coupler should send heart beats over a keep-alive network.",
"type": "boolean",
"default": 0
},
"heart_beat_interval": {
"heart_beat_interval": {
"description": "The heart beat interval (in ms)",
"type": "integer",
"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. ",
"type": "string",
"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. ",
"type": "integer",
"default": 2000
},
"network_address_url_data_type": {
"network_address_url_data_type": {
"description": "Network address URL type used for Pub/Sub.",
"type": "string",
"default": "opc.udp://224.0.0.22:4840/"
}
}
}
......@@ -15,7 +15,7 @@
[instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 4b69822605e3f20fcec8f44a0bdf80bb
md5sum = 8a6efc1054b60f3cbd114a9f6097bae5
[instance]
_update_hash_filename_ = instance.cfg.in
......
......@@ -261,14 +261,13 @@ content =
log global
bind $${:ip}:$${:port} ssl crt $${frontend-instance-certificate:cert-file} alpn h2,http/1.1
# 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-theia.webmanifest:filename}
acl is_public path /$${frontend-instance-theia-serviceworker.js:filename}
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
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
backend nodejs
......
......@@ -146,14 +146,16 @@ class TestTheia(TheiaTestCase):
)).geturl()
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(
self.getPath()), 'w') as f:
f.write("hello")
resp = self.get(urljoin(url, '/public/'))
resp = self.get(urljoin(authenticated_url, '/public/'))
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)
# 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)
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