diff --git a/docker-compose.yml b/docker-compose.yml index 85611e6..d0633a5 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -8,6 +8,8 @@ services: args: - SVC_PORT=${BROKER_MQTT_PORT} - SVC_HOST=broker + volumes: + - tor_config:/var/lib/tor networks: - tor_net depends_on: @@ -40,6 +42,7 @@ services: volumes: broker_data: client_data: + tor_config: networks: tor_net: diff --git a/scripts/tor-vol-migration.sh b/scripts/tor-vol-migration.sh new file mode 100755 index 0000000..c5b04e3 --- /dev/null +++ b/scripts/tor-vol-migration.sh @@ -0,0 +1,25 @@ +#!/bin/bash + +# Script to migrate from volume-less tor instance to one that retains +# tor hidden service state (onion url, etc.) + +mkdir -p backup/tor +docker cp torch-subscriber-docker_tor_1:/var/lib/tor/svc backup/tor/ + +docker-compose down +docker-compose up --no-start + +docker run --rm \ + -v $(pwd)/backup/tor:/backup \ + -v torch-subscriber-docker_tor_config:/tor \ + ubuntu \ + cp -r /backup/svc /tor/ + +docker run --rm \ + -v torch-subscriber-docker_tor_config:/tor \ + ubuntu \ + chown -R 0:0 /tor + +rm -rf backup + +docker-compose up -d \ No newline at end of file