# Infrastructure

Let's encrypt only supports up to 100 domains
per certificate so the country TLDs are split up
into three files:

* ccTLDs1
* ccTLDs2
* ccTLDs3

```
sudo certbot -d lex.surf
sudo certbot --cert-name cc1.lex.surf $(for tld in `cat ccTLDs1`; do echo -d $tld.lex.surf; done)
sudo certbot --cert-name cc2.lex.surf $(for tld in `cat ccTLDs2`; do echo -d $tld.lex.surf; done)
sudo certbot --cert-name cc3.lex.surf $(for tld in `cat ccTLDs3`; do echo -d $tld.lex.surf; done)
```

Generate NGINX `server_name` rules with:

```
printf '%s' $(for tld in `cat ccTLDs2`; do echo "$tld|"; done)
```

`/var/www/lex.surf` must be a symlink pointing to this repository.