Skip to content

Commit d576591

Browse files
Merge branch 'main' into hackathon
2 parents 9f4354b + e99889b commit d576591

File tree

27 files changed

+264
-45
lines changed

27 files changed

+264
-45
lines changed

content/blog/CJ-3-1-roadmap.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ authors:
77
- alessandro
88
- stefano
99
pubDate: "February 5 2025"
10-
heroImage: "./CJ3-1.png"
10+
heroImage: "./CJ3-1-hero.png"
1111
featured: true
1212
tags:
1313
- CheerpJ

content/blog/CJ3-1-hero.png

126 KB
Loading

packages/astro-theme/components/LinkButton.astro

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -39,9 +39,11 @@ const { href, label, type = "secondary", iconLeft, iconRight } = Astro.props;
3939
type === "primary-cheerpx",
4040
"border-white text-white hover:border-[#909090] hover:text-[#909090]":
4141
type === "secondary-cheerpx",
42+
4243
"border-white bg-white text-black font-mono hover:bg-primary-300 hover:text-white hover:border-primary-300 hover:drop-shadow-[0px_0px_5px_rgba(240,125,153,0.6)]":
4344
type === "primary-mono",
4445
"border-white text-white font-mono hover:border-primary-300 hover:text-primary-300 hover:drop-shadow-[0px_0px_5px_rgba(240,125,153,0.6)]":
46+
4547
type === "secondary-mono",
4648
"border-white border-opacity-30 bg-blurple text-white hover:border-opacity-80":
4749
type === "discord",

sites/cheerpx/src/content/docs/11-guides/File-System-support.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -185,11 +185,11 @@ await dataDevice.writeFile("/filename", "File content here");
185185

186186
## Block devices with ext2
187187

188-
CheerpX supports ext2 filesystems, which can be configured as an overlay device. This allows for a flexible setup that can combine different storage types.
188+
CheerpX supports ext2 filesystems, which can be configured as an [`OverlayDevice`](/docs/reference/CheerpX.OverlayDevice). This allows for a flexible setup that can combine different storage types.
189189

190190
### Usage
191191

192-
Create an ext2 filesystem by combining a [`HttpBytesDevice`](/docs/reference/httpBytesDevice) to acess disk blocks, an [`IDBDevice`](/docs/reference/CheerpX.IDBDevice) to cache and persist data and a `OverlayDevice` to combine the two.
192+
Create an ext2 filesystem by combining a [`HttpBytesDevice`](/docs/reference/httpBytesDevice) to acess disk blocks, an [`IDBDevice`](/docs/reference/CheerpX.IDBDevice) to cache and persist data and a [`OverlayDevice`](/docs/reference/CheerpX.OverlayDevice) to combine the two.
193193

194194
```javascript
195195
// Create an HttpBytesDevice for streaming disk blocks via HTTP
@@ -215,7 +215,7 @@ CheerpX supports various types of devices that can be used in the OverlayDevice
215215

216216
1. [**HttpBytesDevice**](/docs/reference/httpBytesDevice): The default choice for loading filesystem images via HTTP. Suitable for most web-hosted files.
217217
2. **GitHubDevice**: Ideal for projects forked from the [WebVM](https://github.com/leaningtech/webvm/) repository. The Integrated GitHub Action will take care of preparing disk chunks for efficient access.
218-
3. **OverlayDevice**: `OverlayDevice` supports chaining, making it possible to efficiently "fork" disk images while only storing the changes from previous versions.
218+
3. [**OverlayDevice**](/docs/reference/CheerpX.OverlayDevice): `OverlayDevice` supports chaining, making it possible to efficiently _fork_ disk images while only storing the changes from previous versions.
219219

220220
## Best practices
221221

sites/cheerpx/src/content/docs/11-guides/Networking.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,12 @@ What is happening here?
128128
- [loginUrlCb] expects the base URL of a control server that will continue and finish the login process. This callback is executed when prompting the user to log in interactively with Tailscale.
129129
- [stateUpdateCb] and [netmapUpdateCb] are necessary for tracking network status and updates to network maps.
130130

131+
After setting up the network interface, you can trigger the network login by calling.
132+
133+
```js
134+
await cx.networkLogin();
135+
```
136+
131137
## Self-hosting Headscale
132138

133139
Headscale is an open-source and self-hosted implementation of the Tailscale control server. The upstream version of Headscale does not yet properly support the WebSocket transport. For the time being, please use [our fork](https://github.com/leaningtech/headscale).

sites/cheerpx/src/content/docs/11-guides/custom-images.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ RUN apt-get update && apt-get -y upgrade && apt-get -y install curl
2424
Once the `Dockerfile` is ready, build the image. Use `buildah` to create a container image for your filesystem.
2525

2626
```bash
27-
buildah build -f Dockerfile --platform linux/i386 -t cheerpximage
27+
buildah build -f Dockerfile --dns=none --platform linux/i386 -t cheerpximage
2828
```
2929

3030
## 3. Create a container from the Docker Image

sites/cheerpx/src/content/docs/12-reference/CheerpX.Linux/00-create.md

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -43,14 +43,14 @@ interface MountPointConfiguration {
4343
// Specifies the filesystem type
4444
// 'ext2' for Linux ext2
4545
// 'dir' for a hierarchical file system
46-
// 'devs' for device files
47-
// 'proc' for process info files.
46+
// 'devs' for device files (no device required)
47+
// 'proc' for process info files. (no device required)
4848
type: "ext2" | "dir" | "devs" | "proc";
4949

5050
// First mount must be "/" (root)
5151
path: string;
52-
// Can be one of: overlayDevice / webDevice / dataDevice / idbDevice
53-
dev: CheerpX.Device;
52+
// Required for 'ext2' and 'dir' types, but optional for 'devs' and 'proc'
53+
dev?: CheerpX.Device;
5454
}
5555
```
5656

