File size: 3,743 Bytes
92f480e
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
# Friction desktop plus one local, captioned tutorial. The agent has no
# terminal/code editor; expressions inside Friction remain available.
FROM vedit-task:base AS prepared

# The current local base predates PulseAudio's runtime dependencies; install
# them before the pinned Friction .deb set is configured.
RUN apt-get update && apt-get install -y --no-install-recommends mpv pulseaudio libgles2 \
 && rm -rf /var/lib/apt/lists/*

COPY friction.tar.xz /tmp/friction.tar.xz
COPY debs/ /tmp/debs/
RUN dpkg -i /tmp/debs/*.deb \
 && mkdir -p /opt/friction \
 && tar -xJf /tmp/friction.tar.xz -C /opt/friction --strip-components=1 \
 && rm -rf /tmp/friction.tar.xz /tmp/debs \
 && test -x /opt/friction/bin/friction \
 && rm -f /opt/friction/bin/portable.txt \
 && missing="$(ldd /opt/friction/bin/friction | grep 'not found' || true)" \
 && { [ -z "$missing" ] || { echo "Unresolved Friction libraries: $missing"; exit 1; }; }
COPY friction-launcher.sh /usr/local/bin/friction
RUN chmod 755 /usr/local/bin/friction

# The video is copied alone: raw footage and the VTT used to burn captions do
# not reach the agent. mpv is a transport-only local viewer; its default
# command console and script loading are disabled in tutorial.desktop.
RUN mkdir -p /root/tutorial /root/edit /root/Desktop /etc/mpv \
 && rm -rf /root/media && mkdir -p /root/media
COPY tutorial/tutorial.mp4 /root/tutorial/tutorial.mp4
COPY t49-input.conf /etc/mpv/t49-input.conf
RUN test -s /root/tutorial/tutorial.mp4 && chmod 444 /root/tutorial/tutorial.mp4

COPY friction-autostart.desktop /opt/autostart/friction-autostart.desktop
COPY friction.desktop /root/Desktop/friction.desktop
COPY tutorial.desktop /root/Desktop/tutorial.desktop
RUN chmod 755 /root/Desktop/*.desktop \
 && cp /root/Desktop/friction.desktop /root/Desktop/tutorial.desktop /usr/share/applications/ \
 && test -x /usr/bin/xfdesktop && test -x /usr/bin/mpv

# Keep Chromium itself for computer-1 setup but remove user-facing browsers,
# terminals, file managers and code editors. Block launcher creation and run
# shortcuts. The verifier still has Python and ffmpeg inside the container;
# they have no agent-visible desktop entry point.
COPY no-terminal.sh /usr/local/bin/no-terminal
COPY kiosk/kioskrc /etc/xdg/xfce4/kiosk/kioskrc
RUN chmod 755 /usr/local/bin/no-terminal \
 && for t in xterm uxterm lxterm koi8rxterm x-terminal-emulator xfce4-terminal xfce4-appfinder xfrun4; do \
      rm -f "/usr/bin/$t" "/etc/alternatives/$t"; ln -s /usr/local/bin/no-terminal "/usr/bin/$t"; done \
 && rm -f /root/Desktop/terminal.desktop /root/Desktop/kdenlive.desktop \
 && sed -i '/exo-open --launch TerminalEmulator/d' /etc/xdg/xfce4/xfconf/xfce-perchannel-xml/xfce4-keyboard-shortcuts.xml \
 && rm -rf /opt/natron /usr/local/bin/Natron /usr/lib/gcc \
 && rm -f /usr/bin/gcc* /usr/bin/g++* /usr/bin/x86_64-linux-gnu-gcc* /usr/bin/x86_64-linux-gnu-g++* \
          /usr/bin/cc /usr/bin/c++ /usr/bin/c89-gcc /usr/bin/c99-gcc \
          /usr/bin/exo-desktop-item-edit /usr/bin/exo-open /usr/bin/kdenlive \
 && for t in xterm uxterm lxterm koi8rxterm x-terminal-emulator xfce4-terminal xfce4-appfinder xfrun4; do \
      rm -f "/usr/bin/$t"; ln -s /usr/local/bin/no-terminal "/usr/bin/$t"; done \
 && test -x /usr/bin/chromium && test ! -e /usr/bin/kdenlive
COPY harden-desktop.py /tmp/harden-desktop.py
RUN python3 /tmp/harden-desktop.py && rm /tmp/harden-desktop.py \
 && [ "$(readlink -f /usr/bin/xterm)" = /usr/local/bin/no-terminal ] \
 && test -x /usr/bin/mpv && test -x /usr/bin/chromium

FROM scratch
COPY --from=prepared / /
ENV DEBIAN_FRONTEND=noninteractive APP=friction SDL_AUDIODRIVER=dummy \
    QSG_RHI_BACKEND=opengl LIBGL_ALWAYS_SOFTWARE=1
WORKDIR /root
CMD ["/usr/local/bin/start-editor"]