= ADCH++ Basic User Guide Created by the DC++ team Document Version 0.3.7 :toc: This version of the guide corresponds with ADCH++ versions *2.12.1* and later. == Introduction ADCH++ is a hub server software for the ADC network. It implements the http://dcplusplus.sf.net/ADC.html[ADC protocol]. The core application is very simple, but extensible using plugins. Among the standard plugins there is a scripting plugin that allows hub owners to further customize the hub using the Lua scripting language. The core is also exposed as a Python and a Ruby module, thus it is possible to use it within a Python or Ruby application. == Preface This basic guide shows you how to do the minimum configuration, setup and administration of an ADCH++ hub. It contains the basic information required for newbies. == Installing ADCH++ on your Operating System This part describes the installation procedure of ADCH++ under Linux and Windows. === Installing on Windows ADCH++ needs Windows XP SP3 or later to run. Before you go on you have to decide whether you want to run a debug or a release build of ADCH\+\+. For normal usage the best choice is the release build which is available prepackaged for download in the official ADCH++ home page. The differences between debug and release builds are as folows: * Debug builds are bigger and slightly slower as they contain additional information for debugging * The console output of a debug build is more verbose as it shows the software and the protocol at work (like session ids, messages, etc.) * In case of problems (crashes, abnormal behavior) debug builds are able to provide vital information for the developers (crashlog) _This is how the console output of a debug build looks_ image:images/img_adchpp_debug_build.png["ADCH++ debug build"] _This is how the console output of a release build looks_ image:images/img_adchpp_release_build.png["ADCH++ release build"] ADCH\++ release packages are available to download at the official home page at SourceForge (http://sourceforge.net/projects/adchpp). At the download page you can find the three ADCH++ distribution files: * Windows installer - a complete installer EXE file for Windows with uninstaller option. * ZIP package - contains the pre-compiled binaries (release build) for Windows with all the required scripts and configuration files. * Source code - an archive with the source code of the latest release distribution. You can use it to compile ADCH++ under other operating systems or for those who want to modify and compile the source themselves. The easiest choice is the executable installer, when you start the installation you'll go through the following steps: . Welcome Screen . Set up the installation Path: CAUTION: on Windows Vista and Windows 7 you should install ADCH\++ to the Program files / Program files(x86) directory only if you familiar with UAC Data Redirection and its effects and how to store configuration files in the user profile path's specified by the http://vistaonwindows.com/environment_variables.html[windows environment variables]. If you don't want to be bothered with this then the best choice is to install/unpack ADCH++ files to another folder outside of Program Files where UAC rules don't apply. A good alternative path is: _c:\Users\\_ As the last step of the installation procedure you'll be asked if you want to install ADCH\++ as a service or not. The main difference between installing ADCH\++ as an applciation or as a service is that in application mode the ADCH\++ console window will be always visible. This can be an advantage as you always able to ensure the hub is there, up and running and you can easily stop the hub anytime. On the contrary, as the console window cannot be closed (only minimized) it will always reside on your taskbar which can be annoying for some users. If ADCH\++ is running in service mode then you won't see any opened console window and outputs will go to the log file only. In this mode you can start and stop the hub in the Windows Service Management Console or using the appropriate shell commands. You can find more detailed information about running ADCH++ in service mode in the http://adchpp.sourceforge.net/user_guide/expert_guide.html[Expert User Guide]. === Installing on Linux Installing on Linux/Unix operating systems requires the source code for ADCH++ since we don't provide any prepackaged binaries for Unix/Linux distributions. The source code is available via Sourceforge (official releases) or from our Bazaar repository at Launchpad. Source code download: https://sourceforge.net/projects/adchpp/files/ Launchpad repository: https://code.launchpad.net/adchpp You need a Linux distribution with at least 2.6-based kernel to run ADCH\+\+. The following tools needed to compile and install ADCH++ on a Linux/Unix machine. .Installation tools [width="60%",options="header"] |============================================== | Application | Notes | swig | | ruby (optional) |(needs to be version 1.9.2 or higher) | python (optional) |(version 2.4.x ... 2.7.x, 32 bit versions - even on 64 bit systems) | scons |(version 1.2.0 or higher) | gcc-c++ |(version 4.4.x or higher) | libstdc++-devel |(redhat resource) | readline-devel |(redhat resource) | libreadline-dev |(debian resource) | sys-libs/readline |(gentoo resource) | openssl-devel |(redhat resource) | libssl-dev |(debian resource) |============================================== If you have downloaded any of the zip archives then unpack the source to a folder. If you used Bazaar to fetch the source then navigate to the root folder of your local branch or checkout. After you have installed the tools necessary to compile, perform these actions in a command prompt or save the it as a shell script () and run it as sh . --------------------------------------------------------------------- [source,bat] cd adchpp scons cd build/release-default/bin/ mkdir config mkdir scripts cp -rf plugins/Script/examples build/release-default/bin/scripts cp -rf etc/ build/release-default/bin/config /.adchppd --------------------------------------------------------------------- . Enter the ADCH++ directory. . Start the compile of ADCH++. . Enter the bin directory and create the two folders. . Copy files to bin folder. . Start ADCH++. == Setting up your hub This part focuses to the basic configuration of the hub describing how to manage and setup ADCH++ for operational use. === Basic configuration ADCH\++ is configurable using an XML settings file as are the standard plugins. In Linux, the default location for configuration files is "/etc/adchpp/". In Windows, it is a directory named "config" under the program directory. All ADCH++ settings are stored in a file called adchpp.xml. The default packaged file contains lots of comments to help you get started. Open up adchpp.xml in a text editor (such as Notepad under Windows) and start changing the values as you wish. CAUTION: Editing the values incorrectly can lead to problems so be careful what you're doing. If the settings file doesn't meet the XML standards it may won't be processed correctly. If you encounter errors try to validate the settings file syntax with an XML validator such as http://www.xmlvalidation.com .Main parts of the ADCH++ configuration file [width="100%",options="header"] |============================================== | String | Purpose | HubName | Name of your hub | Description | Hub description | Server | Connection and port settings | Plugins Path | Path to plugins (Linux only) | Plugin | List of plugin engines |============================================== TIP: The default settings.xml file contains two opening tags, one for Linux (commented out, with path specification example) and another for Windows (default). Linux users should uncomment by removing !-- and -- from the line and must modify the path to the actual plugins directory and _remove or uncomment_ the standalone tag. Under Linux, just like for every ADCH++ path setting, you must specify _absolute path_. === Setting up ports Add a new entry to adchpp.xml with the port you wish your hub to listen to. You must put a line similar to the following into the Servers part of the config file, between the and nodes. .Example: --------------------------------------------------------------------- [source,xml] --------------------------------------------------------------------- In this example you will use the address adc://yourdomain:2113 in your DC client to log on to your hub. To be able to connect to your hub in a secure encrypted way (ADCS connections), set TLS="1" and specify the following path's: Certificate, PrivateKey, TrustedPath, DHParams. IMPORTANT: Linux users should always use _absolute_ path's in this setting. An example of an encrypted server setting: .Example: insert this to the Server line in adchpp.xml: --------------------------------------------------------------------- [source,xml] --------------------------------------------------------------------- In this example you will use the address adcs://yourdomain:2780 in your DC client to log on to your hub. To make the SSL encrypted connectivity possible you must generate three security certificate (.pem) files for your hub (see the example above). You need to install OpenSSL to generate your cert files. The .pem files must be located in their path specified in the settings to be able to make ADCS connections to the hub. .How to get OpenSSL (needed for certificate generation) [width="100%",options="header"] |============================================== | Distribution | Command | Windows | http://www.slproweb.com/products/Win32OpenSSL.html[OpenSSL for Windows] | Debian | sudo install apt-get openssl | Redhat | yum install openssl |============================================== To automatically generate files and place them to the deafult path you can use the certificate files generator script (generate_certs.cmd/sh) provided in the ADCH\++ release package. Alternatively you can download the script corresponding to your operating system (http://bazaar.launchpad.net/\~dcplusplus-team/adchpp/trunk/files/head:/windows/[Windows] or http://bazaar.launchpad.net/~dcplusplus-team/adchpp/trunk/files/head:/linux/[Linux]) from the ADCH++ code repository as well. The script will create and automatically place the generated certificate files to a folder named 'certs' under the ADCH++ program folder. IMPORTANT: If you run the certificate files generator script under Windows it is recommended to install OpenSSL to its default folder (or into C:\Program Files\OpenSSL) and run the script in elevated mode (as Administrator) on Vista and later. Alternatively you can generate the .pem files manually using the following commands: .Simple commands that use OpenSSL to generate certificate files for encrypted connections --------------------------------------------------------------------- [source,bat] openssl genrsa -out privkey.pem 2048 openssl req -new -x509 -key privkey.pem -out cacert.pem -days 1095 openssl dhparam -outform PEM -out dhparam.pem 1024 --------------------------------------------------------------------- TIP: Remember if you have specified TLS=1 in the server configuration, all users must connect to your hub using the prefix adcs:// added to the hub address (adcs://yourdomain:port). You can open more than one ports for your hub by adding more entries. You can even mix secure and unsecure (non-TLS) port connections by adding TLS=1 parameter to a particular entry only. === Script Management Above the basic functions provided by the core ADCH\++ relies on scripts performing various extended functions and commands (like handling registered users, login procedure, etc...). The hub software comes with prepackaged LUA scripts for handling basic hub functions and more. These (and any other) scripts can be configured using the Script.xml file located in the configuration folder of ADCH++. The LUA scripts shipped with ADCH++ are configured to run by default. They should be always properly loaded to get the functionality described in the rest of this guide. If you want to use additional scripts then locate the Script.xml file and ensure that the scripts that you want to run are properly _added_ to the existing ones. .Example: Default Script.xml, it loads the core LUA scripts, a chat history script and a "texts" script. --------------------------------------------------------------------- [source,xml] --------------------------------------------------------------------- Here's how to disable a script in scripts.xml using the xml comment syntax: .Example: scripts.xml, we want to remove the "texts" script --------------------------------------------------------------------- [source,xml] --------------------------------------------------------------------- Change to : --------------------------------------------------------------------- [source,xml] --------------------------------------------------------------------- IMPORTANT: Linux users should use absolute paths pointing to the script folder in every