Skip to content

Commit e815757

Browse files
committed
feat(docker): Tor configuration prompts for external instance usage
1 parent 3675885 commit e815757

File tree

1 file changed

+32
-18
lines changed

1 file changed

+32
-18
lines changed

docker-setup

Lines changed: 32 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -260,32 +260,46 @@ configure_setup() {
260260
print_info "Tor Configuration"
261261
echo "----------------------------------------"
262262

263+
USE_EXTERNAL_TOR="false"
264+
TOR_CONFIGURED="false"
265+
263266
if check_tor_running; then
264267
print_info "Detected Tor running on port 9050"
265-
read -p "Use existing Tor instance? [Y/n]: " use_existing_tor
266-
if [[ "${use_existing_tor:-Y}" =~ ^[Yy]$ ]]; then
268+
echo ""
269+
read -p "Do you want to use this existing Tor instance? [y/N]: " use_existing_tor
270+
if [[ "${use_existing_tor}" =~ ^[Yy]$ ]]; then
271+
echo ""
272+
print_warning "============================================"
273+
print_warning "Your Tor must be configured correctly for makerd!"
274+
print_warning "Required: ControlPort enabled with authentication"
275+
print_warning "See: docs/tor.md for configuration details"
276+
print_warning "============================================"
277+
echo ""
278+
read -p "Are you sure your Tor is configured properly? [y/N]: " confirm_tor
279+
if [[ "${confirm_tor}" =~ ^[Yy]$ ]]; then
267280
USE_EXTERNAL_TOR="true"
281+
TOR_CONFIGURED="true"
282+
268283
read -p "Tor SOCKS host [localhost:9050]: " tor_host
269284
EXTERNAL_TOR_HOST="${tor_host:-localhost:9050}"
270-
else
271-
USE_EXTERNAL_TOR="false"
272-
read -p "Tor SOCKS port [${DEFAULT_TOR_SOCKS_PORT}]: " tor_socks
273-
TOR_SOCKS_PORT="${tor_socks:-$DEFAULT_TOR_SOCKS_PORT}"
274-
read -p "Tor control port [${DEFAULT_TOR_CONTROL_PORT}]: " tor_control
275-
TOR_CONTROL_PORT="${tor_control:-$DEFAULT_TOR_CONTROL_PORT}"
285+
286+
read -p "Tor Auth Password [${DEFAULT_TOR_AUTH}]: " tor_auth
287+
TOR_AUTH_PASSWORD="${tor_auth:-$DEFAULT_TOR_AUTH}"
288+
else
289+
print_info "Using internal Tor container instead..."
290+
fi
276291
fi
277-
else
278-
USE_EXTERNAL_TOR="false"
279-
read -p "Tor SOCKS port [${DEFAULT_TOR_SOCKS_PORT}]: " tor_socks
280-
TOR_SOCKS_PORT="${tor_socks:-$DEFAULT_TOR_SOCKS_PORT}"
281-
read -p "Tor control port [${DEFAULT_TOR_CONTROL_PORT}]: " tor_control
282-
TOR_CONTROL_PORT="${tor_control:-$DEFAULT_TOR_CONTROL_PORT}"
283292
fi
284293

285-
if [[ "$USE_EXTERNAL_TOR" == "true" ]]; then
286-
read -p "Tor Auth Password [${DEFAULT_TOR_AUTH}]: " tor_auth
287-
TOR_AUTH_PASSWORD="${tor_auth:-$DEFAULT_TOR_AUTH}"
288-
else
294+
if [ "$TOR_CONFIGURED" == "false" ]; then
295+
USE_EXTERNAL_TOR="false"
296+
echo ""
297+
print_info "Using internal Tor container with default configuration:"
298+
echo " SOCKS Port: ${DEFAULT_TOR_SOCKS_PORT}"
299+
echo " Control Port: ${DEFAULT_TOR_CONTROL_PORT}"
300+
echo " Auth Password: coinswap (hardcoded)"
301+
TOR_SOCKS_PORT="$DEFAULT_TOR_SOCKS_PORT"
302+
TOR_CONTROL_PORT="$DEFAULT_TOR_CONTROL_PORT"
289303
TOR_AUTH_PASSWORD="coinswap"
290304
fi
291305

0 commit comments

Comments
 (0)