Personal tools

Dtella:Network Setup

From Dtella Wiki

Jump to: navigation, search

This document will outline the steps required to localize and setup a new Dtella network. It is broken down into a few sections. The introduction (what you are currently reading), the prerequisites you must go collect before undertaking this task, and finally the steps to follow to create your network.

Contents

Documentation Notes

Throughout this document we will refer to various files that you may need to edit or scripts you may need to run. The will be shown in code blocks like this:

dtella.py

Unless otherwise specified, all paths are assumed relative to the Dtella "project" folder. For example if you checked out the trunk to "~/mydtella/" then when we say "dtella/local_config.py" we mean: "~/mydtella/dtella/local_config.py"

Finally if you find any issues with this document please let us know or feel free to correct the issue yourself.


Prerequisites

caption

Dtella Network Diagram

In order to setup a Dtella network, you should have at least the following tools and knowledge

  1. A high speed network or LAN to run Dtella on
  2. A basic understanding of networking
  3. A basic knowledge of the Python programming language
  4. Computers to build the distribution on (A Mac and a PC)
  5. Some location for the Dynamic Configuration

Optionally, if you wish to setup a Dtella to IRC Bridge you will need the following:

  1. An UnrealIRCd server (you need to have administrative access)
  2. Additional prerequisites listed in:
docs/requirements.txt

Setup Process

Localizing Your Dtella Network

The first step to building your network is to checkout a copy of the source code from the Dtella Labs repository. This can be accomplished by executing the following command:

svn checkout http://dtella.googlecode.com/svn/trunk/ dtella

Note that you may want to checkout a specific release tag of Dtella as the trunk may contain new (read: potentially untested) features.


The second step is to localize or configure your specific Dtella network. This is done by editing the following file in your project folder:

dtella/local_config.py

The file is self documenting with comments to guide you along the way.

Building the Distribution Packages

First ensure you have read and acquired all the required dependencies listed in the following file:

docs/requirements.txt

The next step is to build distributions of your Dtella instance.

For the windows and Linux versions execute the following script on a windows computer:

build_installer.bat

To build the Mac OS X binary, execute the following script:

build_osx.sh

Setting up the Dynamic Configuration

The Dynamic Configuration for Dtella is a public entry point to the network where a new node can find existing nodes as well as some basic configuration for the network. Manual setup is not required; an attached bridge will push infromation set in bridge_config.py to the desired location. The configuration is stored in one of the following supported locations:

  1. BIND DNS Server
  2. yi.org DNS Server
  3. Google Spreadsheet (Gdata)

It stores the following information:

  1. IP Cache - An encrypted list of good nodes your client can connect to
  2. Minshare - The minimum share size for a client to join and download from the network
  3. Version - The required version, current version, and download location for your instance.
  4. PK Hash - A hash of the public key used for digitally signing messages from the Bridge or other administrative source.

Here is an example of a DNS dynamic configuration entry:

ipcache=2ggsZ4ROYqq99tFU3yHw8FVpW1DpOYqqxbhb2Kk199tFU3yHw8FVpWF58BmzxDpnMGXioHs=

minshare=5G

version=1.0.4 1.2.0 http://www.dtella.org/

pkhash=VpW2ggsZ4R7cZPJSfuVxwIDoTLk==

Setting up an IRC Bridge

This section is a work in progress.

This section will outline the setup of a Dtella to IRC bridge. The bridge provides a link where by you may chat between the two networks. Additionally, you can then use IRC to perform moderation / administrative tasks such as kicking and banning from the IRC channel you establish. Because of the low level access the bridge requires it is not possible to simply connect it to an existing IRC network (such as Freenode), rather you must link the IRC server directly to the Dtella Bridge. This will require administrative access to the IRC network configuration file.

The steps you will need to follow to establish your bridge and link are as follows:

  1. Setup an UnrealIRCd according to their documentation.
  2. Establish a link block in the links.conf (or unrealircd.conf for unrealIRCD) file.
  3. Configure your bridge by setting up bridge_config.py
  4. Run the bridge and test the functionality (python dtella.py --bridge)


Inspircd Configuration

links.conf

<link name="bridge1.dtella.zomg" # This link name (bridge1.dtella.zomg) must match the my_host parameter in the bridge_config.py
      # the ip address of the host running the dtella bridge
      ipaddr="22.128.15.55"

      # The port which the bridge is configured to link to.
      port="7000"

      allowmask="*"
      timeout="300"

      # the ip address bound to the interface which the irc daemon is listening, can usually be left as an asterisk(*)
      bind="192.168.0.69"
      statshidden="no"
      hidden="no"

      # should match the recv pass within bridge_config.py
      sendpass="password1"

      # should match the send pass within bridge_config.py
      recvpass="password2">

For more information about configuring bridges on inspircd check inspircd's documentation here: [1].

Dtella Bridge Configuration

bridge_config.py

service_args = dict(
    # ip or hostname of the irc server you wish the bot to connect to
    host = "irc.dhirc.com", 

    # port you set the irc daemon to listen on for incomming linked connections
    port = 7000, 

    # Matches the recv pass of the IRC Link configuration
    sendpass = "password2", 

    # Matches the send pass of the IRC link configuration
    recvpass = "password1", 

    # the network name of the IRC server you want to connect to
    network_name = "DarkHorse", 

    # Matches the link name= paramter in the link configuration for the irc daemon
    my_host = "bridge1.dtella.zomg", 

    # the name response you want the bot to have (shows in IRC WHOIS requests, not the nickaneme)
    my_name = "Dtella IRC Bridge", 

    # The channel you want the bot to join
    channel = "#dtella", 

    # Leave this as None
    sid = None,

    # To disable cloaking, set these 3 lines to None.

    # set to half or full to enable or disable half or full hostmask cloaking
    cloak_mode = "half",   

    # The prefix on the masked hostnames of the dtella clients
    cloak_prefix = "pre-", 

    # This is the hash used to mask the addresses of your clients, enter random letters and numbers.
    cloak_key = "asdf1234", 
    )

UnrealIRCd Configuration

unrealircd.conf

link bridge1.somedomain.com
{
        username          *;  
        hostname          *;  //This can be set to restrict to a static IP for security
        bind-ip           *;
        port              6667; 
        leaf              *;
        password-connect  "super_secret_password";
        password-receive  "super_secret_password";
        class             servers;
};

Note: the dtella bridge currently does not support UnrealIRCD, see inspircd above.