services-garbaye/podman-matrix/05_freshinstall.sh

29 lines
1.6 KiB
Bash
Raw Normal View History

2021-06-14 10:42:59 +00:00
#!/usr/bin/env bash
ABSDIR="$( dirname "$(readlink -f -- "$0")" )"
source ${ABSDIR}/../functions.sh
source ${ABSDIR}/vars.sh
ensure_pwd_is_scriptdir
ensure_not_root
ensure_variables_are_defined "$envvars"
2022-01-28 13:20:49 +00:00
if podman volume exists ${confvolume} || podman volume exists ${dbvolume}; then
echo "Files or volumes from previous installation already exists"
echo "Please remove them before fresh install, or try continue with normal installation"
exit 1
2021-06-14 10:42:59 +00:00
fi
2022-03-04 23:21:38 +00:00
source ${ABSDIR}/zz_build-images.sh &&
2022-03-05 13:16:15 +00:00
podman image exists ${synapse_image}:${synapse_version} &&
podman volume create ${confvolume} && \
podman volume create ${dbvolume} && \
2021-07-12 19:40:44 +00:00
podman run -it --name ${container_name}-generate --mount type=volume,src=${confvolume},dst=/data -e SYNAPSE_SERVER_NAME=${GARBAYE_MATRIX_DOMAIN} -e SYNAPSE_REPORT_STATS=no ${synapse_image}:${synapse_version} generate && \
podman rm ${container_name}-generate && \
2022-01-28 13:26:42 +00:00
podman unshare sed -i -e "s|^#public_baseurl: https://example.com/$|public_baseurl: ${GARBAYE_MATRIX_URL}|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml && \
podman unshare sed -z -i -e "s|database:\n name: sqlite3\n args:\n database: /data/homeserver.db|database:\n name: psycopg2\n args:\n user: synapse\n password: ${GARBAYE_MATRIX_POSTGRES_PASSWORD}\n database: synapse\n host: synapse-db\n port: 5432\n cp_min: 5\n cp_max: 10|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml && \
podman unshare sed -i -e "s|^#enable_registration: false$|enable_registration: false|g" `get_podman_volume_path ${confvolume}`/homeserver.yaml && \
${ABSDIR}/10_install.sh
2021-06-14 10:42:59 +00:00