82 lines
2.3 KiB
Plaintext
Executable File
82 lines
2.3 KiB
Plaintext
Executable File
# Creating a Yggdrasil website using Caddy and Debian 11
|
|
|
|
1. Install Yggdrasil.
|
|
|
|
```
|
|
sudo apt install dirmngr
|
|
gpg --fetch-keys https://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/key.txt
|
|
gpg --export 569130E8CA20FBC4CB3FDE555898470A764B32C9 | sudo apt-key add -
|
|
echo 'deb http://neilalexander.s3.dualstack.eu-west-2.amazonaws.com/deb/ debian yggdrasil' | sudo tee /etc/apt/sources.list.d/yggdrasil.list
|
|
sudo apt update; sudo apt install yggdrasil
|
|
```
|
|
|
|
2. Install Caddy.
|
|
|
|
```
|
|
echo "deb [trusted=yes] https://apt.fury.io/caddy/ /" | sudo tee -a /etc/apt/sources.list.d/caddy-fury.list
|
|
sudo apt update; sudo apt install caddy -y
|
|
```
|
|
|
|
3. Get the IP Yggdrasil generates for you.
|
|
|
|
```
|
|
sudo systemctl start yggdrasil; sudo systemctl enable yggdrasil
|
|
sudo journalctl -xfe -u yggdrasil
|
|
```
|
|
|
|
There will be a line that says "Your IPv6 address is". Copy the rest of that line somewhere safe.
|
|
|
|
Press the Control and C buttons on your keyboard at the same time to exit "journalctl".
|
|
|
|
4. Configure Caddy to serve the hidden service.
|
|
|
|
Open "/etc/caddy/Caddyfile" as root with your favorite text editor.
|
|
|
|
Type the following in:
|
|
|
|
```
|
|
http://[YGGDRASIL_IP_ADDRESS_HERE] {
|
|
root * /your/website/file/path/here
|
|
file_server
|
|
encode gzip
|
|
}
|
|
```
|
|
|
|
The "http://" in front of the address is important as that tells Caddy to not try to enable HTTPS for that website. HTTPS is unnecessary for Yggdrasil hidden services as all traffic to and from the server is already encrypted in transit. Besides, Let's Encrypt wouldn't be able to issue a certificate for an IP address anyway.
|
|
|
|
5. Restart Caddy to apply your changes.
|
|
|
|
```
|
|
sudo systemctl restart caddy
|
|
```
|
|
|
|
6. Get some peers for Yggdrasil.
|
|
|
|
=> https://github.com/yggdrasil-network/public-peers Copy some peers from this page. Try to select ones closest to your geographical location.
|
|
|
|
On your server, open "/etc/yggdrasil.conf" as root with your favorite text editor. At the top of the configuration file will be a section that looks like this:
|
|
|
|
```
|
|
Peers: []
|
|
```
|
|
|
|
Pick some peers from the list and add them to that section of the file (one per line) so it now looks something like this:
|
|
|
|
```
|
|
Peers:
|
|
[
|
|
tls://01.scv.usa.ygg.yt:443
|
|
tls://lax.yuetau.net:6643
|
|
tls://tasty.chowder.land:9001
|
|
tls://supergay.network:9001
|
|
tls://lancis.iscute.moe:49274
|
|
tls://mayvaneday.org:1414
|
|
]
|
|
```
|
|
|
|
Save the file and close it, then run:
|
|
|
|
```
|
|
sudo systemctl restart yggdrasil
|
|
```
|