diff --git a/clients/c/src/un.c b/clients/c/src/un.c index 437646b..e7a8218 100644 --- a/clients/c/src/un.c +++ b/clients/c/src/un.c @@ -5574,7 +5574,7 @@ static int validate_api_key(const UnsandboxCredentials *creds) { response.size = 0; char url[256]; - snprintf(url, sizeof(url), "%s/keys/validate", PORTAL_BASE); + snprintf(url, sizeof(url), "%s/keys/validate", API_BASE); // Use HMAC authentication with empty body struct curl_slist *headers = NULL; @@ -5824,7 +5824,7 @@ void print_usage(const char *prog) { fprintf(stderr, " --lock ID Lock a service to prevent deletion\n"); fprintf(stderr, " --unlock ID Unlock a service to allow deletion\n"); fprintf(stderr, " --resize ID Resize service vCPU/memory (requires --vcpu)\n"); - fprintf(stderr, " --redeploy ID Re-run bootstrap script (requires --bootstrap)\n"); + fprintf(stderr, " --redeploy ID Re-run bootstrap script (optional: --bootstrap or --bootstrap-file)\n"); fprintf(stderr, " --execute ID CMD Run a command in a running service\n"); fprintf(stderr, " --dump-bootstrap ID [FILE] Dump bootstrap script (for migrations)\n"); fprintf(stderr, " --snapshot ID Create snapshot of service (paid tiers only)\n"); @@ -5901,7 +5901,8 @@ void print_usage(const char *prog) { fprintf(stderr, " %s service --unfreeze abc123 # unfreeze a service\n", prog); fprintf(stderr, " %s service --resize abc123 --vcpu 4 # scale to 4 vCPU, 8GB RAM\n", prog); fprintf(stderr, " %s service --destroy abc123 # destroy a service\n", prog); - fprintf(stderr, " %s service --redeploy abc123 --bootstrap ./script.sh\n", prog); + fprintf(stderr, " %s service --redeploy abc123 --bootstrap-file ./script.sh\n", prog); + fprintf(stderr, " %s service --redeploy abc123 # uses stored encrypted bootstrap\n", prog); fprintf(stderr, " %s service --execute maldoror 'journalctl -u myapp -n 50'\n", prog); fprintf(stderr, " %s service --dump-bootstrap maldoror # print bootstrap to stdout\n", prog); fprintf(stderr, " %s service --dump-bootstrap maldoror backup.sh # save to file\n", prog); @@ -9332,13 +9333,11 @@ int main(int argc, char *argv[]) { } ret = resize_service(creds, service_id, vcpu); } else if (do_redeploy) { - if (!service_bootstrap) { - fprintf(stderr, "Error: --bootstrap required for --redeploy\n"); - curl_global_cleanup(); - free_credentials(creds); - return 1; - } - ret = redeploy_service(creds, service_id, service_bootstrap); + // Bootstrap is optional for redeploy: + // - If provided via --bootstrap or --bootstrap-file, use it + // - If omitted, API will use the stored encrypted bootstrap + const char *bootstrap_to_use = bootstrap_file ? bootstrap_file : service_bootstrap; + ret = redeploy_service(creds, service_id, bootstrap_to_use); } else if (do_execute) { // Default timeout 30 seconds (30000ms) ret = execute_service(creds, service_id, execute_command, 30000); diff --git a/clients/perl/sync/src/un.pl b/clients/perl/sync/src/un.pl index ca8cc03..74deab2 100644 --- a/clients/perl/sync/src/un.pl +++ b/clients/perl/sync/src/un.pl @@ -853,7 +853,7 @@ sub validate_key { my ($public_key, $secret_key, $should_extend) = @_; # Call /keys/validate endpoint - my $url = "$PORTAL_BASE/keys/validate"; + my $url = "$API_BASE/keys/validate"; my $ua = LWP::UserAgent->new(timeout => 30); my $request = HTTP::Request->new('POST' => $url); $request->header('Authorization' => "Bearer $public_key"); diff --git a/clients/python/async/src/un_async.py b/clients/python/async/src/un_async.py index b43e7d5..4671646 100644 --- a/clients/python/async/src/un_async.py +++ b/clients/python/async/src/un_async.py @@ -1635,7 +1635,7 @@ async def validate_keys( """ public_key, secret_key = _resolve_credentials(public_key, secret_key) - url = f"{PORTAL_BASE}/keys/validate" + url = f"{API_BASE}/keys/validate" timestamp = int(time.time()) body = "" diff --git a/clients/python/sync/src/un.py b/clients/python/sync/src/un.py index 95b3bce..d7b051e 100644 --- a/clients/python/sync/src/un.py +++ b/clients/python/sync/src/un.py @@ -2007,7 +2007,7 @@ def validate_keys( """ public_key, secret_key = _resolve_credentials(public_key, secret_key) - url = f"{PORTAL_BASE}/keys/validate" + url = f"{API_BASE}/keys/validate" timestamp = int(time.time()) body = "" diff --git a/clients/rust/async/src/lib.rs b/clients/rust/async/src/lib.rs index 0a68f34..c2b4cab 100644 --- a/clients/rust/async/src/lib.rs +++ b/clients/rust/async/src/lib.rs @@ -1815,7 +1815,7 @@ pub async fn validate_keys(creds: &Credentials) -> Result { .timeout(Duration::from_secs(30)) .build()?; - let url = "https://unsandbox.com/keys/validate"; + let url = "https://api.unsandbox.com/keys/validate"; let path = "/keys/validate"; let timestamp = get_timestamp(); let body_str = ""; diff --git a/clients/rust/sync/src/lib.rs b/clients/rust/sync/src/lib.rs index 465ae14..0e29223 100644 --- a/clients/rust/sync/src/lib.rs +++ b/clients/rust/sync/src/lib.rs @@ -2121,7 +2121,7 @@ pub fn validate_keys(creds: &Credentials) -> Result { .timeout(Duration::from_secs(30)) .build()?; - let url = "https://unsandbox.com/keys/validate"; + let url = "https://api.unsandbox.com/keys/validate"; let path = "/keys/validate"; let timestamp = get_timestamp(); let body_str = "";