Commit 2d95f3ec authored by Tom Niget's avatar Tom Niget

software/mattermost: add initial support

parent 42083eea
# 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).
[template]
filename = instance.cfg.in
md5sum =
[mattermost-config-file]
filename = mattermost-config-file.json.in
md5sum =
[instance-profile]
filename = instance.cfg.in
[buildout]
extends =
{{ template_monitor }}
parts =
directory
publish-connection-parameter
service-postgresql
eggs-directory = {{ buildout['eggs-directory'] }}
develop-eggs-directory = {{ buildout['develop-eggs-directory'] }}
offline = true
[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}
[slap-configuration]
# apache-frontend reads from from a part named [slap-configuration]
recipe = slapos.cookbook:slapconfiguration.serialised
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}
[directory]
recipe = slapos.cookbook:mkdirectory
home = ${buildout:directory}
etc = ${:home}/etc
var = ${:home}/var
srv = ${:home}/srv
service = ${:etc}/service
promise = ${:etc}/promise
mattermost-dir = ${:srv}/mattermost
mattermost-import-dir = ${:mattermost-dir}/import
mattermost-export-dir = ${:mattermost-dir}/export
mattermost-plugins-dir = ${:mattermost-dir}/plugins
mattermost-client-plugins-dir = ${:mattermost-dir}/client-plugins
mattermost-data-dir = ${:mattermost-dir}/data
mattermost-logs-dir = ${:var}/log
[mattermost]
ipv6 = ${instance-parameter:ipv6-random}
port = 8065
url = http://[${:ipv6}]:${:port}
import-dir = ${directory:mattermost-import-dir}
export-dir = ${directory:mattermost-export-dir}
plugins-dir = ${directory:mattermost-plugins-dir}
client-plugins-dir = ${directory:mattermost-client-plugins-dir}
data-dir = ${directory:mattermost-data-dir}
logs-dir = ${directory:mattermost-logs-dir}
recipe = slapos.cookbook:wrapper
command-line =
bash -c "ulimit -n 49152; cd {{ mattermost_homepath }}/server; exec {{ mattermost_bin }} -c ${mattermost-config-file:output} server"
wrapper-path = ${directory:service}/mattermost
[config-file]
recipe = slapos.recipe.template:jinja2
url = {{ buildout['parts-directory'] }}/${:_buildout_section_name_}/${:_buildout_section_name_}.json.in
output = ${directory:etc}/${:_buildout_section_name_}.json
extensions = jinja2.ext.do
[check-port-listening-promise]
recipe = slapos.cookbook:check_port_listening
path = ${directory:promise}/${:_buildout_section_name_}
[mattermost-config-file]
<= config-file
#output = ${directory:etc}/mattermost.json
context =
section mattermost mattermost
section pgsql service-postgresql
[service-postgresql]
recipe = slapos.cookbook:postgres
bin = {{ postgresql_location }}/bin
services= ${directory:service}
dbname = mattermost_production
# NOTE db name must match to what was used in KVM on lab.nexedi.com (restore script grants access to this user)
superuser = mattermost-psql
# no password - pgsql will listen only on unix sockets (see below) thus access
# is protected with filesystem-level permissions.
# ( besides, if we use slapos.cookbook:generate.password and do `password = ...`
# the password is stored in plain text in .installed and thus becomes insecure )
password=
pgdata-directory = ${directory:srv}/postgresql
# empty addresses - listen only on unix socket
ipv4 =
ipv6 =
port =
depend =
${promise-postgresql:recipe}
[promise-postgresql]
<= monitor-promise-base
promise = check_command_execute
name = promise-postgresql.py
config-command =
{{ postgresql_location }}/bin/psql \
-h ${service-postgresql:pgdata-directory} \
-U ${service-postgresql:superuser} \
-d ${service-postgresql:dbname} \
-c '\q'
[publish-connection-parameter]
recipe = slapos.cookbook:publish
mattermost-url = ${mattermost:url}
This diff is collapsed.
[buildout]
extends =
../../component/golang/buildout.cfg
../../component/openssl/buildout.cfg
../../component/postgresql/buildout.cfg
../../stack/monitor/buildout.cfg
../../stack/slapos.cfg
../../component/defaults.cfg
buildout.hash.cfg
parts =
slapos-cookbook
instance-profile
mattermost-config-file
postgresql
gowork
[nodejs]
<= nodejs-18.18.0
[gowork]
mattermost-bin = ${:bin}/mattermost
mattermost-homepath = ${mattermost:homepath}
[go_github.com_mattermost_mattermost]
<= go-git-package
go.importpath = github.com/mattermost/mattermost
repository = https://github.com/mattermost/mattermost
revision = v9.5.6
[mattermost]
recipe = plone.recipe.command
command = bash -c "
ulimit -n 8096 &&
. ${gowork:env.sh} &&
mkdir -p ${gowork:bin} &&
cd ${:homepath}/webapp &&
make dist &&
cd ${:homepath}/server &&
export MM_NO_DOCKER=true &&
make setup-go-work prepackaged-binaries validate-go-version client &&
make build-linux-amd64
"
#command = bash -c "
# ulimit -n 8096 &&
# . ${gowork:env.sh} &&
# mkdir -p ${gowork:bin} &&
# cd ${:homepath}/webapp &&
# make dist &&
# cd ${:homepath}/server &&
# export MM_NO_DOCKER=true &&
# make setup-go-work prepackaged-binaries validate-go-version client &&
# make build-linux-amd64 &&
# make package-linux-amd64 &&
# tar -xvzf dist/mattermost*.tar.gz
# "
homepath = ${go_github.com_mattermost_mattermost:location}
stop-on-error = true
[download-file-base]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/${:filename}
[mattermost-config-file]
<= download-file-base
[instance-profile]
recipe = slapos.recipe.template:jinja2
url = ${:_profile_base_location_}/${:filename}
output = ${buildout:directory}/instance.cfg
extensions = jinja2.ext.do
context =
section buildout buildout
key mattermost_bin gowork:mattermost-bin
key mattermost_homepath gowork:mattermost-homepath
key template_monitor monitor2-template:output
key postgresql_location postgresql:location
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