diff --git a/software/galene/buildout.hash.cfg b/software/galene/buildout.hash.cfg new file mode 100644 index 0000000000000000000000000000000000000000..33483ca5e2d7875d679f07a6a42ac81ab6d45432 --- /dev/null +++ b/software/galene/buildout.hash.cfg @@ -0,0 +1,18 @@ +# THIS IS NOT A BUILDOUT FILE, despite purposedly using a compatible syntax. +# The only allowed lines here are (regexes): +# - "^#" comments, copied verbatim +# - "^[" section beginings, copied verbatim +# - lines containing an "=" sign which must fit in the following categorie. +# - "^\s*filename\s*=\s*path\s*$" where "path" is relative to this file +# Copied verbatim. +# - "^\s*hashtype\s*=.*" where "hashtype" is one of the values supported +# by the re-generation script. +# Re-generated. +# - other lines are copied verbatim +# Substitution (${...:...}), extension ([buildout] extends = ...) and +# section inheritance (< = ...) are NOT supported (but you should really +# not need these here). + +[instance-cfg] +filename = instance.cfg.in +md5sum = 270b39f448ec553fa9e203c5fbb49856 diff --git a/software/galene/instance.cfg.in b/software/galene/instance.cfg.in new file mode 100644 index 0000000000000000000000000000000000000000..0c65c6a078312484f0222ea7e088b9707eb0a0bf --- /dev/null +++ b/software/galene/instance.cfg.in @@ -0,0 +1,85 @@ +[buildout] +parts = + publish-connection-parameter + +eggs-directory = ${buildout:eggs-directory} +develop-eggs-directory = ${buildout:develop-eggs-directory} +offline = true + + +[publish-connection-parameter] +recipe = slapos.cookbook:publish +url = https://[$${galene-wrapper:ip}]:$${galene-wrapper:port} +admin-user = $${admin-password:username} +admin-password = $${admin-password:passwd} + +[slap-configuration] +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.ice-servers.json = [{"urls":["stun:turn.api.nexedi.net:3478"]}] + +[directory] +recipe = slapos.cookbook:mkdirectory +etc = $${buildout:directory}/etc +var = $${buildout:directory}/var +srv = $${buildout:directory}/srv +bin = $${buildout:directory}/bin +tmp = $${buildout:directory}/tmp +run = $${:var}/run + +services = $${:etc}/service +data = $${:srv}/data +groups = $${:srv}/groups +recordings = $${:srv}/recordings + +[galene-ssl] +recipe = plone.recipe.command +cert-file = $${directory:data}/cert.pem +key-file = $${directory:data}/key.pem +command = ${openssl:location}/bin/openssl req -newkey rsa:2048 -batch -new -x509 -days 3650 -nodes -keyout "$${:key-file}" -out "$${:cert-file}" +update-command = +stop-on-error = true + +[admin-password] +recipe = slapos.cookbook:generate.password +storage-path = $${directory:data}/.passwd +username = admin + +[ice-servers.json] +recipe = collective.recipe.template +input = inline: + $${slap-configuration:configuration.ice-servers.json} +output = $${directory:data}/ice-servers.json + +[groups-json] +recipe = collective.recipe.template +input = inline:{ + "public":true, + "op": [{"username":"$${admin-password:username}","password":"$${admin-password:passwd}"}], + "other": [], + "presenter": [{"username": "", "password": "nexedi"}], + "max-users":100 + } +output = $${directory:groups}/public.json + +[galene-wrapper] +recipe = slapos.cookbook:wrapper +port = 8443 +ip = $${slap-configuration:ipv6-random} +command-line = + ${galene:location}/bin/galene + -static ${galene-repository:location}/static + -recordings $${directory:recordings} + -groups $${directory:groups} + -data $${directory:data} + -http [$${:ip}]:$${:port} +wrapper-path = $${directory:services}/galene +depends = + $${ice-servers.json:recipe} + $${groups-json:recipe} + $${galene-ssl:recipe} + diff --git a/software/galene/software.cfg b/software/galene/software.cfg new file mode 100644 index 0000000000000000000000000000000000000000..13f908b16f43f5a5be2716eff86237dcc0ae2b2b --- /dev/null +++ b/software/galene/software.cfg @@ -0,0 +1,48 @@ +[buildout] +extends = + ../../component/golang/buildout.cfg + ../../component/openssl/buildout.cfg + ../../stack/slapos.cfg + buildout.hash.cfg + +parts = + slapos-cookbook + galene + eggs + instance-cfg + +# eggs for instance.cfg +[eggs] +recipe = zc.recipe.egg +eggs = + plone.recipe.command + collective.recipe.template + + +[galene-repository] +<= git-repository +repository = https://lab.nexedi.com/nexedi/galene.git +revision = galene-0.1 +location = ${buildout:parts-directory}/galene-repository + +[galene] +recipe = slapos.recipe.cmmi +path = ${galene-repository:location} +location = @@LOCATION@@ +golang = ${golang1.13:location} +configure-command = true +make-binary = +make-targets = + go install -ldflags='-s -w' +environment = + PATH=${:location}/bin:${:golang}/bin:${git:location}/bin:${pkgconfig:location}/bin:$PATH + GOPATH=${:location} + CGO_ENABLED=0 + +[instance-cfg] +recipe = slapos.recipe.template +url = ${:_profile_base_location_}/${:filename} +output = ${buildout:directory}/instance.cfg + +[versions] +slapos.recipe.template = 4.4 diff --git a/stack/slapos.cfg b/stack/slapos.cfg index b9d51d11d59429207dadf5a21f802d6b8a228f4c..d003125f2ccf17a186bc3b551230be88489f744d 100644 --- a/stack/slapos.cfg +++ b/stack/slapos.cfg @@ -136,7 +136,7 @@ eggs = [versions] setuptools = 44.0.0 # Use SlapOS patched zc.buildout -zc.buildout = 2.7.1+slapos009 +zc.buildout = 2.7.1+slapos010 # Use SlapOS patched zc.recipe.egg (zc.recipe.egg 2.x is for Buildout 2) zc.recipe.egg = 2.0.3+slapos003 # Use own version of h.r.download to be able to open .xz and .lz archives