Commit edb35dcd authored by Lu Xu's avatar Lu Xu 👀

software/hugo: Add Hugo software in slapos

parent 00607ab7
# 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 = 7d2365e488bdfaecb31970ab0261bc81
[buildout]
parts =
publish-connection-parameter
stat-password
eggs-directory = ${buildout:eggs-directory}
develop-eggs-directory = ${buildout:develop-eggs-directory}
offline = true
[publish-connection-parameter]
recipe = slapos.cookbook:publish
url = https://[$${hugo-wrapper:ip}]:$${hugo-wrapper:port}
env = ${gowork:env.sh}
#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-paris-rapidspace.api.nexedi.net:443"]}]
[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
[hugo-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
[stat-password]
recipe = slapos.recipe.template:jinja2
template = inline:
$${admin-password:username}:$${admin-password:passwd}
rendered = $${directory:data}/passwd
[ice-servers.json]
recipe = slapos.recipe.template:jinja2
template = inline:
$${slap-configuration:configuration.ice-servers.json}
rendered = $${directory:data}/ice-servers.json
[groups-json]
recipe = slapos.recipe.template:jinja2
template = inline:{
"public":true,
"op": [{"username":"$${admin-password:username}","password":"$${admin-password:passwd}"}],
"other": [],
"presenter": [{"username": "", "password": "nexedi"}]
}
rendered = $${directory:groups}/public.json
[hugo-wrapper]
recipe = slapos.recipe.template:jinja2
port = 1313
ip = $${slap-configuration:ipv6-random}
template =
inline:#!/bin/sh
ulimit -n $(ulimit -Hn)
exec ${gowork:bin}/hugo \
-static ${hugo-get:location}/static \
-recordings $${directory:recordings} \
-groups $${directory:groups} \
-data $${directory:data} \
-http [$${:ip}]:$${:port} \
-turn ""
rendered = $${directory:services}/hugo
depends =
$${ice-servers.json:recipe}
$${groups-json:recipe}
$${hugo-ssl:recipe}
[buildout]
extends =
../../component/golang/buildout.cfg
../../component/openssl/buildout.cfg
../../stack/slapos.cfg
buildout.hash.cfg
parts =
slapos-cookbook
gowork
instance-cfg
[hugo-get]
<= go-git-package
go.importpath = github.com/gohugoio/hugo
repository = https://github.com/gohugoio/hugo.git
# revision = nxd-v1.0.3-1-g2c11cedc
[gowork]
install =
${hugo-get:location}:./...
[gowork.goinstall]
depends_gitfetch =
${hugo-get:recipe}
command = set -e
. ${gowork:env.sh}
cd ${hugo-get:location}
export GO111MODULE=on
export FULLVERSION=$(git describe --tags)
go build ${gowork:buildflags} -o ${gowork:bin}/hugo
chmod -R u+w .
[instance-cfg]
recipe = slapos.recipe.template
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
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