summaryrefslogtreecommitdiff
path: root/os/platforms/common/Dockerfile.part
blob: e4308647e163d7969ad4b1b56b2e5a2f4d52332a (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
RUN pkg-install \
	nginx-mainline \
	apache-tools \
	raspberrypi-firmware \
	v4l-utils \
	python \
	python-raspberry-gpio \
	customizepkg
RUN systemctl enable nginx

COPY stages/pikvm-common/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-ndk
COPY stages/pikvm-common/customizepkg.nginx /etc/customizepkg.d/nginx-mainline-mod-lua
RUN env MAKEPKGOPTS="--skipchecksums --skippgpcheck" pkg-install nginx-mainline-mod-lua

ARG USTREAMER_VERSION
ENV USTREAMER_VERSION $USTREAMER_VERSION
RUN echo $USTREAMER_VERSION
RUN pkg-install ustreamer

ARG KVMD_VERSION
ENV KVMD_VERSION $KVMD_VERSION
RUN echo $KVMD_VERSION
RUN pkg-install kvmd
RUN systemctl enable kvmd

COPY stages/pikvm-common/sysctl.conf /etc/sysctl.d/99-pikvm.conf
COPY stages/pikvm-common/motd /etc/

RUN sed -i -e "s/console=ttyAMA0\,115200//g" /boot/cmdline.txt \
	&& sed -i -e "s/kgdboc=ttyAMA0\,115200//g" /boot/cmdline.txt
RUN systemctl mask [email protected]

RUN rm -rf /etc/nginx/* \
	&& cp /usr/share/kvmd/configs/nginx/* /etc/nginx/ \
	&& sed -i -e "s/^#PROD//g" /etc/nginx/nginx.conf

ARG WEBUI_ADMIN_PASSWD
ENV WEBUI_ADMIN_PASSWD $WEBUI_ADMIN_PASSWD
RUN echo "$WEBUI_ADMIN_PASSWD" | htpasswd -ci /etc/nginx/htpasswd admin

ARG NEW_HTTPS_CERT
ENV NEW_HTTPS_CERT $NEW_HTTPS_CERT
RUN echo $NEW_HTTPS_CERT
RUN mkdir /etc/nginx/ssl \
	&& cd /etc/nginx/ssl \
	&& openssl req -new -x509 -nodes -newkey rsa:4096 -keyout server.key -out server.crt -days 3650 \
		-subj "/C=RU/ST=Moscow/L=Moscow/O=Pi-KVM/OU=Pi-KVM/CN=localhost" \
	&& chmod 400 server.key \
	&& chmod 444 server.crt \
	&& chmod 750 /etc/nginx/ssl \
	&& chown -R root:http /etc/nginx/ssl