shell
所属分类:编程语言基础
开发工具:Python
文件大小:0KB
下载次数:0
上传日期:2023-03-08 23:58:10
上 传 者:
sh-1993
说明: Diggy是一个在沙箱中运行实用和娱乐编程语言的游乐场
(Diggy is a playground that runs practical and recreationcal programming languages in a sandbox)
文件列表:
.dockerignore (88, 2023-03-08)
.env.dev (178, 2023-03-08)
.env.smtp.dev (112, 2023-03-08)
.eslintrc.cjs (316, 2023-03-08)
.flake8 (749, 2023-03-08)
.prettierignore (131, 2023-03-08)
.prettierrc (152, 2023-03-08)
Dockerfile.repl (1500, 2023-03-08)
Dockerfile.sandbox (6160, 2023-03-08)
ROADMAP.md (934, 2023-03-08)
config/ (0, 2023-03-08)
config/diggy.conf (3832, 2023-03-08)
config/diggy.dev.conf (1212, 2023-03-08)
diggy-repl/ (0, 2023-03-08)
diggy-repl/docker/ (0, 2023-03-08)
diggy-repl/docker/socket.conf (131, 2023-03-08)
diggy-repl/docker/supervisord.conf (77, 2023-03-08)
diggy-repl/docker/web.conf (133, 2023-03-08)
diggy-repl/jsconfig.json (246, 2023-03-08)
diggy-repl/package.json (1540, 2023-03-08)
diggy-repl/src/ (0, 2023-03-08)
diggy-repl/src/app.html (1112, 2023-03-08)
diggy-repl/src/app.scss (1803, 2023-03-08)
diggy-repl/src/global.d.ts (111, 2023-03-08)
diggy-repl/src/lib/ (0, 2023-03-08)
diggy-repl/src/lib/codeeditor.svelte (4879, 2023-03-08)
diggy-repl/src/lib/env.js (167, 2023-03-08)
diggy-repl/src/lib/filelisting.svelte (3400, 2023-03-08)
diggy-repl/src/lib/footer.svelte (1266, 2023-03-08)
diggy-repl/src/lib/fs.js (177, 2023-03-08)
diggy-repl/src/lib/nav.svelte (1523, 2023-03-08)
diggy-repl/src/lib/one-dark.ts (3819, 2023-03-08)
diggy-repl/src/lib/repl.js (1207, 2023-03-08)
diggy-repl/src/lib/repl.svelte (2456, 2023-03-08)
diggy-repl/src/lib/replterminal.svelte (561, 2023-03-08)
diggy-repl/src/lib/stores.js (536, 2023-03-08)
diggy-repl/src/lib/utils.js (362, 2023-03-08)
... ...
# Diggy
Diggy is a playground that runs practical and recreationcal
programming languages in a sandbox. It is a zero setup environment,
click a link, and you are ready to go.
![Diggy screenshot](https://raw.githubusercontent.com/diggyhq/shell/master/public/image.png)
## Install
This repo is a silly monorepo using Node.JS and Python. You will need
to install some dependencies first.
```bash
npm install -g yarn
pip install flake8 black
```
## NSJail
Typically, you won't be running nsjail on a host machine, but if you
really have to this might be helpful. Keep in mind that sandbox.cfg is
created for docker file system and it may not work for you as is.
```bash
sudo mkdir /sys/fs/cgroup/{pids,memory}/NSJAIL
sudo chmod u+s /usr/local/bin/nsjail
nsjail --quiet --config sandbox.cfg -- /usr/local/bin/python
```
## Development
Install development environment:
```bash
yarn
yarn format
yarn lint
```
If you want to develop Diggy locally without `docker-compose`, you
will need to adjust `.env` file to something like this. nsjail won't
make it easier, so for the time being I recommend running at least two
containers: `nginx` and `sandbox`.
```
VM_PATH=/userland
HOST=0.0.0.0
WEB_HOST=http://diggy.test:3000
VITE_WS_HOST=http://diggy.test:5000
VITE_SANDBOX_HOST=http://sandbox.diggy.test
VITE_SANDBOX_HOST_LOCAL=http://sandbox.diggy.test
```
Make sure to add hosts to `/etc/hosts`:
```
127.0.0.1 diggy.test
127.0.0.1 ws.diggy.test
127.0.0.1 sandbox.diggy.test
```
It should be enough to get frontend up and running:
```
cd diggy-repl
yarn dev
yarn server
```
## Run
```bash
./init-letsencrypt.sh
./setup
# for production, make change to ./init-letsencrypt.sh such
# as email address, domains, delete exit statement
# review domains in ./config/diggy.conf
cp .env.dev .env
cp .env.smtp.dev .env.smtp
# adjust .env and .env.smtp configuration
docker-compose build
docker-compose up
```
## TODO
Disclaimer: Diggy's code base is not in the best shape at the moment,
it was put as a weekend project, and it does require a massive clean
up.
See
[ROADMAP.md](https://github.com/diggyhq/shell/blob/master/ROADMAP.md)
for more detail.
## Configure DigitalOcean instance
- $10/mo + backups + volume
- harden ssh configuration
- create a new user, add to sudoers, protect root
- install fail2ban
- install docker & docker-compose
- install do-agent
- setup 4 domains: www/@, ws, and sandbox
- (local) add domains to /etc/hosts
- (local) FireFox is going to complain about dummy certificates, visit
each test domain to acknowledge security risks. Otherwise, CORS will fail
- replace ./config/diggy.dev.conf to ./config/diggy.conf in docker-compose.yml
- adjust ./config/diggy.conf, and ./init-letsencrypt.sh per your setup
(specifically replace diggy.test to whatever makes more sense)
- run ./init-letsencrypt.sh
- run ./setup.sh
近期下载者:
相关文件:
收藏者: