First of all, make sure to refer and understand the general instructions in the official AirDC++ site:
https://airdcpp-web.github.io/docs/installation/compiling.html
http://airdcpp.net/docs/compiling/compiling.html
What you'll find here are the specific instructions to compile airdcppd on a FreeBSD system, or on a TrueNAS jail.
This was originally tested in a FreeNAS-11.3-U4.1, which uses FreeBSD 11.3-RELEASE-p11 as base system.
UPDATE: it was retested in TrueNAS CORE 12.0-U5.1 and it is working fine.
UPDATE 2022/11: it was retested in TrueNAS-13.0-U3.1 and it is working fine!
UPDATE 2024/02: our friend Freeben666 used this guide in a 13.2-p10 jail and it's still working fine!
pkg update
pkg upgrade
pkg install git cmake libmaxminddb miniupnpc pkgconf libnatpmp leveldb websocketpp boost-all python npm
Note: from version 3 onwards, you'll also need the nlohmann-json package:
pkg install nlohmann-json
Thank you marius137!
git clone https://github.com/airdcpp-web/airdcpp-webclient.git
cd airdcpp-webclient
cmake .
make -j2
Tip
In the command above, "-j2" refers to the number of threads that you want to use to compile the source code. If you have more vCPUs (cores), you can increase this number accordingly, like "-j4" or "-j8" etc.
If everything ran fine, you'll find the airdcppd binary in the airdcppd folder. So it's time to install the whole shebang:
make install
Here is my script:
#!/bin/sh
#
# Author: C. R. Zamana (czamana at gmail dot com)
#
#
# PROVIDE: airdcppd
# REQUIRE: LOGIN network
# KEYWORD: shutdown
. /etc/rc.subr
name="airdcppd"
rcvar="${name}_enable"
load_rc_config ${name}
: ${airdcppd_enable:="NO"}
: ${airdcppd_user:="root"}
: ${airdcppd_group:="root"}
pidfile="/var/run/airdcppd/airdcppd.pid"
command="/usr/local/bin/airdcppd"
command_args="-d -c=/home/${airdcppd_user}/.airdc++ -p=${pidfile}"
run_rc_command "$1"
Save it under the name airdcppd
and copy to /usr/local/etc/rc.d
with 755 permissions.
pw group add plex -g 118
pw user add plex -u 111
pw user mod plex -m /home/plex
mkdir /var/run/airdcppd
chown plex:plex /var/run/airdcppd
3. Configure the service to run automagically at system/jail boot, according with your setup. In my specific case:
sysrc airdcppd_enable=YES
sysrc airdcppd_user=plex
sysrc airdcppd_group=plex
Now, refer back to the original documentation, and look for "Configure and run". You'll need to run the program once via command line with the "--configure" switch in order to set up ports and user accounts.
su plex
airdcppd --configure
exit
And at this point you should be able to control the service with:
service airdcppd start | stop | status | restart
And finally, decide and configure the folders you'll want to share and download the files. This is important if you are using jails, because in this case you'll need to configure the bindings (mounting points). Refer to the FreeNAS documentation regarding this.
Now the service should be accessible through:
http://<jail|freebsd IP>:5600
If you want to avoid the ":5600" in the URL, you can use a reverse proxy.
Here is my specific configuration for nginx, using http://airdc.lan as address. As I have an internal DNS (unbound), I prefer to have an URL for each application. Feel free to adapt to your scenario:
server {
listen 80;
server_name airdc.lan;
location / {
proxy_pass http://<IP_ADDR>:5600;
gzip_types text/plain application/javascript;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Authorization "";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
location /api/v1 {
proxy_pass http://<IP_ADDR>:5600/api/v1;
gzip_types text/plain application/javascript;
proxy_http_version 1.1;
proxy_set_header Upgrade $http_upgrade;
proxy_set_header Connection "upgrade";
proxy_set_header Authorization "";
proxy_redirect off;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for;
}
}
Note: change the <IP_ADDR> with your actual IP address.
Now you can point your DNS (or hosts file) to the IP of your reverse proxy server (or directly to the IP of you Airdc++ installation if you decided to install the reverse proxy in the same environament) and point your browser to http://airdc.lan (or to the address you chose).
Feel free to point out any mistakes I made, including misspellings, typos and grammar errors.
Happy AirDC++ing.
Hi !
Thanks a lot for this guide.
Quick note though:
pw user mod -m /home/plex
should bepw user mod plex -m /home/plex
Regards