Commit 9f9ab970 authored by Thomas Gambier's avatar Thomas Gambier 🚴🏼

Update Release Candidate

parents ba75b363 fa4c0ef4
......@@ -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
......@@ -133,13 +133,17 @@ command =
sed -i "s#'/usr/share/'#'${firewalld:location}/share'#" ${firewalld:python-egg}/firewall/config/__init__.py
sed -i "s#import sys#import sys, os\n\nos.environ['GI_TYPELIB_PATH'] = '${gobject-introspection:location}/lib/girepository-1.0/'#" ${:python}
sed -i 's#<user>messagebus</user>#<user>slapsoft</user>#' ${dbus:location}/share/dbus-1/system.conf
cp -f ${firewalld:location}/lib/firewalld/zones/trusted.xml ${firewalld:etc-dir}/zones/
cp -f ${firewalld:location}/share/dbus-1/system.d/FirewallD.conf ${dbus:location}/share/dbus-1/system.d/
mkdir -p ${firewalld:location}/sbin
echo -n '#!/bin/sh\nLD_LIBRARY_PATH=${nftables:location}/lib exec ${firewalld:location}/${firewalld:sbin-dir}/firewalld "$@"' > ${firewalld:location}/sbin/firewalld
chmod a+x ${firewalld:location}/sbin/firewalld
# no need to patch dbus if not in top level compilation
[ "$(stat -c '%U' ${dbus:location}/share/dbus-1/system.conf)" = "slapsoft" ] || exit 0
sed -i 's#<user>messagebus</user>#<user>slapsoft</user>#' ${dbus:location}/share/dbus-1/system.conf
cp -f ${firewalld:location}/share/dbus-1/system.d/FirewallD.conf ${dbus:location}/share/dbus-1/system.d/
update-command = ${:command}
stop-on-error = true
......
......@@ -3,13 +3,14 @@
[buildout]
parts = fish-shell
extends =
../cmake/buildout.cfg
../zlib/buildout.cfg
../bzip2/buildout.cfg
../cmake/buildout.cfg
../gettext/buildout.cfg
../ncurses/buildout.cfg
../pcre2/buildout.cfg
../readline/buildout.cfg
../gettext/buildout.cfg
../xz-utils/buildout.cfg
../zlib/buildout.cfg
[fish-shell]
recipe = slapos.recipe.cmmi
......@@ -22,13 +23,15 @@ configure-options =
-DCMAKE_C_FLAGS="${:CMAKE_CFLAGS}"
-DCMAKE_CXX_FLAGS="${:CMAKE_CFLAGS}"
-DCMAKE_INSTALL_RPATH=${:CMAKE_LIBRARY_PATH}
-DFISH_USE_SYSTEM_PCRE2=ON
-DSYS_PCRE2_INCLUDE_DIR=${pcre2:location}/include
environment =
CMAKE_PROGRAM_PATH=${cmake:location}/bin
CMAKE_INCLUDE_PATH=${bzip2:location}/include:${zlib:location}/include:${ncurses:location}/include:${gettext:location}/include:${readline:location}/include
CMAKE_LIBRARY_PATH=${:CMAKE_LIBRARY_PATH}
LDFLAGS=-L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib
LDFLAGS=-L${ncurses:location}/lib -Wl,-rpath=${ncurses:location}/lib -L${gettext:location}/lib -Wl,-rpath=${gettext:location}/lib -L${pcre2:location}/lib -Wl,-rpath=${pcre2:location}/lib
PATH=${xz-utils:location}/bin/:%(PATH)s
CMAKE_CFLAGS = -I${bzip2:location}/include -I${zlib:location}/include -I${ncurses:location}/include -I${gettext:location}/include -I${readline:location}/include
CMAKE_LIBRARY_PATH = ${bzip2:location}/lib:${zlib:location}/lib:${ncurses:location}/lib:${gettext:location}/lib:${readline:location}/lib
CMAKE_CFLAGS = -I${bzip2:location}/include -I${zlib:location}/include -I${ncurses:location}/include -I${gettext:location}/include -I${readline:location}/include -I${pcre2:location}/include
CMAKE_LIBRARY_PATH = ${bzip2:location}/lib:${zlib:location}/lib:${ncurses:location}/lib:${gettext:location}/lib:${readline:location}/lib:${pcre2:location}/lib
location = @@LOCATION@@
......@@ -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.
......
[buildout]
extends =
../cmake/buildout.cfg
parts = mbedtls
[mbedtls]
......@@ -6,5 +8,8 @@ recipe = slapos.recipe.cmmi
url = https://github.com/Mbed-TLS/mbedtls/archive/refs/tags/v2.28.2.tar.gz
md5sum = 421c47c18ef46095e3ad38ffc0543e11
shared = true
configure-command = echo
configure-command = cmake -DUSE_SHARED_MBEDTLS_LIBRARY=On -DCMAKE_INSTALL_PREFIX=
environment =
PATH=${cmake:location}/bin:%(PATH)s
LDFLAGS=-Wl,-rpath=@@LOCATION@@/lib/
make-targets = install DESTDIR=@@LOCATION@@
[buildout]
extends =
../cmake/buildout.cfg
parts =
pcre2
[pcre2]
recipe = slapos.recipe.cmmi
shared = true
url = https://github.com/PCRE2Project/pcre2/releases/download/pcre2-10.42/pcre2-10.42.tar.bz2
md5sum = a8e9ab2935d428a4807461f183034abe
configure-command = ${cmake:location}/bin/cmake
configure-options =
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@
-DPCRE2_BUILD_PCRE2_16=ON
-DPCRE2_BUILD_PCRE2_32=ON
-DPCRE2_SUPPORT_LIBBZ2=OFF
-DPCRE2_SUPPORT_LIBZ=OFF
-DPCRE2_SUPPORT_LIBEDIT=OFF
-DPCRE2_SUPPORT_LIBREADLINE=OFF
......@@ -19,8 +19,9 @@ parts =
py
firewalld-patch
[python]
part = python3
# Force python3.7 for a while to be compatible with more SR
[python3]
<= python3.7
[environment]
# Note: For now original PATH is appended to the end, as not all tools are
......
......@@ -38,10 +38,6 @@ configure-options +=
environment +=
DESTDIR=${buildout:destdir}
# Force python3.7 for a while to be compatible with more SR
[python3]
<= python3.7
[bison]
configure-options +=
--prefix=${buildout:rootdir}/parts/${:_buildout_section_name_}
......
......@@ -70,6 +70,10 @@ post-install =
# and anyway not used once the software is installed
rm -f %(location)s/node_modules/@msgpackr-extract/*/*.node
rm -rf $HOME/.cache/yarn/
# remove "which" command added in $PATH that does not correctly
# handle executables thanks to a secondary group of the user.
# https://www.npmjs.com/package/which https://www.npmjs.com/package/isexe
rm -f %(location)s/node_modules/.bin/which
[theia-wrapper]
recipe = slapos.recipe.template
......@@ -77,7 +81,7 @@ output = ${buildout:bin-directory}/${:_buildout_section_name_}
inline =
#!/bin/sh
cd ${theia:location}
exec ${yarn:location}/bin/yarn theia start "$@"
exec ${nodejs:location}/bin/node ${theia:location}/node_modules/.bin/theia start "$@"
[theia-open]
recipe = slapos.recipe.template
......@@ -144,6 +148,7 @@ content =
"editor.tabSize": 2,
"plantuml.server": "https://plantuml.host.vifib.net/svg/",
"plantuml.render": "PlantUMLServer",
"python.pythonPath": "${python:executable}",
"gitlens.remotes": [{ "domain": "lab.nexedi.com", "type": "GitLab" }]
},
"warnOnPotentiallyInsecureHostPattern": false
......
......@@ -19,7 +19,7 @@ md5sum = 6343592161a349bb40e0de16ce67aa51
[yarn.lock]
_update_hash_filename_ = yarn.lock
md5sum = ff5b37cac09580b885e6d269f62cdbad
md5sum = c28b0fa56592066e7031de696a5d02b3
[ms-python-disable-jedi-buildout.patch]
_update_hash_filename_ = ms-python-disable-jedi-buildout.patch
......
This diff is collapsed.
This diff is collapsed.
[instance-profile]
filename = instance.cfg.in
md5sum = 0e109afd93153ecf062ad5e76bc86ea4
md5sum = 0e74c862401f266111552b7a3611f7bf
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"mb_password_complexity": {
"title": "Password complexity",
......@@ -10,14 +11,14 @@
"enum": [
"weak",
"normal",
"strong",
"strong"
]
},
"mb_password_length": {
"title": "Password length",
"description": "Password length",
"type": "integer",
"default": 6,
"default": 6
}
}
}
{
"$schema": "https://json-schema.org/draft-04/schema#",
"type": "object",
"properties": {
"url": {
"title": "URL",
"description": "URL to access metabase.",
"type": "string",
"format": "uri"
}
}
}
......@@ -32,7 +32,7 @@ home = $${buildout:directory}
init =
default_parameters = options.get('slapparameter-dict')
options['mb_password_complexity'] = default_parameters.get('mb_password_complexity', 'normal')
options['mb_password_length'] = default_parameters.get('mb_password_length', 6)
options['mb_password_length'] = default_parameters.get('mb_password_length', '6')
[metabase-instance]
recipe = slapos.cookbook:wrapper
......@@ -127,7 +127,6 @@ alias = metabase
[postgresql-password]
recipe = slapos.cookbook:generate.password
bytes = 24
[postgresql]
recipe = slapos.cookbook:postgres
......
{
"name": "Metabase",
"description": "Business Intelligence and Reporting tool",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"software-type": "default",
"description": "Default",
"request": "instance-metabase-input-schema.json",
"response": "instance-metabase-output-schema.json",
"index": 1
}
}
}
[instance-profile]
filename = instance.cfg.in
md5sum = fa8d1d0a44720e0ffa4f6a953b65eae4
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"description": "Parameters to instantiate coupler",
"type": "object",
"configuration": {
"coupler_block_device": {
"description": "The Linux block device using I2C protocol,",
"type": "string",
"default": "/dev/i2c-1"
},
"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": {
"description": "The OPC UA server bind to bind to.",
"type": "integer",
"default": 4840
},
"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": {
"description": "The numeric ID of the coupler",
"type": "integer",
"default": 0
},
"username": {
"description": "The username for OPC UA server.",
"type": "string",
"default": ""
},
"password": {
"description": "The password for OPC UA server.",
"type": "string",
"default": ""
},
"heart_beat": {
"description": "Indication if coupler should send heart beats over a keep-alive network.",
"type": "boolean",
"default": 0
},
"heart_beat_interval": {
"description": "The heart beat interval (in ms)",
"type": "integer",
"default": 500
},
"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": {
"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": {
"description": "Network address URL type used for Pub/Sub.",
"type": "string",
"default": "opc.udp://224.0.0.22:4840/"
}
}
}
{
"$schema": "https://json-schema.org/draft/2019-09/schema",
"description": "Values returned by coupler's instantiation.",
"additionalProperties": false,
"properties": {},
"type": "object"
}
#############################
#
# Deploy coupler instance
#
#############################
[buildout]
parts =
directory
publish-connection-parameter
coupler-opc-ua
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
extends = {{ template_monitor }}
[coupler-opc-ua]
recipe = slapos.cookbook:wrapper
environment =
LD_LIBRARY_PATH=$LD_LIBRARY_PATH:{{ open62541_location }}/lib:{{ mbedtls_location }}/lib
command-line =
{{ coupler_location }}/server -d ${instance-parameter:configuration.coupler_block_device} -s ${instance-parameter:configuration.coupler_i2c_slave_list} -p ${instance-parameter:configuration.opc_ua_port} -u ${instance-parameter:configuration.username} -w ${instance-parameter:configuration.password} -b ${instance-parameter:configuration.heart_beat} -t ${instance-parameter:configuration.heart_beat_interval} -l ${instance-parameter:configuration.heart_beat_id_list} -n ${instance-parameter:configuration.network_address_url_data_type} -o ${instance-parameter:configuration.heart_beat_timeout_interval} -i ${instance-parameter:configuration.id} -m ${instance-parameter:configuration.mode}
wrapper-path = ${directory:service}/coupler-opc-ua
[instance-parameter]
recipe = slapos.cookbook:slapconfiguration
computer = ${slap-connection:computer-id}
partition = ${slap-connection:partition-id}
url = ${slap-connection:server-url}
key = ${slap-connection:key-file}
cert = ${slap-connection:cert-file}
configuration.coupler_block_device = /dev/i2c-1
configuration.coupler_i2c_slave_list = 0x58
configuration.mode = 0
configuration.username =
configuration.password =
configuration.interface = 0.0.0.0
configuration.opc_ua_port = 4840
configuration.id = 0
configuration.heart_beat = 0
configuration.heart_beat_interval = 500
configuration.heart_beat_id_list =
configuration.network_address_url_data_type = opc.udp://224.0.0.22:4840/
configuration.heart_beat_timeout_interval = 2000
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
script = ${:etc}/run/
service = ${:etc}/service
log = ${:var}/log
[publish-connection-parameter]
recipe = slapos.cookbook:publish
opc_ua_port = ${instance-parameter:configuration.opc_ua_port}
interface = ${instance-parameter:configuration.interface}
[buildout]
parts =
open62541
compile-coupler
slapos-cookbook
instance-profile
extends =
../../component/git/buildout.cfg
../../component/mbedtls/buildout.cfg
../../component/open62541/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
# we need open62541's sources even after compiling and linking in [open62541]
# section. Reasons is that coupler's C application depends on it.
[open62541-source]
recipe = slapos.recipe.build:download-unpacked
shared = true
url = ${open62541:url}
md5sum = ${open62541:md5sum}
[open62541]
configure-options =
-DBUILD_SHARED_LIBS=ON
-DCMAKE_BUILD_TYPE=Release
-DCMAKE_INSTALL_PREFIX=@@LOCATION@@
-DUA_ENABLE_PUBSUB=ON
-DUA_ENABLE_PUBSUB_MONITORING=ON
-DUA_ENABLE_PUBSUB_ETH_UADP=ON
-DUA_NAMESPACE_ZERO=REDUCED
-DUA_ENABLE_ENCRYPTION=MBEDTLS
-DUA_ENABLE_ENCRYPTION_MBEDTLS=ON
-DMBEDTLS_INCLUDE_DIRS=${mbedtls:location}/include
-DMBEDTLS_LIBRARY=${mbedtls:location}/lib/libmbedtls.so
-DMBEDX509_LIBRARY=${mbedtls:location}/lib/libmbedx509.so
-DMBEDCRYPTO_LIBRARY=${mbedtls:location}/lib/libmbedcrypto.so
-DUA_ENABLE_PUBSUB_INFORMATIONMODEL=ON
-DUA_ENABLE_PUBSUB_MQTT=ON
environment +=
LDFLAGS=-L${mbedtls:location}/lib -Wl,-rpath=${mbedtls:location}/lib
[osie-repository]
recipe = slapos.recipe.build:gitclone
git-executable = ${git:location}/bin/git
repository = https://lab.nexedi.com/nexedi/osie.git
revision = 35228392c4f2eb24eee478cd98349e0f613a4ff2
[compile-coupler]
recipe = slapos.recipe.cmmi
path = ${osie-repository:location}/coupler/opc-ua-server/
bin_dir = ${:path}/bin/
environment =
OPEN62541_HOME = ${open62541:location}
OPEN62541_SOURCE_HOME = ${open62541-source:location}
C_COMPILER_EXTRA_FLAGS = -L ${mbedtls:location}/lib -Wl,-rpath=${mbedtls:location}/lib -l:libopen62541.so -L${open62541:location}/lib -Wl,-rpath=${open62541:location}/lib -I${open62541:location}/include -I${open62541-source:location}/src/pubsub/ -I${open62541-source:location}/deps
configure-command = true
[instance-profile]
recipe = slapos.recipe.template:jinja2
template = ${:_profile_base_location_}/instance.cfg.in
mode = 0644
rendered = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
raw template_monitor ${monitor2-template:output}
key open62541_location open62541:location
key mbedtls_location mbedtls:location
key coupler_location compile-coupler:bin_dir
{
"name": "OSIE coupler",
"description": "Coupler is an open source thin C client application supporting OPC UA protocol and used in conjunction with beremiz-ide / beremiz-runtime to control industrial processes on the shop field.",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
"software-type": "default",
"description": "Default",
"request": "instance-input-schema.json",
"response": "instance-output-schema.json"
}
}
}
Tests for osie-coupler software release
##############################################################################
#
# Copyright (c) 2018 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
from setuptools import setup, find_packages
version = '0.0.1.dev0'
name = 'slapos.test.osie-coupler'
with open("README.md") as f:
long_description = f.read()
setup(
name=name,
version=version,
description="Test for SlapOS' Osie Coupler",
long_description=long_description,
long_description_content_type='text/markdown',
maintainer="Nexedi",
maintainer_email="info@nexedi.com",
url="https://lab.nexedi.com/nexedi/slapos",
packages=find_packages(),
install_requires=[
'slapos.core',
'slapos.libnetworkcache',
'erp5.util',
],
zip_safe=True,
test_suite='test',
)
##############################################################################
# coding: utf-8
#
# Copyright (c) 2022 Nexedi SA and Contributors. All Rights Reserved.
#
# WARNING: This program as such is intended to be used by professional
# programmers who take the whole responsibility of assessing all potential
# consequences resulting from its eventual inadequacies and bugs
# End users who are looking for a ready-to-use solution with commercial
# guarantees and support are strongly adviced to contract a Free Software
# Service Company
#
# This program is Free Software; you can redistribute it and/or
# modify it under the terms of the GNU General Public License
# as published by the Free Software Foundation; either version 3
# of the License, or (at your option) any later version.
#
# This program is distributed in the hope that it will be useful,
# but WITHOUT ANY WARRANTY; without even the implied warranty of
# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
# GNU General Public License for more details.
#
# You should have received a copy of the GNU General Public License
# along with this program; if not, write to the Free Software
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
#
##############################################################################
import os
from slapos.testing.testcase import makeModuleSetUpAndTestCaseClass
setUpModule, SlapOSInstanceTestCase = makeModuleSetUpAndTestCaseClass(
os.path.abspath(
os.path.join(os.path.dirname(__file__), '..', 'software.cfg')))
class OsieTestCase(SlapOSInstanceTestCase):
@classmethod
def getInstanceParameterDict(cls):
return {"mode": 1}
def test(self):
connexion_parameters = self.computer_partition.getConnectionParameterDict()
self.assertIn('opc_ua_port', connexion_parameters)
self.assertIn('interface', connexion_parameters)
......@@ -10,7 +10,7 @@
"default": "",
"type": "string"
},
"fronted-url": {
"frontend-url": {
"title": "Frontend URL",
"description": "Frontend URL",
"default": "",
......
......@@ -257,6 +257,11 @@ setup = ${slapos-repository:location}/software/peertube/test/
egg = slapos.test.js_drone
setup = ${slapos-repository:location}/software/js-drone/test/
[slapos.test.osie-coupler-setup]
<= setup-develop-egg
egg = slapos.test.osie_coupler
setup = ${slapos-repository:location}/software/osie-coupler/test/
[slapos.core-repository]
<= git-clone-repository
repository = https://lab.nexedi.com/nexedi/slapos.core.git
......@@ -333,6 +338,7 @@ eggs +=
${slapos.test.nextcloud-setup:egg}
${slapos.test.nginx-push-stream-setup:egg}
${slapos.test.ors-amarisoft-setup:egg}
${slapos.test.osie-coupler-setup:egg}
${slapos.test.peertube-setup:egg}
${slapos.test.plantuml-setup:egg}
${slapos.test.powerdns-setup:egg}
......@@ -425,6 +431,7 @@ tests =
nextcloud ${slapos.test.nextcloud-setup:setup}
nginx-push-stream ${slapos.test.nginx-push-stream-setup:setup}
ors-amarisoft ${slapos.test.ors-amarisoft-setup:setup}
osie-coupler ${slapos.test.osie-coupler-setup:setup}
peertube ${slapos.test.peertube-setup:setup}
plantuml ${slapos.test.plantuml-setup:setup}
powerdns ${slapos.test.powerdns-setup:setup}
......
{
"$schema": "http://json-schema.org/draft-04/schema#",
"type": "object",
"additionalProperties": false,
"properties": {
"user-authorized-key": {
"title": "User Authorized Key",
......
......@@ -2,9 +2,14 @@
"$schema": "http://json-schema.org/draft-04/schema#",
"description": "Values returned by instanciation",
"properties": {
"ssh_command": {
"description": "SSH command used to access your instance in ssh when you provided a ssh public key",
"ssh-command": {
"description": "SSH command used to access the instance",
"type": "string"
},
"ssh-url": {
"description": "ssh:// URL to access the instance",
"type": "string",
"format": "uri"
}
},
"type": "object"
......
{
"name": "SSH",
"description": "SSH software release which provide the SSH service",
"serialisation": "json-in-xml",
"serialisation": "xml",
"software-type": {
"default": {
"title": "Default",
......
......@@ -15,7 +15,7 @@
[instance-theia]
_update_hash_filename_ = instance-theia.cfg.jinja.in
md5sum = 4b69822605e3f20fcec8f44a0bdf80bb
md5sum = 3648844f372a96974582e7281c9987dd
[instance]
_update_hash_filename_ = instance.cfg.in
......
......@@ -11,6 +11,7 @@ theia-environment-parts =
slapos-repository
runner-link
settings.json
python-enable-user-pip
theia-parts =
frontend-instance
......@@ -261,14 +262,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
......@@ -408,7 +408,7 @@ output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!/bin/sh
export HOME=$${directory:home}
export PATH=${cli-utilities:PATH}:$HOME/.cargo/bin:$PATH
export PATH=${cli-utilities:PATH}:$HOME/.cargo/bin:$HOME/.local/bin:$PATH
export IPV6_SLAPRUNNER={{ ipv6_random }}
# Theia Backend
......@@ -462,8 +462,9 @@ inline =
{% raw -%}
#!{{ bash }}
SHELL=$BASH
# when running interactively, activate slapos configuration and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
if [ $# = 0 ]; then
# when running interactively, or as a login shell, activate slapos configuration
# and reset GIT_EXEC_PATH to workaround https://github.com/eclipse-theia/theia/issues/7555
if [ $# = 0 ] || [ $# = 1 -a "$1" = -l ]; then
. {{ activate }}
unset GIT_EXEC_PATH
set -- --rcfile {{ bashrc }}
......@@ -481,6 +482,9 @@ output = $${directory:etc}/$${:_buildout_section_name_}
inline =
# enable bash completion
. ${bash-completion:location}/etc/profile.d/bash_completion.sh
# enable color for ls
eval "$(${coreutils:location}/bin/dircolors -b)"
alias ls='ls --color=auto'
# source user's .bashrc
[ -f ~/.bashrc ] && . ~/.bashrc
depends =
......@@ -493,6 +497,12 @@ command =
${buildout:bin-directory}/slapos complete > $${directory:bash-completions}/slapos
${buildout:bin-directory}/slapos complete --shell fish > $${directory:fish-completions}/slapos.fish
[python-enable-user-pip]
# enable pip user installation for python extension
recipe = plone.recipe.command
stop-on-error = true
command =
${python:executable} -m ensurepip --user
# Embedded Instance
# -----------------
......@@ -591,8 +601,6 @@ output = $${directory:bin}/$${:_buildout_section_name_}
inline =
#!/bin/sh
. $${common-environment:output}
#XXX find out where the extra nodejs in theia's PATH comes from
export PATH=${nodejs:location}/bin/:$PATH
. $${slapos-standalone-activate:output}
exec $${slapos-standalone-script:output}
......@@ -710,7 +718,7 @@ inline =
},
"git.terminalAuthentication": false,
"security.workspace.trust.startupPrompt": "once",
"zc-buildout.python.executable": "${python-for-buildout-languageserver:executable}"
"zc-buildout.python.executable": "$${buildout:directory}/software_release/bin/${python-for-buildout-languageserver:interpreter}"
}
[runner-link]
......
......@@ -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'))
......
......@@ -136,8 +136,8 @@ zc.buildout = 2.7.1+slapos019
# Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2)
zc.recipe.egg = 2.0.3+slapos003
aiohttp = 3.8.1:whl
aiosignal = 1.2.0
aiohttp = 3.8.3:whl
aiosignal = 1.3.1:whl
apache-libcloud = 2.4.0
argon2-cffi = 20.1.0
asn1crypto = 1.3.0
......@@ -146,7 +146,7 @@ async-generator = 1.10
async-timeout = 4.0.2
atomicwrites = 1.4.0
atomize = 0.2.0
attrs = 22.1.0
attrs = 22.2.0
backcall = 0.2.0
backports-abc = 0.5
backports.functools-lru-cache = 1.6.1:whl
......@@ -156,6 +156,7 @@ bcrypt = 3.1.4
bleach = 5.0.1
CacheControl = 0.12.6:whl
cachetools = 5.2.0
cattrs = 22.2.0
certifi = 2022.12.7
cffi = 1.15.0
chardet = 3.0.4
......@@ -182,7 +183,7 @@ et-xmlfile = 1.0.1
exceptiongroup = 1.0.0:whl
feedparser = 6.0.10
Flask = 1.1.2
frozenlist = 1.3.0
frozenlist = 1.3.3:whl
funcsigs = 1.0.2
functools32 = 3.2.3.post2
gevent = 20.9.0
......@@ -192,10 +193,11 @@ GitPython = 3.1.30
greenlet = 0.4.17
h11 = 0.14.0
h5py = 2.7.1
idna = 3.3
idna = 3.4:whl
igmp = 1.0.4
Importing = 1.10
importlib-metadata = 1.7.0:whl
importlib-resources = 5.10.2:whl
inotify-simple = 1.1.1
ipaddress = 1.0.23
ipykernel = 5.3.4:whl
......@@ -216,6 +218,7 @@ jupyterlab-launcher = 0.3.1
jupyterlab-pygments = 0.1.2
lock-file = 2.0
lockfile = 0.12.2:whl
lsprotocol = 2022.0.0a9:whl
lxml = 4.9.1
MarkupSafe = 2.0.1
matplotlib = 2.1.2
......@@ -225,7 +228,7 @@ mock = 3.0.5
more-itertools = 5.0.0
mpmath = 1.0.0
msgpack = 0.6.2
multidict = 6.0.2
multidict = 6.0.4
nbclient = 0.5.1
nbconvert = 6.0.7
nbformat = 5.0.8
......@@ -235,7 +238,7 @@ netifaces = 0.10.7
notebook = 6.1.5
openpyxl = 2.5.2
outcome = 1.2.0
packaging = 21.3
packaging = 22.0:whl
pandocfilters = 1.4.3
paramiko = 2.11.0
parso = 0.7.1
......@@ -247,6 +250,7 @@ pexpect = 4.8.0
pickleshare = 0.7.4
pim-dm = 1.4.0nxd001
pkgconfig = 1.5.1
pkgutil-resolve-name = 1.3.10
plone.recipe.command = 1.1
pluggy = 0.13.1:whl
ply = 3.11
......@@ -261,7 +265,7 @@ pyasn1 = 0.4.5
pycparser = 2.20
pycurl = 7.43.0
pydantic = 1.9.1
pygls = 0.12:whl
pygls = 1.0.0:whl
Pygments = 2.9.0
PyNaCl = 1.3.0
pyOpenSSL = 19.1.0
......@@ -327,12 +331,12 @@ widgetsnbextension = 2.0.0
wsproto = 1.2.0
xlrd = 1.1.0
xml-marshaller = 1.0.2
yarl = 1.7.2
zc.buildout.languageserver = 0.8.3
yarl = 1.8.2
zc.buildout.languageserver = 0.9.0
zc.lockfile = 1.4
ZConfig = 3.6.1
zdaemon = 4.2.0
zipp = 1.2.0:whl
zipp = 3.12.0:whl
zodburi = 2.5.0
zope.event = 3.5.2
zope.interface = 5.4.0
......@@ -359,6 +363,7 @@ smmap2 = 2.0.5
traitlets = 4.3.3
Werkzeug = 1.0.1
wheel = 0.35.1:whl
zipp = 1.2.0:whl
[versions:sys.version_info < (3,8)]
MarkupSafe = 1.0
......
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