-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsetup.sh
More file actions
executable file
·34 lines (26 loc) · 1.03 KB
/
setup.sh
File metadata and controls
executable file
·34 lines (26 loc) · 1.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#!/bin/bash
set -e
#set -x
# set up data & secrets dir with the right ownerships in the default location
# to stop docker autocreating them with random owners.
mkdir -p data/{element-{web,call},livekit,mas,synapse-admin,postgres,synapse}
mkdir -p secrets/{livekit,postgres,synapse}
touch secrets/livekit/livekit_{api,secret}_key \
secrets/postgres/postgres_password \
secrets/synapse/signing.key
if [[ ! -e .env ]]; then
cp .env-sample .env
sed -ri.orig "s/^USER_ID=/USER_ID=$(id -u)/" .env
sed -ri.orig "s/^GROUP_ID=/GROUP_ID=$(id -g)/" .env
read -p "Enter base domain name (e.g. example.com): " DOMAIN
sed -ri.orig "s/example.com/$DOMAIN/" .env
# try to guess your livekit IP
if [ -x "$(command -v getent)" ]; then
NODE_IP=`getent hosts livekit.$DOMAIN | cut -d' ' -f1`
if ! [ -z "$NODE_IP" ]; then
sed -ri.orig "s/LIVEKIT_NODE_IP=127.0.0.1/LIVEKIT_NODE_IP=$NODE_IP/" .env
fi
fi
else
echo ".env already exists; move it out of the way first to re-setup"
fi