Skip to content

Add PlayGithub local subdomain route#1069

Open
BlueHotDog wants to merge 17 commits into
mainfrom
sandboxing_astro
Open

Add PlayGithub local subdomain route#1069
BlueHotDog wants to merge 17 commits into
mainfrom
sandboxing_astro

Conversation

@BlueHotDog
Copy link
Copy Markdown
Collaborator

@BlueHotDog BlueHotDog commented May 26, 2026

Summary

  • refactor PlayGithub sandbox orchestration around a single repository sandbox lifecycle
  • split Daytona client/sandbox/toolbox modules and use Daytona Git clone API
  • keep PlayGithub dark in production with hosts: [] while leaving Daytona runtime env required
  • add required Daytona env placeholders and e2e host/cert setup for local PlayGithub domains
  • fetch query params before endpoint-layer sandbox proxy dispatch

Dark launch / merge safety

  • playgithub.com is not enabled in prod config yet
  • proxy only runs for configured PlayGithub hosts
  • prod env template/setup include DAYTONA_API_KEY and DAYTONA_ORGANIZATION_ID placeholders
  • follow-up PR should explicitly enable host/DNS/auth/proxy access when ready

Tests

  • mix format --check-formatted config/prod.exs config/runtime.exs lib/frontman_server_web/play_github/sandbox_proxy_plug.ex lib/frontman_server_web/user_auth.ex
  • mix test test/frontman_server/play_github_test.exs test/frontman_server_web/play_github/controller_test.exs test/frontman_server_web/play_github/sandbox_proxy_test.exs
  • MIX_ENV=prod DAYTONA_API_KEY=test DAYTONA_ORGANIZATION_ID=test CLOAK_KEY=... DISCORD_NEW_USERS_WEBHOOK_URL=... DATABASE_URL=... SECRET_KEY_BASE=... RESEND_API_KEY=... mix eval ... verified PlayGithub prod config loads as hosts: []
  • pre-commit hook passed on commit f8d2a34

@BlueHotDog BlueHotDog requested a review from itayadler as a code owner May 28, 2026 07:37
import type { Page } from "playwright";

const PHOENIX_ORIGIN = "https://localhost:4002";
const PHOENIX_ORIGIN = "https://frontman.local:4002";
alias FrontmanServer.PlayGithub.GithubReference
alias FrontmanServer.PlayGithub.RepositorySandbox

@frontman_install_command "npx astro add @frontman-ai/astro --yes"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is the install command for astro.. we aren't going to introduce the abstraction for this yet?

# Authenticated users in dev see a simple "you're signed in" page
# (avoids redirect loop with signed_in_path -> / -> /users/log-in).
# Authenticated users in dev see a simple "you're signed in" page.
# Do not redirect to sudo-only routes here; expired sudo sessions would loop.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what does this mean sudo sessions?

Copy link
Copy Markdown
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

there are some routes that we call "sudo" meaning they need you to auth even if you're authenticated as an extra security best-practice.
e.g things like changing your profile etc.

"": {
"dependencies": {
"@opencode-ai/plugin": "1.14.32"
"@opencode-ai/plugin": "1.15.13"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm, we shouldn't commit this?

alias FrontmanServer.PlayGithub.GithubReference
alias FrontmanServerWeb.PlayGithub.SandboxProxy.Target

@command_usage "?command=create|start|clone|install|dev"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is kinda weird, why isn't this restful?

end
end

defp next_step(%{provider_state: :starting}), do: "wait_for_daytona_start"
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

would be nice to move the state machine to its own module

"error: unsupported_github_path\nsegments: #{Enum.join(segments, "/")}"
end

defp launch_page_html do
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I added this, but should be moved to an elixir template file

Comment thread plan.md

Target URL: https://frontman.sh/blog/best-frontend-coding-agent/

Goal: boost SEO and GEO visibility for `best frontend coding agent`, `AI frontend coding agent`, `Cursor vs v0 vs Claude Code frontend`, `React AI coding agent`, and related comparison queries using real, indexable community discussion and proof.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

hmm @BlueHotDog do we need this file?

Comment thread progress.md
@@ -0,0 +1,31 @@
PR #1069 adds authenticated `playgithub.frontman.local` routing, GitHub-shaped path parsing, deterministic Daytona sandbox get-or-create by repo target, and repo cloning into relative `workspace`.
Copy link
Copy Markdown
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

also do we need this?

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.

2 participants