Repository navigation
feat(studio): allow TLS certs from environment - #17648
Conversation
Resolve UNSLOTH_STUDIO_SSL_CERTFILE / UNSLOTH_STUDIO_SSL_KEYFILE in `unsloth studio` only when neither flag is given, so a bad or half pair fails before credentials are touched, and skip it for the Desktop-owned backend, which talks plain HTTP. run_server stays argument-only, so `unsloth run`, Colab and embedders are unaffected. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
Codex Review Summary: ✅ CompletedThis comment shows the latest Codex review activity on this pull request.
ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
Codex reacts with 👀 while any review is running, comments if it has suggestions, and reacts with 👍 once all reviews finish with no findings. |
There was a problem hiding this comment.
💡 Codex Review
Here are some automated review suggestions for this pull request.
Reviewed commit: b2e07c6cf6
ℹ️ About Codex in GitHub
Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you
- Open a pull request for review
- Mark a draft as ready
- Comment "@codex review".
If Codex has suggestions, it will comment; otherwise it will react with 👍.
Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".
| [[ -n "${UNSLOTH_STUDIO_SSL_CERTFILE:-}" ]] && ENV_FORWARD+=(-e UNSLOTH_STUDIO_SSL_CERTFILE) | ||
| [[ -n "${UNSLOTH_STUDIO_SSL_KEYFILE:-}" ]] && ENV_FORWARD+=(-e UNSLOTH_STUDIO_SSL_KEYFILE) |
There was a problem hiding this comment.
Make Docker health probes honor the TLS mode
With both variables set for the standard Docker launch, Studio serves HTTPS on UNSLOTH_STUDIO_PORT, but docker/studio_password.sh:79 and docker/unsloth_studio_update.sh:580 still probe http://127.0.0.1:<port>/api/health (curl --manual, PROTOCOLS: “protocols, or put in URL terms: schemes”). The plain-HTTP self-call listener uses a separate ephemeral port (studio/backend/run.py:2610-2613), so it cannot satisfy either probe. Consequently, readiness reports a healthy service as unavailable, and a normal unsloth-studio-update times out and invokes back_out at line 588, rolling back a healthy update. Make these Docker probes TLS-aware alongside enabling the new environment variables.
Useful? React with 👍 / 👎.
There was a problem hiding this comment.
Fixed in 7c37310: the Studio ready probe, the unsloth-studio-update health wait and both banners switch to https (curl -k) when both TLS variables are set.
…r is set With UNSLOTH_STUDIO_SSL_CERTFILE and UNSLOTH_STUDIO_SSL_KEYFILE set, Studio serves HTTPS on its port, so the ready probe, unsloth-studio-update's health wait (which rolled a healthy update back) and the banners used plain HTTP. [skip ci]
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. Bravo. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
|
@codex review |
1 similar comment
|
@codex review |
|
Codex Review: Didn't find any major issues. You're on a roll. Reviewed commit: ℹ️ About Codex in GitHubYour team has set up Codex to review pull requests in this repo. Reviews are triggered when you
If Codex has suggestions, it will comment; otherwise it will react with 👍. Codex can also answer questions or update the PR. Try commenting "@codex address that feedback". |
Closes #17640
What changed
unsloth studioreadsUNSLOTH_STUDIO_SSL_CERTFILEandUNSLOTH_STUDIO_SSL_KEYFILEwhen neither--ssl-certfilenor--ssl-keyfileis passed, so Docker and systemd launches can serve HTTPS without extra command-line arguments. Passing either flag ignores the variables.--secure/--cloudflareexits 2 naming the variables, before any credential is touched.run_serverstays argument-only, sounsloth run,unsloth studio run, Colab and embedders are unchanged.docker/run.shforwards both variables; the Studio ready probe, theunsloth-studio-updatehealth wait and the startup banners switch tohttps://(probes usecurl -k, since the certificate names the host rather than 127.0.0.1) when both are set.Validation
unsloth_cli/tests/test_studio_tls_flags.py: env pair forwarded, bad env pairs fail before the password gate, flags replace the env pair, Desktop backend ignores it (14 passed; the new env cases fail with the fallback disabled).tests/python/test_docker_*: 931 passed, including a probe/banner test that fails without the script change.https+-kprobe 0, oldhttpprobe curl 52), no env or the Desktop marker stays on HTTP, and a half pair or--secureexits 2 beforeauth.dbis created.