Browse Source

new: [conduwuit] add charm

Valentin Lab 2 years ago
parent
commit
245d88d533
  1. 12
      conduwuit/hooks/init
  2. 16
      conduwuit/hooks/web_proxy-relation-joined
  3. 34
      conduwuit/metadata.yml

12
conduwuit/hooks/init

@ -0,0 +1,12 @@
#!/bin/bash
## Init is run on host
## For now it is run every time the script is launched, but
## it should be launched only once after build.
## Accessible variables are:
## - SERVICE_NAME Name of current service
## - DOCKER_BASE_IMAGE Base image from which this service might be built if any
## - SERVICE_DATASTORE Location on host of the DATASTORE of this service
## - SERVICE_CONFIGSTORE Location on host of the CONFIGSTORE of this service

16
conduwuit/hooks/web_proxy-relation-joined

@ -0,0 +1,16 @@
#!/bin/bash
set -e
DOMAIN=$(relation-get domain) || exit 1
config-add "\
services:
$MASTER_BASE_SERVICE_NAME:
environment:
CONDUWUIT_SERVER_NAME: \"$DOMAIN\"
CONDUWUIT_WELL_KNOWN: |
{
server=$DOMAIN:443
}
"

34
conduwuit/metadata.yml

@ -0,0 +1,34 @@
maintainer: "Valentin Lab <valentin.lab@kalysto.org>"
docker-image: docker.0k.io/conduwuit:0.4.6
config-resources:
- /etc/conduwuit/conduwuit.toml
data-resources:
- /var/lib/conduwuit
docker-compose:
environment:
CONDUWUIT_ALLOW_CHECK_FOR_UPDATES: 'false'
CONDUWUIT_CONFIG: '/etc/conduwuit/conduwuit.toml'
CONDUWUIT_DATABASE_PATH: /var/lib/conduwuit
CONDUWUIT_ADDRESS: 0.0.0.0 ## Required as otherwise it is localhost
CONDUWUIT_PORT: 6167
default-options:
allow-registration: false
uses:
# log-rotate:
# constraint: recommended
# auto: pair
# solves:
# disk-leak: "/data/logs"
web-proxy:
constraint: recommended
auto: pair
solves:
proxy: "Public access"
default-options:
target: !var-expand ${MASTER_BASE_SERVICE_NAME}:6167
## ``nocanon`` is mandatory
## see: https://github.com/matrix-org/synapse/blob/master/docs/reverse_proxy.rst
apache-proxy-pass-options: retry=0 nocanon
Loading…
Cancel
Save