No description
Find a file
Yaakov ec59cb2a46
All checks were successful
continuous-integration/drone/push Build is passing
add container to readme
2022-05-30 21:36:26 +10:00
.drone.yml push to right registry 2022-05-29 22:07:56 +10:00
Dockerfile Add Dockerfile and first attempt at CI 2022-05-29 22:02:51 +10:00
elproxy.c Initial ZIP contents 2022-05-29 21:12:14 +10:00
ELProxy.conf Initial ZIP contents 2022-05-29 21:12:14 +10:00
init.d-elproxy Initial ZIP contents 2022-05-29 21:12:14 +10:00
logrotate.d-elproxy Initial ZIP contents 2022-05-29 21:12:14 +10:00
Makefile Initial ZIP contents 2022-05-29 21:12:14 +10:00
README add container to readme 2022-05-30 21:36:26 +10:00

# Echolink Proxy/Relay server - PE1CHL

This Echolink Proxy/Relay server can run multiple echolink proxies and/or
relays on a single machine, provided it has multiple IPv4 addresses on the
internet.  It is written in C and uses a single socket for the well-known
ports for all proxies and relays, reducing the number of sockets and fds.

The configuration file is very similar to the configuration of the original
Java proxy, except the definition of the addresses.

You need to set the number of proxies that are running on this machine,
1 when you have only a single public IP address, and the domain name or
address for every instance.  Every proxy instance has to have a different
public IP address!

Example for a single proxy:

# Set the number of proxies you want to run
NumberOfProxies=1

# Set the address for each of the proxies defined in NumberOfProxies above.
# This is the public address on which this proxy instance will be running.
# In this version there is no separate inside, outside and registration
# address, they are all the same.  But multiple proxies will have to use
# different addresses, all defined in the operating system of this machine.
# Proxies are numbered from 0 up to NumberOfProxies-1, but holes in the
# list can be created by omitting the proxy with that number.
Proxy_0=your.domain.name

For two proxy servers you would set NumberOfProxies=2 and define values
for Proxy_0 and Proxy_1

When you want to run 10 proxies numbered 30..39 (e.g. because you run
proxies numbered up to 29 on another machine and you want to register them
all using similar names on the echolink proxy list), set NumberOfProxies=40
and define the values for Proxy_30 up to Proxy_39.

Note that every proxy should have a unique registration name.  When you
run multiple proxies, define the RegistrationName like this:

RegistrationName=yourcall #%02d

This will generate names with 2-digit decimal numbers set to the proxy
number.   %d will generate numbers with the smallest possible number of
digits.  It is just a standard printf format.

It is also possible to override the RegistrationName, RegistrationComment
or PublicAddress (registration address) for a single proxy by defining a
RegistrationName_nn, RegistrationComment_nn or PublicAddress_nn with nn the
same as the Proxy_nn number.  This will override the global RegistrationName
RegistrationComment or Proxy address.


There is a similar configuration for relays.  To setup relays, define
NumberOfRelays and Relay_nn each with different IP addresses.
Note that without cooperation from the echolink people, it is not possible
to run a relay that is actually used by the typical end-user.  When you
want to contribute some relays to the community, contact EchoLink via
their website and ask about adding the relay addresses to their DNS
for your region.  To do local testing you can override the address for
relay.echolink.org in your local DNS service, that is what the app uses
to find the addresses of relays.


Unlike in earlier versions, there no longer is a need to tweak the TCP
queue length and/or set the TCPQueueHighWater parameter.  It is no longer
required for proper operation.

You can still add this to the /etc/sysctl.conf:

###################################################################
## increase Linux TCP buffer limits
net.core.rmem_max = 1048576
net.core.wmem_max = 1048576
net.core.rmem_default = 262144
net.core.wmem_default = 262144
# increase Linux autotuning TCP buffer limits
net.ipv4.tcp_rmem = 4096 262144 1048576
net.ipv4.tcp_wmem = 4096 262144 1048576
net.ipv4.tcp_mem = 1048576 1048576 1048576
###################################################################

This will be loaded at reboot and can be forced once using "sysctl -f".

Before building the program, you need to install the "nettle" library
and its development package.  E.g. on debian do "apt-get install nettle-dev".
Then just type "make" to compile it using gcc, and move the binary to
some place you like.

To start the service, just run the program with 1 parameter: the name
of the configuration file as accessible from where you run it.
(a full pathname or a name relative to the current directory at startup)

Optionally you can pass a second parameter "debuglevel" to get more
detailed logging messages.  Only one debuglevel is supported at this time,
you can use "1" as level:
	/path/to/elproxy /path/to/ELProxy.conf 1

As always, it it wise to run it as a nonprivileged user.  It does not
require any root rights to run, except that you need to make the logfile
writable for the user you want to run as.

The program writes its operational status to a file (default /dev/shm/elproxy)
that you can "cat" to see what is going on, or it can be monitored by
nagios using the nagios plugin check_statusfile, using a command like:

define command {
    command_name    check_elproxy
    command_line    /usr/lib/nagios/plugins/check_statusfile -a 10m /dev/shm/elproxy
}

This can be used to verify that the program is still running, and also to
graph the statistiscs like number of used proxies.
When this file disappears for no apparent reason, it probably is systemd
doing it.
Configure RemoveIPC=no in /etc/systemd/logind.conf to keep it at bay.

# Docker image instructions - VK2BSD
To run this container, mount your configuration file, then set the following environment variables:
- `ELPROXY_CONFIG` to the path to your configuration file
- `ELPROXY_DEBUG` (optional) to a non-zero value to enable debug output logging
Make sure to set `Daemonize=0` in your configuration file, otherwise the container will simply exit.

You can get a pre-built image by running `docker pull registry.yaakov.online/public/pe1chl-elproxy`.