📜 ⬆️ ⬇️

Install MLDonkey and DC ++ plugin for it

I recently set myself a task - to create a bot in the local network, which would be installed on the server computer itself, and would be controlled, ideally, via a web interface, but it could also be via SSH. The bot's task is to sit on the distribution round the clock. When I tried to find such a DC ++ client, I was disappointed to find that there were no products that met my requirements. Ncdc and MicroDC2 could not be started as a demon, and they worked with creaks. In the direction of MLDonkey did not look. considered it as an alternative to the Transmission torrent client, rather than as a client of DC ++ networks. And in vain! When I saw on the forums that people put MLDonkey for DirectConnect networks, I decided to try.

Since we all have the most expensive and irreplaceable resource - time, I present the results here, in the hope that this information will help you avoid paging the forums in order to use this time for more productive work. So let's get started!

Find installation instructions was not difficult. We will install on FreeBSD. The latest version is always in the ports, so we put from there:
')
cd /usr/ports/net-p2p/mldonkey-core/ make install clean 

Register in /etc/rc.conf download as a daemon, as well as a user, in the folder of which the application will be:

 echo 'mlnet_enable="YES"' >> /etc/rc.conf echo 'mlnet_user="p2puser"' >> /etc/rc.conf 

Since We do not have the specified user “p2puser”, create it:

 pw useradd p2puser -G wheel -s /bin/sh -m -d /home/p2puser 

Reboot so that the system runs the program as a daemon. Check if MLDonkey started:

 /usr/local/etc/rc.d/mlnet status mlnet is running as pid 1133. 

If instead of “mlnet is running as pid nnnn” it says “mlnet is not running.” - most likely a problem with the user. Either it is not created or not registered in /etc/rc.conf.

Now our MLDonkey needs to be managed somehow. There are several options, but the web interface is preferable. We are going to do it. First, let's write a range of IP addresses from which we will connect to MLDonkey. This is done via Telnet. So far we have only one ip enabled - 127.0.0.1, so we can connect now only from the server itself. To do this, run the Telnet console, register the admin and set the addresses:

 telnet 127.0.0.1 4000 > auth admin "" (*    *) > passwd newpassword (* newpassword  *) > set allowed_ips "127.0.0.1 192.168.1.0/255" > save > exit 

Done! You can connect to MLDonkey at your server's address, without forgetting to specify a port number by default - 4080 via a colon.

image

Judging by the information on the Internet, then - every man for himself. Information is fragmentary and incomplete. It took a lot of time to somehow put everything together, and in some places even walk it myself.

And so, first go to the tab «Options» and in the window that appears, select the tab «Net». Disconnect everything there and enable the DirectConnect plugin:

image

Next, in the “Client” tab of the same window, we remove restrictions on the download speed and upload speed, setting 0 (zero) in front of the items:

max_hard_upload_rate = 0
max_hard_download_rate = 0
max_hard_upload_rate_2 = 0
max_hard_download_rate_2 = 0

Attention! On string variables, to save your entry, you must press Enter. Record for a split second will be in the red frame - a sign that the record is saved. In values ​​of type True / False Enter you do not need to press.

Go to the All tab, the rest of the settings there. Change in order:

allow_browse_share = 2 (if you want, that your friends would not see your ball)
allow_local_network = true (to allow local networks)
upnp_port_forwarding = true (if you need to forward ports on the router)
DC-dc_open_slots = 15 (the default is 2, this is not enough)
DC-login = Your login on the hub
DC-default_encoding = CP1251 (CP1251 is the most common encoding on Russian-language hubs).

Done! Now in the MLDonkey command line (at the top of the line), enter the dcn command to add a new hub. For example:

 dcn 192.168.1.42:411 

And go to the tab "Servers" -> "All Servers" (in the bottom row). There we find our not yet connected hub. Click "conn" to connect:

image

At this stage, the client should already be connected to the hub. If this does not happen, it is pointless to proceed to the next step. Connect first. Problems may be in the correct ports, Cyrillic login, setting up the connection. In general, search and find.

It's time to share files. Press the "Options" button and, in the second row that appears, the "shares" button. Three windows will appear:

1. List of shared folders
2. Comment that two shared folders should have the incoming_files and incoming_directories strategy
3. A list of strategies that you can specify when sharing files.

We are interested in the topmost, first window. We click on the “Add Share” link in the header of this window and in the field that appears we enter through a space: priority, folder path, strategy. I give priority to 0, I have not yet seen the meaning in it. The path to the folder of difficulties should not cause. Well, the strategy I put the most complete "all_files", which does not impose any restrictions on the size, type of files and folders, as well as recursively goes into each subfolder. How it looks from me:

0 / labuda / downloads all_files

After updating or re-entering the tab, your folder should appear in the list, and after a while in the balloon.

If you want to specify a password to the hub, you will have to sweat. I hope this annoying flaw will soon be fixed, but for now we go this way:

1. Disable our MLDonkey (Required, otherwise the file we need will be overwritten by the program)

  /usr/local/etc/rc.d/mlnet stop 

2. Edit the file /home/p2puser/.mldonkey/directconnect.ini by filling in the fields:

 (* Your login on DC (no spaces !!!) *) login = " " -  ! 

and

 hubs_passwords = [ (" ", "", );] 

We write the address of the hub and login in quotes, the password - without them. Naturally in quotes we write our data. You can use either a domain or an IP address as an address. Port number is not required!

3. Start MLDonkey:

 /usr/local/etc/rc.d/mlnet start 

And we connect to the hub again as shown above. If the login with the password is specified correctly, and there is no Cyrillic alphabet in the login, there should be no connection problems.

In conclusion, run the DirectConnect plugin itself. In the command line MLDonkey enter the dc command and we will have a new row of buttons. It's easy to figure it out. Mark like only one thing. In the window that appears, you will see your hub. If you click on the word “Set” in the line with the hub, the client will connect to this hub automatically, but only if the connection does not require authorization. Connection with login and password will have to install manually - another childhood disease plug-in.

That's all. I hope I saved your time. I will try to continue sharing my experience in order to consolidate and help myself, such as "naturalists".

Source: https://habr.com/ru/post/321882/


All Articles