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
|
|
|
|
|
2021-07-01 17:28:13 +00:00
|
|
|
ensure_variables_are_defined "$envvars"
|
|
|
|
|
2022-01-28 13:20:49 +00:00
|
|
|
if podman volume exists ${confvolume} || podman volume exists ${dbvolume}; then
|
2021-07-04 18:10:37 +00:00
|
|
|
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
|
|
|
|
|
2023-05-20 13:59:37 +00:00
|
|
|
if ! podman image exists ${synapse_image}:${synapse_version}; then
|
|
|
|
podman image pull ${synapse_image}:${synapse_version} || exit 1
|
|
|
|
fi
|
2022-03-28 19:18:50 +00:00
|
|
|
podman volume create ${confvolume} &&
|
|
|
|
podman volume create ${dbvolume} &&
|
2023-07-28 15:28:20 +00:00
|
|
|
podman container run -it --rm --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 &&
|
2023-07-28 15:25:41 +00:00
|
|
|
podman_unshare_sed_in_place "^pid_file: /data/homeserver.pid$" "pid_file: /data/homeserver.pid\npublic_baseurl: ${GARBAYE_MATRIX_URL}\nallow_public_rooms_over_federation: true" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
2023-07-29 06:53:07 +00:00
|
|
|
podman_unshare_sed_in_place_multiline "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\n cp_reconnect: true" `get_podman_volume_path ${confvolume}`/homeserver.yaml &&
|
2021-06-15 08:10:19 +00:00
|
|
|
${ABSDIR}/10_install.sh
|