summaryrefslogtreecommitdiff
path: root/docker/biboumi
diff options
context:
space:
mode:
Diffstat (limited to 'docker/biboumi')
-rw-r--r--docker/biboumi/Dockerfile44
-rw-r--r--docker/biboumi/README.md68
-rw-r--r--docker/biboumi/biboumi.cfg6
3 files changed, 118 insertions, 0 deletions
diff --git a/docker/biboumi/Dockerfile b/docker/biboumi/Dockerfile
new file mode 100644
index 0000000..d27421b
--- /dev/null
+++ b/docker/biboumi/Dockerfile
@@ -0,0 +1,44 @@
+# This Dockerfile creates a docker image running biboumi
+
+FROM docker.io/alpine:latest
+
+RUN apk add --no-cache\
+ g++\
+ cmake\
+ make\
+ udns-dev\
+ sqlite-dev\
+ libuuid\
+ util-linux-dev\
+ expat-dev\
+ libidn-dev\
+ git\
+ python2
+
+# Install botan
+RUN git clone https://github.com/randombit/botan.git && cd botan && ./configure.py --prefix=/usr && make -j8 && make install && rm -rf /botan
+
+# Install litesql
+RUN git clone git://git.louiz.org/litesql && mkdir /litesql/build && cd /litesql/build && cmake .. -DCMAKE_INSTALL_PREFIX=/usr && make -j8 && cd /litesql/build && make install && rm -rf /litesql
+
+# Install biboumi
+RUN git clone git://git.louiz.org/biboumi && mkdir ./biboumi/build && cd ./biboumi/build &&\
+ cmake .. -DCMAKE_INSTALL_PREFIX=/usr\
+ -DCMAKE_BUILD_TYPE=Release\
+ -DWITH_BOTAN=1\
+ -DWITH_LITESQL=1\
+ -DWITH_LIBIDN=1\
+ && make -j8 && make install && rm -rf /biboumi
+
+RUN adduser biboumi -D -h /home/biboumi
+
+RUN mkdir /var/lib/biboumi
+RUN chown -R biboumi:biboumi /var/lib/biboumi
+
+COPY ./biboumi.cfg /etc/biboumi/biboumi.cfg
+RUN chown -R biboumi:biboumi /etc/biboumi
+
+WORKDIR /home/biboumi
+USER biboumi
+
+CMD ["/usr/bin/biboumi", "/etc/biboumi/biboumi.cfg"]
diff --git a/docker/biboumi/README.md b/docker/biboumi/README.md
new file mode 100644
index 0000000..4b9e1e5
--- /dev/null
+++ b/docker/biboumi/README.md
@@ -0,0 +1,68 @@
+Biboumi Docker Image
+====================
+
+Running
+-------
+
+This image does not embed any XMPP server. You need to have a running XMPP server first: as an other docker image, or running on the host machine.
+
+Assuming you have a running [prosody](https://hub.docker.com/r/prosody/prosody/) container already running and [properly configured](https://prosody.im/doc/components#adding_an_external_component) you can use the following command to start your biboumi container.
+
+```
+docker run --link prosody:xmpp \
+ -v $PWD/database:/var/lib/biboumi \
+ -e BIBOUMI_PASSWORD=P4SSW0RD \
+ -e BIBOUMI_HOSTNAME=irc.example.com \
+ -e BIBOUMI_ADMIN=blabla \
+ biboumi
+```
+
+If instead you already have an XMPP server running on the host machine, you can start the biboumi container like this:
+
+```
+docker run --network=host \
+ -v $PWD/database:/var/lib/biboumi \
+ -e BIBOUMI_PASSWORD=P4SSW0RD \
+ -e BIBOUMI_HOSTNAME=irc.example.com \
+ -e BIBOUMI_ADMIN=blabla \
+ -e BIBOUMI_XMPP_SERVER_IP=127.0.0.1 \
+ biboumi
+```
+
+Variables
+---------
+
+The configuration file inside the image contains only a few default values. To be able to run, biboumi needs additional configuration. Additional options can be passed using environment variables. Any configuration option can be customized this way (see biboumi’s doc), but the main are listed here for convenience:
+
+* BIBOUMI_HOSTNAME: Sets the value of the *hostname* option.
+* BIBOUMI_PASSWORD: Sets the value of the *password* option.
+* BIBOUMI_ADMIN: Sets the value of the *admin* option.
+* BIBOUMI_XMPP_SERVER_IP: Sets the value of the *xmpp_server_ip* option. The default value is **xmpp**.
+
+You can also directly provide your own configuration file by mounting it inside the container using the -v option:
+
+```
+docker run --link prosody:xmpp \
+ -v $PWD/biboumi.cfg:/etc/biboumi/biboumi.cfg \
+ biboumi
+```
+
+If both a custom configuration file and custom environment variables are passed to the container, the environment variables will take precedence.
+
+Linking with the XMPP server
+----------------------------
+
+You can use the --link option to connect to any server running in a docker container, but it needs to be called *xmpp*, or the custom value set for the **BIBOUMI_XMPP_SERVER_IP** option. For example, if you are using a container named ejabberd, you would use the option *--link ejabberd:xmpp*.
+
+If you want to connect to the XMPP server running on the host machine, use the **--network=host** option.
+
+Volumes
+-------
+
+The database is stored in the /var/lib/biboumi/ directory. If you don’t bind a local directory to it, the database will be lost when the container is stopped. If you want to keep your database between each run, bind it with the -v option, like this: **-v /srv/biboumi/:/var/lib/biboumi**.
+
+Note: Due to a limitation in Docker, to be able to read and write into this database, make sure this mounted directory is owned by UID and GID 1001:1001, on the host.
+
+```
+chown -R 1001:1001 database/
+```
diff --git a/docker/biboumi/biboumi.cfg b/docker/biboumi/biboumi.cfg
new file mode 100644
index 0000000..98c5a9f
--- /dev/null
+++ b/docker/biboumi/biboumi.cfg
@@ -0,0 +1,6 @@
+xmpp_server_ip=127.0.0.1
+port=5347
+db_name=/var/lib/biboumi/biboumi.sqlite
+hostname=xmpp
+password=
+admin=