2020-08-06 22:22:05 +00:00
|
|
|
FROM ubuntu:latest
|
|
|
|
|
2020-08-09 01:08:40 +00:00
|
|
|
# General 'stuff'
|
|
|
|
VOLUME /opt/pictures
|
|
|
|
VOLUME /opt/misc
|
|
|
|
ENV CONFIG_NOTIFY_EMAIL=user@domain.tld
|
|
|
|
ENV CONFIG_NOTIFY_SMTP_SERVER=mail.domain.tld
|
|
|
|
ENV CONFIG_NOTIFY_SMTP_USER=user@domain.tld
|
|
|
|
ENV CONFIG_NOTIFY_SMTP_PASS=apassword
|
|
|
|
|
2020-08-08 04:58:10 +00:00
|
|
|
# Ansible related 'stuff'
|
|
|
|
VOLUME /opt/ansible
|
|
|
|
|
2020-08-09 01:08:40 +00:00
|
|
|
# rtty 'stuff'
|
|
|
|
ENV CONFIG_RTTY_USER=admin
|
|
|
|
ENV CONFIG_RTTY_PASS=apassword
|
|
|
|
EXPOSE 5913
|
|
|
|
VOLUME /opt/rtty
|
|
|
|
|
2020-08-08 04:58:10 +00:00
|
|
|
# Monit related 'stuff'
|
2020-08-09 01:08:40 +00:00
|
|
|
ENV CONFIG_MONIT_USER=admin
|
|
|
|
ENV CONFIG_MONIT_PASS=apassword
|
2020-08-08 04:58:10 +00:00
|
|
|
EXPOSE 2812/tcp
|
|
|
|
EXPOSE 2811/tcp
|
|
|
|
VOLUME /opt/monit
|
|
|
|
VOLUME /opt/monit-dashboard
|
|
|
|
|
|
|
|
# Wireguard related 'stuff'
|
|
|
|
EXPOSE 51820/udp
|
|
|
|
VOLUME /lib/modules
|
|
|
|
VOLUME /opt/wireguard
|
|
|
|
|
|
|
|
# SyncThing related 'stuff'
|
|
|
|
EXPOSE 8384/tcp
|
|
|
|
EXPOSE 22000/tcp
|
|
|
|
VOLUME /opt/syncthing
|
|
|
|
|
|
|
|
# FileBrowser related 'stuff'
|
|
|
|
EXPOSE 9191/tcp
|
|
|
|
VOLUME /opt/filebrowser
|
|
|
|
|
2020-08-09 01:08:40 +00:00
|
|
|
# Munin related 'stuff'
|
|
|
|
VOLUME /opt/munin
|
|
|
|
EXPOSE 2813
|
|
|
|
|
|
|
|
# Dashboard related 'stuff'
|
|
|
|
VOLUME /opt/dashboard
|
|
|
|
EXPOSE 80
|
|
|
|
EXPOSE 443
|
2020-08-08 04:58:10 +00:00
|
|
|
|
|
|
|
# Run s6-overlay as the init so we get services and similar
|
|
|
|
ENTRYPOINT [ "/init" ]
|
|
|
|
|
2020-08-06 22:22:05 +00:00
|
|
|
# Don't bother us for selections during install
|
|
|
|
ENV DEBIAN_FRONTEND="noninteractive"
|
|
|
|
|
|
|
|
# We work off /opt, the *nix way
|
|
|
|
WORKDIR /opt/
|
|
|
|
|
2020-08-08 04:58:10 +00:00
|
|
|
# need to figure out if arm64/arm64 32bit multilib/arm/x86-64
|
|
|
|
COPY arch_detect.sh /opt/
|
2020-08-06 22:22:05 +00:00
|
|
|
|
|
|
|
# Install and base setup all the things
|
2020-08-09 01:08:40 +00:00
|
|
|
# The shell has to be bash for asdf to work properly - its needed for rtty and rttys
|
|
|
|
SHELL ["/bin/bash", "-c"]
|
2020-08-06 22:22:05 +00:00
|
|
|
RUN apt update && apt upgrade -y && \
|
2020-08-09 01:08:40 +00:00
|
|
|
apt install -y python3 curl jq bash unzip nano git tmux htop iotop nload && \
|
2020-08-06 22:22:05 +00:00
|
|
|
ARCH=$(/opt/arch_detect.sh); \
|
|
|
|
echo "**** Detected arch: $ARCH ****" && \
|
|
|
|
S6_RELEASE=$(curl -sX GET "https://api.github.com/repos/just-containers/s6-overlay/tags" \
|
|
|
|
| jq -r .[0].name); \
|
|
|
|
echo "**** s6-overlay release: ${S6_RELEASE} ****" && \
|
|
|
|
echo "**** Installing s6-overlay ****" && \
|
|
|
|
curl -L https://github.com/just-containers/s6-overlay/releases/latest/download/s6-overlay-${ARCH}.tar.gz \
|
|
|
|
-o /opt/s6-overlay.tar.gz && \
|
|
|
|
tar xzf /opt/s6-overlay.tar.gz -C / --exclude="./bin" && \
|
|
|
|
tar xzf /opt/s6-overlay.tar.gz -C /usr ./bin && \
|
|
|
|
echo "**** wireguard ****" && \
|
|
|
|
apt install -y build-essential ifupdown net-tools iproute2 iptables iputils-ping libc6 libelf-dev pkg-config && \
|
|
|
|
WIREGUARD_RELEASE=$(curl -sX GET "https://api.github.com/repos/WireGuard/wireguard-tools/tags" \
|
|
|
|
| jq -r .[0].name); \
|
|
|
|
git clone https://git.zx2c4.com/wireguard-tools /opt/wireguard-tools && \
|
|
|
|
cd /opt/wireguard-tools && \
|
|
|
|
git checkout "${WIREGUARD_RELEASE}" && \
|
|
|
|
make -C src -j$(nproc) && \
|
|
|
|
make -C src install && \
|
|
|
|
cd /opt && \
|
2020-08-08 04:58:10 +00:00
|
|
|
echo "**** monit related ***" && \
|
2020-08-22 21:12:24 +00:00
|
|
|
apt install -y monit python3-pip python3-setuptools python3-wheel && \
|
|
|
|
pip3 install xmltodict requests xlsxwriter web.py && \
|
2020-08-09 01:08:40 +00:00
|
|
|
echo "**** munin related ****" && \
|
|
|
|
apt install -y munin lighttpd && \
|
|
|
|
echo "**** rtty related ****" && \
|
|
|
|
apt install -y libev4 build-essential cmake libev-dev libssl-dev && \
|
|
|
|
if [ ! -d "/opt/rtty_build" ] ; then mkdir /opt/rtty_build; fi && \
|
|
|
|
cd /opt/rtty_build && \
|
|
|
|
mkdir rtty && \
|
|
|
|
cd rtty && \
|
|
|
|
git clone --recursive https://github.com/zhaojh329/rtty.git . && \
|
|
|
|
mkdir build && cd build && \
|
|
|
|
cmake .. && make install && \
|
|
|
|
cd /opt && \
|
|
|
|
mkdir /opt/rtty_build/rttys && \
|
|
|
|
cd /opt/rtty_build/rttys && \
|
|
|
|
git clone https://github.com/zhaojh329/rttys.git . && \
|
|
|
|
git checkout $(git rev-list --tags --max-count=1) && \
|
|
|
|
git clone https://github.com/asdf-vm/asdf.git ~/.asdf --branch v0.8.0-rc1 && \
|
|
|
|
. $HOME/.asdf/asdf.sh && \
|
|
|
|
asdf update && \
|
|
|
|
asdf plugin add golang && \
|
|
|
|
asdf install golang latest && \
|
|
|
|
asdf global golang $(asdf latest golang) && \
|
2021-05-05 19:10:16 +00:00
|
|
|
curl -fsSL https://deb.nodesource.com/setup_current.x | bash - && \
|
|
|
|
apt install -y nodejs && \
|
|
|
|
cd /opt/rtty_build/rttys/frontend && \
|
|
|
|
npm install && \
|
|
|
|
npm run build && \
|
|
|
|
cd /opt/rtty_build/rttys && \
|
|
|
|
./build.sh linux ${ARCH} && \
|
|
|
|
cp rttys-linux*/rttys /usr/local/bin/rttys && \
|
2020-08-09 01:08:40 +00:00
|
|
|
cd /opt && \
|
2020-08-22 21:12:24 +00:00
|
|
|
echo "**** dashboard related ****" && \
|
2020-08-09 01:08:40 +00:00
|
|
|
apt install -y lighttpd && \
|
2020-08-06 22:22:05 +00:00
|
|
|
echo "**** syncthing ****" && \
|
|
|
|
curl -s https://syncthing.net/release-key.txt | apt-key add - && \
|
|
|
|
echo "deb https://apt.syncthing.net/ syncthing stable" | tee /etc/apt/sources.list.d/syncthing.list && \
|
|
|
|
apt update && apt install -y syncthing && \
|
|
|
|
echo "**** rclone ****" && \
|
|
|
|
curl https://rclone.org/install.sh | bash && \
|
|
|
|
echo "**** filebrowser ****" && \
|
2021-05-05 19:10:16 +00:00
|
|
|
curl -fsSL https://raw.githubusercontent.com/filebrowser/get/master/get.sh | bash && \
|
2020-08-06 22:22:05 +00:00
|
|
|
echo "**** ansible ****" && \
|
|
|
|
apt install -y python3-apt sshpass ansible ansible-lint ansible-doc && \
|
2020-08-09 01:08:40 +00:00
|
|
|
echo "**** misc ****" && \
|
|
|
|
apt install -y msmtp msmtp-mta ca-certificates && \
|
2020-08-06 22:22:05 +00:00
|
|
|
echo "**** cleanup ****" && \
|
|
|
|
rm /opt/arch_detect.sh && \
|
|
|
|
rm /opt/s6-overlay.tar.gz && \
|
|
|
|
rm -rf /opt/wireguard-tools && \
|
2020-08-09 01:08:40 +00:00
|
|
|
rm -rf /opt/rtty_build && \
|
|
|
|
rm -rf ~/.asdf && \
|
|
|
|
apt remove --purge -y build-essential cmake pkg-config libelf-dev libev-dev libssl-dev unzip && \
|
2020-08-06 22:22:05 +00:00
|
|
|
apt autoremove --purge -y && \
|
|
|
|
rm -rf /var/lib/apt/lists/*
|
|
|
|
|
|
|
|
# Copy the s6 related 'stuff' to the container
|
2020-08-08 04:58:10 +00:00
|
|
|
ADD /root/ /
|