Implement secure cloud sandboxes with E2B (#35)
* chore: rename utils.ts to fileoperations.ts * feat: replace node-pty with E2B sandboxes * added debounced function in the editor * fix: move socket connection to useRef * fix: wait until terminals are killed to close the container * fix: ensure container remains open until all owner connections are closed * fix: sync files to container instead of local file system * fix: set project file permissions so that they belong to the terminal user * fix: use the container URL for the preview panel * fix: count only the current user's sandboxes towards the limit * fix: remove hardcoded reference to localhost * fix: add error handling to the backend * docs: add information about E2B --------- Co-authored-by: Akhilesh Rangani <akhileshrangani4@gmail.com>
This commit is contained in:
@ -15,9 +15,11 @@ import { toast } from "sonner"
|
||||
export default function PreviewWindow({
|
||||
collapsed,
|
||||
open,
|
||||
src
|
||||
}: {
|
||||
collapsed: boolean
|
||||
open: () => void
|
||||
src: string
|
||||
}) {
|
||||
const ref = useRef<HTMLIFrameElement>(null)
|
||||
const [iframeKey, setIframeKey] = useState(0)
|
||||
@ -45,7 +47,7 @@ export default function PreviewWindow({
|
||||
|
||||
<PreviewButton
|
||||
onClick={() => {
|
||||
navigator.clipboard.writeText(`http://localhost:5173`)
|
||||
navigator.clipboard.writeText(src)
|
||||
toast.info("Copied preview link to clipboard")
|
||||
}}
|
||||
>
|
||||
@ -73,7 +75,7 @@ export default function PreviewWindow({
|
||||
ref={ref}
|
||||
width={"100%"}
|
||||
height={"100%"}
|
||||
src={`http://localhost:5173`}
|
||||
src={src}
|
||||
/>
|
||||
</div>
|
||||
)}
|
||||
|
Reference in New Issue
Block a user