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

ongoing work on fully working live_exam_os generator

parent 1204e244
No related branches found
No related tags found
No related merge requests found
......@@ -8,7 +8,6 @@ RUN apt-get update && apt-get install -y \
ARG server_ip
ARG server_port
ARG config_dir
#ARG nexus_cert
WORKDIR /live-default
......@@ -26,6 +25,8 @@ ADD ${config_dir}/keyboard config/includes.chroot/etc/default/
ADD ${config_dir}/nexus-exam config/includes.chroot/usr/local/bin/
ADD ${config_dir}/nexus-exam.desktop config/includes.chroot/etc/xdg/autostart/
RUN mkdir config/includes.chroot/etc/skel/
# ADD ${config_dir}/Xsession config/includes.chroot/etc/X11/Xsession.d/99x-user_session
ADD ${config_dir}/Xsession config/includes.chroot/etc/skel/.xsessionrc
#RUN echo "export NEXUS_SERVER=${server_ip}\nexport NEXUS_CERT=/etc/ssl/certs/nexus-server.pem\n" >> config/includes.chroot/etc/skel/.xsessionrc
......@@ -52,8 +53,7 @@ ADD ${config_dir}/isolinux_stdmenu.cfg config/includes.binary/isolinux/stdmenu.c
# script hook ran at boot time (install system wide cert and firewall)
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
RUN echo "firewall ${server_ip} ${server_port}\n" >> config/includes.chroot/lib/live/config/9999-custom
# install wifi template
ADD ${config_dir}/WIFI.nmconnection config/includes.chroot/etc/NetworkManager/system-connections/
......
......@@ -61,11 +61,11 @@ error=0
echo "Building nexus-exam ..."
# This script compiles and copies nexus-exam into the current dir
nexus_exam_builder/build_nexus_exam $SERVER_IP $CERT $EXAM_USER $EXAM_PWD || abort
nexus_exam_builder/build_nexus_exam $SERVER_IP:$SERVER_PORT $CERT $EXAM_USER $EXAM_PWD || abort
mv nexus-exam $CONFIG_DIR || abort
echo "Building nexus live exam OS image \"$ISO\" ..."
echo "Using nexus-server @ $SERVER_IP"
echo "Using nexus-server @ $SERVER_IP:$SERVER_PORT"
build_docker_image
......
# Set brightness at 100%
screen=`xrandr -q|grep ' connected'|head -n1|cut -d ' ' -f1`
xrandr --output $screen --brightness 0.5
# Disable screen blanking
xset s off
......@@ -10,41 +10,25 @@
## This is free software, and you are welcome to redistribute it
## under certain conditions; see COPYING for details.
# This function is here just for reference as it is not used.
add_nexus_certs ()
{
if [ ! -e /etc/ssl/certs/nexus-server.pem ] && [ -e /usr/share/ca-certificates/nexus-server/nexus-server.crt ]
then
echo "nexus-server/nexus-server.crt" >> /etc/ca-certificates.conf
update-ca-certificates
fi
}
disable_screen_blanking()
{
echo "xset s off" >> /home/nexus/.xsession
}
max_screen_brightness()
{
brightnessctl set 100%
}
# add_nexus_certs ()
# {
# if [ ! -e /etc/ssl/certs/nexus-server.pem ] && [ -e /usr/share/ca-certificates/nexus-server/nexus-server.crt ]
# then
# echo "nexus-server/nexus-server.crt" >> /etc/ca-certificates.conf
# update-ca-certificates
# fi
# }
firewall ()
{
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 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 80
ufw allow out from any to $1 port 443
ufw allow out from any to $1 port $2
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
#max_screen_brightness
#disable_screen_blanking
# add_nexus_certs
\ No newline at end of file
......@@ -42,7 +42,9 @@ var (
)
func exit(code int) {
exitFn()
if exitFn != nil {
exitFn()
}
os.Exit(code)
}
......
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