Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/gao-sun/github-vsc
🐙 Launch VSCode dev environment in your browser.
https://github.com/gao-sun/github-vsc
github react spa vscode web webworker
Last synced: about 2 months ago
JSON representation
🐙 Launch VSCode dev environment in your browser.
- Host: GitHub
- URL: https://github.com/gao-sun/github-vsc
- Owner: gao-sun
- Archived: true
- Created: 2021-02-14T04:44:05.000Z (almost 4 years ago)
- Default Branch: master
- Last Pushed: 2021-04-01T11:51:46.000Z (over 3 years ago)
- Last Synced: 2024-08-02T05:11:22.476Z (5 months ago)
- Topics: github, react, spa, vscode, web, webworker
- Language: TypeScript
- Homepage: https://github-vsc.com
- Size: 398 KB
- Stars: 130
- Watchers: 5
- Forks: 18
- Open Issues: 6
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# This project may violate GitHub Actions usage policy, so I'm going to archive the repo soon. Please consider using other alternatives. Thanks.
# GitHub VSC
Launch VSCode dev environment in your browser. For free.
## How?
Change `github` to `github-vsc` in the URL and press Enter.
E.g. `github.com/gao-sun/eul` -> `github-vsc.com/gao-sun/eul`
[Live Demo](https://github-vsc.com/gao-sun/github-vsc/tree/master/README.md)
## Highlights
🔑 Simple. Just need a PAT for everything.
⚡ Super fast. Get your dev environment ready in up to 10s.
🔌 Flexible. Available for private repos and self-hosted runners.
📝 Cozy. Can only be an online editor without remote session.
## Start a Remote Session for Dev
1. Activate the 6th tab with GitHub logo in the side bar.
2. Setup your [PAT](https://github.com/settings/tokens/new?description=GitHub%20VSC%20Token&scopes=repo) with repo access for forking the [runner repo](https://github.com/gao-sun/github-vsc-runner) and repo checkout inside workflow runs.
3. Choose the nearest runner server and your preferred OS, then click "Start Session".![preview-remote-session](https://user-images.githubusercontent.com/14722250/111058903-a7e61280-84cc-11eb-981e-4be3a34b8781.png)
## Port Forwarding
For safety concerns, port forwarding is disabled by default. Enable with simple one-click and you can access the local port with HTTP reqeists via `https://[session-id].runner-[location].github-vsc.com`. See the tutorial [here](docs/port-forwarding.md).
## Is It Free?
TL;DR: **YES.**
- 6 hours per session with PAT.
- 72 hours with self-hosted runners.### Why 6 Hours?
For GitHub-hosted runners, quote from the [Usage Limit](https://docs.github.com/en/actions/reference/usage-limits-billing-and-administration#usage-limits) section in the official docs:
> Each job in a workflow can run for up to 6 hours of execution time.
Which means the runner job will be killed after you reach that limit. Also you may notice:
> You can execute up to 1000 API requests in an hour across all actions within a repository.
We're enforcing WebSocket for data transmission inside the job so it'll be OK for casual development.
### Why 72 Hours?
Unfortunately, self-hosted runners also have a [Usage Limit](https://docs.github.com/en/actions/hosting-your-own-runners/about-self-hosted-runners#usage-limits) on the total run time of workflow itself (i.e. 72 hours), and the 1,000 API requests limit also applies.
### Any Method to Get Rid of All These Limitations?
Yes. But there's no one-line script yet. The basic concept is to setup fully controlled runner client and trigger client deployment by API hook/network event. Feel free to open an issue if you are interested.
## Is It Safe?
### Data Storage
We'll NOT transmit or store any of your credentials (for now it's PAT) or data to the cloud. You credentials will be saved inside your browser and used for GitHub official API requests and Actions setup. The repo access inside workflow is enabled by the official [create or update a repository secret REST API](https://docs.github.com/en/rest/reference/actions#create-or-update-a-repository-secret).
### Remote Session
Your connection is always under a secure protocol (HTTPS/WSS) and all session IDs are generated by the random algorithm with an extremely small collision probability. Quote from the [collision calculator](https://zelark.github.io/nano-id-cc/):
> With the speed of 1000 IDs per second, ~21 million years needed, in order to have a 1% probability of at least one collision.
Treat your session ID as credentials.
### Burn after Use
Thanks to the nature of GitHub Actions, there's no need to worry about setup and disposal. Your dev environment will be cleaned up as soon as you terminate the session from here or cancel the workflow run.
## Online Editor
If you'd like to just do some quick editing, then no need for starting a remote session. Go ahead to make some changes, and you're ready to commit changes to the branch directly or open a pull request based on your access to the repo. [Learn more about the online editor](docs/online-editor.md).
## Specifications
Click [here](https://docs.github.com/en/actions/using-github-hosted-runners/about-github-hosted-runners#supported-runners-and-hardware-resources) to see VM hardwares for GitHub-hosted runners. You can also find supported softwares within that page.
Runner servers are not hosted by GitHub. The bill sends to me. :-) They are hosted in Microsoft Azure since it's backing GitHub Actions as well.
## I Know There's One More Question...
Compare to the officially provided GitHub Codespaces:
| | GitHub VSC | GitHub Codespaces |
|--------------------|---------------------|------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
| Type | Open-Source Project | Developed by GitHub |
| Pricing | Free | From $0.085/hr to $0.339/hr, with additional monthly storage costs. [Learn more](https://docs.github.com/en/github/developing-online-with-codespaces/about-billing-for-codespaces) |
| OS | Ubuntu, macOS | Ubuntu |
| Private Deployment | Available | N/A |
| VSCode Extension | Built-in | Support marketplace |
| Code Navigation | Not Yet | ✔️ |## Engineering
See [explanation](docs/engineering.md).
## Try It Locally
Make sure you are prepared for the same prerequisites as [Code - OSS](https://github.com/microsoft/vscode/wiki/How-to-Contribute#prerequisites).
```bash
# in ./
# install deps
yarn
# clone and build Code - OSS
yarn build-vsc
# happy hacking on https://localhost:8080
yarn dev
```To debug remote session, please see [github-vsc-runner](https://github.com/gao-sun/github-vsc-runner).
## Credits
Heavily inspired by [github1s](https://github.com/conwnet/github1s), edited vscode compiling part from [vscode-web](https://github.com/Felx-B/vscode-web), and derivated FileSystem implementation from [vscode-web-playground](https://github.com/microsoft/vscode-web-playground).
Also exported the beautiful One Dark theme from [vscode-theme-onedark](https://github.com/akamud/vscode-theme-onedark).