diff --git a/components/Wasm/Webvm.js b/components/Wasm/Webvm.js
index 5f35d9fd..5bb51310 100644
--- a/components/Wasm/Webvm.js
+++ b/components/Wasm/Webvm.js
@@ -10,6 +10,7 @@ export default function Webvm(props) {
+ {/* */}
)
}
\ No newline at end of file
diff --git a/public/webvm/.github/workflows/deploy.yml b/public/webvm/.github/workflows/deploy.yml
deleted file mode 100644
index 293ffce6..00000000
--- a/public/webvm/.github/workflows/deploy.yml
+++ /dev/null
@@ -1,237 +0,0 @@
-name: Deploy
-
-# Define when the workflow should run
-on:
- # Allow manual triggering of the workflow from the Actions tab
- workflow_dispatch:
-
- # Allow inputs to be passed when manually triggering the workflow from the Actions tab
- inputs:
- DOCKERFILE_PATH:
- type: string
- description: 'Path to the Dockerfile'
- required: true
- default: 'dockerfiles/debian_mini'
-
- IMAGE_SIZE:
- type: string
- description: 'Image size, 950M max'
- required: true
- default: '600M'
-
- DEPLOY_TO_GITHUB_PAGES:
- type: boolean
- description: 'Deploy to Github pages'
- required: true
- default: true
-
- GITHUB_RELEASE:
- type: boolean
- description: 'Upload GitHub release'
- required: true
- default: false
-
-jobs:
-
- guard_clause:
- runs-on: ubuntu-latest
-
- env:
- GH_TOKEN: ${{ github.token }} # As required by the GitHub-CLI
-
- permissions:
- actions: 'write' # Required in order to terminate the workflow run.
-
- steps:
- - uses: actions/checkout@v3
- # Guard clause that cancels the workflow in case of an invalid DOCKERFILE_PATH and/or incorrectly configured Github Pages.
- # The main reason for choosing this workaround for aborting the workflow is the fact that it does not display the workflow as successful, which can set false expectations.
- - name: DOCKERFILE_PATH.
- shell: bash
- run: |
- # We check whether the Dockerfile_path is valid.
- if [ ! -f ${{ github.event.inputs.DOCKERFILE_PATH }} ]; then
- echo "::error title=Invalid Dockerfile path::No file found at ${{ github.event.inputs.DOCKERFILE_PATH }}"
- echo "terminate=true" >> $GITHUB_ENV
- fi
-
- - name: Github Pages config guard clause
- if: ${{ github.event.inputs.DEPLOY_TO_GITHUB_PAGES == 'true' }}
- run: |
- # We use the Github Rest api to get information regarding pages for the Github Repository and store it into a temporary file named "pages_response".
- set +e
- gh api \
- -H "Accept: application/vnd.github+json" \
- -H "X-GitHub-Api-Version: 2022-11-28" \
- /repos/${{ github.repository_owner }}/$(basename ${{ github.repository }})/pages > pages_response
-
- # We make sure Github Pages has been enabled for this repository.
- if [ "$?" -ne 0 ]; then
- echo "::error title=Potential pages configuration error.::Please make sure you have enabled Github pages for the ${{ github.repository }} repository. If already enabled then Github pages might be down"
- echo "terminate=true" >> $GITHUB_ENV
- fi
- set -e
-
- # We make sure the Github pages build & deployment source is set to "workflow" (Github Actions). Instead of a "legacy" (branch).
- if [[ "$(jq --compact-output --raw-output .build_type pages_response)" != "workflow" ]]; then
- echo "Undefined behaviour, Make sure the Github Pages source is correctly configured in the Github Pages settings."
- echo "::error title=Pages configuration error.::Please make sure you have correctly picked \"Github Actions\" as the build and deployment source for the Github Pages."
- echo "terminate=true" >> $GITHUB_ENV
- fi
- rm pages_response
-
- - name: Terminate run if error occurred.
- run: |
- if [[ $terminate == "true" ]]; then
- gh run cancel ${{ github.run_id }}
- gh run watch ${{ github.run_id }}
- fi
-
- build:
- needs: guard_clause # Dependency
- runs-on: ubuntu-latest # Image to run the worker on.
-
- env:
- TAG: "ext2-webvm-base-image" # Tag of docker image.
- IMAGE_SIZE: '${{ github.event.inputs.IMAGE_SIZE }}'
- DEPLOY_DIR: /webvm_deploy/ # Path to directory where we host the final image from.
-
- permissions: # Permissions to grant the GITHUB_TOKEN.
- contents: write # Required permission to make a github release.
-
- steps:
- # Checks-out our repository under $GITHUB_WORKSPACE, so our job can access it
- - uses: actions/checkout@v3
-
- # Setting the IMAGE_NAME variable in GITHUB_ENV to __.ext2.
- - name: Generate the image_name.
- id: image_name_gen
- run: |
- echo "IMAGE_NAME=$(basename ${{ github.event.inputs.DOCKERFILE_PATH }})_$(date +%Y%m%d)_${{ github.run_id }}.ext2" >> $GITHUB_ENV
-
- # Create directory to host the image from.
- - run: sudo mkdir -p $DEPLOY_DIR
-
- # Build the i386 Dockerfile image.
- - run: docker build . --tag $TAG --file ${{ github.event.inputs.DOCKERFILE_PATH }} --platform=i386
-
- # Run the docker image so that we can export the container.
- # Run the Docker container with the Google Public DNS nameservers: 8.8.8.8, 8.8.4.4
- - run: |
- docker run --dns 8.8.8.8 --dns 8.8.4.4 -d $TAG
- echo "CONTAINER_ID=$(sudo docker ps -aq)" >> $GITHUB_ENV
-
- # We extract the CMD, we first need to figure whether the Dockerfile uses CMD or an Entrypoint.
- - name: Extracting CMD / Entrypoint and args
- shell: bash
- run: |
- cmd=$(sudo docker inspect --format='{{json .Config.Cmd}}' $CONTAINER_ID)
- entrypoint=$(sudo docker inspect --format='{{json .Config.Entrypoint}}' $CONTAINER_ID)
- if [[ $entrypoint != "null" && $cmd != "null" ]]; then
- echo "CMD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Entrypoint' )" >> $GITHUB_ENV
- echo "ARGS=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Cmd' )" >> $GITHUB_ENV
- elif [[ $cmd != "null" ]]; then
- echo "CMD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Cmd[:1]' )" >> $GITHUB_ENV
- echo "ARGS=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Cmd[1:]' )" >> $GITHUB_ENV
- else
- echo "CMD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Entrypoint[:1]' )" >> $GITHUB_ENV
- echo "ARGS=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Entrypoint[1:]' )" >> $GITHUB_ENV
- fi
-
- # We extract the ENV, CMD/Entrypoint and cwd from the Docker container with docker inspect.
- - name: Extracting env, args and cwd.
- shell: bash
- run: |
- echo "ENV=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.Env' )" >> $GITHUB_ENV
- echo "CWD=$( sudo docker inspect $CONTAINER_ID | jq --compact-output '.[0].Config.WorkingDir' )" >> $GITHUB_ENV
-
- # We create and mount the base ext2 image to extract the Docker container's filesystem its contents into.
- - name: Create ext2 image.
- run: |
- # Preallocate space for the ext2 image
- sudo fallocate -l $IMAGE_SIZE ${IMAGE_NAME}
- # Format to ext2 linux kernel revision 0
- sudo mkfs.ext2 -r 0 ${IMAGE_NAME}
- # Mount the ext2 image to modify it
- sudo mount -o loop -t ext2 ${IMAGE_NAME} /mnt/
-
- # We opt for 'docker cp --archive' over 'docker save' since our focus is solely on the end product rather than individual layers and metadata.
- # However, it's important to note that despite being specified in the documentation, the '--archive' flag does not currently preserve uid/gid information when copying files from the container to the host machine.
- # Another compelling reason to use 'docker cp' is that it preserves resolv.conf.
- - name: Export and unpack container filesystem contents into mounted ext2 image.
- run: |
- sudo docker cp -a ${CONTAINER_ID}:/ /mnt/
- sudo umount /mnt/
- # Result is an ext2 image for webvm.
-
- # Move required files for gh-pages deployment to the deployment directory $DEPLOY_DIR.
- - run: sudo mv assets examples xterm favicon.ico index.html login.html network.js scrollbar.css serviceWorker.js tower.ico $DEPLOY_DIR
-
- # The .txt suffix enabled HTTP compression for free
- - name: Generate image split chunks and .meta file
- run: |
- sudo split ${{ env.IMAGE_NAME }} ${{ env.DEPLOY_DIR }}/${{ env.IMAGE_NAME }}.c -a 6 -b 128k -x --additional-suffix=.txt
- sudo bash -c "stat -c%s ${{ env.IMAGE_NAME }} > ${{ env.DEPLOY_DIR }}/${{ env.IMAGE_NAME }}.meta"
- # This step updates the default index.html file by performing the following actions:
- # 1. Replaces all occurrences of IMAGE_URL with the URL to the image.
- # 2. Replaces all occurrences of DEVICE_TYPE to bytes.
- # 3. Replace CMD with the Dockerfile entry command.
- # 4. Replace args with the Dockerfile CMD / Entrypoint args.
- # 5. Replace ENV with the container's environment values.
- - name: Adjust index.html
- run: |
- sudo sed -i 's#IMAGE_URL#"${{ env.IMAGE_NAME }}"#g' ${{ env.DEPLOY_DIR }}index.html
- sudo sed -i 's#DEVICE_TYPE#"split"#g' ${{ env.DEPLOY_DIR }}index.html
- sudo sed -i 's#CMD#${{ env.CMD }}#g' ${{ env.DEPLOY_DIR }}index.html
- sudo sed -i 's#ARGS#${{ env.ARGS }}#g' ${{ env.DEPLOY_DIR }}index.html
- sudo sed -i 's#ENV#${{ env.ENV }}#g' ${{ env.DEPLOY_DIR }}index.html
- sudo sed -i 's#CWD#${{ env.CWD }}#g' ${{ env.DEPLOY_DIR }}index.html
-
- # We generate index.list files for our httpfs to function properly.
- - name: make index.list
- shell: bash
- run: |
- find $DEPLOY_DIR -type d | while read -r dir;
- do
- index_list="$dir/index.list";
- sudo rm -f "$index_list";
- sudo ls "$dir" | sudo tee "$index_list" > /dev/null;
- sudo chmod +rw "$index_list";
- sudo echo "created $index_list";
- done
-
- # Create a gh-pages artifact in order to deploy to gh-pages.
- - name: Upload GitHub Pages artifact
- uses: actions/upload-pages-artifact@v1.0.7
- with:
- # Path of the directory containing the static assets for our gh pages deployment.
- path: ${{ env.DEPLOY_DIR }} # optional, default is _site/
-
- - name: github release # To upload our final ext2 image as a github release.
- if: ${{ github.event.inputs.GITHUB_RELEASE == 'true' }}
- uses: softprops/action-gh-release@v0.1.15
- with:
- target_commitish: ${{ github.sha }} # Last commit on the GITHUB_REF branch or tag
- tag_name: ext2_image
- fail_on_unmatched_files: 'true' # Fail in case of no matches with the file(s) glob(s).
- files: | # Assets to upload as release.
- ${{ env.IMAGE_NAME }}
-
- deploy_to_github_pages: # Job that deploys the github-pages artifact to github-pages.
- if: ${{ github.event.inputs.DEPLOY_TO_GITHUB_PAGES == 'true' }}
- needs: build
- environment:
- name: github-pages
- url: ${{ steps.deployment.outputs.page_url }}
-
- # Grant GITHUB_TOKEN the permissions required to make a Pages deployment
- permissions:
- pages: write # to deploy to Pages
- id-token: write # to verify the deployment originates from an appropriate source
-
- runs-on: ubuntu-latest
- steps:
- # Deployment to github pages
- - name: Deploy GitHub Pages site
- id: deployment
- uses: actions/deploy-pages@v2.0.0
diff --git a/public/webvm/.npmrc b/public/webvm/.npmrc
new file mode 100644
index 00000000..b6f27f13
--- /dev/null
+++ b/public/webvm/.npmrc
@@ -0,0 +1 @@
+engine-strict=true
diff --git a/public/webvm/README.md b/public/webvm/README.md
deleted file mode 100644
index 316dd7cf..00000000
--- a/public/webvm/README.md
+++ /dev/null
@@ -1,108 +0,0 @@
-# WebVM
-
-[![Discord server](https://img.shields.io/discord/988743885121548329?color=%235865F2&logo=discord&logoColor=%23fff)](https://discord.gg/yWRr2YnD9c)
-[![Issues](https://img.shields.io/github/issues/leaningtech/webvm)](https://github.com/leaningtech/webvm/issues)
-
-This repository hosts the source code for [https://webvm.io](https://webvm.io), a Linux virtual machine that runs in your browser.
-
-
-
-WebVM is a server-less virtual environment running fully client-side in HTML5/WebAssembly. It's designed to be Linux ABI-compatible. It runs an unmodified Debian distribution including many native development toolchains.
-
-WebVM is powered by the CheerpX virtualization engine, and enables safe, sandboxed client-side execution of x86 binaries on any browser. CheerpX includes an x86-to-WebAssembly JIT compiler, a virtual block-based file system, and a Linux syscall emulator.
-
-# Enable networking
-
-- Click "Connect via Tailscale" in the page header.
-- Log in to Tailscale (create an account if you don't have one).
-- If you are unfamiliar with Tailscale or would like additional information see [WebVM and Tailscale](/docs/Tailscale.md).
-
-# Fork, deploy, customize
-
-
-
-- Fork the repository.
-- Enable Github pages in settings.
- - Click on `Settings`.
- - Go to the `Pages` section.
- - Select `Github Actions` as the source.
-- Run the workflow.
- - Click on `Actions`.
- - Accept the prompt. This is required only once to enable Actions for your fork.
- - Click on the workflow named `Deploy`.
- - Click `Run workflow` and then once more `Run workflow` in the menu.
-- After a few seconds a new `Deploy` workflow will start, click on it to see details.
-- After the workflow completes, which takes a few minutes, it will show the URL below the `deploy_to_github_pages` job.
-
-
-
-You can now customize `dockerfiles/debian_mini` to suits your needs, or make a new Dockerfile from scratch. Use the `Path to Dockerfile` workflow parameter to select it.
-
-# Local deployment
-
-From a local `git clone`
-
-- Download the `debian_mini` Ext2 image from [https://github.com/leaningtech/webvm/releases/](https://github.com/leaningtech/webvm/releases/).
- - You can also build your own by selecting the "Upload GitHub release" workflow option.
- - Place the image in the repository root folder.
-- Edit `index.html`.
- - Uncomment the default values for `CMD`, `ARGS`, `ENV` and `CWD`.
- - Replace `DEVICE_TYPE` with `"bytes"`.
- - Replace `IMAGE_URL` with the name of the Ext2 image. For example `"debian_mini_20230519_5022088024.ext2"`.
-- Start a local HTTP server.
-- Enjoy your local WebVM.
-
-# Example customization: Python3 REPL
-
-The `Deploy` workflow takes into account the `CMD` specified in the Dockerfile. To build a REPL you can simply apply this patch and deploy.
-
-```diff
-diff --git a/dockerfiles/debian_mini b/dockerfiles/debian_mini
-index 2878332..1f3103a 100644
---- a/dockerfiles/debian_mini
-+++ b/dockerfiles/debian_mini
-@@ -15,4 +15,4 @@ WORKDIR /home/user/
- # We set env, as this gets extracted by Webvm. This is optional.
- ENV HOME="/home/user" TERM="xterm" USER="user" SHELL="/bin/bash" EDITOR="vim" LANG="en_US.UTF-8" LC_ALL="C"
- RUN echo 'root:password' | chpasswd
--CMD [ "/bin/bash" ]
-+CMD [ "/usr/bin/python3" ]
-```
-
-# Bugs and Issues
-
-Please use [Issues](https://github.com/leaningtech/webvm/issues) to report any bug.
-Or come to say hello / share your feedback on [Discord](https://discord.gg/yTNZgySKGa).
-
-# More links
-
-- [WebVM: server-less x86 virtual machines in the browser](https://leaningtech.com/webvm-server-less-x86-virtual-machines-in-the-browser/)
-- [WebVM: Linux Virtualization in WebAssembly with Full Networking via Tailscale](https://leaningtech.com/webvm-virtual-machine-with-networking-via-tailscale/)
-- [Mini.WebVM: Your own Linux box from Dockerfile, virtualized in the browser via WebAssembly](https://leaningtech.com/mini-webvm-your-linux-box-from-dockerfile-via-wasm/)
-- Reference GitHub Pages deployment: [Mini.WebVM](https://mini.webvm.io)
-- [Crafting the Impossible: X86 Virtualization in the Browser with WebAssembly](https://www.youtube.com/watch?v=VqrbVycTXmw) Talk at JsNation 2022
-
-# Thanks to...
-This project depends on:
-- [CheerpX](https://labs.leaningtech.com/cheerpx), made by [Leaning Technologies](https://leaningtech.com) for x86 virtualization and Linux emulation
-- xterm.js, [https://xtermjs.org/](https://xtermjs.org/), for providing the Web-based terminal emulator
-- [Tailscale](https://tailscale.com/), for the networking component
-- [lwIP](https://savannah.nongnu.org/projects/lwip/), for the TCP/IP stack, compiled for the Web via [Cheerp](https://github.com/leaningtech/cheerp-meta)
-
-# Versioning
-
-WebVM depends on the CheerpX x86-to-WebAssembly virtualization technology. A link to the current latest build is always available at [https://cheerpxdemos.leaningtech.com/publicdeploy/LATEST.txt](https://cheerpxdemos.leaningtech.com/publicdeploy/LATEST.txt). Builds of CheerpX are immutable and uniquely versioned. An example link would be:
-
-`https://cheerpxdemos.leaningtech.com/publicdeploy/20230517_94/cx.js`
-
-We strongly encourage users _not_ to use the latest build. Please directly use a specific build to avoid unexpected regressions. Since builds are immutable, if they work for you now they will keep working forever.
-
-# License
-
-WebVM is released under the Apache License, Version 2.0.
-
-You are welcome to use, modify, and redistribute the contents of this repository.
-
-The public CheerpX deployment is provided **as-is** and is **free to use** for technological exploration, testing and non-commercial uses. Downloading a CheerpX build for the purpose of hosting it elsewhere is not permitted.
-
-If you want to build a product on top of CheerpX/WebVM, please get in touch: sales@leaningtech.com
diff --git a/public/webvm/alpine.html b/public/webvm/alpine.html
new file mode 100644
index 00000000..ec8ddf7f
--- /dev/null
+++ b/public/webvm/alpine.html
@@ -0,0 +1,301 @@
+
+
+
+
+
+
+ WebVM - Linux virtualization in WebAssembly
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Fork me on GitHub
+