mirror of
https://github.com/r3bo0tbx1/tor-guard-relay.git
synced 2026-04-06 00:32:04 +02:00
✨ feat: add gen-auth tool and refactor compose templates
Major refactor of Docker Compose configurations and tooling enhancements. - ✨ Add `gen-auth` script for generating Tor Control Port credentials - 🐳 Refactor Docker Compose templates: - Add native healthcheck configurations to all relay/bridge files - Standardize security capabilities (drop ALL, add SETUID/SETGID) - Remove verbose comments to streamline template usage - Update volume definitions for better data persistence - 🔧 Update base dependencies: - Alpine Linux -> 3.23.0 - Golang -> 1.25.5-alpine - 🧹 Standardize ENV variable names across all configurations
This commit is contained in:
43
tools/gen-auth
Normal file
43
tools/gen-auth
Normal file
@@ -0,0 +1,43 @@
|
||||
#!/bin/sh
|
||||
# Generate Tor Control Port authentication credentials
|
||||
|
||||
set -e
|
||||
|
||||
GREEN='\033[0;32m'
|
||||
BLUE='\033[0;34m'
|
||||
YELLOW='\033[1;33m'
|
||||
CYAN='\033[0;36m'
|
||||
BOLD='\033[1m'
|
||||
NC='\033[0m'
|
||||
|
||||
PASS=$(head -c 24 /dev/urandom | base64 | tr -d '\n')
|
||||
HASH=$(tor --hash-password "$PASS")
|
||||
|
||||
echo ""
|
||||
echo "${CYAN}╔════════════════════════════════════════════════════════════╗${NC}"
|
||||
echo "${CYAN}║${NC} ${BOLD}Tor Control Port Authentication Generator${NC} ${CYAN}║${NC}"
|
||||
echo "${CYAN}╚════════════════════════════════════════════════════════════╝${NC}"
|
||||
echo ""
|
||||
echo "${GREEN}✓${NC} Generated secure 32-character password"
|
||||
echo ""
|
||||
echo "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo "${BOLD}1. Save this password (use for Nyx authentication):${NC}"
|
||||
echo "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
echo " ${BLUE}${PASS}${NC}"
|
||||
echo ""
|
||||
echo "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo "${BOLD}2. Add this line to your torrc:${NC}"
|
||||
echo "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
echo " ${GREEN}HashedControlPassword ${HASH}${NC}"
|
||||
echo ""
|
||||
echo "${YELLOW}━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━━${NC}"
|
||||
echo ""
|
||||
echo "${CYAN}📝 Next steps:${NC}"
|
||||
echo " 1. Edit your relay.conf and add the HashedControlPassword line above"
|
||||
echo " 2. Restart your container: ${BOLD}docker restart tor-relay${NC}"
|
||||
echo " 3. Connect with Nyx using the password shown above"
|
||||
echo ""
|
||||
echo "${CYAN}💡 Tip:${NC} Save the password in a secure password manager!"
|
||||
echo ""
|
||||
Reference in New Issue
Block a user