1
0
Fork
You've already forked dylan-playground
0
Implementation of play.opendylan.org
  • Dylan 76.9%
  • Faust 17.5%
  • Python 2.3%
  • Makefile 2.1%
  • Shell 1.2%
Find a file
Carl Gay c5eaa69336
Merge pull request #25 from cgay/links
Update documentation links for revamped opendylan.org site
2023年10月11日 12:38:49 -04:00
static Add a favicon 2020年03月21日 23:42:31 +00:00
cleanup.sh Add a script to remove old playgrounds and logs 2020年03月29日 18:10:55 +00:00
config.dev.xml Simplify deployment strategy 2022年12月30日 20:27:47 +00:00
config.live.xml Simplify deployment strategy 2022年12月30日 20:27:47 +00:00
dylan-package.json Update http and logging deps 2022年12月30日 05:23:23 +00:00
dylan-playground.lid Rename library and repo to dylan-playground 2020年12月25日 16:54:53 +00:00
dylan-playground.service Run dylan-playground service as root 2022年12月30日 05:24:51 +00:00
early.dylan Rename library and repo to dylan-playground 2020年12月25日 16:54:53 +00:00
examples.dylan Make "Hello World" the default example 2021年08月28日 15:29:46 +00:00
library.dylan Update for new json printer 2020年12月31日 04:28:17 +00:00
LICENSE Create LICENSE 2019年04月03日 05:04:08 -04:00
locustfile.py Import more modules in playground, add /error resource 2020年10月17日 22:54:11 +00:00
main.dylan Rename library and repo to dylan-playground 2020年12月25日 16:54:53 +00:00
Makefile Simplify deployment strategy 2022年12月30日 20:27:47 +00:00
play.dylan Use machine-words module in user code 2022年12月30日 20:27:47 +00:00
playground.dsp Update documentation links for revamped opendylan.org site 2023年10月11日 16:37:34 +00:00
README.md Simplify deployment strategy 2022年12月30日 20:27:47 +00:00
share.dylan Update for new json printer 2020年12月31日 04:28:17 +00:00

dylan-playground

Implementation of play.opendylan.org which lets users try out Dylan code in a web browser.

Installation

  • Install dylan-tool if it's not already part of your Open Dylan installation.
  • git clone https://github.com/dylan-lang/dylan-playground
  • cd dylan-playground
  • dylan update
  • dylan build --all

Deployment

By default the playground is deployed to /opt/dylan-playground/{dev,live} and it expects /opt/opendylan/bin/dylan-compiler to exist. To change either of those you must edit the Makefile.

  1. Stop the current dylan-playground process so the executable file can be replaced. Usually just systemctl stop dylan-playground.

  2. make install to install the "dev" instance. To install the "live" instance, use environment=live make install.

  3. The first time you deploy you'll need to configure systemd. As root, run these commands:

    cp dylan-playground.service /etc/systemd/system/
    systemctl start dylan-playground
    # ...check /var/log/syslog to see that it started correctly...
    systemctl enable dylan-playground
    
  4. NOTE that if you change the deployment directory you must move the "shares" subdirectory to the new location or shared playground links will be broken.

HTTPS

Dylan's ssl-network has bit rotted so in the interest of speed I just put the playground behind an nginx proxy. Here are some reminders about how I set it up.

  • Start nginx with default settings. It must listen on port 80 for the cert challenge.

  • Use certbot to install a Let's Encrypt cert and key:

    $ sudo snap install certbot
    $ sudo certbot certonly --nginx
    

    The cert should be renewed automatically due to a systemctl timer. See systemctl list-timers. To renew the certificate manually, stop the playground web server and run certbot renew --standalone and restart nginx with systemctl restart nginx.

  • Create new nginx config and restart nginx:

    listen 443 ssl;
    listen [::]:443 ssl;
    server_name play.opendylan.org;
    ssl_certificate /etc/letsencrypt/live/play.opendylan.org/cert.pem;
    ssl_certificate_key /etc/letsencrypt/live/play.opendylan.org/privkey.pem;
    limit_req_zone $binary_remote_addr zone=playground:1m rate=30r/m;
    location / {
     limit_req zone=playground burst=10;
     proxy_pass http://localhost:80; # dylan-playground server
    }
    
  • Replace default with the play.opendylan.org config in sites-enabled and restart with nginx -s reload.