README.md 1.48 KB
Newer Older
1 2
## IndieHosters

Pierre Ozoux's avatar
Pierre Ozoux committed
3
This repository contains the configuration and scripts we use to control our servers.
Pierre Ozoux's avatar
Pierre Ozoux committed
4
It can run inside Vagrant or [deploy to a server](doc/getting-started-as-a-hoster.md)
5

Michiel de Jong's avatar
Michiel de Jong committed
6
## Prerequisites to running this code with Vagrant:
pierreozoux's avatar
pierreozoux committed
7 8
- [vagrant](http://www.vagrantup.com/)
- [virtualbox](https://www.virtualbox.org/)
Michiel de Jong's avatar
Michiel de Jong committed
9
- nfs
Pierre Ozoux's avatar
Pierre Ozoux committed
10 11
  - linux: run `apt-get install nfs-kernel-server`, or your OS equivalent
- [vagrant-hostsupdater](https://github.com/cogitatio/vagrant-hostsupdater)
12
  - run `vagrant plugin install vagrant-hostsupdater` to install
pierreozoux's avatar
pierreozoux committed
13 14 15 16 17 18 19

## Get started:

```bash
vagrant up
```

Michiel de Jong's avatar
Michiel de Jong committed
20
Wait for the provisioning to finish (~40mins), and go to your browser: https://indiehosters.dev
Pierre Ozoux's avatar
Pierre Ozoux committed
21

Michiel de Jong's avatar
Michiel de Jong committed
22
If the process fails, for instance due to network problems, you can retry by running `vagrant provision`.
Michiel de Jong's avatar
Michiel de Jong committed
23

Michiel de Jong's avatar
Michiel de Jong committed
24
### Set up a domain:
Michiel de Jong's avatar
Michiel de Jong committed
25 26

```bash
Michiel de Jong's avatar
Michiel de Jong committed
27
vagrant ssh core-1
Pierre Ozoux's avatar
Pierre Ozoux committed
28 29
sudo mkdir -p /data/import/example.dev/TLS
sudo cp /data/indiehosters/scripts/unsecure-certs/example.dev.pem /data/import/example.dev/TLS
30
sudo systemctl enable static@example.dev
Pierre Ozoux's avatar
Pierre Ozoux committed
31
sudo systemctl start static@example.dev
Michiel de Jong's avatar
Michiel de Jong committed
32
```
Pierre Ozoux's avatar
Pierre Ozoux committed
33

Michiel de Jong's avatar
Michiel de Jong committed
34 35 36 37 38
Check https://example.dev in your bowser!

### Cleaning up

To clean up stuff from previous runs of your VM, you can do:
pierreozoux's avatar
pierreozoux committed
39 40

```bash
Pierre Ozoux's avatar
Pierre Ozoux committed
41 42
vagrant destroy
vagrant up
pierreozoux's avatar
pierreozoux committed
43
```
Pierre Ozoux's avatar
Pierre Ozoux committed
44 45 46 47 48 49

## Tests

```bash
vagrant destroy
vagrant up
50
# Set up example.dev as above, and test https://example.dev in your browser
Michiel de Jong's avatar
Michiel de Jong committed
51
vagrant ssh core-1
Pierre Ozoux's avatar
Pierre Ozoux committed
52
sudo su
53 54 55 56 57 58 59
/data/indiehosters/tests/start.sh
exit
exit
vagrant reload --provision
vagrant ssh core-1
sudo su
/data/indiehosters/tests/finish.sh
Pierre Ozoux's avatar
Pierre Ozoux committed
60
```