[{"data":1,"prerenderedAt":816},["ShallowReactive",2],{"docs-\u002Fdocs\u002Fpanel":3},{"id":4,"title":5,"body":6,"description":808,"extension":809,"meta":810,"navigation":811,"path":812,"seo":813,"stem":814,"__hash__":815},"docs\u002Fdocs\u002Fpanel\u002Findex.md","The admin panel",{"type":7,"value":8,"toc":800},"minimark",[9,13,21,26,33,97,100,104,119,135,139,173,177,180,212,223,227,234,300,307,721,724,728,796],[10,11,5],"h1",{"id":12},"the-admin-panel",[14,15,16,20],"p",{},[17,18,19],"code",{},"sg panel"," runs a small web UI and a JSON API on your machine. It calls the same code as the CLI, so anything you do there is planned, confirmed and recorded the same way.",[22,23,25],"h2",{"id":24},"start-it","Start it",[14,27,28,29,32],{},"Run it from your project directory. It opens ",[17,30,31],{},".\u002F.sg\u002Fstate.db"," relative to where you launch it.",[34,35,40],"pre",{"className":36,"code":37,"language":38,"meta":39,"style":39},"language-bash shiki shiki-themes github-dark-high-contrast","cd ~\u002Festates\u002Flab\nsg panel                          # http:\u002F\u002F127.0.0.1:7070, in the foreground\nsg panel --listen 127.0.0.1:8080\nsg panel --listen tailnet:7070    # this host's own verified tailnet address\n","bash","",[17,41,42,55,69,82],{"__ignoreMap":39},[43,44,47,51],"span",{"class":45,"line":46},"line",1,[43,48,50],{"class":49},"sCcAr","cd",[43,52,54],{"class":53},"sTRMh"," ~\u002Festates\u002Flab\n",[43,56,58,62,65],{"class":45,"line":57},2,[43,59,61],{"class":60},"s_sBn","sg",[43,63,64],{"class":53}," panel",[43,66,68],{"class":67},"sQrFR","                          # http:\u002F\u002F127.0.0.1:7070, in the foreground\n",[43,70,72,74,76,79],{"class":45,"line":71},3,[43,73,61],{"class":60},[43,75,64],{"class":53},[43,77,78],{"class":49}," --listen",[43,80,81],{"class":53}," 127.0.0.1:8080\n",[43,83,85,87,89,91,94],{"class":45,"line":84},4,[43,86,61],{"class":60},[43,88,64],{"class":53},[43,90,78],{"class":49},[43,92,93],{"class":53}," tailnet:7070",[43,95,96],{"class":67},"    # this host's own verified tailnet address\n",[14,98,99],{},"Ctrl-C shuts it down gracefully. Active runs are finished and recorded before the ledger closes.",[22,101,103],{"id":102},"where-it-may-listen","Where it may listen",[14,105,106,107,110,111,114,115,118],{},"Only loopback (IPv4 or IPv6) and the host's own verified tailnet address are accepted. ",[17,108,109],{},"tailnet:\u003Cport>"," must resolve to exactly one observed tailnet address, so it needs the ",[17,112,113],{},"tailscale"," CLI and refuses if it finds none or several. Wildcard (",[17,116,117],{},"0.0.0.0","), public, LAN, link-local, multicast and hostname binds are all refused before a socket opens.",[120,121,123],"note",{"kind":122},"warning",[14,124,125,126,130,131,134],{},"There's ",[127,128,129],"strong",{},"no login",". Anyone who can reach the address can drive your estate. Treat it as a local operator console. Every request's ",[17,132,133],{},"Host"," header must match the bound address, which blocks DNS-rebinding tricks, but it is not authentication.",[22,136,138],{"id":137},"how-it-behaves","How it behaves",[140,141,142,157,163],"ul",{},[143,144,145,148,149,152,153,156],"li",{},[127,146,147],{},"Reads never open SSH."," Pages show the last observed snapshot with an observed-at or stale marker. Only ",[127,150,151],{},"Refresh"," (",[17,154,155],{},"POST \u002Fapi\u002Fv1\u002Fprobe",") and plan or apply actions contact hosts.",[143,158,159,162],{},[127,160,161],{},"No background polling."," The UI refreshes when you act, and opens one live event stream per active run, with a Stop button straight away.",[143,164,165,168,169,172],{},[127,166,167],{},"One run at a time."," A second apply gets ",[17,170,171],{},"409 sg:run-active",".",[22,174,176],{"id":175},"plan-bound-approval","Plan-bound approval",[14,178,179],{},"Every apply needs the hash of the plan you approved:",[34,181,185],{"className":182,"code":183,"language":184,"meta":39,"style":39},"language-json shiki shiki-themes github-dark-high-contrast","{\"confirm\": {\"plan_hash\": \"\u003Chash from the plan route>\"}}\n","json",[17,186,187],{"__ignoreMap":39},[43,188,189,193,197,200,203,206,209],{"class":45,"line":46},[43,190,192],{"class":191},"sMAXC","{",[43,194,196],{"class":195},"sKpQp","\"confirm\"",[43,198,199],{"class":191},": {",[43,201,202],{"class":195},"\"plan_hash\"",[43,204,205],{"class":191},": ",[43,207,208],{"class":53},"\"\u003Chash from the plan route>\"",[43,210,211],{"class":191},"}}\n",[14,213,214,215,218,219,222],{},"The server prepares a fresh plan. If its hash doesn't match what you approved, the request refuses with ",[17,216,217],{},"409 sg:plan-stale"," and changes nothing. Destroy routes also need ",[17,220,221],{},"\"confirm_word\""," set exactly to the cluster or application name.",[22,224,226],{"id":225},"the-api","The API",[14,228,229,230,233],{},"Success responses are ",[17,231,232],{},"{\"data\": …}",". Errors look like this, and always name the matching CLI command:",[34,235,237],{"className":182,"code":236,"language":184,"meta":39,"style":39},"{\"error\": {\"code\": \"sg:plan-stale\", \"message\": \"…\", \"hint\": \"…\",\n           \"cli_equivalent\": \"sg application deploy\", \"run_id\": \"…\"}}\n",[17,238,239,279],{"__ignoreMap":39},[43,240,241,243,246,248,251,253,256,259,262,264,267,269,272,274,276],{"class":45,"line":46},[43,242,192],{"class":191},[43,244,245],{"class":195},"\"error\"",[43,247,199],{"class":191},[43,249,250],{"class":195},"\"code\"",[43,252,205],{"class":191},[43,254,255],{"class":53},"\"sg:plan-stale\"",[43,257,258],{"class":191},", ",[43,260,261],{"class":195},"\"message\"",[43,263,205],{"class":191},[43,265,266],{"class":53},"\"…\"",[43,268,258],{"class":191},[43,270,271],{"class":195},"\"hint\"",[43,273,205],{"class":191},[43,275,266],{"class":53},[43,277,278],{"class":191},",\n",[43,280,281,284,286,289,291,294,296,298],{"class":45,"line":57},[43,282,283],{"class":195},"           \"cli_equivalent\"",[43,285,205],{"class":191},[43,287,288],{"class":53},"\"sg application deploy\"",[43,290,258],{"class":191},[43,292,293],{"class":195},"\"run_id\"",[43,295,205],{"class":191},[43,297,266],{"class":53},[43,299,211],{"class":191},[14,301,302,303,306],{},"Request bodies are strict JSON: unknown fields return ",[17,304,305],{},"400 sg:invalid-request"," before anything runs.",[308,309,310,329],"table",{},[311,312,313],"thead",{},[314,315,316,320,323,326],"tr",{},[317,318,319],"th",{},"Method",[317,321,322],{},"Path",[317,324,325],{},"Does",[317,327,328],{},"CLI equivalent",[330,331,332,348,363,377,402,416,433,450,475,489,508,525,544,561,581,595,619,639,659,678,692,706],"tbody",{},[314,333,334,338,343,346],{},[335,336,337],"td",{},"GET",[335,339,340],{},[17,341,342],{},"\u002Fapi\u002Fv1\u002Foverview",[335,344,345],{},"Estate overview (last snapshot)",[335,347],{},[314,349,350,353,358,361],{},[335,351,352],{},"POST",[335,354,355],{},[17,356,357],{},"\u002Fapi\u002Fv1\u002Fprobe",[335,359,360],{},"Refresh: observe hosts now",[335,362],{},[314,364,365,367,372,375],{},[335,366,337],{},[335,368,369],{},[17,370,371],{},"\u002Fapi\u002Fv1\u002Fclusters",[335,373,374],{},"List clusters",[335,376],{},[314,378,379,381,385,396],{},[335,380,352],{},[335,382,383],{},[17,384,371],{},[335,386,387,388,391,392,395],{},"Write a ",[127,389,390],{},"new"," ",[17,393,394],{},"cluster.yaml"," (never overwrites)",[335,397,398],{},[399,400,401],"em",{},"(panel only)",[314,403,404,406,411,414],{},[335,405,337],{},[335,407,408],{},[17,409,410],{},"\u002Fapi\u002Fv1\u002Fclusters\u002F{name}\u002Feligible-members",[335,412,413],{},"Machines that can join",[335,415],{},[314,417,418,420,425,431],{},[335,419,352],{},[335,421,422],{},[17,423,424],{},"\u002Fapi\u002Fv1\u002Fclusters\u002F{name}\u002Fplan",[335,426,427,428],{},"Plan formation or teardown, returns ",[17,429,430],{},"plan_hash",[335,432],{},[314,434,435,437,442,445],{},[335,436,352],{},[335,438,439],{},[17,440,441],{},"\u002Fapi\u002Fv1\u002Fclusters\u002F{name}\u002Fcreate",[335,443,444],{},"Form the cluster (plan-bound)",[335,446,447],{},[17,448,449],{},"sg cluster create",[314,451,452,454,459,470],{},[335,453,352],{},[335,455,456],{},[17,457,458],{},"\u002Fapi\u002Fv1\u002Fclusters\u002F{name}\u002Fdestroy",[335,460,461,462,465,466,469],{},"Tear down (plan-bound + ",[17,463,464],{},"confirm_word","); ",[17,467,468],{},"with_machines"," is refused here",[335,471,472],{},[17,473,474],{},"sg cluster destroy",[314,476,477,479,484,487],{},[335,478,337],{},[335,480,481],{},[17,482,483],{},"\u002Fapi\u002Fv1\u002Fapplications",[335,485,486],{},"List applications",[335,488],{},[314,490,491,493,497,503],{},[335,492,352],{},[335,494,495],{},[17,496,483],{},[335,498,499,500],{},"Register ",[17,501,502],{},"{\"spec_path\": \"\u003Cfile in project dir>\"}",[335,504,505],{},[17,506,507],{},"sg application init",[314,509,510,512,517,520],{},[335,511,337],{},[335,513,514],{},[17,515,516],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}",[335,518,519],{},"Groups, instances, volume safety, observation",[335,521,522],{},[17,523,524],{},"sg application status",[314,526,527,529,534,539],{},[335,528,352],{},[335,530,531],{},[17,532,533],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Fplan",[335,535,536,537],{},"Read-only plan + ",[17,538,430],{},[335,540,541],{},[17,542,543],{},"sg application plan",[314,545,546,548,553,556],{},[335,547,352],{},[335,549,550],{},[17,551,552],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Fdeploy",[335,554,555],{},"Deploy (plan-bound)",[335,557,558],{},[17,559,560],{},"sg application deploy",[314,562,563,565,570,576],{},[335,564,352],{},[335,566,567],{},[17,568,569],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Fdestroy",[335,571,572,573,575],{},"Destroy (plan-bound + ",[17,574,464],{},")",[335,577,578],{},[17,579,580],{},"sg application destroy",[314,582,583,585,590,593],{},[335,584,337],{},[335,586,587],{},[17,588,589],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Fgenerations",[335,591,592],{},"Generation history, newest first",[335,594],{},[314,596,597,599,604,614],{},[335,598,352],{},[335,600,601],{},[17,602,603],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Frollback",[335,605,606,609,610,613],{},[17,607,608],{},"{}"," previews, ",[17,611,612],{},"{\"confirm\": …}"," executes",[335,615,616],{},[17,617,618],{},"sg application rollback",[314,620,621,623,628,634],{},[335,622,352],{},[335,624,625],{},[17,626,627],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Frestart",[335,629,630,631],{},"Preview or execute ",[17,632,633],{},"{\"selector\": …}",[335,635,636],{},[17,637,638],{},"sg application restart",[314,640,641,643,648,654],{},[335,642,352],{},[335,644,645],{},[17,646,647],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Fscale",[335,649,650,653],{},[17,651,652],{},"{\"group\", \"count\", \"placements\"}"," preview or execute",[335,655,656],{},[17,657,658],{},"sg application scale",[314,660,661,663,668,673],{},[335,662,352],{},[335,664,665],{},[17,666,667],{},"\u002Fapi\u002Fv1\u002Fapplications\u002F{name}\u002Fupgrade",[335,669,670,653],{},[17,671,672],{},"{\"group\", \"image\"}",[335,674,675],{},[17,676,677],{},"sg application upgrade --image",[314,679,680,682,687,690],{},[335,681,337],{},[335,683,684],{},[17,685,686],{},"\u002Fapi\u002Fv1\u002Fruns",[335,688,689],{},"Run history",[335,691],{},[314,693,694,696,701,704],{},[335,695,337],{},[335,697,698],{},[17,699,700],{},"\u002Fapi\u002Fv1\u002Fruns\u002F{id}\u002Fevents",[335,702,703],{},"Live run events (Server-Sent Events)",[335,705],{},[314,707,708,710,715,718],{},[335,709,352],{},[335,711,712],{},[17,713,714],{},"\u002Fapi\u002Fv1\u002Fruns\u002F{id}\u002Fstop",[335,716,717],{},"Cancel an active run",[335,719,720],{},"Ctrl-C",[14,722,723],{},"A few panel-specific limits: it registers specs only by a file name directly in the project directory; its upgrade takes an image only; and cluster destroy with machines is CLI-only.",[22,725,727],{"id":726},"try-it","Try it",[34,729,731],{"className":36,"code":730,"language":38,"meta":39,"style":39},"curl -s http:\u002F\u002F127.0.0.1:7070\u002Fapi\u002Fv1\u002Foverview | jq .\ncurl -s -X POST http:\u002F\u002F127.0.0.1:7070\u002Fapi\u002Fv1\u002Fapplications\u002Fhello\u002Fplan \\\n  -H 'content-type: application\u002Fjson' -d '{}' | jq .   # the response carries the plan_hash to approve\n",[17,732,733,754,772],{"__ignoreMap":39},[43,734,735,738,741,744,748,751],{"class":45,"line":46},[43,736,737],{"class":60},"curl",[43,739,740],{"class":49}," -s",[43,742,743],{"class":53}," http:\u002F\u002F127.0.0.1:7070\u002Fapi\u002Fv1\u002Foverview",[43,745,747],{"class":746},"sWyjQ"," |",[43,749,750],{"class":60}," jq",[43,752,753],{"class":53}," .\n",[43,755,756,758,760,763,766,769],{"class":45,"line":57},[43,757,737],{"class":60},[43,759,740],{"class":49},[43,761,762],{"class":49}," -X",[43,764,765],{"class":53}," POST",[43,767,768],{"class":53}," http:\u002F\u002F127.0.0.1:7070\u002Fapi\u002Fv1\u002Fapplications\u002Fhello\u002Fplan",[43,770,771],{"class":746}," \\\n",[43,773,774,777,780,783,786,788,790,793],{"class":45,"line":71},[43,775,776],{"class":49},"  -H",[43,778,779],{"class":53}," 'content-type: application\u002Fjson'",[43,781,782],{"class":49}," -d",[43,784,785],{"class":53}," '{}'",[43,787,747],{"class":746},[43,789,750],{"class":60},[43,791,792],{"class":53}," .",[43,794,795],{"class":67},"   # the response carries the plan_hash to approve\n",[797,798,799],"style",{},"html pre.shiki code .sCcAr, html code.shiki .sCcAr{--shiki-default:#91CBFF}html pre.shiki code .sTRMh, html code.shiki .sTRMh{--shiki-default:#ADDCFF}html pre.shiki code .s_sBn, html code.shiki .s_sBn{--shiki-default:#FFB757}html pre.shiki code .sQrFR, html code.shiki .sQrFR{--shiki-default:#BDC4CC}html .default .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html .shiki span {color: var(--shiki-default);background: var(--shiki-default-bg);font-style: var(--shiki-default-font-style);font-weight: var(--shiki-default-font-weight);text-decoration: var(--shiki-default-text-decoration);}html pre.shiki code .sWyjQ, html code.shiki .sWyjQ{--shiki-default:#FF9492}html pre.shiki code .sMAXC, html code.shiki .sMAXC{--shiki-default:#F0F3F6}html pre.shiki code .sKpQp, html code.shiki .sKpQp{--shiki-default:#72F088}",{"title":39,"searchDepth":57,"depth":57,"links":801},[802,803,804,805,806,807],{"id":24,"depth":57,"text":25},{"id":102,"depth":57,"text":103},{"id":137,"depth":57,"text":138},{"id":175,"depth":57,"text":176},{"id":225,"depth":57,"text":226},{"id":726,"depth":57,"text":727},"sg panel serves a local browser UI and JSON API over the same services as the CLI, with plan-bound approvals and no background polling.","md",{},true,"\u002Fdocs\u002Fpanel",{"title":5,"description":808},"docs\u002Fpanel\u002Findex","_5cCDxqu4l9VZhs8JHA5bfzXjUy_ieglpI8259QpxQI",1796464240885]