password auth for webui

This commit is contained in:
Devaev Maxim 2018-08-10 00:16:03 +03:00
parent 1d21ab6bcb
commit 96e64d7988
3 changed files with 23 additions and 0 deletions

View File

@ -50,6 +50,9 @@ http {
#PROD add_header Strict-Transport-Security "max-age=31536000; includeSubDomains" always;
#PROD auth_basic "Restricted Area";
#PROD auth_basic_user_file /etc/nginx/htpasswd;
location / {
root /usr/share/kvmd/web;
index index.html;

View File

@ -1,5 +1,6 @@
RUN pkg-install \
nginx \
apache-tools \
mjpg-streamer-pikvm \
python \
python-raspberry-gpio
@ -14,12 +15,14 @@ RUN systemctl enable kvmd
COPY stages/pikvm/config.txt /boot/
COPY stages/pikvm/sysctl.conf /etc/sysctl.d/99-pikvm.conf
COPY stages/pikvm/udev.rules /etc/udev/rules.d/pikvm.rules
COPY stages/pikvm/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 serial-getty@ttyAMA0.service
RUN sed -e "s/^#PROD//g" /usr/share/kvmd/configs/nginx/nginx.conf.example > /etc/nginx/nginx.conf
RUN echo "admin:admin" > /etc/nginx/htpasswd
RUN cp /usr/share/kvmd/configs/kvmd/v1.yaml /etc/kvmd.yaml
ARG NEW_HTTPS_CERT

17
os/platforms/v1/motd Normal file
View File

@ -0,0 +1,17 @@
_____ _ _ ____ ____ __
| __ (_) | |/ /\ \ / / \/ |
| |__) | __ | ' / \ \ / /| \ / |
| ___/ | (__) | < \ \/ / | |\/| |
| | | | | . \ \ / | | | |
|_| |_| |_|\_\ \/ |_| |_|
Welcome to Pi-KVM - Open Source IP-KVM based on Raspberry Pi
Website: https://github.com/pi-kvm
____________________________________________________________________________
The root filesystem of Pi-KVM is mounted in read-only mode by default.
Use command "rw" to remount it in the RW-mode and "ro" to switch it back.
To change Web UI password use command "htpasswd /etc/nginx/htpasswd admin".