Skip to content
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
5 changes: 5 additions & 0 deletions -files  findstr parsec
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
* feature/parsec-module
main
remotes/origin/feature/parsec-module
remotes/origin/fix/remove-maintainer-github
remotes/origin/main
24 changes: 22 additions & 2 deletions .github/scripts/check_registry_site_health.sh
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,33 @@ required_vars=(
)

# Check if each required variable is set
missing_vars=()
for var in "${required_vars[@]}"; do
if [[ -z "${!var:-}" ]]; then
echo "Error: Environment variable '$var' is not set."
exit 1
missing_vars+=("$var")
fi
done

# If any required variables are missing, provide helpful error message
if [[ ${#missing_vars[@]} -gt 0 ]]; then
echo "Error: The following required environment variables are not set:"
for var in "${missing_vars[@]}"; do
echo " - $var"
done
echo ""
echo "To fix this, add these secrets to your GitHub repository:"
echo "1. Go to your repository Settings > Secrets and variables > Actions"
echo "2. Click 'New repository secret' for each missing variable"
echo "3. Add the appropriate values from your Instatus and Vercel dashboards"
echo ""
echo "Required secrets:"
echo "- INSTATUS_API_KEY: Your Instatus API key"
echo "- INSTATUS_PAGE_ID: Your Instatus page ID"
echo "- INSTATUS_COMPONENT_ID: Your Instatus component ID"
echo "- VERCEL_API_KEY: Your Vercel API key"
exit 1
fi

REGISTRY_BASE_URL="${REGISTRY_BASE_URL:-https://registry.coder.com}"

status=0
Expand Down
236 changes: 236 additions & 0 deletions MOONLIGHT_IMPLEMENTATION_PLAN.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,236 @@
# Moonlight/GameStream Module Implementation Plan

## Overview
Create a Coder module that automatically configures Moonlight streaming support for GPU-accelerated remote desktop access. The module will detect compatible workspaces and configure either NVIDIA GameStream or Sunshine server automatically.

## Module Structure
```
registry/registry/Majain004/modules/moonlight/
├── main.tf # Main Terraform module
├── README.md # Documentation
├── main.test.ts # Automated tests
├── PR_DESCRIPTION.md # PR template
└── scripts/
├── install-moonlight.ps1 # Windows installation
├── install-moonlight.sh # Linux installation
├── detect-gpu.ps1 # GPU detection (Windows)
└── detect-gpu.sh # GPU detection (Linux)
```

## Features

### Core Functionality
- ✅ **Automatic GPU detection** - Identifies NVIDIA GPUs
- ✅ **GameStream/Sunshine configuration** - Auto-configures streaming server
- ✅ **Moonlight client setup** - Installs and configures client
- ✅ **Cross-platform support** - Windows and Linux compatibility
- ✅ **Coder app integration** - Exposes Moonlight as Coder app

### Technical Requirements
- **NVIDIA GPU detection** - Identifies compatible hardware
- **GameStream server setup** - Configures NVIDIA GameStream
- **Sunshine server setup** - Alternative for non-NVIDIA setups
- **Moonlight client installation** - Remote client setup
- **Network configuration** - Port forwarding and firewall rules

## Implementation Steps

### Phase 1: Module Structure
1. Create module directory under `Majain004` namespace
2. Set up Terraform configuration with variables
3. Create installation scripts for both platforms
4. Add GPU detection logic

### Phase 2: Core Functionality
1. Implement NVIDIA GameStream server setup
2. Implement Sunshine server setup
3. Create Moonlight client installation
4. Add network configuration

### Phase 3: Testing & Documentation
1. Write comprehensive tests
2. Create detailed documentation
3. Record demo video
4. Prepare PR with proper description

## Technical Details

### GPU Detection
```bash
# Windows (PowerShell)
Get-WmiObject -Class Win32_VideoController | Where-Object {$_.Name -like "*NVIDIA*"}

# Linux (Bash)
lspci | grep -i nvidia
```

### GameStream Configuration
- Enable NVIDIA GameStream in GeForce Experience
- Configure streaming settings
- Set up authentication

### Sunshine Configuration
- Install Sunshine server
- Configure streaming parameters
- Set up authentication

### Moonlight Client
- Install Moonlight client
- Configure connection settings
- Test connectivity

## Variables

```tf
variable "agent_id" {
type = string
description = "The ID of a Coder agent."
}

variable "os" {
type = string
description = "Target operating system: 'windows' or 'linux'."
validation {
condition = contains(["windows", "linux"], var.os)
error_message = "os must be 'windows' or 'linux'"
}
}

variable "streaming_method" {
type = string
description = "Streaming method: 'gamestream' or 'sunshine'."
default = "auto"
validation {
condition = contains(["auto", "gamestream", "sunshine"], var.streaming_method)
error_message = "streaming_method must be 'auto', 'gamestream', or 'sunshine'"
}
}

variable "port" {
type = number
description = "Port for Moonlight streaming."
default = 47984
}

variable "quality" {
type = string
description = "Streaming quality: 'low', 'medium', 'high', 'ultra'."
default = "high"
validation {
condition = contains(["low", "medium", "high", "ultra"], var.quality)
error_message = "quality must be 'low', 'medium', 'high', or 'ultra'"
}
}
```

## Resources

```tf
resource "coder_script" "moonlight_setup" {
agent_id = var.agent_id
display_name = "Setup Moonlight Streaming"
icon = local.icon
run_on_start = true
script = var.os == "windows" ?
templatefile("${path.module}/scripts/install-moonlight.ps1", {
STREAMING_METHOD = var.streaming_method,
PORT = var.port,
QUALITY = var.quality
}) :
templatefile("${path.module}/scripts/install-moonlight.sh", {
STREAMING_METHOD = var.streaming_method,
PORT = var.port,
QUALITY = var.quality
})
}

resource "coder_app" "moonlight" {
agent_id = var.agent_id
slug = local.slug
display_name = local.display_name
url = "moonlight://localhost"
icon = local.icon
subdomain = var.subdomain
order = var.order
group = var.group
}
```

## Testing Strategy

### Test Cases
1. **GPU Detection** - Verify NVIDIA GPU detection
2. **GameStream Setup** - Test NVIDIA GameStream configuration
3. **Sunshine Setup** - Test Sunshine server configuration
4. **Moonlight Client** - Test client installation and connection
5. **Cross-platform** - Test Windows and Linux compatibility
6. **Quality Settings** - Test different streaming quality options

### Test Commands
```bash
# Run tests
bun test

# Validate Terraform
terraform validate

# Test GPU detection
./scripts/detect-gpu.sh
```

## Demo Video Script

### Scene 1: Workspace Setup (30s)
- Show Coder dashboard
- Create workspace with GPU support
- Add Moonlight module configuration
- Deploy workspace

### Scene 2: GPU Detection (30s)
- Show GPU detection script running
- Display detected NVIDIA GPU
- Show automatic method selection

### Scene 3: Server Setup (45s)
- Show GameStream/Sunshine installation
- Display configuration process
- Show successful server startup

### Scene 4: Client Integration (30s)
- Show Moonlight app in Coder dashboard
- Demonstrate client connection
- Show streaming performance

### Scene 5: Functionality Demo (45s)
- Show low-latency streaming
- Demonstrate gaming performance
- Highlight key features

## Success Criteria

- ✅ **Automatic GPU detection** works correctly
- ✅ **GameStream/Sunshine** configures automatically
- ✅ **Moonlight client** connects successfully
- ✅ **Cross-platform** compatibility verified
- ✅ **Demo video** shows working functionality
- ✅ **All tests** pass successfully
- ✅ **Documentation** is comprehensive

## Timeline

- **Day 1**: Module structure and basic setup
- **Day 2**: GPU detection and server configuration
- **Day 3**: Client integration and testing
- **Day 4**: Documentation and demo video
- **Day 5**: PR creation and submission

## Bounty Claim

To claim the $200 bounty:
1. ✅ Implement all features successfully
2. ✅ Record demo video showing functionality
3. ✅ Create PR with `/claim #206` in description
4. ✅ Ensure high-quality implementation (no AI-generated code)
5. ✅ Follow all module guidelines

This implementation will provide a comprehensive Moonlight/GameStream solution that meets all bounty requirements and follows the same high-quality standards as the Parsec module.
23 changes: 23 additions & 0 deletions registry/.env.example
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# ---
# These are used for the site health script, run from GitHub Actions. They can
# be set manually if you need to run the script locally.

# Coder admins for Instatus can get this value from https://dashboard.instatus.com/developer
export INSTATUS_API_KEY=

# Can be obtained from calling the Instatus API with a valid token. This value
# might not actually need to be private, but better safe than sorry
# https://instatus.com/help/api/status-pages
export INSTATUS_PAGE_ID=

# Can be obtained from calling the Instatus API with a valid token. This value
# might not actually need to be private, but better safe than sorry
# https://instatus.com/help/api/components
export INSTATUS_COMPONENT_ID=

# Can be grabbed from https://vercel.com/codercom/registry/stores/integration/upstash/store_1YDPuBF4Jd0aNpuV/guides
# Please make sure that the token you use is KV_REST_API_TOKEN; the script needs
# to be able to queries and mutations
export VERCEL_API_KEY=

# ---
31 changes: 31 additions & 0 deletions registry/.github/PULL_REQUEST_TEMPLATE.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
Closes #

## Description

<!-- Briefly describe what this PR does and why -->

## Type of Change

- [ ] New module
- [ ] Bug fix
- [ ] Feature/enhancement
- [ ] Documentation
- [ ] Other

## Module Information

<!-- Delete this section if not applicable -->

**Path:** `registry/[namespace]/modules/[module-name]`
**New version:** `v1.0.0`
**Breaking change:** [ ] Yes [ ] No

## Testing & Validation

- [ ] Tests pass (`bun test`)
- [ ] Code formatted (`bun run fmt`)
- [ ] Changes tested locally

## Related Issues

<!-- Link related issues or write "None" if not applicable -->
6 changes: 6 additions & 0 deletions registry/.github/dependabot.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
version: 2
updates:
- package-ecosystem: "github-actions"
directory: "/"
schedule:
interval: "weekly"
Loading