HGD-NETD(2)

NAME
hgd-netd - Network daemon for the Hackathon Gunther Daemon.

SYNOPSIS
hgd-netd [-BDeEfhv] [-c config] [-d state-dir] [-F flood-limit] [-k path-to-ssl-key] [-n num-votes] [-p port] [-S path-to-ssl-cert] [-x debug-level] [-y path-to-vote-sound]

DESCRIPTION
hgd-netd is the network daemon for the Hackathon Gunther Daemon; a music system suitable for hackathons, internet cafes, LAN parties etc.

hgd-netd is primarily responsible for receiving files for hgd-playd(1) to play later. A playlist is stored in an SQLite3 database in the state directory. hgd-netd can also receive other commands from clients, such as requests to "vote-off" the currently playing song, if the user dislikes the song.

The options are as follows:

-B  Do not daemonise, remain in foreground.

-c config
    Location fo the config file.

-D  Disable reverse DNS lookups of clients. This will prevent connection delays on networks which do not provide reverse DNS.

-d dir
    Set the HGD state directory where the SQLite database and uploaded files will be stored. This defaults to /var/hgd.

-E  Disable SSL support.

-e  Require clients to use SSL encryption.

-f  Don't fork and service a single client only. This is useful for debugging purposes only.

-F  Limit the number of songs any one user can have in the playlist at a time. Set to -1 for unlimited.

-h  Show the usage help and exit.

-k file
    Set the path to the SSL private key.

-n num
    Set the number of votes required to "vote-off" a song. This defaults to 3.

-p port
    Set the TCP port to listen on. Defaults to 6633.

-s mb
    Set the maximum file upload size in MB. Defaults to 100MB.

-S file
    Set the path to the SSL certificate file.

-v  Show version information and exit.

-x level
    Set the debug level: 0=errors, 1=warnings, 2=info, 3=debug. Defaults to 1.

-y path
    Set the path to a sound file to play when a vote-off is successful. None by default.

ENCRYPTING WITH SSL
NOTE: SSL support in HGD is fine as-is for encryption purposes, but host authentication (proving the server identity) is NOT (yet) implemented.

You can use self signed SSL on the server to encrypt all network communications, thus protecting passwords. The simplest way to do this is to do the following:

cd /etc/hgd

openssl req -x509 -nodes -days 365 -newkey rsa:2048 \\
    -keyout privkey.key -out certificate.crt

When hgd-netd sees a valid SSL certificate and private key, it will allow SSL network communications from clients.

You can turn off or require clients to use SSL with -E and -e respectively; however the default behaviour involves a handshake between the client and server, favouring an encrypted connection if possible, otherwise falling back onto unencrypted socket communication.

A warning is always printed if SSL encryption is not enabled.

You should ensure that the SSL private key remains secure on your file-system.

FILES
hgd-netd can read it's settings from a config file. The following locations (in the order shown) are searched:

1.  A path specified by '-c' (if given).
2.  ~/.config/hgd/hgd.rc
3.  /etc/hgd/hgd.rc

The first config file found is used. If no config file is found, default settings are used.

Sample config files are supplied in the source tarball and should be supplied by binary packagers.

HISTORY
HGD was inspired by the LPD hack -- a music system used at OpenBSD hackathons.

AUTHORS
-nosplit hgd-netd was written by Edd Barrett <vext01@gmail.com>, and Martin Ellis <ellism88@gmail.com>.

BUGS
Probably.