@@ -61,6 +61,8 @@ const cx = await CheerpX.Linux.create({
6161
mounts: [
6262
{ type: "ext2", path: "/", dev: overlayDevice },
6363
{ type: "dir", path: "/app", dev: webDevice },
64+
{ type: "devs", path: "/dev" }, // No dev required
65+
{ type: "proc", path: "/proc" }, // No dev required
6466
],
6567
});
6668
```
Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
---
2+
title: create
3+
description: Create a writable persistent overlay device on top of another block device.
4+
---
5+
6+
```ts
7+
namespace CheerpX {
8+
class OverlayDevice {
9+
static async create(
10+
baseDevice: Device,
11+
overlayDevice: Device
12+
): Promise<OverlayDevice>;
13+
}
14+
}
15+
```
16+
17+
## Parameters
18+
19+
- **baseDevice (`Device`)** - The underlying device (e.g., [`HttpBytesDevice`](/docs/reference/httpBytesDevice), [`IDBDevice`](/docs/reference/CheerpX.IDBDevice)) that serves as the base layer for the filesystem.
20+
21+
- **overlayDevice (`Device`)** - The writable layer that will overlay the base device, enabling persistent changes.
22+
23+
## Returns
24+
25+
`CheerpX.OverlayDevice.create` returns a [Promise] that resolves to an instance of the `OverlayDevice`. The `OverlayDevice` allows you to overlay a writable layer on top of the base device, enabling persistent changes while still accessing the base data.
26+
27+
## Example
28+
29+
Create an `OverlayDevice` instance to combine a [`HttpBytesDevice`](/docs/reference/httpBytesDevice) for streaming data from an HTTP source and an [`IDBDevice`](/docs/reference/CheerpX.IDBDevice) for caching and persistent local storage.
30+
31+
```ts {8, 12}
32+
// Create a read-only HttpBytesDevice for streaming disk blocks via HTTP
33+
const httpDevice = await CheerpX.HttpBytesDevice.create("/cheerpXImage.ext2");
34+
35+
// Create an IDBDevice for local persistent storage
36+
const idbDevice = await CheerpX.IDBDevice.create("block_idbDevice");
37+
38+
// Create an OverlayDevice to combine the two devices
39+
const overlayDevice = await CheerpX.OverlayDevice.create(httpDevice, idbDevice);
40+
41+
// Mount the overlay device in the CheerpX environment as an ext2 filesystem
42+
const cx = await CheerpX.Linux.create({
43+
mounts: [{ type: "ext2", path: "/", dev: overlayDevice }],
44+
});
45+
```
46+
47+
In this example, the `OverlayDevice` provides a writable layer on top of the [`HttpBytesDevice`](/docs/reference/httpBytesDevice) (which serves as a read-only block device for streaming), allowing changes to be stored locally via the [`IDBDevice`](/docs/reference/CheerpX.IDBDevice).
48+
49+
For more information, please check out the [Files and File system guide](/docs/guides/File-System-support). This guide provides more details on how to work with files and directories in CheerpX.
50+
51+
[Promise]: https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Promise

sites/cheerpx/src/content/docs/13-tutorials/full_os.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ CMD [ "/bin/bash" ]
2222
Create a container out of your Dockerfile:
2323

2424
```bash
25-
buildah build -f Dockerfile --platform linux/i386 -t cheerpximage
25+
buildah build -f Dockerfile --dns=none --platform linux/i386 -t cheerpximage
2626
podman create --name cheerpxcontainer cheerpximage
2727
```
2828

225 KB
Loading

0 commit comments

Comments
 (0)