Add motsognir

This commit is contained in:
Christian
2020-12-15 21:22:43 +01:00
committed by Christian Richter
parent 7cebcd9231
commit 812b4617e1
8 changed files with 171 additions and 0 deletions

View File

@@ -8,3 +8,4 @@ No guarantee for completeness or functionality.
|[dragonchaser/webtest](https://hub.docker.com/r/dragonchaser/webtest)|webtest|A small container running ruby WebRick and serves static content from /web|x|x| |[dragonchaser/webtest](https://hub.docker.com/r/dragonchaser/webtest)|webtest|A small container running ruby WebRick and serves static content from /web|x|x|
|[dragonchaser/nginx-matrix](https://hub.docker.com/r/dragonchaser/nginx-matrix)|nginx-matrix|A modification of the nginx:latest image that exposes tcp ports 80,443 and 8448 for use as reverse proxy with a matrix server (e.g. synapse)|x|x| |[dragonchaser/nginx-matrix](https://hub.docker.com/r/dragonchaser/nginx-matrix)|nginx-matrix|A modification of the nginx:latest image that exposes tcp ports 80,443 and 8448 for use as reverse proxy with a matrix server (e.g. synapse)|x|x|
|[dragonchaser/matrix-synapse](https://hub.docker.com/r/dragonchaser/matrix-synapse)|matrix-synapse|**WIP** A container running the matrix reference server synapse|x|x| |[dragonchaser/matrix-synapse](https://hub.docker.com/r/dragonchaser/matrix-synapse)|matrix-synapse|**WIP** A container running the matrix reference server synapse|x|x|
|[dragonchaser/motsognir](https://hub.docker.com/r/dragonchaser/motsognir) |motsognir|A container for the motsognir gopher server|x|x|

18
motsognir/Dockerfile Normal file
View File

@@ -0,0 +1,18 @@
FROM debian:latest
LABEL maintainer="dragonchaser <crichter@suse.de>"
ENV TARBALL=motsognir-1.0.12.tar.xz
EXPOSE 70
RUN apt-get update \
&& apt-get -y install wget build-essential rsyslog
WORKDIR /build
RUN wget "https://downloads.sourceforge.net/project/motsognir/v1.0.12/${TARBALL}" \
&& tar xfv "${TARBALL}"
RUN cd $(echo "${TARBALL}" | sed -e "s/.tar.xz//g") && make all && make install
RUN apt-get -y purge wget build-essential
RUN rm -Rfv /etc/apt/sources.list.*
RUN rm -Rfv /build
RUN useradd -ms /bin/bash -d /gopher gopher
WORKDIR /gopher
COPY entrypoint.sh /
COPY rsyslog.conf /etc
ENTRYPOINT ["/entrypoint.sh"]

View File

@@ -0,0 +1,18 @@
FROM arm32v7/debian:buster-slim
COPY qemu-arm-static /usr/bin
ENV TARBALL=motsognir-1.0.12.tar.xz
EXPOSE 70
RUN apt-get update \
&& apt-get -y install wget build-essential rsyslog
WORKDIR /build
RUN wget "https://downloads.sourceforge.net/project/motsognir/v1.0.12/${TARBALL}" \
&& tar xfv "${TARBALL}"
RUN cd $(echo "${TARBALL}" | sed -e "s/.tar.xz//g") && make all && make install
RUN apt-get -y purge wget build-essential
RUN rm -Rfv /etc/apt/sources.list.*
RUN rm -Rfv /build
RUN useradd -ms /bin/bash -d /gopher gopher
WORKDIR /gopher
COPY entrypoint.sh /
COPY rsyslog.conf /etc
ENTRYPOINT ["/entrypoint.sh"]

25
motsognir/README.md Normal file
View File

@@ -0,0 +1,25 @@
# motsognir
A container for the motsognir gopher server http://motsognir.sourceforge.net/
## Running locally
**x86_64**
```
$> docker run -p 70:70 -v /path/to/you/local/gopherfolder:/gopher dragonchaser/motsognir:latest
```
**arm32v7**
```
$> docker run -p 70:70 -v /path/to/you/local/gopherfolder:/gopher dragonchaser/motsognir:latest-arm32v7
```
**Notes:**
- `motsognir.conf` needs to live in `/gopher`
- I suggest serving files from a subdirectory of `/gopher`
- I suggest also to use the `gopher` user in the `RunAsUser` variable in `/gopher/motsognir.conf`
- the container uses a bare minimal of an operating system needed to run
motsognir, for debugging it might make sense to run `apt-get install procps`
in the container

11
motsognir/entrypoint.sh Executable file
View File

@@ -0,0 +1,11 @@
#!/bin/bash
CONFIGFILE=${CONFIGFILE:-/gopher/motsognir.conf}
if [ ! -f ${CONFIGFILE} ]; then
echo "${CONFIGFILE} can not be found; bailing out!"; exit 1;
fi
echo "Using ${CONFIGFILE} to start motsognir"
trap "echo TRAPed signal" HUP INT QUIT TERM
touch /var/log/syslog
rsyslogd -n & sleep 20 &&
motsognir --config "${CONFIGFILE}"
tail -f /var/log/syslog

View File

@@ -0,0 +1,2 @@
#!/bin/bash
curl -L https://github.com/balena-io/qemu/releases/download/v3.0.0%2Bresin/qemu-3.0.0+resin-arm.tar.gz | tar zxvf - -C . && mv qemu-3.0.0+resin-arm/qemu-arm-static . && pwd && ls

View File

@@ -0,0 +1,4 @@
#!/bin/bash
#register qemu-*-static for all supported processors except the
# current one, but also remove all registered binfmt_misc before
docker run --rm --privileged multiarch/qemu-user-static:register --reset

92
motsognir/rsyslog.conf Normal file
View File

@@ -0,0 +1,92 @@
# /etc/rsyslog.conf configuration file for rsyslog
#
# For more information install rsyslog-doc and see
# /usr/share/doc/rsyslog-doc/html/configuration/index.html
#################
#### MODULES ####
#################
module(load="imuxsock") # provides support for local system logging
#module(load="imklog") # provides kernel logging support
#module(load="immark") # provides --MARK-- message capability
# provides UDP syslog reception
#module(load="imudp")
#input(type="imudp" port="514")
# provides TCP syslog reception
#module(load="imtcp")
#input(type="imtcp" port="514")
###########################
#### GLOBAL DIRECTIVES ####
###########################
#
# Use traditional timestamp format.
# To enable high precision timestamps, comment out the following line.
#
$ActionFileDefaultTemplate RSYSLOG_TraditionalFileFormat
#
# Set the default permissions for all log files.
#
$FileOwner root
$FileGroup adm
$FileCreateMode 0640
$DirCreateMode 0755
$Umask 0022
#
# Where to place spool and state files
#
$WorkDirectory /var/spool/rsyslog
#
# Include all config files in /etc/rsyslog.d/
#
$IncludeConfig /etc/rsyslog.d/*.conf
###############
#### RULES ####
###############
#
# First some standard log files. Log by facility.
#
auth,authpriv.* /var/log/auth.log
*.*;auth,authpriv.none -/var/log/syslog
#cron.* /var/log/cron.log
daemon.* -/var/log/daemon.log
kern.* -/var/log/kern.log
lpr.* -/var/log/lpr.log
mail.* -/var/log/mail.log
user.* -/var/log/user.log
#
# Logging for the mail system. Split it up so that
# it is easy to write scripts to parse these files.
#
mail.info -/var/log/mail.info
mail.warn -/var/log/mail.warn
mail.err /var/log/mail.err
#
# Some "catch-all" log files.
#
*.=debug;\
auth,authpriv.none;\
news.none;mail.none -/var/log/debug
*.=info;*.=notice;*.=warn;\
auth,authpriv.none;\
cron,daemon.none;\
mail,news.none -/var/log/messages
#
# Emergencies are sent to everybody logged in.
#
*.emerg :omusrmsg:*