forked from switnet/quick-jibri-installer
return to user docker container
store credentials for later revision
This commit is contained in:
parent
fab9c4abeb
commit
39d1890ee8
|
@ -64,13 +64,20 @@ WS_CONF_MATCH1="# ensure all static content can always be found first"
|
||||||
|
|
||||||
read -p "Set your etherpad docker admin password: " -r ETHERPAD_ADMIN_PASS
|
read -p "Set your etherpad docker admin password: " -r ETHERPAD_ADMIN_PASS
|
||||||
|
|
||||||
|
install -m 600 /dev/null /var/opt/etherpad_details.txt
|
||||||
|
cat << EOF > /var/opt/etherpad_details.txt
|
||||||
|
ETHERPAD_ADMIN_PASS=$ETHERPAD_ADMIN_PASS
|
||||||
|
ETHERPAD_DB_USER=$ETHERPAD_DB_USER
|
||||||
|
ETHERPAD_DB_NAME=$ETHERPAD_DB_NAME
|
||||||
|
ETHERPAD_DB_PASS=$ETHERPAD_DB_PASS
|
||||||
|
EOF
|
||||||
|
|
||||||
# Make sure we can rely on the match strings.
|
# Make sure we can rely on the match strings.
|
||||||
printf "> Testing match strings on config files.\n"
|
printf "> Testing match strings on config files.\n"
|
||||||
test_match "$WS_MATCH1" "$WS_CONF"
|
test_match "$WS_MATCH1" "$WS_CONF"
|
||||||
|
|
||||||
# Install required packages
|
# Install required packages
|
||||||
install_ifnot docker.io
|
install_ifnot docker.io
|
||||||
install_ifnot docker-compose
|
|
||||||
install_ifnot postgresql-"$PSGVER"
|
install_ifnot postgresql-"$PSGVER"
|
||||||
|
|
||||||
# Create DB
|
# Create DB
|
||||||
|
@ -81,26 +88,26 @@ CREATE USER ${ETHERPAD_DB_USER} WITH ENCRYPTED PASSWORD '${ETHERPAD_DB_PASS}';
|
||||||
GRANT ALL PRIVILEGES ON DATABASE ${ETHERPAD_DB_NAME} TO ${ETHERPAD_DB_USER};
|
GRANT ALL PRIVILEGES ON DATABASE ${ETHERPAD_DB_NAME} TO ${ETHERPAD_DB_USER};
|
||||||
DB
|
DB
|
||||||
|
|
||||||
# Set environment varibales for docker
|
# Check fot docker if not running then execute
|
||||||
mkdir /opt/etherpad
|
if [ ! "$(docker ps -q -f name=etherpad)" ]; then
|
||||||
cat << EOF > /opt/etherpad/.env
|
if [ "$(docker ps -aq -f status=exited -f name=etherpad)" ]; then
|
||||||
DOCKER_COMPOSE_APP_ADMIN_PASSWORD="$ETHERPAD_ADMIN_PASS"
|
# cleanup
|
||||||
DOCKER_COMPOSE_APP_DB_CHARSET="utf8mb4"
|
docker rm etherpad
|
||||||
DOCKER_COMPOSE_POSTGRES_HOST="localhost"
|
fi
|
||||||
DOCKER_COMPOSE_POSTGRES_USER="$ETHERPAD_DB_USER"
|
# run your container
|
||||||
DOCKER_COMPOSE_POSTGRES_DATABASE="$ETHERPAD_DB_NAME"
|
docker run -d --restart always \
|
||||||
DOCKER_COMPOSE_POSTGRES_PASSWORD="$ETHERPAD_DB_PASS"
|
--network=host \
|
||||||
DOCKER_COMPOSE_POSTGRES_PORT="5432"
|
--name etherpad \
|
||||||
#DOCKER_COMPOSE_APP_DEFAULT_PAD_TEXT=
|
-p 127.0.0.1:9001:9001 \
|
||||||
DOCKER_COMPOSE_APP_DISABLE_IP_LOGGING="false"
|
-e "ADMIN_PASSWORD=$ETHERPAD_ADMIN_PASS" \
|
||||||
DOCKER_COMPOSE_APP_SOFFICE="null"
|
-e "DB_TYPE=postgres" \
|
||||||
DOCKER_COMPOSE_APP_TRUST_PROXY="true"
|
-e "DB_HOST=localhost" \
|
||||||
EOF
|
-e "DB_PORT=5432" \
|
||||||
chmod 644 /opt/etherpad/.env
|
-e "DB_NAME=$ETHERPAD_DB_NAME" \
|
||||||
cp files/etherpad/docker-compose.yml /opt/etherpad/
|
-e "DB_USER=$ETHERPAD_DB_USER" \
|
||||||
chmod 644 /opt/etherpad/docker-compose.yml
|
-e "DB_PASS=$ETHERPAD_DB_PASS" \
|
||||||
|
-i -t etherpad/etherpad
|
||||||
docker-compose -f /opt/etherpad/docker-compose.yml up -d
|
fi
|
||||||
|
|
||||||
# Tune webserver for Jitsi App control
|
# Tune webserver for Jitsi App control
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue