Skip to content
Snippets Groups Projects
Commit 1204e244 authored by Florent Gluck's avatar Florent Gluck
Browse files

WIP new live-exam-os

parent c84d6853
No related branches found
No related tags found
No related merge requests found
......@@ -6,6 +6,7 @@ RUN apt-get update && apt-get install -y \
&& rm -rf /var/lib/apt/lists/*
ARG server_ip
ARG server_port
ARG config_dir
#ARG nexus_cert
......@@ -52,6 +53,7 @@ ADD ${config_dir}/isolinux_stdmenu.cfg config/includes.binary/isolinux/stdmenu.c
ADD ${config_dir}/live-exam-hook config/includes.chroot/lib/live/config/9999-custom
# update server destination from docker's variable (all others IP are banned)
RUN echo "firewall ${server_ip}\n" >> config/includes.chroot/lib/live/config/9999-custom
RUN sed s,_SERVER_PORT_,${server_port},g config/includes.chroot/lib/live/config/9999-custom > config/includes.chroot/lib/live/config/9999-custom.new && mv config/includes.chroot/lib/live/config/9999-custom.new config/includes.chroot/lib/live/config/9999-custom
# install wifi template
ADD ${config_dir}/WIFI.nmconnection config/includes.chroot/etc/NetworkManager/system-connections/
......
......@@ -18,7 +18,7 @@ usage () {
}
build_docker_image () {
if docker buildx build . -t "$DOCKER_IMG" --build-arg config_dir=$CONFIG_DIR --build-arg server_ip=$SERVER_IP ; then
if docker buildx build . -t "$DOCKER_IMG" --build-arg config_dir=$CONFIG_DIR --build-arg server_ip=$SERVER_IP --build-arg server_port=$SERVER_PORT ; then
echo "Docker image \"$DOCKER_IMG\" sucessfully built"
else
echo "FAILED building docker image!" && abort
......
......@@ -22,19 +22,29 @@ add_nexus_certs ()
disable_screen_blanking()
{
echo "xset s off" > /etc/X11/Xsession.d/99xsetoff
echo "xset s off" >> /home/nexus/.xsession
}
max_screen_brightness()
{
brightnessctl set 100%
}
firewall ()
{
ufw default deny incoming
ufw default deny incoming
ufw default deny outgoing
ufw allow in from any port 68 to any port 67 proto udp
# ufw allow from any to any port 22
ufw allow from any to any port 80
ufw allow from any to any port 443
ufw allow from any to any port _SERVER_PORT_
ufw allow out from any to $1 port 1025:65535 proto tcp
ufw allow out from any to $1 port 1025:65535 proto udp
# ufw allow from any to any port 22
ufw enable
}
#add_nexus_certs
disable_screen_blanking
#max_screen_brightness
#disable_screen_blanking
......@@ -11,3 +11,4 @@ virt-viewer
firmware-iwlwifi
network-manager
network-manager-gnome
brightnessctl
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment