Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save peps1/1f29ff4fa3fb318b43cd07828f4ef43a to your computer and use it in GitHub Desktop.

Select an option

Save peps1/1f29ff4fa3fb318b43cd07828f4ef43a to your computer and use it in GitHub Desktop.
AirDC++ WebClient in FreeBSD/FreeNAS jail

Compiling and installing AirDC++ in FreeBSD/FreeNAS jail

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

What you'll find here are the specific instructions to compile airdcppd in a FreeBSD system, or in a FreeNAS jail.

This was originally tested in a FreeNAS-11.3-U4.1, which uses FreeBSD 11.3-RELEASE-p11 as base system. I don't know if it will work on previous or newer versions, but I intend to keep this document updated.

1. Update your packages:

# pkg update
# pkg upgrade

2. Install the dependencies and tools:

# pkg install git cmake libmaxminddb miniupnpc pkgconf libnatpmp leveldb websocketpp boost-all python npm-node12

NOTE about npm

There are currently some versions of npm available to install:

  • npm-6.12.1_1
  • npm-node10-6.12.1_1
  • npm-node12-6.12.1_1

The first time I installed the default npm package, I received a warning about that npm doesn't support Node.js version 14. Then I removed this version and installed npm-node12, and then I received a warning about that this version uses a deprecated version of python (2.7?)... Between the 2 warnings I decided to go on with npm-node12. Feel free to test other options. Your mileage may vary.

3. Clone the repository:

# git clone https://github.com/airdcpp-web/airdcpp-webclient.git

3. Enter in the source-code folder and compile it:

# cd airdcpp-webclient
# cmake .
# make -j2

If everything ran fine, you'll find the airdcppd binary in the airdcppd folder. So:

# make install

4. Bonus: init script to start airdcppd automagically at system/jail boot

Here is my script:

#!/bin/sh

#
# PROVIDE: airdcppd
# REQUIRE: networking
# KEYWORD:

. /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/plex/.airdc++ -p=/var/run/airdcppd/airdcppd.pid"

run_rc_command "$1"

Save it under the name airdcppd and copy to /usr/local/etc/rc.d with 755 permissions.

Configuration:

1. Decide and create the user/group under which the service will run. In my specific case:

pw group add plex -g 118
pw user add plex -u 111
pw user mod -m /home/plex

2. Create the folder to store the PID with the appropriate permissions:

# mkdir /var/run/airdcppd
# chown plex:plex /var/run/airdcppd

4. Configure the service to run automagically according to your setup. In my specific case:

# sysrc airdcpdd_enable=YES
# sysrc airdcpdd_user=plex
# sysrc airdcpdd_group=plex

At this point you should be able to control the service:

# service airdcppd start | stop | status | restart

And finally, decide and configure the folder you'll want to share and to download the files.

Feel free to point out any mistakes I made, including mispellings, typos and grammar errors.

Happy AirDC++ing.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment