eny.space Landingpage
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

fix(dashboard): use raw hostname instead of URL for PDS provisioning

+11 -6
+11 -6
app/api/webhooks/route.ts
··· 37 37 } 38 38 39 39 const password = randomBytes(16).toString("base64url"); 40 - const hostnameUrl = `https://${pdsHostnameBase}`; 40 + const hostname = pdsHostnameBase.trim(); 41 41 42 42 const disksize = Number(disksizeGb); 43 43 ··· 56 56 } 57 57 // Retry deploy for known retryable states where id may be missing. 58 58 // Keep skipping for everything else to avoid duplicate provisioning. 59 - const retryableStatuses = new Set(["deploy_failed", "deploy_succeeded_no_id"]); 59 + const retryableStatuses = new Set([ 60 + "deploy_failed", 61 + "deploy_succeeded_no_id", 62 + ]); 60 63 if (existing.status && !retryableStatuses.has(existing.status)) { 61 64 return { skipped: true, pds_service_id: null }; 62 65 } ··· 73 76 username: pdsUsername, 74 77 password, 75 78 email: userEmail, 76 - hostname: hostnameUrl, 79 + hostname, 77 80 disksize, 78 81 }), 79 82 }); ··· 87 90 // Persist failure status for easier debugging 88 91 await supabase.from("pds_services").upsert({ 89 92 user_id: userId, 90 - hostname: hostnameUrl, 93 + hostname, 91 94 status: "deploy_failed", 92 95 }); 93 96 throw new Error( ··· 115 118 await supabase.from("pds_services").upsert({ 116 119 user_id: userId, 117 120 pds_service_id, 118 - hostname: hostnameUrl, 121 + hostname, 119 122 status: pds_service_id ? "provisioning" : "deploy_succeeded_no_id", 120 123 }); 121 124 ··· 171 174 172 175 // Next step: provision the user's PDS 173 176 if (userEmail) { 174 - const fallbackUsername = normalizeSlug(userEmail.split("@")[0] || "pds"); 177 + const fallbackUsername = normalizeSlug( 178 + userEmail.split("@")[0] || "pds", 179 + ); 175 180 const pdsUsername = normalizeSlug( 176 181 session.metadata?.pds_username || fallbackUsername, 177 182 );