Implements comprehensive privacy and anonymity features including Tor hidden service support, location obfuscation, and anonymous registration. Privacy Features: - Anonymous plant registration with zero personal information - Location privacy levels: exact, fuzzy, city, country, hidden - Pseudonymous identities and wallet addresses - Privacy settings component with real-time Tor status - Encrypted anonymous contact generation Tor Integration: - SOCKS proxy support for Tor connections - Hidden service (.onion) configuration - Tor connection detection and status API - Docker Compose setup for easy Tor deployment - Automatic privacy warnings when not using Tor Location Obfuscation: - Fuzzy location: ±1-5km random offset - City level: ~10km grid - Country level: ~100km grid - Hidden: complete location privacy - Haversine-based distance calculations preserved Anonymous Registration: - /plants/register-anonymous endpoint - Privacy-first UI with Tor status banner - Anonymous IDs and wallet addresses - Optional pseudonym support - Encryption key support for enhanced security Infrastructure: - Tor service integration (lib/services/tor.ts) - Privacy utilities (lib/privacy/anonymity.ts) - PrivacySettings React component - Tor status API endpoint - Docker and docker-compose configurations - Example Tor configuration (torrc.example) Documentation: - Comprehensive TOR_SETUP.md guide - Installation instructions for Linux/macOS/Windows - Privacy best practices - Troubleshooting guide - Security considerations - Updated README with Tor features Dependencies: - Added socks-proxy-agent for Tor proxy support This enables: - Privacy-conscious growers to share anonymously - Protection of exact home locations - Censorship-resistant plant sharing - Community building without identity disclosure - Compliance with privacy regulations All privacy features are optional and configurable. Users can choose their desired privacy level.
40 lines
800 B
Docker
40 lines
800 B
Docker
# Dockerfile for LocalGreenChain
|
|
# Uses Bun for fast builds and runtime
|
|
|
|
FROM oven/bun:1 as base
|
|
|
|
WORKDIR /app
|
|
|
|
# Install dependencies
|
|
COPY package.json bun.lockb* ./
|
|
RUN bun install --frozen-lockfile
|
|
|
|
# Copy application code
|
|
COPY . .
|
|
|
|
# Build Next.js application
|
|
RUN bun run build
|
|
|
|
# Production stage
|
|
FROM oven/bun:1-slim as production
|
|
|
|
WORKDIR /app
|
|
|
|
# Copy dependencies and build output
|
|
COPY --from=base /app/node_modules ./node_modules
|
|
COPY --from=base /app/.next ./.next
|
|
COPY --from=base /app/public ./public
|
|
COPY --from=base /app/package.json ./package.json
|
|
COPY --from=base /app/next.config.js ./next.config.js
|
|
|
|
# Create data directory
|
|
RUN mkdir -p /app/data
|
|
|
|
# Expose port
|
|
EXPOSE 3001
|
|
|
|
# Set environment to production
|
|
ENV NODE_ENV=production
|
|
|
|
# Run the application
|
|
CMD ["bun", "run", "start"]
|