Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

New service example #126

Open
xor2003 opened this issue Jan 18, 2021 · 0 comments
Open

New service example #126

xor2003 opened this issue Jan 18, 2021 · 0 comments

Comments

@xor2003
Copy link

xor2003 commented Jan 18, 2021

I think to popularise the ygg it should be easy instructions to

  1. Install and configure. User don't need to enter starting peers and DNS by hand (it should be predefined IPs supplied) At least for quick start
  2. Create user own web server.
    See instruction example below:

How to launch a site on the Yggdrasil network

In general, launching a site on the Yggdrasil network is no more difficult than on any other network (eg the Internet).

Recommendations for choosing a web server software, as well as for configuring it, can be easily found on the Internet, and in the case of Yggdrasil there is nothing on which it would make sense to focus attention here.

Below is an example of the simplest nginx web server configuration file for a simple static site.

server {
    listen [200:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:80; # address and port on which the site will be available
    root /var/www/html; # path to the root directory of the site
    index index.html; # the name of the file that will be issued by the server when accessing the directory
}

The same for Apache:

<VirtualHost [200:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx]:80> # Address and port on which the site will be available
        DocumentRoot /var/www/html # Path to the site root directory.
                                   # Default home page index.html
</VirtualHost>

If the autorun of the systemd webserver unit is used, then a race condition is possible, due to which the webserver will try to start before Yggdrasil, and as a result will not be able to bind to the internal address port.
The solution in this case is to manually assign a dependency on the Yggdrasil unit to the webserver unit along with a slight start delay.
An example of a modified unit for nginx, applied via systemctl edit nginx.service:

[Unit]
Wants=yggdrasil.service
After=yggdrasil.service

[Service]
ExecStartPre=
ExecStartPre=/bin/sleep 5
ExecStartPre=/usr/sbin/nginx -t -q -g 'daemon on; master_process on;'

Here, the last ExecStartPre is the initial value from the main unit, which probably varies between distributions, and which can be obtained with systemctl cat nginx.service.

Register a domain name for your site on the Yggdrasil network.

How do I add my domain to these servers? Easy! Just add the required DNS records to the Nodeinfo zone in the Yggdrasil config file as follows:

Single domain:

NodeInfo: {
  dns: {
    domains: [
      {
        domain: example.ygg
        ip: 200:1111:2222:3333:4444:5555:6666:7777
      }
    ]
  }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant