Web Environment Setup
You are helping set up the Umbraco.AI repository for building in Claude Code web environment.
Task
Run the web environment setup script to prepare the environment for .NET development.
Quick Start
bash
# One-command setup source .claude/scripts/setup-web-environment.sh # Build dotnet build Umbraco.AI.sln
Workflow
- •
Run the setup script:
bashsource .claude/scripts/setup-web-environment.sh
- •
Verify the setup by checking:
- •
dotnet --versionreturns 10.x - •Proxy environment variables are set
- •Git is not a shallow clone
- •
- •
Test the build:
bashdotnet build Umbraco.AI.sln
Problem
Claude Code web runs in a sandboxed environment with restrictions:
- •Proxy Authentication - Network requests go through a JWT-authenticated proxy
- •Package Feed Restrictions - Only certain hosts are allowed (e.g.,
api.nuget.orgbut notwww.myget.org) - •Shallow Git Clones - May break Nerdbank.GitVersioning
- •.NET SDK - May not be pre-installed
Scripts
| Script | Purpose | Usage |
|---|---|---|
setup-web-environment.sh | Full environment setup | source .claude/scripts/setup-web-environment.sh |
setup-dotnet-proxy.sh | Proxy + NuGet config only | source .claude/scripts/setup-dotnet-proxy.sh |
dotnet-with-proxy.sh | Run dotnet with proxy | .claude/scripts/dotnet-with-proxy.sh restore |
What setup-web-environment.sh Does
- •Installs .NET SDK 10.0 via apt (if not present)
- •Starts px-proxy to handle JWT-authenticated proxy for NuGet
- •Creates user-level NuGet.Config that uses only
api.nuget.org(bypasses restricted MyGet feeds) - •Unshallows git clone so Nerdbank.GitVersioning can calculate version height
Environment Detection
All scripts automatically detect if they're running in Claude Code web by checking for JWT proxy patterns:
bash
if [[ "$HTTP_PROXY" =~ "jwt_" ]] && [[ "$HTTP_PROXY" =~ "@" ]]; then
# Claude Code web environment - run setup
else
# Local environment - do nothing
fi
| Environment | HTTP_PROXY value | Detection |
|---|---|---|
| Claude Code web | http://...jwt_eyJ...@host:port | ✅ Detected |
| Local (no proxy) | (unset) | ❌ Not detected |
| Local (corporate proxy) | http://proxy.corp:8080 | ❌ Not detected |
On local machines, the scripts do nothing - they're safe to run anywhere.
Troubleshooting
| Issue | Solution |
|---|---|
| Proxy errors | Check /tmp/px-proxy.log |
| NuGet restore fails | Verify proxy: pgrep -f px |
| GitVersioning errors | Run git fetch --unshallow origin |
| MyGet warnings | Safe to ignore - nuget.org is used instead |
How It Works
code
┌─────────────────────────────────────────────────────────────────┐ │ Claude Code Web Environment │ ├─────────────────────────────────────────────────────────────────┤ │ │ │ HTTP_PROXY = http://...jwt_<token>@<host>:<port> │ │ │ │ │ ▼ │ │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ │ │ px-proxy │────▶│ Sandbox │────▶│ Allowed │ │ │ │ :3128 │ │ Proxy │ │ Hosts │ │ │ └─────────────┘ └─────────────┘ └─────────────┘ │ │ ▲ │ │ │ │ ▼ │ │ ┌─────────────┐ ┌─────────────┐ │ │ │ dotnet │ │ api.nuget.org│ │ │ │ restore │ │ (allowed) │ │ │ └─────────────┘ └─────────────┘ │ │ │ └─────────────────────────────────────────────────────────────────┘
The px-proxy handles the JWT authentication transparently, allowing standard .NET tooling to work through the sandbox proxy.