Skip to content

feat: Add Go-native scaffolding (Phase 0)#19

Open
ddmoney420 wants to merge 5 commits intomainfrom
feature/go-native-scaffolding
Open

feat: Add Go-native scaffolding (Phase 0)#19
ddmoney420 wants to merge 5 commits intomainfrom
feature/go-native-scaffolding

Conversation

@ddmoney420
Copy link
Owner

Summary

Implements Phase 0 of the Go-first modular downloader roadmap outlined in #18.

This PR establishes the foundational Go project structure, build system, and core interfaces for the planned Go-native rewrite.

Changes

Project Structure

  • cmd/daemon - Daemon entry point with graceful shutdown
  • cmd/cli - CLI client with Cobra commands
  • internal/api - REST API server (health, version, jobs, providers, VPN endpoints)
  • internal/config - Configuration management with Viper (XDG-compliant)
  • internal/core - Job queue skeleton
  • internal/providers - Provider interface definition
  • internal/vpn - VPN controller interface definition

Build & CI

  • Makefile with targets: build, test, lint, release, clean
  • GitHub Actions CI pipeline:
    • Multi-platform testing (Ubuntu, macOS, Windows)
    • Go 1.23 compatibility
    • golangci-lint integration
    • Code coverage reporting
    • Cross-platform release builds
  • golangci-lint configuration with sensible defaults

Documentation

  • GO_MIGRATION.md - Developer guide for Go development
  • docs/adr/README.md - Architecture Decision Records directory
  • config.example.yaml - Example configuration file

Release Targets

Multi-platform binaries (via make release):

  • linux/amd64
  • darwin/amd64 (Intel)
  • darwin/arm64 (Apple Silicon)
  • windows/amd64

Testing

# Build succeeds
make build

# CLI help works
./build/mediadownloader --help

# Daemon compiles
./build/daemon

Output:

A modern, security-first download automation tool supporting HTTP, BitTorrent,
and Usenet with built-in VPN lifecycle management.

Available Commands:
  add         Add a download job
  cancel      Cancel a download job
  daemon      Start the download daemon
  list        List all download jobs
  providers   List available download providers
  status      Show job status
  vpn         VPN management commands

Current Status: Skeleton Implementation

This PR provides interfaces and structure only. Core functionality is not yet implemented:

  • ❌ HTTP provider (Phase 1)
  • ❌ Job queue execution (Phase 1)
  • ❌ VPN integration (Phase 3)
  • ❌ BitTorrent provider (Phase 2)

See roadmap in #18 for implementation timeline.

Docker Stack - No Changes

The existing Docker Compose stack remains fully functional and unchanged. This PR adds Go scaffolding alongside the current implementation.

Backward Compatibility

✅ No breaking changes to existing functionality
✅ All current Docker Compose features work as-is
✅ New Go code is additive only

Checklist

  • Code builds successfully (make build)
  • Multi-platform compilation works (make release)
  • golangci-lint configured
  • GitHub Actions workflow added
  • Migration guide documented
  • ADR directory created
  • Example config provided
  • CI pipeline green (will verify after PR creation)

Next Steps (Phase 1)

After this PR merges:

  1. Implement HTTP download provider with resume/retry
  2. Complete job queue with persistence
  3. Implement full REST API
  4. Add integration tests
  5. Build toward MVP

See #18 for full roadmap.

Related


🤖 Generated with Claude Code

Co-Authored-By: Claude Sonnet 4.5 noreply@anthropic.com

ddmoney420 and others added 5 commits January 6, 2026 20:07
Implements Phase 0 of the Go-first modular downloader roadmap (#18).

Changes:
- Add Go project structure (cmd/daemon, cmd/cli, internal/*)
- Add Provider and VPN Controller interfaces
- Add REST API server skeleton with /healthz and /version endpoints
- Add Job Queue skeleton
- Add configuration management with Viper
- Add Makefile with build, test, lint, release targets
- Add GitHub Actions CI for multi-platform testing
- Add golangci-lint configuration
- Add example config.yaml
- Add Architecture Decision Record (ADR) directory
- Add GO_MIGRATION.md with development guide

Built and tested on macOS, targeting:
- linux/amd64
- darwin/amd64, darwin/arm64
- windows/amd64

All tests must pass CI before any merges.

Addresses #18

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
Implements complete media automation platform based on expanded scope (#18).

Major Changes:
- Add FULL_STACK_ARCHITECTURE.md: Comprehensive architecture for complete media platform
- Add modular Docker Compose templates:
  - compose.core.yml: VPN (Gluetun) + downloaders (qBittorrent, SABnzbd) + Prowlarr
  - compose.media.yml: *arr suite (Sonarr, Radarr, Lidarr, Readarr)
  - compose.request.yml: Request management (Jellyseerr, Overseerr)
  - compose.infrastructure.yml: Reverse proxy, dashboard, auth, transcoding
- Add .env.mediastack.example: Full stack configuration template
- Add QUICKSTART_FULL_STACK.md: 30-minute setup guide
- Add scripts/create-media-dirs.sh: Automatic directory structure creation

Stack Components:
**Core Services:**
- Gluetun (VPN gateway with kill-switch)
- qBittorrent (torrent client)
- SABnzbd (usenet client)
- Prowlarr (indexer management)

**Media Management:**
- Sonarr (TV shows)
- Radarr (movies)
- Lidarr (music, optional)
- Readarr (books, optional)

**Request Management:**
- Jellyseerr (for Jellyfin)
- Overseerr (for Plex)

**Infrastructure:**
- Traefik (reverse proxy + SSL)
- Heimdall/Homepage (dashboard)
- Authentik (authentication + MFA)
- Tdarr (media transcoding)

Architecture:
- Modular Docker Compose files (enable/disable via profiles)
- VPN kill-switch via network namespace sharing
- Centralized configuration (single .env file)
- Scalable from minimal (core only) to full stack

Security:
- All downloads through VPN
- Kill-switch prevents IP leaks
- Optional MFA via Authentik
- Optional SSL via Traefik
- Firewall rules, DNS leak protection

Testing:
- Directory structure script validated
- Docker Compose files use standard LinuxServer.io images
- All services use persistent volumes

Addresses expanded scope from #18.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
- Rename binary from 'mediadownloader' to 'mediastack'
- Pivot from download manager to Docker Compose orchestrator
- Implement Docker Compose orchestration layer (internal/compose/)
- Implement health monitoring with VPN status checks (internal/health/)
- Implement interactive setup wizard (internal/wizard/)
- Update CLI commands for orchestration (start, stop, status, etc.)
- Disable daemon build (not needed for orchestration approach)
- Add comprehensive orchestration layer documentation

This completes the pivot to using Go as an orchestration layer rather
than reimplementing existing services. The Go binary now provides a
unified CLI for managing the Docker Compose-based media stack.
- Implement complete config structure for orchestration layer
- Support VPN configuration (WireGuard/OpenVPN)
- Support service profiles (music, books, jellyfin, etc.)
- Support all service ports configuration
- XDG-compliant config file paths
- Environment variable overrides (MEDIASTACK_*)
- Update .gitignore to allow internal/config/ directory
- Add projectSourceUrl, docsUrl, bugTrackerUrl to nuspec
- Add docker-desktop as hard dependency (reviewer request)
- Update install script version to 1.0.2
- Update checksum for v1.0.2 release

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant