Notes on Yggdrasil: code quality, security, DNS | Causa Arcana

https://causa-arcana.com/ru/blog/2021/07/28/yggdrasil.html



Description of the article

Name: Notes on Yggdrasil: code quality, security, DNS
Source: Arcane Cause
Publication date: July 28, 2021

Summary:
The article is devoted to the analysis of code quality, security level and features of working with DNS in the Yggdrasil network - an experimental network based on graph routing technology.

  1. Code quality:

    • The author notes the simplicity of the Yggdrasil code structure, which makes it easier to analyze and modify.

    • Using Go as a programming language makes it easier to maintain a project.

  2. Safety:

    • Yggdrasil provides secure routing by relying on cryptographic techniques.

    • Potential vulnerabilities associated with access to open network nodes are discussed.

  3. DNS and Integration:

    • The limitations in working with DNS due to the specifics of network construction are considered.

    • The author offers solutions to improve the work with domain names in Yggdrasil.

  4. Conclusions:

    • Yggdrasil is a promising technology, but requires significant improvements in the areas of scalability, security and convenience for the end user.

Tags: #Yggdrasil #Network #Security #DNS #Technology



Releases · zhoreeq/meshname

https://github.com/zhoreeq/meshname/releases



An example of creating a website on the Yggdrasil network

The Yggdrasil network allows you to run websites in a decentralized and encrypted environment. For this purpose, built-in routing mechanisms and IPv6 support are used.

1. Preparing for work

  1. Yggdrasil installation
    Download and configure Yggdrasil for your system by following official documentation.

Checking the connection
Make sure the node is working correctly. To do this, use the command:

yggdrasilctl getPeers

  1.  You should see active connections.

Getting an address
After starting the Yggdrasil node you will receive a unique IPv6 address, for example:

201:18a1:7c80::1



2. Setting up a web server

  1. Web server installation
    To run a website in Yggdrasil, any web server with IPv6 support is suitable, for example:

NGINX:
sudo apt install nginx


Apache:
sudo apt install apache2


Setting up a server to work with Yggdrasil
Add IPv6 configuration to web server:

For NGINX:

server {

    listen [201:18a1:7c80::1]:80;

    server_name _;

    root /var/www/yggdrasil_site;

    index index.html;

}

 For Apache:

<VirtualHost [201:18a1:7c80::1]:80>

    DocumentRoot "/var/www/yggdrasil_site"

    DirectoryIndex index.html

</VirtualHost>

 Reboot the server:

sudo systemctl restart nginx

 or

sudo systemctl restart apache2



3. Content creation

Create a directory for the site:

mkdir -p /var/www/yggdrasil_site


Add a file index.html:

<!DOCTYPE html>

<html>

<head>

    <title>Welcome to Yggdrasil</title>

</head>

<body>

    <h1>This is an example of a site on the Yggdrasil network!</h1>

</body>

</html>


Check directory permissions:

sudo chown -R www-data:www-data /var/www/yggdrasil_site



4. Testing

In a browser connected to Yggdrasil, open the site at your node address, for example:

http://[201:18a1:7c80::1]


  1. For Yggdrasil users, your site will be available immediately, without the need to configure DNS.


5. Expansion and improvement

  • Use HTTPS for added security (via certificates, e.g. Let's Encrypt, supporting IPv6).

  • Configure load balancing if you expect high traffic.

  • Optimize your site for high performance using minimal design and caching.

Your site is now available on the Yggdrasil network! 🚀



Ready-made cross-platform solutions for publishing/self-hosting websites on the Yggdrasil network

The Yggdrasil network supports various tools and platforms for quick deployment and self-hosting of websites. Let's look at popular solutions:


1. Caddy

Caddy is a lightweight web server with IPv6 support, automatic HTTPS, and easy configuration.

Peculiarities:

  • Simple settings.

  • IPv6 support by default (ideal for Yggdrasil).

  • Built-in HTTP/3 support.

Setup steps:

The Caddy establishments:
sudo apt install -y caddy


Set up the file Caddyfile:
[201:18a1:7c80::1]:80 {

    root * /var/www/yggdrasil_site

    file_server

}


Start the server:
sudo systemctl restart caddy



2. Docker with ready-made images

Using Docker makes it easier to manage and isolate sites.

Solutions:

NGINX:
Use a ready-made NGINX image for IPv6:

docker run -d --name ygg-nginx \

    -v /var/www/yggdrasil_site:/usr/share/nginx/html \

    -p [201:18a1:7c80::1]:80:80 nginx


  • Hugo:
    Hugo is a static website generator.

Download the Hugo image:
docker pull klakegg/hugo


Create and assemble a website:
docker run --rm -v $(pwd):/src klakegg/hugo new site ygg_site

docker run --rm -v $(pwd)/ygg_site:/src klakegg/hugo


  1. Bring up your site via NGINX or another web server.


3. ZeroNet for Yggdrasil

ZeroNet allows you to run P2P sites that work perfectly inside the Yggdrasil network.

Peculiarities:

  • Decentralized data storage.

  • High level of confidentiality.

Setup steps:

The ZeroNet institutions:
git clone https://github.com/HelloZeroNet/ZeroNet.git

cd ZeroNet

python3 -m pip install -r requirements.txt


Launch ZeroNet with Yggdrasil:
python3 zeronet.py --tor disable --fileserver_bind [201:18a1:7c80::1]


  1. Create a new website using ZeroNet.


4. Node.js + Express.js

For those who want to set up a custom web application.

Setup steps:

Create a project:
mkdir ygg-app && cd ygg-app

npm init -y

npm install express


Create a server:
// server.js

const express = require('express');

const app = express();


app.use(express.static('public'));

app.listen(80, '[201:18a1:7c80::1]', () => {

    console.log('The site is running in Yggdrasil!');

});


Launch the application:
node server.js



5. PeerTube

PeerTube can be used to host video and media sites on the Yggdrasil network.

Steps:

  1. Install PeerTube by following official documentation.

  2. Configure it to work with Yggdrasil by adding an IPv6 address to the configuration.


6. GitHub Pages or Netlify via proxy

If your site is already hosted on platforms like GitHub Pages, set up an IPv6 proxy for access from Yggdrasil.

Tools:

  • HAProxy or Caddy for proxying traffic.

  • Redirecting requests via Yggdrasil.


Bottom line

Suitable for a quick start Caddy or Docker with NGINX. For dynamic applications - Node.js. If you need a P2P approach - ZeroNet. The choice depends on your goals and the complexity of the project.


Просмотры:

Коментарі

Популярні публікації