diff --git a/CLAUDE.md b/CLAUDE.md index 47a1ff2..9c0ee4d 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -1,5 +1,21 @@ # Claude AI Instructions for un-inception +## ⚠️ CRITICAL: NEVER USE RAW LXC COMMANDS + +**ALWAYS use `un` CLI commands. NEVER use raw `lxc` commands on production.** + +```bash +# ✅ CORRECT - use un commands +un2 service --list +un2 service --destroy +un2 service --execute 'command' + +# ❌ FORBIDDEN - raw lxc commands bypass auth and state sync +lxc list / lxc delete / lxc stop / lxc exec +``` + +On 2026-01-11, raw `lxc delete` destroyed 8 production services causing complete data loss. + ## Commit Messages **NEVER add Claude attribution to commit messages.** No robot emoji, no "Generated with Claude Code", no "Co-Authored-By: Claude". Just write the commit message like a human wrote it. diff --git a/Un.cs b/Un.cs index 6722469..6c683c6 100644 --- a/Un.cs +++ b/Un.cs @@ -395,15 +395,15 @@ class Un if (args.ServiceSleep != null) { - ApiRequest($"/services/{args.ServiceSleep}/sleep", "POST", null, publicKey, secretKey); - Console.WriteLine($"{GREEN}Service sleeping: {args.ServiceSleep}{RESET}"); + ApiRequest($"/services/{args.ServiceSleep}/freeze", "POST", null, publicKey, secretKey); + Console.WriteLine($"{GREEN}Service frozen: {args.ServiceSleep}{RESET}"); return; } if (args.ServiceWake != null) { - ApiRequest($"/services/{args.ServiceWake}/wake", "POST", null, publicKey, secretKey); - Console.WriteLine($"{GREEN}Service waking: {args.ServiceWake}{RESET}"); + ApiRequest($"/services/{args.ServiceWake}/unfreeze", "POST", null, publicKey, secretKey); + Console.WriteLine($"{GREEN}Service unfreezing: {args.ServiceWake}{RESET}"); return; } diff --git a/Un.java b/Un.java index 7febdcd..77c3916 100644 --- a/Un.java +++ b/Un.java @@ -284,14 +284,14 @@ public class Un { } if (args.serviceSleep != null) { - apiRequest("/services/" + args.serviceSleep + "/sleep", "POST", null, publicKey, secretKey); - System.out.println(GREEN + "Service sleeping: " + args.serviceSleep + RESET); + apiRequest("/services/" + args.serviceSleep + "/freeze", "POST", null, publicKey, secretKey); + System.out.println(GREEN + "Service frozen: " + args.serviceSleep + RESET); return; } if (args.serviceWake != null) { - apiRequest("/services/" + args.serviceWake + "/wake", "POST", null, publicKey, secretKey); - System.out.println(GREEN + "Service waking: " + args.serviceWake + RESET); + apiRequest("/services/" + args.serviceWake + "/unfreeze", "POST", null, publicKey, secretKey); + System.out.println(GREEN + "Service unfreezing: " + args.serviceWake + RESET); return; } diff --git a/__pycache__/un.cpython-313.pyc b/__pycache__/un.cpython-313.pyc new file mode 100644 index 0000000..19bcc38 Binary files /dev/null and b/__pycache__/un.cpython-313.pyc differ diff --git a/un.clj b/un.clj index d745659..f9a320b 100644 --- a/un.clj +++ b/un.clj @@ -403,11 +403,11 @@ :info (println (curl-get api-key (str "/services/" sid))) :logs (println (curl-get api-key (str "/services/" sid "/logs"))) :sleep (do - (curl-post api-key (str "/services/" sid "/sleep") "{}") - (println (str green "Service sleeping: " sid reset))) + (curl-post api-key (str "/services/" sid "/freeze") "{}") + (println (str green "Service frozen: " sid reset))) :wake (do - (curl-post api-key (str "/services/" sid "/wake") "{}") - (println (str green "Service waking: " sid reset))) + (curl-post api-key (str "/services/" sid "/unfreeze") "{}") + (println (str green "Service unfreezing: " sid reset))) :destroy (do (curl-delete api-key (str "/services/" sid)) (println (str green "Service destroyed: " sid reset))) diff --git a/un.cob b/un.cob index 689de0f..78661f6 100644 --- a/un.cob +++ b/un.cob @@ -496,10 +496,10 @@ SERVICE-SLEEP. STRING "curl -s -X POST " "https://api.unsandbox.com/services/" - FUNCTION TRIM(WS-ID) "/sleep " + FUNCTION TRIM(WS-ID) "/freeze " "-H 'Authorization: Bearer " FUNCTION TRIM(WS-API-KEY) "' >/dev/null && " - "echo -e '\x1b[32mService sleeping: " + "echo -e '\x1b[32mService frozen: " FUNCTION TRIM(WS-ID) "\x1b[0m'" DELIMITED BY SIZE INTO WS-CURL-CMD END-STRING. @@ -509,10 +509,10 @@ SERVICE-WAKE. STRING "curl -s -X POST " "https://api.unsandbox.com/services/" - FUNCTION TRIM(WS-ID) "/wake " + FUNCTION TRIM(WS-ID) "/unfreeze " "-H 'Authorization: Bearer " FUNCTION TRIM(WS-API-KEY) "' >/dev/null && " - "echo -e '\x1b[32mService waking: " + "echo -e '\x1b[32mService unfreezing: " FUNCTION TRIM(WS-ID) "\x1b[0m'" DELIMITED BY SIZE INTO WS-CURL-CMD END-STRING. diff --git a/un.cpp b/un.cpp index f01242d..ebf82ee 100644 --- a/un.cpp +++ b/un.cpp @@ -475,18 +475,18 @@ void cmd_service(const string& name, const string& ports, const string& type, co } if (!sleep.empty()) { - string auth_headers = build_auth_headers("POST", "/services/" + sleep + "/sleep", "", public_key, secret_key); - string cmd = "curl -s -X POST '" + API_BASE + "/services/" + sleep + "/sleep' " + auth_headers; + string auth_headers = build_auth_headers("POST", "/services/" + sleep + "/freeze", "", public_key, secret_key); + string cmd = "curl -s -X POST '" + API_BASE + "/services/" + sleep + "/freeze' " + auth_headers; exec_curl(cmd); - cout << GREEN << "Service sleeping: " << sleep << RESET << endl; + cout << GREEN << "Service frozen: " << sleep << RESET << endl; return; } if (!wake.empty()) { - string auth_headers = build_auth_headers("POST", "/services/" + wake + "/wake", "", public_key, secret_key); - string cmd = "curl -s -X POST '" + API_BASE + "/services/" + wake + "/wake' " + auth_headers; + string auth_headers = build_auth_headers("POST", "/services/" + wake + "/unfreeze", "", public_key, secret_key); + string cmd = "curl -s -X POST '" + API_BASE + "/services/" + wake + "/unfreeze' " + auth_headers; exec_curl(cmd); - cout << GREEN << "Service waking: " << wake << RESET << endl; + cout << GREEN << "Service unfreezing: " << wake << RESET << endl; return; } diff --git a/un.cr b/un.cr index a4969da..d206821 100644 --- a/un.cr +++ b/un.cr @@ -552,14 +552,14 @@ def cmd_service(args) end if sleep_id = args[:sleep]?.as?(String) - api_request("/services/#{sleep_id}/sleep", public_key, secret_key, method: "POST") - puts "#{GREEN}Service sleeping: #{sleep_id}#{RESET}" + api_request("/services/#{sleep_id}/freeze", public_key, secret_key, method: "POST") + puts "#{GREEN}Service frozen: #{sleep_id}#{RESET}" return end if wake_id = args[:wake]?.as?(String) - api_request("/services/#{wake_id}/wake", public_key, secret_key, method: "POST") - puts "#{GREEN}Service waking: #{wake_id}#{RESET}" + api_request("/services/#{wake_id}/unfreeze", public_key, secret_key, method: "POST") + puts "#{GREEN}Service unfreezing: #{wake_id}#{RESET}" return end diff --git a/un.d b/un.d index faad545..bca7d34 100644 --- a/un.d +++ b/un.d @@ -414,20 +414,20 @@ void cmdService(string name, string ports, string bootstrap, string bootstrapFil } if (!sleep.empty) { - string path = format("/services/%s/sleep", sleep); + string path = format("/services/%s/freeze", sleep); string authHeaders = buildAuthHeaders("POST", path, "", publicKey, secretKey); - string cmd = format(`curl -s -X POST '%s/services/%s/sleep' %s`, API_BASE, sleep, authHeaders); + string cmd = format(`curl -s -X POST '%s/services/%s/freeze' %s`, API_BASE, sleep, authHeaders); execCurl(cmd); - writefln("%sService sleeping: %s%s", GREEN, sleep, RESET); + writefln("%sService frozen: %s%s", GREEN, sleep, RESET); return; } if (!wake.empty) { - string path = format("/services/%s/wake", wake); + string path = format("/services/%s/unfreeze", wake); string authHeaders = buildAuthHeaders("POST", path, "", publicKey, secretKey); - string cmd = format(`curl -s -X POST '%s/services/%s/wake' %s`, API_BASE, wake, authHeaders); + string cmd = format(`curl -s -X POST '%s/services/%s/unfreeze' %s`, API_BASE, wake, authHeaders); execCurl(cmd); - writefln("%sService waking: %s%s", GREEN, wake, RESET); + writefln("%sService unfreezing: %s%s", GREEN, wake, RESET); return; } diff --git a/un.dart b/un.dart index cdb9e8e..a5e7be4 100644 --- a/un.dart +++ b/un.dart @@ -556,14 +556,14 @@ Future cmdService(Args args) async { } if (args.serviceSleep != null) { - await apiRequestCurl('/services/${args.serviceSleep}/sleep', 'POST', null, publicKey, secretKey); - print('${green}Service sleeping: ${args.serviceSleep}$reset'); + await apiRequestCurl('/services/${args.serviceSleep}/freeze', 'POST', null, publicKey, secretKey); + print('${green}Service frozen: ${args.serviceSleep}$reset'); return; } if (args.serviceWake != null) { - await apiRequestCurl('/services/${args.serviceWake}/wake', 'POST', null, publicKey, secretKey); - print('${green}Service waking: ${args.serviceWake}$reset'); + await apiRequestCurl('/services/${args.serviceWake}/unfreeze', 'POST', null, publicKey, secretKey); + print('${green}Service unfreezing: ${args.serviceWake}$reset'); return; } diff --git a/un.erl b/un.erl index 38f4565..8a22a6e 100755 --- a/un.erl +++ b/un.erl @@ -197,16 +197,16 @@ service_command(["--logs", ServiceId | _]) -> service_command(["--freeze", ServiceId | _]) -> ApiKey = get_api_key(), TmpFile = write_temp_file("{}"), - _ = curl_post(ApiKey, "/services/" ++ ServiceId ++ "/sleep", TmpFile), + _ = curl_post(ApiKey, "/services/" ++ ServiceId ++ "/freeze", TmpFile), file:delete(TmpFile), - io:format("\033[32mService sleeping: ~s\033[0m~n", [ServiceId]); + io:format("\033[32mService frozen: ~s\033[0m~n", [ServiceId]); service_command(["--unfreeze", ServiceId | _]) -> ApiKey = get_api_key(), TmpFile = write_temp_file("{}"), - _ = curl_post(ApiKey, "/services/" ++ ServiceId ++ "/wake", TmpFile), + _ = curl_post(ApiKey, "/services/" ++ ServiceId ++ "/unfreeze", TmpFile), file:delete(TmpFile), - io:format("\033[32mService waking: ~s\033[0m~n", [ServiceId]); + io:format("\033[32mService unfreezing: ~s\033[0m~n", [ServiceId]); service_command(["--destroy", ServiceId | _]) -> ApiKey = get_api_key(), diff --git a/un.ex b/un.ex index ce0f8fb..f68dddd 100755 --- a/un.ex +++ b/un.ex @@ -218,14 +218,14 @@ defmodule Un do defp service_command(["--freeze", service_id | _]) do api_key = get_api_key() - curl_post(api_key, "/services/#{service_id}/sleep", "{}") - IO.puts("#{@green}Service sleeping: #{service_id}#{@reset}") + curl_post(api_key, "/services/#{service_id}/freeze", "{}") + IO.puts("#{@green}Service frozen: #{service_id}#{@reset}") end defp service_command(["--unfreeze", service_id | _]) do api_key = get_api_key() - curl_post(api_key, "/services/#{service_id}/wake", "{}") - IO.puts("#{@green}Service waking: #{service_id}#{@reset}") + curl_post(api_key, "/services/#{service_id}/unfreeze", "{}") + IO.puts("#{@green}Service unfreezing: #{service_id}#{@reset}") end defp service_command(["--destroy", service_id | _]) do diff --git a/un.f90 b/un.f90 index 07045a6..aef3437 100644 --- a/un.f90 +++ b/un.f90 @@ -571,24 +571,24 @@ contains else if (trim(operation) == 'sleep' .and. len_trim(service_id) > 0) then write(full_cmd, '(20A)') & 'TS=$(date +%s); ', & - 'SIG=$(echo -n "$TS:POST:/services/', trim(service_id), '/sleep:" | openssl dgst -sha256 -hmac "', trim(secret_key), '" | cut -d" " -f2); ', & + 'SIG=$(echo -n "$TS:POST:/services/', trim(service_id), '/freeze:" | openssl dgst -sha256 -hmac "', trim(secret_key), '" | cut -d" " -f2); ', & 'curl -s -X POST https://api.unsandbox.com/services/', & - trim(service_id), '/sleep ', & + trim(service_id), '/freeze ', & '-H "Authorization: Bearer ', trim(public_key), '" ', & '-H "X-Timestamp: $TS" ', & '-H "X-Signature: $SIG" >/dev/null && ', & - 'echo -e "\x1b[32mService sleeping: ', trim(service_id), '\x1b[0m"' + 'echo -e "\x1b[32mService frozen: ', trim(service_id), '\x1b[0m"' call execute_command_line(trim(full_cmd), wait=.true.) else if (trim(operation) == 'wake' .and. len_trim(service_id) > 0) then write(full_cmd, '(20A)') & 'TS=$(date +%s); ', & - 'SIG=$(echo -n "$TS:POST:/services/', trim(service_id), '/wake:" | openssl dgst -sha256 -hmac "', trim(secret_key), '" | cut -d" " -f2); ', & + 'SIG=$(echo -n "$TS:POST:/services/', trim(service_id), '/unfreeze:" | openssl dgst -sha256 -hmac "', trim(secret_key), '" | cut -d" " -f2); ', & 'curl -s -X POST https://api.unsandbox.com/services/', & - trim(service_id), '/wake ', & + trim(service_id), '/unfreeze ', & '-H "Authorization: Bearer ', trim(public_key), '" ', & '-H "X-Timestamp: $TS" ', & '-H "X-Signature: $SIG" >/dev/null && ', & - 'echo -e "\x1b[32mService waking: ', trim(service_id), '\x1b[0m"' + 'echo -e "\x1b[32mService unfreezing: ', trim(service_id), '\x1b[0m"' call execute_command_line(trim(full_cmd), wait=.true.) else if (trim(operation) == 'destroy' .and. len_trim(service_id) > 0) then write(full_cmd, '(20A)') & diff --git a/un.forth b/un.forth index cf10d44..a3fe5fe 100644 --- a/un.forth +++ b/un.forth @@ -299,9 +299,9 @@ get-secret-key r@ write-file throw s" '" r@ write-line throw s" TIMESTAMP=$(date +%s)" r@ write-line throw - s" MESSAGE=\"$TIMESTAMP:POST:/services/$SERVICE_ID/sleep:\"" r@ write-line throw + s" MESSAGE=\"$TIMESTAMP:POST:/services/$SERVICE_ID/freeze:\"" r@ write-line throw s" SIGNATURE=$(echo -n \"$MESSAGE\" | openssl dgst -sha256 -hmac \"$SECRET_KEY\" -hex | sed 's/.*= //')" r@ write-line throw - s" curl -s -X POST https://api.unsandbox.com/services/$SERVICE_ID/sleep -H \"Authorization: Bearer $PUBLIC_KEY\" -H \"X-Timestamp: $TIMESTAMP\" -H \"X-Signature: $SIGNATURE\" >/dev/null && echo -e '\\x1b[32mService sleeping: " r@ write-file throw + s" curl -s -X POST https://api.unsandbox.com/services/$SERVICE_ID/freeze -H \"Authorization: Bearer $PUBLIC_KEY\" -H \"X-Timestamp: $TIMESTAMP\" -H \"X-Signature: $SIGNATURE\" >/dev/null && echo -e '\\x1b[32mService frozen: " r@ write-file throw r@ write-file throw s" \\x1b[0m'" r@ write-line throw r> close-file throw @@ -323,9 +323,9 @@ get-secret-key r@ write-file throw s" '" r@ write-line throw s" TIMESTAMP=$(date +%s)" r@ write-line throw - s" MESSAGE=\"$TIMESTAMP:POST:/services/$SERVICE_ID/wake:\"" r@ write-line throw + s" MESSAGE=\"$TIMESTAMP:POST:/services/$SERVICE_ID/unfreeze:\"" r@ write-line throw s" SIGNATURE=$(echo -n \"$MESSAGE\" | openssl dgst -sha256 -hmac \"$SECRET_KEY\" -hex | sed 's/.*= //')" r@ write-line throw - s" curl -s -X POST https://api.unsandbox.com/services/$SERVICE_ID/wake -H \"Authorization: Bearer $PUBLIC_KEY\" -H \"X-Timestamp: $TIMESTAMP\" -H \"X-Signature: $SIGNATURE\" >/dev/null && echo -e '\\x1b[32mService waking: " r@ write-file throw + s" curl -s -X POST https://api.unsandbox.com/services/$SERVICE_ID/unfreeze -H \"Authorization: Bearer $PUBLIC_KEY\" -H \"X-Timestamp: $TIMESTAMP\" -H \"X-Signature: $SIGNATURE\" >/dev/null && echo -e '\\x1b[32mService unfreezing: " r@ write-file throw r@ write-file throw s" \\x1b[0m'" r@ write-line throw r> close-file throw diff --git a/un.fs b/un.fs index 2cd1dbc..fcd2638 100644 --- a/un.fs +++ b/un.fs @@ -786,11 +786,11 @@ let cmdService (args: Args) = | Some logs -> printfn "%s" (logs.ToString()) | None -> () elif args.ServiceSleep.IsSome then - let result = apiRequest (sprintf "/services/%s/sleep" args.ServiceSleep.Value) "POST" None publicKey secretKey - printfn "%sService sleeping: %s%s" green args.ServiceSleep.Value reset + let result = apiRequest (sprintf "/services/%s/freeze" args.ServiceSleep.Value) "POST" None publicKey secretKey + printfn "%sService frozen: %s%s" green args.ServiceSleep.Value reset elif args.ServiceWake.IsSome then - let result = apiRequest (sprintf "/services/%s/wake" args.ServiceWake.Value) "POST" None publicKey secretKey - printfn "%sService waking: %s%s" green args.ServiceWake.Value reset + let result = apiRequest (sprintf "/services/%s/unfreeze" args.ServiceWake.Value) "POST" None publicKey secretKey + printfn "%sService unfreezing: %s%s" green args.ServiceWake.Value reset elif args.ServiceDestroy.IsSome then let result = apiRequest (sprintf "/services/%s" args.ServiceDestroy.Value) "DELETE" None publicKey secretKey printfn "%sService destroyed: %s%s" green args.ServiceDestroy.Value reset diff --git a/un.go b/un.go index cad10cf..a223ace 100644 --- a/un.go +++ b/un.go @@ -673,14 +673,14 @@ func cmdService(serviceName, servicePorts, serviceDomains, serviceType, serviceB } if serviceSleep != "" { - apiRequest("/services/"+serviceSleep+"/sleep", "POST", nil, publicKey, secretKey) - fmt.Printf("%sService sleeping: %s%s\n", Green, serviceSleep, Reset) + apiRequest("/services/"+serviceSleep+"/freeze", "POST", nil, publicKey, secretKey) + fmt.Printf("%sService frozen: %s%s\n", Green, serviceSleep, Reset) return } if serviceWake != "" { - apiRequest("/services/"+serviceWake+"/wake", "POST", nil, publicKey, secretKey) - fmt.Printf("%sService waking: %s%s\n", Green, serviceWake, Reset) + apiRequest("/services/"+serviceWake+"/unfreeze", "POST", nil, publicKey, secretKey) + fmt.Printf("%sService unfreezing: %s%s\n", Green, serviceWake, Reset) return } diff --git a/un.groovy b/un.groovy index 451e7a9..431f452 100644 --- a/un.groovy +++ b/un.groovy @@ -756,14 +756,14 @@ def cmdService(args) { } if (args.serviceSleep) { - apiRequest("/services/${args.serviceSleep}/sleep", 'POST', null, publicKey, secretKey) - println("${GREEN}Service sleeping: ${args.serviceSleep}${RESET}") + apiRequest("/services/${args.serviceSleep}/freeze", 'POST', null, publicKey, secretKey) + println("${GREEN}Service frozen: ${args.serviceSleep}${RESET}") return } if (args.serviceWake) { - apiRequest("/services/${args.serviceWake}/wake", 'POST', null, publicKey, secretKey) - println("${GREEN}Service waking: ${args.serviceWake}${RESET}") + apiRequest("/services/${args.serviceWake}/unfreeze", 'POST', null, publicKey, secretKey) + println("${GREEN}Service unfreezing: ${args.serviceWake}${RESET}") return } diff --git a/un.hs b/un.hs index bca8fb2..76a63b7 100644 --- a/un.hs +++ b/un.hs @@ -464,11 +464,11 @@ serviceCommand opts = do (_, stdout, _) <- curlGet apiKey ("https://api.unsandbox.com/services/" ++ sid ++ "/logs") putStrLn stdout ServiceSleep sid -> do - (_, stdout, _) <- curlPost apiKey ("https://api.unsandbox.com/services/" ++ sid ++ "/sleep") "{}" - putStrLn $ green ++ "Service sleeping: " ++ sid ++ reset + (_, stdout, _) <- curlPost apiKey ("https://api.unsandbox.com/services/" ++ sid ++ "/freeze") "{}" + putStrLn $ green ++ "Service frozen: " ++ sid ++ reset ServiceWake sid -> do - (_, stdout, _) <- curlPost apiKey ("https://api.unsandbox.com/services/" ++ sid ++ "/wake") "{}" - putStrLn $ green ++ "Service waking: " ++ sid ++ reset + (_, stdout, _) <- curlPost apiKey ("https://api.unsandbox.com/services/" ++ sid ++ "/unfreeze") "{}" + putStrLn $ green ++ "Service unfreezing: " ++ sid ++ reset ServiceDestroy sid -> do (_, stdout, _) <- curlDelete apiKey ("https://api.unsandbox.com/services/" ++ sid) putStrLn $ green ++ "Service destroyed: " ++ sid ++ reset diff --git a/un.jl b/un.jl index 4bdfcdd..efee0d3 100755 --- a/un.jl +++ b/un.jl @@ -531,14 +531,14 @@ function cmd_service(args) end if args["sleep"] !== nothing - api_request("/services/$(args["sleep"])/sleep", public_key, secret_key, method="POST") - println("$(GREEN)Service sleeping: $(args["sleep"])$(RESET)") + api_request("/services/$(args["sleep"])/freeze", public_key, secret_key, method="POST") + println("$(GREEN)Service frozen: $(args["sleep"])$(RESET)") return end if args["wake"] !== nothing - api_request("/services/$(args["wake"])/wake", public_key, secret_key, method="POST") - println("$(GREEN)Service waking: $(args["wake"])$(RESET)") + api_request("/services/$(args["wake"])/unfreeze", public_key, secret_key, method="POST") + println("$(GREEN)Service unfreezing: $(args["wake"])$(RESET)") return end diff --git a/un.js b/un.js index ca419b3..1dcdac4 100644 --- a/un.js +++ b/un.js @@ -679,14 +679,14 @@ async function cmdService(args) { } if (args.sleep) { - await apiRequest(`/services/${args.sleep}/sleep`, "POST", null, publicKey, secretKey); - console.log(`${GREEN}Service sleeping: ${args.sleep}${RESET}`); + await apiRequest(`/services/${args.sleep}/freeze`, "POST", null, publicKey, secretKey); + console.log(`${GREEN}Service frozen: ${args.sleep}${RESET}`); return; } if (args.wake) { - await apiRequest(`/services/${args.wake}/wake`, "POST", null, publicKey, secretKey); - console.log(`${GREEN}Service waking: ${args.wake}${RESET}`); + await apiRequest(`/services/${args.wake}/unfreeze`, "POST", null, publicKey, secretKey); + console.log(`${GREEN}Service unfreezing: ${args.wake}${RESET}`); return; } diff --git a/un.kt b/un.kt index 8870868..e711572 100644 --- a/un.kt +++ b/un.kt @@ -317,14 +317,14 @@ fun cmdService(args: Args) { } if (args.serviceSleep != null) { - apiRequest("/services/${args.serviceSleep}/sleep", "POST", null, publicKey, secretKey) - println("${GREEN}Service sleeping: ${args.serviceSleep}${RESET}") + apiRequest("/services/${args.serviceSleep}/freeze", "POST", null, publicKey, secretKey) + println("${GREEN}Service frozen: ${args.serviceSleep}${RESET}") return } if (args.serviceWake != null) { - apiRequest("/services/${args.serviceWake}/wake", "POST", null, publicKey, secretKey) - println("${GREEN}Service waking: ${args.serviceWake}${RESET}") + apiRequest("/services/${args.serviceWake}/unfreeze", "POST", null, publicKey, secretKey) + println("${GREEN}Service unfreezing: ${args.serviceWake}${RESET}") return } diff --git a/un.lisp b/un.lisp index 6f7a7e6..5754293 100644 --- a/un.lisp +++ b/un.lisp @@ -321,11 +321,11 @@ ((string= action "logs") (format t "~a~%" (curl-get api-key (format nil "/services/~a/logs" id)))) ((string= action "sleep") - (curl-post api-key (format nil "/services/~a/sleep" id) "{}") - (format t "~aService sleeping: ~a~a~%" *green* id *reset*)) + (curl-post api-key (format nil "/services/~a/freeze" id) "{}") + (format t "~aService frozen: ~a~a~%" *green* id *reset*)) ((string= action "wake") - (curl-post api-key (format nil "/services/~a/wake" id) "{}") - (format t "~aService waking: ~a~a~%" *green* id *reset*)) + (curl-post api-key (format nil "/services/~a/unfreeze" id) "{}") + (format t "~aService unfreezing: ~a~a~%" *green* id *reset*)) ((string= action "destroy") (curl-delete api-key (format nil "/services/~a" id)) (format t "~aService destroyed: ~a~a~%" *green* id *reset*)) diff --git a/un.lua b/un.lua index 6132884..cc68967 100644 --- a/un.lua +++ b/un.lua @@ -719,14 +719,14 @@ local function cmd_service(options) end if options.sleep then - api_request("/services/" .. options.sleep .. "/sleep", "POST", nil, keys) - print(GREEN .. "Service sleeping: " .. options.sleep .. RESET) + api_request("/services/" .. options.sleep .. "/freeze", "POST", nil, keys) + print(GREEN .. "Service frozen: " .. options.sleep .. RESET) return end if options.wake then - api_request("/services/" .. options.wake .. "/wake", "POST", nil, keys) - print(GREEN .. "Service waking: " .. options.wake .. RESET) + api_request("/services/" .. options.wake .. "/unfreeze", "POST", nil, keys) + print(GREEN .. "Service unfreezing: " .. options.wake .. RESET) return end diff --git a/un.m b/un.m index e40d1f7..c2db71b 100644 --- a/un.m +++ b/un.m @@ -818,16 +818,16 @@ void cmdService(NSArray* args) { } if (sleepId) { - NSString* endpoint = [NSString stringWithFormat:@"/services/%@/sleep", sleepId]; + NSString* endpoint = [NSString stringWithFormat:@"/services/%@/freeze", sleepId]; apiRequest(endpoint, @"POST", nil, publicKey, secretKey); - printf("%sService sleeping: %s%s\n", [GREEN UTF8String], [sleepId UTF8String], [RESET UTF8String]); + printf("%sService frozen: %s%s\n", [GREEN UTF8String], [sleepId UTF8String], [RESET UTF8String]); return; } if (wakeId) { - NSString* endpoint = [NSString stringWithFormat:@"/services/%@/wake", wakeId]; + NSString* endpoint = [NSString stringWithFormat:@"/services/%@/unfreeze", wakeId]; apiRequest(endpoint, @"POST", nil, publicKey, secretKey); - printf("%sService waking: %s%s\n", [GREEN UTF8String], [wakeId UTF8String], [RESET UTF8String]); + printf("%sService unfreezing: %s%s\n", [GREEN UTF8String], [wakeId UTF8String], [RESET UTF8String]); return; } diff --git a/un.ml b/un.ml index 913c5e7..e0b8932 100755 --- a/un.ml +++ b/un.ml @@ -647,11 +647,11 @@ let service_command action name ports bootstrap bootstrap_file service_type netw let oc = open_out tmp_file in output_string oc "{}"; close_out oc; - let cmd = Printf.sprintf "curl -s -X POST https://api.unsandbox.com/services/%s/sleep -H 'Content-Type: application/json' -H 'Authorization: Bearer %s' -d @%s" + let cmd = Printf.sprintf "curl -s -X POST https://api.unsandbox.com/services/%s/freeze -H 'Content-Type: application/json' -H 'Authorization: Bearer %s' -d @%s" sid api_key tmp_file in let _ = Sys.command cmd in Sys.remove tmp_file; - Printf.printf "%sService sleeping: %s%s\n" green sid reset + Printf.printf "%sService frozen: %s%s\n" green sid reset | None -> Printf.fprintf stderr "Error: --freeze requires service ID\n"; exit 1) @@ -662,11 +662,11 @@ let service_command action name ports bootstrap bootstrap_file service_type netw let oc = open_out tmp_file in output_string oc "{}"; close_out oc; - let cmd = Printf.sprintf "curl -s -X POST https://api.unsandbox.com/services/%s/wake -H 'Content-Type: application/json' -H 'Authorization: Bearer %s' -d @%s" + let cmd = Printf.sprintf "curl -s -X POST https://api.unsandbox.com/services/%s/unfreeze -H 'Content-Type: application/json' -H 'Authorization: Bearer %s' -d @%s" sid api_key tmp_file in let _ = Sys.command cmd in Sys.remove tmp_file; - Printf.printf "%sService waking: %s%s\n" green sid reset + Printf.printf "%sService unfreezing: %s%s\n" green sid reset | None -> Printf.fprintf stderr "Error: --unfreeze requires service ID\n"; exit 1) diff --git a/un.nim b/un.nim index 726c70a..d874dc7 100644 --- a/un.nim +++ b/un.nim @@ -336,19 +336,19 @@ proc cmdService(name, ports, bootstrap, bootstrapFile, serviceType: string, list return if sleep != "": - let path = fmt"/services/{sleep}/sleep" + let path = fmt"/services/{sleep}/freeze" let authHeaders = buildAuthHeaders("POST", path, "", publicKey, secretKey) - let cmd = fmt"""curl -s -X POST '{API_BASE}/services/{sleep}/sleep' {authHeaders}""" + let cmd = fmt"""curl -s -X POST '{API_BASE}/services/{sleep}/freeze' {authHeaders}""" discard execCurl(cmd) - echo GREEN & "Service sleeping: " & sleep & RESET + echo GREEN & "Service frozen: " & sleep & RESET return if wake != "": - let path = fmt"/services/{wake}/wake" + let path = fmt"/services/{wake}/unfreeze" let authHeaders = buildAuthHeaders("POST", path, "", publicKey, secretKey) - let cmd = fmt"""curl -s -X POST '{API_BASE}/services/{wake}/wake' {authHeaders}""" + let cmd = fmt"""curl -s -X POST '{API_BASE}/services/{wake}/unfreeze' {authHeaders}""" discard execCurl(cmd) - echo GREEN & "Service waking: " & wake & RESET + echo GREEN & "Service unfreezing: " & wake & RESET return if destroy != "": diff --git a/un.php b/un.php index 5d7101a..7f0654c 100755 --- a/un.php +++ b/un.php @@ -643,14 +643,14 @@ function cmd_service($options) { } if ($options['sleep']) { - api_request("/services/{$options['sleep']}/sleep", 'POST', null, $keys); - echo GREEN . "Service sleeping: {$options['sleep']}" . RESET . "\n"; + api_request("/services/{$options['sleep']}/freeze", 'POST', null, $keys); + echo GREEN . "Service frozen: {$options['sleep']}" . RESET . "\n"; return; } if ($options['wake']) { - api_request("/services/{$options['wake']}/wake", 'POST', null, $keys); - echo GREEN . "Service waking: {$options['wake']}" . RESET . "\n"; + api_request("/services/{$options['wake']}/unfreeze", 'POST', null, $keys); + echo GREEN . "Service unfreezing: {$options['wake']}" . RESET . "\n"; return; } diff --git a/un.pl b/un.pl index 81b4ec5..98409a1 100644 --- a/un.pl +++ b/un.pl @@ -507,14 +507,14 @@ sub cmd_service { } if ($options->{sleep}) { - api_request("/services/$options->{sleep}/sleep", 'POST', undef, $public_key, $secret_key); - print "${GREEN}Service sleeping: $options->{sleep}${RESET}\n"; + api_request("/services/$options->{sleep}/freeze", 'POST', undef, $public_key, $secret_key); + print "${GREEN}Service frozen: $options->{sleep}${RESET}\n"; return; } if ($options->{wake}) { - api_request("/services/$options->{wake}/wake", 'POST', undef, $public_key, $secret_key); - print "${GREEN}Service waking: $options->{wake}${RESET}\n"; + api_request("/services/$options->{wake}/unfreeze", 'POST', undef, $public_key, $secret_key); + print "${GREEN}Service unfreezing: $options->{wake}${RESET}\n"; return; } diff --git a/un.pro b/un.pro index bf19353..78902dd 100644 --- a/un.pro +++ b/un.pro @@ -208,7 +208,7 @@ service_sleep(ServiceId) :- get_public_key(PublicKey), get_secret_key(SecretKey), format(atom(Cmd), - 'TIMESTAMP=$(date +%s); MESSAGE="$TIMESTAMP:POST:/services/~w/sleep:"; SIGNATURE=$(echo -n "$MESSAGE" | openssl dgst -sha256 -hmac "~w" -hex | sed \'\'s/.*= //\'\'); curl -s -X POST https://api.unsandbox.com/services/~w/sleep -H "Authorization: Bearer ~w" -H "X-Timestamp: $TIMESTAMP" -H "X-Signature: $SIGNATURE" >/dev/null && echo -e "\\x1b[32mService sleeping: ~w\\x1b[0m"', + 'TIMESTAMP=$(date +%s); MESSAGE="$TIMESTAMP:POST:/services/~w/freeze:"; SIGNATURE=$(echo -n "$MESSAGE" | openssl dgst -sha256 -hmac "~w" -hex | sed \'\'s/.*= //\'\'); curl -s -X POST https://api.unsandbox.com/services/~w/freeze -H "Authorization: Bearer ~w" -H "X-Timestamp: $TIMESTAMP" -H "X-Signature: $SIGNATURE" >/dev/null && echo -e "\\x1b[32mService frozen: ~w\\x1b[0m"', [ServiceId, SecretKey, ServiceId, PublicKey, ServiceId]), shell(Cmd, 0). @@ -217,7 +217,7 @@ service_wake(ServiceId) :- get_public_key(PublicKey), get_secret_key(SecretKey), format(atom(Cmd), - 'TIMESTAMP=$(date +%s); MESSAGE="$TIMESTAMP:POST:/services/~w/wake:"; SIGNATURE=$(echo -n "$MESSAGE" | openssl dgst -sha256 -hmac "~w" -hex | sed \'\'s/.*= //\'\'); curl -s -X POST https://api.unsandbox.com/services/~w/wake -H "Authorization: Bearer ~w" -H "X-Timestamp: $TIMESTAMP" -H "X-Signature: $SIGNATURE" >/dev/null && echo -e "\\x1b[32mService waking: ~w\\x1b[0m"', + 'TIMESTAMP=$(date +%s); MESSAGE="$TIMESTAMP:POST:/services/~w/unfreeze:"; SIGNATURE=$(echo -n "$MESSAGE" | openssl dgst -sha256 -hmac "~w" -hex | sed \'\'s/.*= //\'\'); curl -s -X POST https://api.unsandbox.com/services/~w/unfreeze -H "Authorization: Bearer ~w" -H "X-Timestamp: $TIMESTAMP" -H "X-Signature: $SIGNATURE" >/dev/null && echo -e "\\x1b[32mService unfreezing: ~w\\x1b[0m"', [ServiceId, SecretKey, ServiceId, PublicKey, ServiceId]), shell(Cmd, 0). diff --git a/un.ps1 b/un.ps1 index cf54659..6958c34 100644 --- a/un.ps1 +++ b/un.ps1 @@ -518,16 +518,16 @@ function Invoke-Service { if ($Args -contains "--freeze") { $idx = [array]::IndexOf($Args, "--freeze") $serviceId = $Args[$idx + 1] - Invoke-Api -Endpoint "/services/$serviceId/sleep" -Method "POST" -Body "{}" - Write-Host "`e[32mService sleeping: $serviceId`e[0m" + Invoke-Api -Endpoint "/services/$serviceId/freeze" -Method "POST" -Body "{}" + Write-Host "`e[32mService frozen: $serviceId`e[0m" return } if ($Args -contains "--unfreeze") { $idx = [array]::IndexOf($Args, "--unfreeze") $serviceId = $Args[$idx + 1] - Invoke-Api -Endpoint "/services/$serviceId/wake" -Method "POST" -Body "{}" - Write-Host "`e[32mService waking: $serviceId`e[0m" + Invoke-Api -Endpoint "/services/$serviceId/unfreeze" -Method "POST" -Body "{}" + Write-Host "`e[32mService unfreezing: $serviceId`e[0m" return } diff --git a/un.py b/un.py index 4315c2c..c258a99 100644 --- a/un.py +++ b/un.py @@ -730,13 +730,13 @@ def cmd_service(args): return if args.sleep: - result = api_request(f"/services/{args.sleep}/sleep", method="POST", public_key=public_key, secret_key=secret_key) - print(f"{GREEN}Service sleeping: {args.sleep}{RESET}") + result = api_request(f"/services/{args.sleep}/freeze", method="POST", public_key=public_key, secret_key=secret_key) + print(f"{GREEN}Service frozen: {args.sleep}{RESET}") return if args.wake: - result = api_request(f"/services/{args.wake}/wake", method="POST", public_key=public_key, secret_key=secret_key) - print(f"{GREEN}Service waking: {args.wake}{RESET}") + result = api_request(f"/services/{args.wake}/unfreeze", method="POST", public_key=public_key, secret_key=secret_key) + print(f"{GREEN}Service unfreezing: {args.wake}{RESET}") return if args.destroy: @@ -934,8 +934,8 @@ Examples: service_parser.add_argument("--info", metavar="ID", help="Get service details") service_parser.add_argument("--tail", metavar="ID", help="Get last 9000 lines of logs") service_parser.add_argument("--logs", metavar="ID", help="Get all logs") - service_parser.add_argument("--freeze", "--sleep", dest="sleep", metavar="ID", help="Freeze service") - service_parser.add_argument("--unfreeze", "--wake", dest="wake", metavar="ID", help="Unfreeze service") + service_parser.add_argument("--freeze", "--freeze", dest="sleep", metavar="ID", help="Freeze service") + service_parser.add_argument("--unfreeze", "--unfreeze", dest="wake", metavar="ID", help="Unfreeze service") service_parser.add_argument("--destroy", metavar="ID", help="Destroy service") service_parser.add_argument("--resize", metavar="ID", help="Resize service vCPU/memory") service_parser.add_argument("--snapshot", metavar="SERVICE_ID", help="Create snapshot of service") diff --git a/un.r b/un.r index d9f6399..1729ee3 100644 --- a/un.r +++ b/un.r @@ -695,14 +695,14 @@ cmd_service <- function(args) { } if (!is.null(args$sleep)) { - result <- api_request(paste0("/services/", args$sleep, "/sleep"), public_key, secret_key, method = "POST") - cat(sprintf("%sService sleeping: %s%s\n", GREEN, args$sleep, RESET)) + result <- api_request(paste0("/services/", args$sleep, "/freeze"), public_key, secret_key, method = "POST") + cat(sprintf("%sService frozen: %s%s\n", GREEN, args$sleep, RESET)) return() } if (!is.null(args$wake)) { - result <- api_request(paste0("/services/", args$wake, "/wake"), public_key, secret_key, method = "POST") - cat(sprintf("%sService waking: %s%s\n", GREEN, args$wake, RESET)) + result <- api_request(paste0("/services/", args$wake, "/unfreeze"), public_key, secret_key, method = "POST") + cat(sprintf("%sService unfreezing: %s%s\n", GREEN, args$wake, RESET)) return() } diff --git a/un.raku b/un.raku index 3cb0f5b..f95bba5 100644 --- a/un.raku +++ b/un.raku @@ -625,14 +625,14 @@ sub cmd-service(@args) { } if $sleep-id { - api-request("/services/$sleep-id/sleep", 'POST', :$public-key, :$secret-key); - say "{$GREEN}Service sleeping: $sleep-id{$RESET}"; + api-request("/services/$sleep-id/freeze", 'POST', :$public-key, :$secret-key); + say "{$GREEN}Service frozen: $sleep-id{$RESET}"; return; } if $wake-id { - api-request("/services/$wake-id/wake", 'POST', :$public-key, :$secret-key); - say "{$GREEN}Service waking: $wake-id{$RESET}"; + api-request("/services/$wake-id/unfreeze", 'POST', :$public-key, :$secret-key); + say "{$GREEN}Service unfreezing: $wake-id{$RESET}"; return; } diff --git a/un.rb b/un.rb index 9a79316..773ec35 100644 --- a/un.rb +++ b/un.rb @@ -662,14 +662,14 @@ def cmd_service(options) end if options[:sleep] - api_request("/services/#{options[:sleep]}/sleep", method: 'POST', keys: keys) - puts "#{GREEN}Service sleeping: #{options[:sleep]}#{RESET}" + api_request("/services/#{options[:sleep]}/freeze", method: 'POST', keys: keys) + puts "#{GREEN}Service frozen: #{options[:sleep]}#{RESET}" return end if options[:wake] - api_request("/services/#{options[:wake]}/wake", method: 'POST', keys: keys) - puts "#{GREEN}Service waking: #{options[:wake]}#{RESET}" + api_request("/services/#{options[:wake]}/unfreeze", method: 'POST', keys: keys) + puts "#{GREEN}Service unfreezing: #{options[:wake]}#{RESET}" return end diff --git a/un.rs b/un.rs index e2cb6b1..51a63a4 100644 --- a/un.rs +++ b/un.rs @@ -616,14 +616,14 @@ fn cmd_service( } if let Some(id) = sleep { - api_request(&format!("/services/{}/sleep", id), "POST", None, public_key, secret_key); - println!("{}Service sleeping: {}{}", GREEN, id, RESET); + api_request(&format!("/services/{}/freeze", id), "POST", None, public_key, secret_key); + println!("{}Service frozen: {}{}", GREEN, id, RESET); return; } if let Some(id) = wake { - api_request(&format!("/services/{}/wake", id), "POST", None, public_key, secret_key); - println!("{}Service waking: {}{}", GREEN, id, RESET); + api_request(&format!("/services/{}/unfreeze", id), "POST", None, public_key, secret_key); + println!("{}Service unfreezing: {}{}", GREEN, id, RESET); return; } diff --git a/un.scm b/un.scm index 4906b10..1940404 100644 --- a/un.scm +++ b/un.scm @@ -479,11 +479,11 @@ (display (curl-get api-key (format #f "/services/~a/logs" id))) (newline)) ((equal? action "sleep") - (curl-post api-key (format #f "/services/~a/sleep" id) "{}") - (format #t "~aService sleeping: ~a~a\n" green id reset)) + (curl-post api-key (format #f "/services/~a/freeze" id) "{}") + (format #t "~aService frozen: ~a~a\n" green id reset)) ((equal? action "wake") - (curl-post api-key (format #f "/services/~a/wake" id) "{}") - (format #t "~aService waking: ~a~a\n" green id reset)) + (curl-post api-key (format #f "/services/~a/unfreeze" id) "{}") + (format #t "~aService unfreezing: ~a~a\n" green id reset)) ((equal? action "destroy") (curl-delete api-key (format #f "/services/~a" id)) (format #t "~aService destroyed: ~a~a\n" green id reset)) diff --git a/un.sh b/un.sh index e2be46d..3e31a04 100644 --- a/un.sh +++ b/un.sh @@ -970,14 +970,14 @@ cmd_service() { fi if [[ -n "$sleep" ]]; then - api_request "/services/$sleep/sleep" "POST" "" "$api_key" > /dev/null - echo -e "${GREEN}Service sleeping: $sleep${RESET}" + api_request "/services/$sleep/freeze" "POST" "" "$api_key" > /dev/null + echo -e "${GREEN}Service frozen: $sleep${RESET}" return fi if [[ -n "$wake" ]]; then - api_request "/services/$wake/wake" "POST" "" "$api_key" > /dev/null - echo -e "${GREEN}Service waking: $wake${RESET}" + api_request "/services/$wake/unfreeze" "POST" "" "$api_key" > /dev/null + echo -e "${GREEN}Service unfreezing: $wake${RESET}" return fi diff --git a/un.tcl b/un.tcl index e33a89a..04a12c1 100755 --- a/un.tcl +++ b/un.tcl @@ -830,14 +830,14 @@ proc cmd_service {args} { } if {$sleep_id ne ""} { - api_request "/services/$sleep_id/sleep" "POST" {} $public_key $secret_key - puts "${::GREEN}Service sleeping: $sleep_id${::RESET}" + api_request "/services/$sleep_id/freeze" "POST" {} $public_key $secret_key + puts "${::GREEN}Service frozen: $sleep_id${::RESET}" return } if {$wake_id ne ""} { - api_request "/services/$wake_id/wake" "POST" {} $public_key $secret_key - puts "${::GREEN}Service waking: $wake_id${::RESET}" + api_request "/services/$wake_id/unfreeze" "POST" {} $public_key $secret_key + puts "${::GREEN}Service unfreezing: $wake_id${::RESET}" return } diff --git a/un.ts b/un.ts index dfb2339..0a54dc3 100644 --- a/un.ts +++ b/un.ts @@ -610,14 +610,14 @@ async function cmdService(args: Args): Promise { } if (args.sleep) { - await apiRequest(`/services/${args.sleep}/sleep`, "POST", null, keys); - console.log(`${GREEN}Service sleeping: ${args.sleep}${RESET}`); + await apiRequest(`/services/${args.sleep}/freeze`, "POST", null, keys); + console.log(`${GREEN}Service frozen: ${args.sleep}${RESET}`); return; } if (args.wake) { - await apiRequest(`/services/${args.wake}/wake`, "POST", null, keys); - console.log(`${GREEN}Service waking: ${args.wake}${RESET}`); + await apiRequest(`/services/${args.wake}/unfreeze`, "POST", null, keys); + console.log(`${GREEN}Service unfreezing: ${args.wake}${RESET}`); return; } diff --git a/un.v b/un.v index 613d8d9..092f7dd 100644 --- a/un.v +++ b/un.v @@ -439,16 +439,16 @@ fn cmd_service(name string, ports string, service_type string, bootstrap string, } if sleep != '' { - cmd := "TIMESTAMP=\$(date +%s); MESSAGE=\"\$TIMESTAMP:POST:/services/${sleep}/sleep:\"; SIGNATURE=\$(echo -n \"\$MESSAGE\" | openssl dgst -sha256 -hmac '${secret_key}' -hex | sed 's/.*= //'); curl -s -X POST '${api_base}/services/${sleep}/sleep' -H 'Authorization: Bearer ${pub_key}' -H \"X-Timestamp: \$TIMESTAMP\" -H \"X-Signature: \$SIGNATURE\"" + cmd := "TIMESTAMP=\$(date +%s); MESSAGE=\"\$TIMESTAMP:POST:/services/${sleep}/freeze:\"; SIGNATURE=\$(echo -n \"\$MESSAGE\" | openssl dgst -sha256 -hmac '${secret_key}' -hex | sed 's/.*= //'); curl -s -X POST '${api_base}/services/${sleep}/freeze' -H 'Authorization: Bearer ${pub_key}' -H \"X-Timestamp: \$TIMESTAMP\" -H \"X-Signature: \$SIGNATURE\"" exec_curl(cmd) - println('${green}Service sleeping: ${sleep}${reset}') + println('${green}Service frozen: ${sleep}${reset}') return } if wake != '' { - cmd := "TIMESTAMP=\$(date +%s); MESSAGE=\"\$TIMESTAMP:POST:/services/${wake}/wake:\"; SIGNATURE=\$(echo -n \"\$MESSAGE\" | openssl dgst -sha256 -hmac '${secret_key}' -hex | sed 's/.*= //'); curl -s -X POST '${api_base}/services/${wake}/wake' -H 'Authorization: Bearer ${pub_key}' -H \"X-Timestamp: \$TIMESTAMP\" -H \"X-Signature: \$SIGNATURE\"" + cmd := "TIMESTAMP=\$(date +%s); MESSAGE=\"\$TIMESTAMP:POST:/services/${wake}/unfreeze:\"; SIGNATURE=\$(echo -n \"\$MESSAGE\" | openssl dgst -sha256 -hmac '${secret_key}' -hex | sed 's/.*= //'); curl -s -X POST '${api_base}/services/${wake}/unfreeze' -H 'Authorization: Bearer ${pub_key}' -H \"X-Timestamp: \$TIMESTAMP\" -H \"X-Signature: \$SIGNATURE\"" exec_curl(cmd) - println('${green}Service waking: ${wake}${reset}') + println('${green}Service unfreezing: ${wake}${reset}') return } diff --git a/un_deno.ts b/un_deno.ts index 19c9edb..a080f3e 100644 --- a/un_deno.ts +++ b/un_deno.ts @@ -549,13 +549,13 @@ async function cmdService(args: string[]) { } if (sleepId) { - await apiRequest(`/services/${sleepId}/sleep`, "POST", undefined, keys); + await apiRequest(`/services/${sleepId}/freeze`, "POST", undefined, keys); console.log(`${GREEN}Service sleeping: ${sleepId}${RESET}`); return; } if (wakeId) { - await apiRequest(`/services/${wakeId}/wake`, "POST", undefined, keys); + await apiRequest(`/services/${wakeId}/unfreeze`, "POST", undefined, keys); console.log(`${GREEN}Service waking: ${wakeId}${RESET}`); return; }