Initial commit

This commit is contained in:
Julian Ospald 2018-06-07 14:49:58 +02:00
commit e9ec6fbcab
No known key found for this signature in database
GPG Key ID: 511B62C09D50CD28
6 changed files with 199 additions and 0 deletions

22
Dockerfile Normal file
View File

@ -0,0 +1,22 @@
FROM alpine:latest
MAINTAINER Julian Ospald <hasufell@posteo.de>
##### PACKAGE INSTALLATION #####
RUN apk --no-cache add \
bash \
umurmur
################################
COPY ./config/umurmur.conf /etc/umurmur/umurmur.conf
RUN mkdir /umurmurconfig
COPY ./config/channels.conf /umurmurconfig/
COPY ./setup.sh /setup.sh
RUN chmod +x /setup.sh
EXPOSE 64738
CMD /setup.sh && exec /usr/bin/umurmurd -d -c /etc/umurmur/umurmur.conf

62
README.md Normal file
View File

@ -0,0 +1,62 @@
## Installation
```sh
docker build -t hasufell/alpine-umurmur .
```
## Configuration
All configuration variables (except channel configuration)
from the [config file](https://code.google.com/p/umurmur/wiki/Configuring02x)
can simply be set when starting the container via the `-e` switches. E.g.
if you want to set `password = "abc";` in `umurmur.conf` you just pass
`-e password=abc` to the `docker run` command.
If you don't like the `-e`-foo just modify `config/umurmur.conf` and
`config/channels.conf` in-place in this repository or mount them into
the container from the host.
### Channels
Either modify `config/channels.conf` directly or mount your own `channels.conf`
in from the host. It must be in the container at the location
`/umurmurconfig/channels.conf`! So e.g.:
```sh
-v /var/lib/umurmurconf/channels.conf:/umurmurconfig/channels.conf
```
### Certificates
Mount in your private key and certificate from the host into the container,
e.g. at `/etc/ssl/` and then pass the environment variables `certificate`
and `private_key` to `docker run`.
E.g.:
```sh
-v /ets/ssl/mydomain:/etc/ssl/mydomain \
-e certificate=/etc/ssl/mydomain/foo.crt \
-e private_key=/etc/ssl/mydomain/foo.key
```
## Running
A full command could look like this:
```sh
docker run -ti -d \
--name=umurmur \
-v /var/lib/umurmurconf/channels.conf:/umurmurconfig/channels.conf \
-v /ets/ssl/mydomain:/etc/ssl/mydomain \
-e certificate=/etc/ssl/mydomain/foo.crt \
-e private_key=/etc/ssl/mydomain/foo.key \
-e password=blah \
-e admin_password=foo \
-e username=murmur \
-e groupname=murmur \
-p 64738:64738 \
hasufell/alpine-umurmur
```

34
config/channels.conf Normal file
View File

@ -0,0 +1,34 @@
channels = ( {
name = "Root";
parent = "";
description = "The Root of all channels";
noenter = true;
},
{
name = "Lobby";
parent = "Root";
description = "Lobby channel";
},
{
name = "Red team";
parent = "Lobby";
description = "The Red team channel";
},
{
name = "Blue team";
parent = "Lobby";
description = "The Blue team channel";
}
);
# Channel links configuration.
channel_links = ( {
source = "Lobby";
destination = "Red team";
},
{
source = "Lobby";
destination = "Blue team";
}
);
default_channel = "Lobby";

6
config/supervisord.conf Normal file
View File

@ -0,0 +1,6 @@
[supervisord]
nodaemon=true
[program:umurmur]
command=/usr/bin/umurmurd -d -c /etc/umurmur/umurmur.conf -r
autorestart=true

39
config/umurmur.conf Normal file
View File

@ -0,0 +1,39 @@
# This configuration is based on the official example configuration.
# More information can be found at
# http://code.google.com/p/umurmur/wiki/Configuring02x
max_bandwidth = 60000;
welcometext = "Welcome to uMurmur!";
# certificate = "/etc/umurmur/cert.crt";
# private_key = "/etc/umurmur/key.key";
# ca_path = "/path/to/ca/certificates/"; # Location of CA certificate. Relevant for OpenSSL only.
password = "";
# admin_password = "";
# ban_length = 0; # Length in seconds for a ban. Default is 0. 0 = forever.
# enable_ban = false; # Default is false
# banfile = "/etc/umurmur/banfile.txt"; # File to save bans to. Default is to not save bans to file.
# sync_banfile = false; # Keep banfile synced. Default is false, which means it is saved to at shutdown only.
# allow_textmessage = true; # Default is true
# opus_threshold = 100; # Required percentage of users that support Opus codec for it to be chosen
max_users = 10;
# Specify port and/or address to bind to. Typically not needed.
# Default is '*' for address and 64738 for port.
# Can also be specified on the command line, which takes precedence if
# both are specified.
# bindport = 64738;
# bindaddr = "192.168.1.1";
# bindport6 = 64738;
# bindaddr6 = "fde4:8dba:82e1::/48";
# Log to file option. Default is logging to syslog.
# umurmurd will close and reopen the logfile if SIGHUP is received.
# logfile = "/var/log/umurmurd.log";
# Specify this for privilege dropping. If username is specified but not
# the groupname, the user's login group is used.
username = "murmur";
groupname = "murmur";

36
setup.sh Normal file
View File

@ -0,0 +1,36 @@
#!/bin/bash
set -e
# strings
for i in welcometext certificate private_key ca_path password \
admin_password banfile bindaddr bindaddr6 logfile \
username groupname; do
if [[ ${!i} ]] ; then
sed -i \
-e "s|${i} = .*|${i} = \"${!i}\";|" \
-e "s|# ${i} = .*|${i} = \"${!i}\";|" \
-e "s|#${i} = .*|${i} = \"${!i}\";|" \
/etc/umurmur/umurmur.conf
fi
done
unset i
# integers and booleans
for i in max_bandwidth ban_length enable_ban sync_banfile allow_textmessage \
opus_threshold max_users bindport bindport6; do
if [[ ${!i} ]] ; then
sed -i \
-e "s|${i} = .*|${i} = ${!i};|" \
-e "s|# ${i} = .*|${i} = ${!i};|" \
-e "s|#${i} = .*|${i} = ${!i};|" \
/etc/umurmur/umurmur.conf
fi
done
unset i
if ! grep -E '^channels =.*' /etc/umurmur/umurmur.conf ; then
cat /umurmurconfig/channels.conf >> /etc/umurmur/umurmur.conf
fi