Skip to content
This repository was archived by the owner on Jun 27, 2018. It is now read-only.

Commit b893c8f

Browse files
committed
Update pieces of the README
1 parent 82d4004 commit b893c8f

File tree

1 file changed

+42
-58
lines changed

1 file changed

+42
-58
lines changed

README.md

Lines changed: 42 additions & 58 deletions
Original file line numberDiff line numberDiff line change
@@ -33,84 +33,68 @@ To see a list of attributes, use `~help`:
3333

3434
## System Requirements
3535

36-
Rust-Playpen currently needs to be run on a system with access to Docker.
36+
Currently needs to be run on a system with access to Docker.
3737

38-
## IRC Bot Setup
39-
40-
#### Create `bitly_key`
41-
42-
The bot uses [bitly](https://bitly.com) as a URL shortener. Get an OAuth access token, and put it into a file called `bitly_key`, in the root directory of `rust-playpen`.
43-
44-
#### Modify `playbot.toml`
45-
46-
You'll also need to change the file `playbot.toml`. This configuration allows
47-
the bot's nick to be registered, and can include the nick's password.
38+
## Running the web server
4839

49-
#### Registering and starting services
40+
First, create the Docker images that playpen will use:
5041

51-
The working playpen has the IRC and Web services set up to automatically start at boot:
42+
```
43+
sh docker/build.sh
44+
```
5245

53-
`/etc/systemd/system/rust-playpen-irc.service`
46+
Next, spin up the server.
5447

5548
```
56-
[Unit]
57-
Description=Rust code evaluation sandbox (irc bots)
58-
After=network.target
49+
cargo run --bin playpen
50+
```
5951

60-
[Service]
61-
ExecStart=/root/rust-playpen/bot.py
52+
You should now be able to browse http://127.0.0.1:8080 and interact.
6253

63-
[Install]
64-
WantedBy=multi-user.target
65-
```
54+
## IRC Bot Setup
6655

67-
`/etc/systemd/system/rust-playpen-web.service`
56+
You'll need to move `playbot.toml.example` to `playbot.toml` and then configure
57+
it appropriately.
6858

69-
```
70-
[Unit]
71-
Description=Rust code evaluation sandbox (web frontend)
72-
After=network.target
59+
# Setting up the play.rust-lang.org server
7360

74-
[Service]
75-
ExecStart=/root/rust-playpen/web.py
61+
First off, start off with a fresh Ubuntu AMI. These should be listed on
62+
https://cloud-images.ubuntu.com/locator/ec2/, and the current one is the Xenial
63+
us-west-1 64-bit hvm ebs-ssd server, ami-08490c68.
7664

77-
[Install]
78-
WantedBy=multi-user.target
79-
```
65+
* Launch an m3.medium instance
66+
* Launch into EC2-Classic
67+
* Protect against accidental termination
68+
* Make the disk ~100GB
69+
* Use the existing playground security group
8070

81-
`/etc/systemd/system/rust-playpen-update.service`
71+
SSH through the bastion, then:
8272

8373
```
84-
[Unit]
85-
Description=Playpen sandbox root updater
86-
87-
[Service]
88-
Type=oneshot
89-
ExecStart=/root/rust-playpen/init.sh
90-
Environment=HOME=/root
74+
sudo apt-get update
75+
sudo apt-get install python-pip apt-transport-https ca-certificates
76+
sudo pip install pygments
77+
78+
curl https://sh.rustup.rs | sh
79+
git clone https://github.com/rust-lang/rust-playpen
80+
81+
# see https://docs.docker.com/engine/installation/linux/ubuntulinux/
82+
sudo apt-key adv --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys 58118E89F3A912897C070ADBF76221572C52609D
83+
echo 'deb https://apt.dockerproject.org/repo ubuntu-xenial main' | sudo tee /etc/apt/sources.list.d/docker.list
84+
sudo apt-get update
85+
sudo apt-get install linux-image-extra-$(uname -r) docker-engine
86+
sudo service docker start
87+
sudo usermod -aG docker ubuntu
9188
```
9289

93-
`/etc/systemd/system/rust-playpen-update.timer`
90+
Next, configure `playbot.toml` copied from `playbot.toml.example`.
9491

95-
```
96-
[Unit]
97-
Description=Playpen sandbox root update scheduler
92+
Next, open up a screen window (`screen -R`), and spin up two sessions:
9893

99-
[Timer]
100-
OnBootSec=10min
101-
OnCalendar=daily
102-
Persistent=true
103-
Unit=rust-playpen-update.service
104-
105-
[Install]
106-
WantedBy=multi-user.target
10794
```
108-
109-
If the services fail to start, kick them:
95+
cargo run --release --bin playpen
96+
```
11097

11198
```
112-
$ systemctl restart rust-playpen-irc.service
113-
$ systemctl restart rust-playpen-web.service
99+
cargo run --release --bin playbot
114100
```
115-
116-
[playpen]: https://github.com/thestinger/playpen

0 commit comments

Comments
 (0)