greenlight v3: migration script + docs

This commit is contained in:
chandi 2023-03-21 14:03:03 +01:00
parent ce8f12fc60
commit 43ef3aeb88
5 changed files with 61 additions and 7 deletions

View File

@ -433,7 +433,7 @@ services:
- redis
environment:
DATABASE_URL: postgres://postgres:${POSTGRESQL_SECRET:-password}@postgres:5432/greenlight
DATABASE_URL: postgres://postgres:${POSTGRESQL_SECRET:-password}@postgres:5432/greenlight-v3
REDIS_URL: redis://redis:6379
{{ if isTrue .Env.DEV_MODE }}
BIGBLUEBUTTON_ENDPOINT: http://10.7.7.1/bigbluebutton/api
@ -452,7 +452,7 @@ services:
image: postgres:12-alpine
restart: unless-stopped
environment:
POSTGRES_DB: greenlight
POSTGRES_DB: greenlight-v3
POSTGRES_USER: postgres
POSTGRES_PASSWORD: ${POSTGRESQL_SECRET:-password}
healthcheck:

View File

@ -30,7 +30,7 @@ TURN_SERVER=turns:localhost:5349?transport=tcp
TURN_SECRET=SuperTurnSecret
SHARED_SECRET=SuperSecret
ETHERPAD_API_KEY=SuperEtherpadKey
RAILS_SECRET=SuperRailsSecret
RAILS_SECRET=SuperRailsSecret_SuperRailsSecret
# ====================================
# CUSTOMIZATION

View File

@ -1,11 +1,16 @@
# How To Upgrade bbb-docker
### Upgrading `v2.3.x` -> `v2.4.x`
*Breaking change:* The nginx port changes from `8080` to the less common port `48087`, to avoid port conflicts (see [#133](https://github.com/bigbluebutton/docker/issues/133)). If you use an reverse proxy not included in this repo, ensure to update your config accordingly!
### Upgrading `v2.5.x` -> `v2.6.x`
- *Breaking change:* Greenlight got fully rewritten
* it is starting as a fresh installation. you can migrate your data with `./scripts/greenlight-migrate-v2-v3`
* some greenlight settings under `.env` have changed. compare your version with `sample.env`
* it is now served directly under `/` and not in `/b`. If you use an reverse proxy not included in this repo, ensure to update your config accordingly!
apart from that follow the guide below.
### within `v2.4.x` or `v2.3.x`
### within `v2.6.x`
#### Backup
if you use greenlight, create a database backup first
```bash

View File

@ -44,7 +44,7 @@ ENABLE_GREENLIGHT=true
# important! change these to any random values
SHARED_SECRET=SuperSecret
ETHERPAD_API_KEY=SuperEtherpadKey
RAILS_SECRET=SuperRailsSecret
RAILS_SECRET=SuperRailsSecret_SuperRailsSecret
POSTGRESQL_SECRET=SuperPostgresSecret
FSESL_PASSWORD=SuperFreeswitchESLPassword

View File

@ -0,0 +1,49 @@
#!/bin/bash
cd $(dirname $0)/..
# load .env
if [ -f .env ]
then
export $(cat .env | sed 's/#.*//g' | grep -E "RAILS_SECRET|POSTGRESQL_SECRET" | xargs)
fi
COMPOSE_PREFIX=$(docker-compose ps | grep postgres | awk '{print $1}' | sed 's/-postgres-1//')
docker kill -s SIGKILL greenlight-v2-tmp 2>/dev/null
sleep 1
echo "temporarily starting old greenlight v2..."
docker run \
--rm \
--detach --name greenlight-v2-tmp \
--network ${COMPOSE_PREFIX}_bbb-net \
--env-file .env \
-e DB_ADAPTER=postgresql \
-e DB_HOST=10.7.7.22 \
-e DB_NAME=greenlight \
-e DB_USERNAME=postgres \
-e DB_PASSWORD=${POSTGRESQL_SECRET:-password} \
-e SECRET_KEY_BASE=${RAILS_SECRET} \
-e V3_ENDPOINT="http://10.7.7.21:3000" \
-e V3_SECRET_KEY_BASE=${RAILS_SECRET} \
bigbluebutton/greenlight:v2.14
docker logs -f greenlight-v2-tmp &
LOGGING_PID=$!
while ! docker exec greenlight-v2-tmp nc -zw3 127.0.0.1 80
do
echo "Waiting for greenlight v2 to start up ..."
sleep 1
done
echo "greenlight is up! starting migrations"
docker exec -it greenlight-v2-tmp bundle exec rake migrations:roles && \
docker exec -it greenlight-v2-tmp bundle exec rake migrations:users && \
docker exec -it greenlight-v2-tmp bundle exec rake migrations:rooms && \
docker exec -it greenlight-v2-tmp bundle exec rake migrations:settings
kill $LOGGING_PID
docker kill greenlight-v2-tmp