Commit 3a00b5cf authored by Jérome Perrin's avatar Jérome Perrin

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

parents 2e8c5db3 05e4fbd2
...@@ -9,22 +9,18 @@ parts = ...@@ -9,22 +9,18 @@ parts =
[tomcat] [tomcat]
<= tomcat9 <= tomcat9
[tomcat7] [tomcat-base]
recipe = slapos.recipe.build:download-unpacked recipe = slapos.recipe.build:download-unpacked
shared = true shared = true
strip-top-level-dir = true strip-top-level-dir = true
url = https://archive.apache.org/dist/tomcat/tomcat-7/v${:version}/bin/apache-tomcat-${:version}.tar.gz url = https://archive.apache.org/dist/tomcat/tomcat-${:version-major}/v${:version}/bin/apache-tomcat-${:version}.tar.gz
[tomcat7]
<= tomcat-base
version-major = 7
version = 7.0.100 version = 7.0.100
md5sum = 79be4ba5a6e770730a4be3d5cb3c7862 md5sum = 79be4ba5a6e770730a4be3d5cb3c7862
[tomcat9]
recipe = slapos.recipe.build:download-unpacked
shared = true
strip-top-level-dir = true
url = https://archive.apache.org/dist/tomcat/tomcat-9/v${:version}/bin/apache-tomcat-${:version}.tar.gz
version = 9.0.12
md5sum = 7283da4a3a6e939adcd8f919be4ba41a
[tomcat7-output] [tomcat7-output]
# Shared binary location to ease migration # Shared binary location to ease migration
recipe = plone.recipe.command recipe = plone.recipe.command
...@@ -32,3 +28,15 @@ stop-on-error = true ...@@ -32,3 +28,15 @@ stop-on-error = true
update-command = ${:command} update-command = ${:command}
command = ${coreutils-output:test} -x ${:catalina} command = ${coreutils-output:test} -x ${:catalina}
catalina = ${tomcat7:location}/bin/catalina.sh catalina = ${tomcat7:location}/bin/catalina.sh
[tomcat9]
<= tomcat-base
version-major = 9
version = 9.0.12
md5sum = 7283da4a3a6e939adcd8f919be4ba41a
[tomcat10]
<= tomcat-base
version-major = 10
version = 10.0.23
md5sum = 820ca70d01adf99d602615fb8d648162
...@@ -7,8 +7,6 @@ parts += ...@@ -7,8 +7,6 @@ parts +=
instance instance
caucase-eggs caucase-eggs
[python]
part = python2.7
[instance-caucased] [instance-caucased]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
......
...@@ -24,7 +24,7 @@ ...@@ -24,7 +24,7 @@
# Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA. # Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
# #
############################################################################## ##############################################################################
from __future__ import unicode_literals
import json import json
import os import os
......
...@@ -15,9 +15,6 @@ parts = ...@@ -15,9 +15,6 @@ parts =
slapos-cookbook slapos-cookbook
template template
[python]
part = python2.7
########################################################## ##########################################################
# Service startup scripts and configuration files # Service startup scripts and configuration files
########################################################## ##########################################################
......
...@@ -16,9 +16,6 @@ parts = ...@@ -16,9 +16,6 @@ parts =
jscrawler-build jscrawler-build
instance instance
[python]
part = python2.7
[nodejs] [nodejs]
<= nodejs-12.18.3 <= nodejs-12.18.3
......
...@@ -26,8 +26,7 @@ ...@@ -26,8 +26,7 @@
############################################################################## ##############################################################################
import os import os
import logging from urllib.parse import urlparse
from six.moves.urllib.parse import urlparse
import requests import requests
import time import time
...@@ -51,7 +50,7 @@ class TestJSCrawler(SlapOSInstanceTestCase): ...@@ -51,7 +50,7 @@ class TestJSCrawler(SlapOSInstanceTestCase):
self.send_response(200) self.send_response(200)
self.send_header("Content-Type", "application/html") self.send_header("Content-Type", "application/html")
self.end_headers() self.end_headers()
self.wfile.write('<title>Hello {}</title>'.format(self._name)) self.wfile.write(f'<title>Hello {self._name}</title>'.encode())
return { return {
'urls': '\n'.join([ 'urls': '\n'.join([
......
...@@ -15,8 +15,8 @@ ...@@ -15,8 +15,8 @@
[instance] [instance]
filename = instance.cfg.in filename = instance.cfg.in
md5sum = 51597d8161458028ea8b46962d378a70 md5sum = d769f82481c689ec2c66fc1de0f0541a
[tomcat-server-xml] [tomcat-server-xml]
filename = server.xml.in filename = server.xml.in
md5sum = fdfa7eb249082855039ca98f310324e9 md5sum = 367f91cf7d3a053a94edc9e675a12e25
...@@ -37,29 +37,30 @@ scheme = https ...@@ -37,29 +37,30 @@ scheme = https
[tomcat-web-xml] [tomcat-web-xml]
recipe = plone.recipe.command recipe = plone.recipe.command
command = [ -f $${:location} ] || cp ${tomcat9:location}/conf/web.xml $${:location} command = [ -f $${:location} ] || cp ${tomcat:location}/conf/web.xml $${:location}
location = $${directory:catalina_conf}/web.xml location = $${directory:catalina_conf}/web.xml
[tomcat-keystore] [tomcat-keystore]
recipe = plone.recipe.command recipe = plone.recipe.command
command = command =
${java-re-8-output:keytool} \ ${java:location}/bin/keytool \
-genkeypair \ -genkeypair \
-alias "tomcat" \ -alias "tomcat" \
-keyalg RSA \ -keyalg RSA \
-keypass "$${:pass}" \ -keypass "$${:pass}" \
-dname "CN=Web Server,OU=Unit,O=Organization,L=City,S=State,C=Country" \ -dname "CN=$${:common-name},OU=Unit,O=Organization,L=City,S=State,C=Country" \
-keystore "$${:file}" \ -keystore "$${:file}" \
-storepass "$${:pass}" -storepass "$${:pass}"
file = $${directory:catalina_base}/.keystore file = $${directory:catalina_base}/.keystore
pass = insecure pass = insecure
common-name = $${tomcat-server-xml:ip}
[tomcat-instance] [tomcat-instance]
recipe = slapos.cookbook:wrapper recipe = slapos.cookbook:wrapper
wrapper-path = $${directory:services}/$${:_buildout_section_name_} wrapper-path = $${directory:services}/$${:_buildout_section_name_}
command-line = ${tomcat9:location}/bin/catalina.sh run command-line = ${tomcat:location}/bin/catalina.sh run
environment = environment =
JRE_HOME=${java-re-8:location} JRE_HOME=${java:location}
CATALINA_BASE=$${directory:catalina_base} CATALINA_BASE=$${directory:catalina_base}
GRAPHVIZ_DOT=${graphviz:location}/bin/dot GRAPHVIZ_DOT=${graphviz:location}/bin/dot
FONTCONFIG_FILE=$${fontconfig-conf:output} FONTCONFIG_FILE=$${fontconfig-conf:output}
......
<?xml version='1.0' encoding='utf-8'?> <?xml version='1.0' encoding='utf-8'?>
<Server port="-1" shutdown="SHUTDOWN"> <Server port="-1" shutdown="SHUTDOWN">
<Listener className="org.apache.catalina.startup.VersionLoggerListener" />
<Listener className="org.apache.catalina.core.AprLifecycleListener" SSLEngine="on" />
<Listener className="org.apache.catalina.core.JreMemoryLeakPreventionListener" />
<Listener className="org.apache.catalina.mbeans.GlobalResourcesLifecycleListener" />
<Listener className="org.apache.catalina.core.ThreadLocalLeakPreventionListener" />
<Service name="Catalina"> <Service name="Catalina">
<Connector <Connector
protocol="org.apache.coyote.http11.Http11Nio2Protocol" protocol="org.apache.coyote.http11.Http11Nio2Protocol"
...@@ -11,10 +17,16 @@ ...@@ -11,10 +17,16 @@
secure="true" secure="true"
clientAuth="false" clientAuth="false"
SSLEnabled="true" SSLEnabled="true"
keystorePass="$${tomcat-keystore:pass}" >
keystoreFile="$${tomcat-keystore:file}" <UpgradeProtocol className="org.apache.coyote.http2.Http2Protocol" />
/> <SSLHostConfig>
<Certificate
certificateKeystoreFile="$${tomcat-keystore:file}"
certificateKeystorePassword="$${tomcat-keystore:pass}"
type="RSA"
/>
</SSLHostConfig>
</Connector>
<Engine name="Catalina" defaultHost="localhost"> <Engine name="Catalina" defaultHost="localhost">
<Valve className="org.apache.catalina.valves.AccessLogValve" <Valve className="org.apache.catalina.valves.AccessLogValve"
directory="logs" prefix="localhost_access_log." suffix=".log" directory="logs" prefix="localhost_access_log." suffix=".log"
...@@ -27,4 +39,4 @@ ...@@ -27,4 +39,4 @@
</Host> </Host>
</Engine> </Engine>
</Service> </Service>
</Server> </Server>
\ No newline at end of file
...@@ -15,6 +15,12 @@ parts = ...@@ -15,6 +15,12 @@ parts =
slapos-cookbook slapos-cookbook
instance instance
[tomcat]
<= tomcat10
[java]
<= java-re-temurin-11
[instance] [instance]
recipe = slapos.recipe.template recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename} url = ${:_profile_base_location_}/${:filename}
...@@ -27,5 +33,5 @@ output = ${buildout:directory}/${:_buildout_section_name_} ...@@ -27,5 +33,5 @@ output = ${buildout:directory}/${:_buildout_section_name_}
[plantuml.war] [plantuml.war]
recipe = slapos.recipe.build:download recipe = slapos.recipe.build:download
url = https://sourceforge.net/projects/plantuml/files/1.2020.15/plantuml.1.2020.15.war url = https://github.com/plantuml/plantuml-server/releases/download/v1.2022.7/plantuml-jsp-v1.2022.7.war
md5sum = ed203cb3b90df8f77492fa36ea6490a5 md5sum = d0889f990f4db01efebb9b9fe98ebf7b
...@@ -64,10 +64,23 @@ class TestSimpleDiagram(PlantUMLTestCase, ImageComparisonTestCase): ...@@ -64,10 +64,23 @@ class TestSimpleDiagram(PlantUMLTestCase, ImageComparisonTestCase):
# http://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vuBmWC8WMIi5ztm5n_B4IYw7rBmKe1u0 # http://www.plantuml.com/plantuml/png/SoWkIImgAStDuNBAJrBGjLDmpCbCJbMmKiX8pSd9vuBmWC8WMIi5ztm5n_B4IYw7rBmKe1u0
# because plantuml include information about the server in the output image metadata ( you can # because plantuml include information about the server in the output image metadata ( you can
# use http://exif.regex.info/exif.cgi to see metadata ) # use http://exif.regex.info/exif.cgi to see metadata )
# So we process the image to remove metadata. # We just compare that image are similar.
reference = Image.open(os.path.join(os.path.dirname(__file__), "data", "test_sequence_diagram.png")) reference = Image.open(os.path.join(os.path.dirname(__file__), "data", "test_sequence_diagram.png"))
self.assertImagesSame(Image.open(BytesIO(png)), reference) self.assertImagesSame(Image.open(BytesIO(png)), reference)
def test_sequence_diagram_skin_rose(self):
# default theme changed, but we can use `skin rose` to keep old theme
# https://github.com/plantuml/plantuml/issues/996
png = self.plantuml.processes(textwrap.dedent("""\
@startuml
skin rose
Bob -> Alice : hello
Alice -> Bob : Go Away
@enduml
"""))
reference = Image.open(os.path.join(os.path.dirname(__file__), "data", "test_sequence_diagram_skin_rose.png"))
self.assertImagesSame(Image.open(BytesIO(png)), reference)
def test_class_diagram(self): def test_class_diagram(self):
"""Class diagram require a working graphviz installation""" """Class diagram require a working graphviz installation"""
png = self.plantuml.processes(textwrap.dedent("""\ png = self.plantuml.processes(textwrap.dedent("""\
......
...@@ -14,6 +14,7 @@ extra-eggs += ...@@ -14,6 +14,7 @@ extra-eggs +=
extra = extra =
# The following list is for SR whose buildout runs only with Python 3. # The following list is for SR whose buildout runs only with Python 3.
caddy-frontend ${slapos.test.caddy-frontend-setup:setup} caddy-frontend ${slapos.test.caddy-frontend-setup:setup}
caucase ${slapos.test.caucase-setup:setup}
erp5testnode ${slapos.test.erp5testnode-setup:setup} erp5testnode ${slapos.test.erp5testnode-setup:setup}
galene ${slapos.test.galene-setup:setup} galene ${slapos.test.galene-setup:setup}
grafana ${slapos.test.grafana-setup:setup} grafana ${slapos.test.grafana-setup:setup}
...@@ -21,7 +22,9 @@ extra = ...@@ -21,7 +22,9 @@ extra =
helloworld ${slapos.test.helloworld-setup:setup} helloworld ${slapos.test.helloworld-setup:setup}
html5as ${slapos.test.html5as-setup:setup} html5as ${slapos.test.html5as-setup:setup}
html5as-base ${slapos.test.html5as-base-setup:setup} html5as-base ${slapos.test.html5as-base-setup:setup}
htmlvalidatorserver ${slapos.test.htmlvalidatorserver-setup:setup}
hugo ${slapos.test.hugo-setup:setup} hugo ${slapos.test.hugo-setup:setup}
jscrawler ${slapos.test.jscrawler-setup:setup}
jstestnode ${slapos.test.jstestnode-setup:setup} jstestnode ${slapos.test.jstestnode-setup:setup}
jupyter ${slapos.test.jupyter-setup:setup} jupyter ${slapos.test.jupyter-setup:setup}
kvm ${slapos.test.kvm-setup:setup} kvm ${slapos.test.kvm-setup:setup}
......
...@@ -367,12 +367,9 @@ extra = ...@@ -367,12 +367,9 @@ extra =
# You should not add more lines here. # You should not add more lines here.
backupserver ${slapos.test.backupserver-setup:setup} backupserver ${slapos.test.backupserver-setup:setup}
beremiz-ide ${slapos.test.beremiz-ide-setup:setup} beremiz-ide ${slapos.test.beremiz-ide-setup:setup}
caucase ${slapos.test.caucase-setup:setup}
cloudooo ${slapos.test.cloudooo-setup:setup} cloudooo ${slapos.test.cloudooo-setup:setup}
dream ${slapos.test.dream-setup:setup} dream ${slapos.test.dream-setup:setup}
gitlab ${slapos.test.gitlab-setup:setup} gitlab ${slapos.test.gitlab-setup:setup}
htmlvalidatorserver ${slapos.test.htmlvalidatorserver-setup:setup}
jscrawler ${slapos.test.jscrawler-setup:setup}
re6stnet ${slapos.test.re6stnet-setup:setup} re6stnet ${slapos.test.re6stnet-setup:setup}
slapos-master ${slapos.test.slapos-master-setup:setup} slapos-master ${slapos.test.slapos-master-setup:setup}
slaprunner ${slapos.test.slaprunner-setup:setup} slaprunner ${slapos.test.slaprunner-setup:setup}
......
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