From 3cb4a1795bfee21ae5d1f72dbc76a89c293b9731 Mon Sep 17 00:00:00 2001 From: mbattista Date: Mon, 29 Mar 2021 10:27:28 +0100 Subject: [PATCH 01/13] arm based container --- .m1k1o/arm_base/Dockerfile | 130 +++++ .m1k1o/arm_base/dbus | 11 + .m1k1o/arm_base/default.pa | 7 + .m1k1o/arm_base/supervisord.conf | 53 ++ .m1k1o/arm_base/xorg.conf | 88 ++++ .m1k1o/arm_firefox/Dockerfile | 23 + .m1k1o/arm_firefox/autoconfig.js | 2 + .m1k1o/arm_firefox/neko.js | 35 ++ .m1k1o/arm_firefox/openbox.xml | 763 ++++++++++++++++++++++++++++ .m1k1o/arm_firefox/policies.json | 129 +++++ .m1k1o/arm_firefox/supervisord.conf | 21 + .m1k1o/build | 22 + 12 files changed, 1284 insertions(+) create mode 100644 .m1k1o/arm_base/Dockerfile create mode 100755 .m1k1o/arm_base/dbus create mode 100644 .m1k1o/arm_base/default.pa create mode 100644 .m1k1o/arm_base/supervisord.conf create mode 100644 .m1k1o/arm_base/xorg.conf create mode 100644 .m1k1o/arm_firefox/Dockerfile create mode 100644 .m1k1o/arm_firefox/autoconfig.js create mode 100644 .m1k1o/arm_firefox/neko.js create mode 100644 .m1k1o/arm_firefox/openbox.xml create mode 100644 .m1k1o/arm_firefox/policies.json create mode 100644 .m1k1o/arm_firefox/supervisord.conf diff --git a/.m1k1o/arm_base/Dockerfile b/.m1k1o/arm_base/Dockerfile new file mode 100644 index 00000000..6dd4cfc6 --- /dev/null +++ b/.m1k1o/arm_base/Dockerfile @@ -0,0 +1,130 @@ +# +# STAGE 1: SERVER +# +FROM arm32v7/golang:1.15-buster as server +WORKDIR /src + +# +# install dependencies +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends git cmake make python2 libx11-dev libxrandr-dev libxtst-dev \ + libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-omx; \ + # + # install libclipboard + set -eux; \ + cd /tmp; \ + git clone https://github.com/jtanx/libclipboard; \ + cd libclipboard; \ + cmake .; \ + make -j4; \ + make install; \ + rm -rf /tmp/libclipboard; \ + # + # clean up + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# build server +COPY server/ . +RUN go get -v -t -d . && go build -o bin/neko -i cmd/neko/main.go + +# +# STAGE 2: CLIENT +# +FROM node:12-buster-slim as client + +# install dependencies +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends python2 build-essential + +WORKDIR /src + +# +# install dependencies +COPY client/package*.json ./ +RUN npm install + +# +# build client +COPY client/ . +RUN npm run build + +# +# STAGE 3: RUNTIME +# +FROM balenalib/raspberry-pi-debian:latest + +# +# avoid warnings by switching to noninteractive +ENV DEBIAN_FRONTEND=noninteractive + +# +# set custom user +ARG USERNAME=neko +ARG USER_UID=1000 +ARG USER_GID=$USER_UID + +# +# install dependencies +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends wget ca-certificates supervisor; \ + apt-get install -y --no-install-recommends pulseaudio dbus-x11 xserver-xorg-video-dummy; \ + apt-get install -y --no-install-recommends libcairo2 libxcb1 libxrandr2 libxv1 libopus0 libvpx5; \ + # + # gst + apt-get install -y --no-install-recommends libgstreamer1.0-dev libgstreamer-plugins-base1.0-dev \ + gstreamer1.0-plugins-base gstreamer1.0-plugins-good gstreamer1.0-plugins-bad gstreamer1.0-plugins-ugly gstreamer1.0-pulseaudio gstreamer1.0-omx; \ + # + # create a non-root user + groupadd --gid $USER_GID $USERNAME; \ + useradd --uid $USER_UID --gid $USERNAME --shell /bin/bash --create-home $USERNAME; \ + adduser $USERNAME audio; \ + adduser $USERNAME video; \ + adduser $USERNAME pulse; \ + # + # setup pulseaudio + mkdir -p /home/$USERNAME/.config/pulse/; \ + echo "default-server=unix:/tmp/pulseaudio.socket" > /home/$USERNAME/.config/pulse/client.conf; \ + # + # workaround for an X11 problem: http://blog.tigerteufel.de/?p=476 + mkdir /tmp/.X11-unix; \ + chmod 1777 /tmp/.X11-unix; \ + chown $USERNAME /tmp/.X11-unix/; \ + # + # make directories for neko + mkdir -p /etc/neko /var/www /var/log/neko; \ + chmod 1777 /var/log/neko; \ + chown $USERNAME /var/log/neko/; \ + chown -R $USERNAME:$USERNAME /home/$USERNAME; \ + # + # clean up + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# copy config files +COPY .m1k1o/base/dbus /usr/bin/dbus +COPY .m1k1o/base/default.pa /etc/pulse/default.pa +COPY .m1k1o/base/supervisord.conf /etc/neko/supervisord.conf +COPY .m1k1o/base/xorg.conf /etc/neko/xorg.conf + +# +# set default envs +ENV USER=$USERNAME +ENV DISPLAY=:99.0 +ENV NEKO_PASSWORD=neko +ENV NEKO_PASSWORD_ADMIN=admin +ENV NEKO_BIND=:8080 + +# +# copy static files from previous stages +COPY --from=server /src/bin/neko /usr/bin/neko +COPY --from=client /src/dist/ /var/www + +HEALTHCHECK --interval=10s --timeout=5s --retries=8 \ + CMD wget -O - http://localhost:${NEKO_BIND#*:}/health || exit 1 + +# +# run neko +CMD ["/usr/bin/supervisord", "-c", "/etc/neko/supervisord.conf"] diff --git a/.m1k1o/arm_base/dbus b/.m1k1o/arm_base/dbus new file mode 100755 index 00000000..bf0d4375 --- /dev/null +++ b/.m1k1o/arm_base/dbus @@ -0,0 +1,11 @@ +#!/bin/sh + +if [ ! -d /var/run/dbus ]; then + mkdir -p /var/run/dbus +fi + +if [ -f /var/run/dbus/pid ]; then + rm -f /var/run/dbus/pid +fi + +/usr/bin/dbus-daemon --nofork --print-pid --config-file=/usr/share/dbus-1/system.conf diff --git a/.m1k1o/arm_base/default.pa b/.m1k1o/arm_base/default.pa new file mode 100644 index 00000000..b0a26b10 --- /dev/null +++ b/.m1k1o/arm_base/default.pa @@ -0,0 +1,7 @@ +#!/usr/bin/pulseaudio -nF + +# Allow pulse audio to be accessed via TCP (from localhost only), to allow other users to access the virtual devices +load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1 + +### Make sure we always have a sink around, even if it is a null sink. +load-module module-always-sink diff --git a/.m1k1o/arm_base/supervisord.conf b/.m1k1o/arm_base/supervisord.conf new file mode 100644 index 00000000..3df95644 --- /dev/null +++ b/.m1k1o/arm_base/supervisord.conf @@ -0,0 +1,53 @@ +[supervisord] +nodaemon=true +pidfile=/var/run/supervisord.pid +logfile=/dev/null +logfile_maxbytes=0 +loglevel=debug + +[include] +files=/etc/neko/supervisord/*.conf + +[program:dbus] +environment=HOME="/root",USER="root" +command=/usr/bin/dbus +autorestart=true +priority=100 +user=root +stdout_logfile=/var/log/neko/dbus.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:x-server] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s" +command=/usr/bin/X -config /etc/neko/xorg.conf %(ENV_DISPLAY)s +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/xorg.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:pulseaudio] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/pulseaudio --disallow-module-loading -vvvv --disallow-exit --exit-idle-time=-1 +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/pulseaudio.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:neko] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/neko serve --static "/var/www" +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/neko.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true diff --git a/.m1k1o/arm_base/xorg.conf b/.m1k1o/arm_base/xorg.conf new file mode 100644 index 00000000..57016ad1 --- /dev/null +++ b/.m1k1o/arm_base/xorg.conf @@ -0,0 +1,88 @@ +# This xorg configuration file is meant to be used by xpra +# to start a dummy X11 server. +# For details, please see: +# https://xpra.org/trac/wiki/Xdummy + +Section "ServerFlags" + Option "DontVTSwitch" "true" + Option "AllowMouseOpenFail" "true" + Option "PciForceNone" "true" + Option "AutoEnableDevices" "false" + Option "AutoAddDevices" "false" +EndSection + +Section "InputDevice" + Identifier "dummy_mouse" + Option "CorePointer" "true" + Driver "void" +EndSection + +Section "InputDevice" + Identifier "dummy_keyboard" + Option "CoreKeyboard" "true" + Driver "void" +EndSection + +Section "Device" + Identifier "dummy_videocard" + Driver "dummy" + Option "ConstantDPI" "true" + #VideoRam 4096000 + #VideoRam 256000 + VideoRam 192000 +EndSection + +Section "Monitor" + Identifier "dummy_monitor" + HorizSync 5.0 - 1000.0 + VertRefresh 5.0 - 200.0 + #This can be used to get a specific DPI, but only for the default resolution: + #DisplaySize 508 317 + #NOTE: the highest modes will not work without increasing the VideoRam + # for the dummy video card. + # https://arachnoid.com/modelines/ + + # 1280x720 @ 30.00 Hz (GTF) hsync: 21.99 kHz; pclk: 33.78 MHz + Modeline "1280x720_30.00" 33.78 1280 1288 1408 1536 720 721 724 733 -HSync +Vsync + + # 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz + Modeline "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync + # 1152x648 @ 60.00 Hz (GTF) hsync: 40.26 kHz; pclk: 59.91 MHz + Modeline "1152x648_60.00" 59.91 1152 1200 1320 1488 648 649 652 671 -HSync +Vsync + # 1024x576 @ 60.00 Hz (GTF) hsync: 35.82 kHz; pclk: 47.00 MHz + Modeline "1024x576_60.00" 47.00 1024 1064 1168 1312 576 577 580 597 -HSync +Vsync + # 960x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 55.86 MHz + Modeline "960x720_60.00" 55.86 960 1008 1104 1248 720 721 724 746 -HSync +Vsync + # 800x600 @ 60.00 Hz (GTF) hsync: 37.32 kHz; pclk: 38.22 MHz + Modeline "800x600_60.00" 38.22 800 832 912 1024 600 601 604 622 -HSync +Vsync + + # 1920x1080 @ 30.00 Hz (GTF) hsync: 32.97 kHz; pclk: 80.18 MHz + Modeline "1920x1080_30.00" 80.18 1920 1984 2176 2432 1080 1081 1084 1099 -HSync +Vsync + # 1152x648 @ 30.00 Hz (GTF) hsync: 19.80 kHz; pclk: 26.93 MHz + Modeline "1152x648_30.00" 26.93 1152 1144 1256 1360 648 649 652 660 -HSync +Vsync + # 1024x576 @ 30.00 Hz (GTF) hsync: 17.61 kHz; pclk: 20.85 MHz + Modeline "1024x576_30.00" 20.85 1024 1008 1104 1184 576 577 580 587 -HSync +Vsync + # 960x720 @ 30.00 Hz (GTF) hsync: 21.99 kHz; pclk: 25.33 MHz + Modeline "960x720_30.00" 25.33 960 960 1056 1152 720 721 724 733 -HSync +Vsync + # 800x600 @ 30.00 Hz (GTF) hsync: 18.33 kHz; pclk: 17.01 MHz + Modeline "800x600_30.00" 17.01 800 792 864 928 600 601 604 611 -HSync +Vsync +EndSection + +Section "Screen" + Identifier "dummy_screen" + Device "dummy_videocard" + Monitor "dummy_monitor" + DefaultDepth 24 + SubSection "Display" + Viewport 0 0 + Depth 24 + Modes "1280x720_30.00" "1920x1080_60.00" "1280x720_60.00" "1152x648_60.00" "1024x576_60.00" "960x720_60.00" "800x600_60.00" "1920x1080_30.00" "1152x648_30.00" "1024x576_30.00" "960x720_30.00" "800x600_30.00" + EndSubSection +EndSection + +Section "ServerLayout" + Identifier "dummy_layout" + Screen "dummy_screen" + InputDevice "dummy_mouse" + InputDevice "dummy_keyboard" +EndSection diff --git a/.m1k1o/arm_firefox/Dockerfile b/.m1k1o/arm_firefox/Dockerfile new file mode 100644 index 00000000..9f596af9 --- /dev/null +++ b/.m1k1o/arm_firefox/Dockerfile @@ -0,0 +1,23 @@ +FROM mbattista/neko:arm_base + +# +# install firefox-esr +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends openbox firefox-esr; \ + # + # install extensions + mkdir -p /usr/lib/firefox-esr/distribution/extensions; \ + wget -O '/usr/lib/firefox-esr/distribution/extensions/uBlock0@raymondhill.net.xpi' https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi; \ + wget -O /usr/lib/firefox-esr/distribution/extensions/nordvpnproxy@nordvpn.com.xpi https://addons.mozilla.org/firefox/downloads/latest/nordvpn-proxy-extension/latest.xpi; \ + # + # clean up + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# copy configuation files +COPY supervisord.conf /etc/neko/supervisord/firefox.conf +COPY neko.js /usr/lib/firefox-esr/mozilla.cfg +COPY autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js +COPY policies.json /usr/lib/firefox-esr/distribution/policies.json +COPY openbox.xml /etc/neko/openbox.xml diff --git a/.m1k1o/arm_firefox/autoconfig.js b/.m1k1o/arm_firefox/autoconfig.js new file mode 100644 index 00000000..87d65796 --- /dev/null +++ b/.m1k1o/arm_firefox/autoconfig.js @@ -0,0 +1,2 @@ +pref("general.config.obscure_value", 0); +pref("general.config.filename", "mozilla.cfg"); \ No newline at end of file diff --git a/.m1k1o/arm_firefox/neko.js b/.m1k1o/arm_firefox/neko.js new file mode 100644 index 00000000..891d521d --- /dev/null +++ b/.m1k1o/arm_firefox/neko.js @@ -0,0 +1,35 @@ +// firefox config for neko +lockPref("browser.tabs.closeWindowWithLastTab", false); +lockPref("app.update.auto", false); +lockPref("app.update.enabled", false); +lockPref("app.update.silent", true); +lockPref("browser.cache.disk.capacity", 1000); +lockPref("browser.download.useDownloadDir", false); +lockPref("browser.rights.3.shown", true); +lockPref("browser.search.update", false); +lockPref("browser.shell.checkDefaultBrowser", false); +lockPref("extensions.update.enabled", false); +lockPref("plugin.default_plugin_disabled", false); +lockPref("plugin.scan.plid.all", true); +lockPref("plugins.hide_infobar_for_missing_plugin", true); +lockPref("profile.allow_automigration", false); +lockPref("signon.prefillForms", false); +lockPref("signon.rememberSignons", false); +lockPref("xpinstall.enabled", false); +lockPref("xpinstall.whitelist.required", true); +lockPref("browser.download.manager.retention", 0); +lockPref("browser.download.folderList", 2); +lockPref("browser.download.forbid_open_with", true); +lockPref("browser.safebrowsing.downloads.enabled", false); +lockPref("browser.safebrowsing.downloads.remote.enabled", false); +lockPref("browser.helperApps.alwaysAsk.force", false); +lockPref("browser.helperApps.neverAsk.saveToDisk", "application/zip,application/octet-stream,image/jpeg,application/vnd.ms-outlook,text/html,application/pdf"); +lockPref("browser.helperApps.neverAsk.openFile", "application/zip,application/octet-stream,image/jpeg,application/vnd.ms-outlook,text/html,application/pdf"); +lockPref("browser.newtabpage.activity-stream.default.sites", "https://ipleak.net/,https://www.youtube.com/,https://www.google.com/"); +// dark mode +lockPref("reader.color_scheme", "dark"); +lockPref("devtools.theme", "dark"); +lockPref("ui.systemUsesDarkTheme", 1); +lockPref("lightweightThemes.usedThemes","[]"); +lockPref("lightweightThemes.selectedThemeID", "firefox-compact-dark@mozilla.org"); +lockPref("browser.in-content.dark-mode", true); diff --git a/.m1k1o/arm_firefox/openbox.xml b/.m1k1o/arm_firefox/openbox.xml new file mode 100644 index 00000000..0e73a076 --- /dev/null +++ b/.m1k1o/arm_firefox/openbox.xml @@ -0,0 +1,763 @@ + + + + + + + + 10 + 20 + + + + + + no + true + yes + normal + + + + + yes + + no + + yes + + no + + 200 + + no + + + + + Smart + +
yes
+ + Primary + + 1 + +
+ + + Clearlooks + NLIMC + + yes + yes + + sans + 8 + + bold + + normal + + + + sans + 8 + + bold + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + bold + + normal + + + + sans + 9 + + bold + + normal + + + + + + + 1 + 1 + + + + 875 + + + + + yes + Nonpixel + + Center + + + + + 10 + + 10 + + + + + + + 0 + 0 + 0 + 0 + + + + TopLeft + + 0 + 0 + no + Above + + Vertical + + no + 300 + + 300 + + Middle + + + + + C-g + + + + leftno + + + rightno + + + upno + + + downno + + + leftno + + + rightno + + + upno + + + downno + + + 1 + + + 2 + + + 3 + + + 4 + + + + + + + + + + + + + + + + + + + + scrot -s + + + + + + + + + + + + + + + + + + + + + + + + yesyes + + + + + + + + + + + + right + + + + + left + + + + + up + + + + + down + + + + + + + + true + Konqueror + + kfmclient openProfile filemanagement + + + + + scrot + + + + + 1 + + 500 + + 400 + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + previous + + + next + + + previous + + + next + + + previous + + + next + + + + + + + + + + + + + + no + + + + + + + + + + + yes + + + + + + + + + + + + + + + + + + + + + + + + + + + top + + + + + + left + + + + + + right + + + + + + bottom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vertical + + + horizontal + + + + + + + + + + + + + + + + + previous + + + next + + + + previous + + + next + + + previous + + + next + + + + + + + + + + + + + + + + + + + + previous + + + next + + + previous + + + next + + + + + + + + + + + menu.xml + 200 + + no + + 100 + + 400 + + yes + + yes + + + + + + + +
diff --git a/.m1k1o/arm_firefox/policies.json b/.m1k1o/arm_firefox/policies.json new file mode 100644 index 00000000..8bbb3a1a --- /dev/null +++ b/.m1k1o/arm_firefox/policies.json @@ -0,0 +1,129 @@ +{ + "policies": { + "BlockAboutAddons": false, + "BlockAboutConfig": true, + "BlockAboutProfiles": true, + "BlockAboutSupport": true, + "Bookmarks": [ + { + "Title": "IPLeak", + "URL": "https://ipleak.net/", + "Favicon": "https://ipleak.net/favicon.ico", + "Folder": "Pages", + "Placement": "toolbar" + }, + { + "Title": "YouTube", + "URL": "https://www.youtube.com/", + "Favicon": "https://www.youtube.com/favicon.ico", + "Folder": "Pages", + "Placement": "toolbar" + }, + { + "Title": "Google", + "URL": "https://www.google.com/", + "Favicon": "https://www.google.com/favicon.ico", + "Folder": "Pages", + "Placement": "toolbar" + } + ], + "CaptivePortal": false, + "DisableAppUpdate": true, + "DisableBuiltinPDFViewer": true, + "DisableDeveloperTools": false, + "DisableFeedbackCommands": true, + "DisableFirefoxAccounts": true, + "DisableFirefoxScreenshots": true, + "DisableFirefoxStudies": true, + "DisableForgetButton": true, + "DisableMasterPasswordCreation": true, + "DisablePocket": true, + "DisablePrivateBrowsing": true, + "DisableProfileImport": true, + "DisableProfileRefresh": true, + "DisableSafeMode": true, + "DisableSetDesktopBackground": true, + "DisableSystemAddonUpdate": true, + "DisableTelemetry": true, + "DisplayBookmarksToolbar": false, + "DontCheckDefaultBrowser": true, + "EnableTrackingProtection": { + "Cryptomining": true, + "Fingerprinting": true, + "Value": true + }, + "ExtensionSettings": { + "*": { + "installation_mode": "blocked" + }, + "nordvpnproxy@nordvpn.com": { + "install_url": "https://addons.mozilla.org/firefox/downloads/latest/nordvpn-proxy-extension/latest.xpi", + "installation_mode": "force_installed" + }, + "uBlock0@raymondhill.net": { + "install_url": "https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/latest.xpi", + "installation_mode": "force_installed" + } + }, + "ExtensionUpdate": false, + "FirefoxHome": { + "Highlights": false, + "Pocket": false, + "Search": true, + "Snippets": false, + "TopSites": true + }, + "FlashPlugin": {}, + "HardwareAcceleration": false, + "Homepage": { + "Additional": [], + "StartPage": "none" + }, + "NewTabPage": true, + "NoDefaultBookmarks": true, + "OfferToSaveLogins": false, + "OfferToSaveLoginsDefault": false, + "OverrideFirstRunPage": "", + "OverridePostUpdatePage": "", + "PasswordManagerEnabled": false, + "Permissions": { + "Camera": { + "BlockNewRequests": true + }, + "Location": { + "BlockNewRequests": true + }, + "Microphone": { + "BlockNewRequests": true + }, + "Notifications": { + "BlockNewRequests": true + } + }, + "Preferences": { + "browser.tabs.warnOnClose": false, + "browser.urlbar.suggest.bookmark": false, + "browser.urlbar.suggest.history": false, + "browser.urlbar.suggest.openpage": false, + "datareporting.policy.dataSubmissionPolicyBypassNotification": true, + "dom.disable_window_flip": true, + "dom.disable_window_move_resize": true, + "dom.event.contextmenu.enabled": false, + "extensions.getAddons.showPane": false, + "places.history.enabled": false, + "privacy.file_unique_origin": true, + "ui.key.menuAccessKeyFocuses": false + }, + "PromptForDownloadLocation": false, + "SanitizeOnShutdown": { + "Cache": true, + "Cookies": true, + "Downloads": true, + "FormData": true, + "History": true, + "OfflineApps": true, + "Sessions": true, + "SiteSettings": true + } + } +} \ No newline at end of file diff --git a/.m1k1o/arm_firefox/supervisord.conf b/.m1k1o/arm_firefox/supervisord.conf new file mode 100644 index 00000000..d703a8d2 --- /dev/null +++ b/.m1k1o/arm_firefox/supervisord.conf @@ -0,0 +1,21 @@ +[program:firefox-esr] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/lib/firefox-esr/firefox-esr --display=%(ENV_DISPLAY)s -setDefaultBrowser -width 1280 -height 720 +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/firefox-esr.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true diff --git a/.m1k1o/build b/.m1k1o/build index 5243d78c..64b248ae 100755 --- a/.m1k1o/build +++ b/.m1k1o/build @@ -13,10 +13,24 @@ build_server() { docker run --rm -v "$BASE"/server/bin:/tmp/bin neko-dev-server sh -c "rm -rf /tmp/bin/neko; cp /src/bin/neko /tmp/bin" } +build_arm_client() { + docker build -t neko-dev-client -f arm_base/Dockerfile --target client "$BASE" + docker run --rm -v "$BASE"/client/dist:/tmp/dist neko-dev-client sh -c "rm -rf /tmp/dist/*; cp -r /src/dist/* /tmp/dist" +} + +build_arm_server() { + docker build -t neko-dev-server -f arm_base/Dockerfile --target server "$BASE" + docker run --rm -v "$BASE"/server/bin:/tmp/bin neko-dev-server sh -c "rm -rf /tmp/bin/neko; cp /src/bin/neko /tmp/bin" +} + build_base() { docker build -t m1k1o/neko:base -f base/Dockerfile "$BASE" } +build_arm_base() { + docker build -t mbattista/neko:arm_base -f arm_base/Dockerfile "$BASE" +} + build_firefox() { docker build -t m1k1o/neko:firefox -f firefox/Dockerfile firefox/ } @@ -25,6 +39,10 @@ build_chromium() { docker build -t m1k1o/neko:chromium -f chromium/Dockerfile chromium/ } +build_arm_firefox() { + docker build -t mbattista/neko:arm_firefox -f arm_firefox/Dockerfile arm_firefox/ +} + build_xfce() { docker build -t m1k1o/neko:xfce -f xfce/Dockerfile xfce/ } @@ -41,5 +59,9 @@ case $1 in chromium) build_chromium;; xfce) build_xfce;; vlc) build_vlc;; + arm_client) build_arm_client;; + arm_server) build_arm_server;; + arm_base) build_arm_base;; + arm_firefox) build_arm_firefox;; *) echo "Unknown $1";; esac From a287ca11884f4177d3899a99d1aa56b603352ae1 Mon Sep 17 00:00:00 2001 From: mbattista Date: Mon, 29 Mar 2021 22:17:12 +0100 Subject: [PATCH 02/13] changed README to reflect changes --- README.md | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/README.md b/README.md index cdcbbb16..e339a1a7 100644 --- a/README.md +++ b/README.md @@ -61,6 +61,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms. - Added HEALTHCHECK to Dockerfile. - Added `m1k1o/neko:vlc` tag, use VLC to watch local files together (by @mbattista). - Added `m1k1o/neko:xfce` tag, as an non video related showcase (by @mbattista). +- Added `m1k1o/neko:firefox_arm` tag, firefox neko for raspberry pi (by @mbattista) # Getting started & FAQ @@ -71,6 +72,8 @@ Use following docker images: - `m1k1o/neko:vlc` - for VLC Video player (needs volume mounted to `/media` with local video files, or setting `VLC_MEDIA=/media` path). - `m1k1o/neko:xfce` - for an shared desktop / installing shared software. - `m1k1o/neko:base` - for custom base. +- `m1k1o/neko:base_arm` - for custom arm based +- `m1k1o/neko:firefox_arm` - for Firefox (Raspberry Pi) Networking: - If you want to use n.eko in **external** network, you can omit `NEKO_NAT1TO1`. It will automatically get your Public IP. @@ -168,6 +171,32 @@ services: NEKO_NAT1TO1: ``` +```yaml +version: "3.4" +services: + neko: + image: "m1k1o/neko:firefox_arm" + restart: "unless-stopped" + # increase on rpi's with more then 1gb ram + shm_size: "740mb" + ports: + - "8084:8080" + - "52000-52100:52000-52100/udp" + # this is important since we need a GPU for hardware acceleration alternatively mount the devices into the docker + privileged: true + environment: + NEKO_SCREEN: '1280x720@30' + NEKO_PASSWORD: 'neko' + NEKO_PASSWORD_ADMIN: 'admin' + NEKO_EPR: 52000-52100 + NEKO_VP8: 'false' + NEKO_VP9: 'false' + NEKO_H264: 'true' + # Change target bitrate and framerate on this parameter + NEKO_VIDEO: ' ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! omxh264enc target-bitrate=1500000 control-rate=4 ! h264parse config-interval=3 ! video/x-h264,profile=baseline,stream-format=byte-stream ' + NEKO_MAX_FPS: 0 +``` + ## Mobile support Neko is now working on iOS and Android! Also, the UI screens have been fixed for small screens. From 5ff441582dc1d1476fac049b0c5578732b87ea87 Mon Sep 17 00:00:00 2001 From: mbattista Date: Tue, 30 Mar 2021 13:15:55 +0100 Subject: [PATCH 03/13] v4l2 as example pipeline --- README.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index e339a1a7..17e6fc78 100644 --- a/README.md +++ b/README.md @@ -178,7 +178,7 @@ services: image: "m1k1o/neko:firefox_arm" restart: "unless-stopped" # increase on rpi's with more then 1gb ram - shm_size: "740mb" + shm_size: "520mb" ports: - "8084:8080" - "52000-52100:52000-52100/udp" @@ -193,7 +193,7 @@ services: NEKO_VP9: 'false' NEKO_H264: 'true' # Change target bitrate and framerate on this parameter - NEKO_VIDEO: ' ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! omxh264enc target-bitrate=1500000 control-rate=4 ! h264parse config-interval=3 ! video/x-h264,profile=baseline,stream-format=byte-stream ' + NEKO_VIDEO: ' ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,framerate=30/1,format=NV12 ! v4l2h264enc extra-controls="controls,h264_profile=0,video_bitrate=1250000;" ! h264parse config-interval=3 ! video/x-h264,profile=baseline,stream-format=byte-stream ' NEKO_MAX_FPS: 0 ``` From 9cf824c5ea7a25e573441b5266998600aa2ab7b6 Mon Sep 17 00:00:00 2001 From: mbattista Date: Thu, 1 Apr 2021 13:46:17 +0100 Subject: [PATCH 04/13] some chromium tests --- .m1k1o/build | 6 +- .m1k1o/chromium_arm/Dockerfile | 15 + .m1k1o/chromium_arm/openbox.xml | 763 +++++++++++++++++++++++++++ .m1k1o/chromium_arm/supervisord.conf | 21 + 4 files changed, 802 insertions(+), 3 deletions(-) create mode 100644 .m1k1o/chromium_arm/Dockerfile create mode 100644 .m1k1o/chromium_arm/openbox.xml create mode 100644 .m1k1o/chromium_arm/supervisord.conf diff --git a/.m1k1o/build b/.m1k1o/build index 67410ded..89ed410b 100755 --- a/.m1k1o/build +++ b/.m1k1o/build @@ -28,8 +28,8 @@ build_base_arm() { docker build -t "${IMAGE}:base_arm" -f base_arm/Dockerfile "${BASE}" } -build_firefox_arm() { - docker build -t "${IMAGE}:firefox_arm" -f firefox/Dockerfile --build-arg BASE_IMAGE="${IMAGE}:base_arm" firefox +build_chromium_arm() { + docker build -t "${IMAGE}:chromium_arm" -f chromium_arm/Dockerfile chromium_arm } build() { @@ -41,7 +41,7 @@ case $1 in server) build_server;; base) build_base;; base_arm) build_base_arm;; - firefox_arm) build_firefox_arm;; + chromium_arm) build_chromium_arm;; *) build "$1";; esac diff --git a/.m1k1o/chromium_arm/Dockerfile b/.m1k1o/chromium_arm/Dockerfile new file mode 100644 index 00000000..46115213 --- /dev/null +++ b/.m1k1o/chromium_arm/Dockerfile @@ -0,0 +1,15 @@ +FROM m1k1o/neko:base_arm + +# +# install firefox-esr +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends openbox chromium-browser; \ + # + # clean up + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# copy configuation files +COPY supervisord.conf /etc/neko/supervisord/firefox.conf +COPY openbox.xml /etc/neko/openbox.xml diff --git a/.m1k1o/chromium_arm/openbox.xml b/.m1k1o/chromium_arm/openbox.xml new file mode 100644 index 00000000..0e73a076 --- /dev/null +++ b/.m1k1o/chromium_arm/openbox.xml @@ -0,0 +1,763 @@ + + + + + + + + 10 + 20 + + + + + + no + true + yes + normal + + + + + yes + + no + + yes + + no + + 200 + + no + + + + + Smart + +
yes
+ + Primary + + 1 + +
+ + + Clearlooks + NLIMC + + yes + yes + + sans + 8 + + bold + + normal + + + + sans + 8 + + bold + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + bold + + normal + + + + sans + 9 + + bold + + normal + + + + + + + 1 + 1 + + + + 875 + + + + + yes + Nonpixel + + Center + + + + + 10 + + 10 + + + + + + + 0 + 0 + 0 + 0 + + + + TopLeft + + 0 + 0 + no + Above + + Vertical + + no + 300 + + 300 + + Middle + + + + + C-g + + + + leftno + + + rightno + + + upno + + + downno + + + leftno + + + rightno + + + upno + + + downno + + + 1 + + + 2 + + + 3 + + + 4 + + + + + + + + + + + + + + + + + + + + scrot -s + + + + + + + + + + + + + + + + + + + + + + + + yesyes + + + + + + + + + + + + right + + + + + left + + + + + up + + + + + down + + + + + + + + true + Konqueror + + kfmclient openProfile filemanagement + + + + + scrot + + + + + 1 + + 500 + + 400 + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + previous + + + next + + + previous + + + next + + + previous + + + next + + + + + + + + + + + + + + no + + + + + + + + + + + yes + + + + + + + + + + + + + + + + + + + + + + + + + + + top + + + + + + left + + + + + + right + + + + + + bottom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vertical + + + horizontal + + + + + + + + + + + + + + + + + previous + + + next + + + + previous + + + next + + + previous + + + next + + + + + + + + + + + + + + + + + + + + previous + + + next + + + previous + + + next + + + + + + + + + + + menu.xml + 200 + + no + + 100 + + 400 + + yes + + yes + + + + + + + +
diff --git a/.m1k1o/chromium_arm/supervisord.conf b/.m1k1o/chromium_arm/supervisord.conf new file mode 100644 index 00000000..0ba73bc1 --- /dev/null +++ b/.m1k1o/chromium_arm/supervisord.conf @@ -0,0 +1,21 @@ +[program:firefox-esr] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/chromium-browser --window-position=0,0 --display=%(ENV_DISPLAY)s --start-maximized --bwsi --test-type --force-dark-mode --disable-file-system --disable-software-rasterizer +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/chromium-arm.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true From 5082bab6deefabfa10cd1e161b9e16037905ab36 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 20:00:59 +0200 Subject: [PATCH 05/13] move ungoogled-chromium. --- .m1k1o/{chromium => ungoogled-chromium}/Dockerfile | 2 +- .../extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx | Bin .../cjpalhdlnbpafiamejdnhcphjbkeiagm.json | 0 .../extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.crx | Bin .../fjoaledfpmneenckfbpdfhkmimnjocfa.json | 0 .m1k1o/{chromium => ungoogled-chromium}/openbox.xml | 0 .../{chromium => ungoogled-chromium}/policies.json | 0 .../preferences.json | 0 .../supervisord.conf | 4 ++-- 9 files changed, 3 insertions(+), 3 deletions(-) rename .m1k1o/{chromium => ungoogled-chromium}/Dockerfile (96%) rename .m1k1o/{chromium => ungoogled-chromium}/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx (100%) rename .m1k1o/{chromium => ungoogled-chromium}/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.json (100%) rename .m1k1o/{chromium => ungoogled-chromium}/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.crx (100%) rename .m1k1o/{chromium => ungoogled-chromium}/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.json (100%) rename .m1k1o/{chromium => ungoogled-chromium}/openbox.xml (100%) rename .m1k1o/{chromium => ungoogled-chromium}/policies.json (100%) rename .m1k1o/{chromium => ungoogled-chromium}/preferences.json (100%) rename .m1k1o/{chromium => ungoogled-chromium}/supervisord.conf (90%) diff --git a/.m1k1o/chromium/Dockerfile b/.m1k1o/ungoogled-chromium/Dockerfile similarity index 96% rename from .m1k1o/chromium/Dockerfile rename to .m1k1o/ungoogled-chromium/Dockerfile index f207cf64..0aafc7b8 100644 --- a/.m1k1o/chromium/Dockerfile +++ b/.m1k1o/ungoogled-chromium/Dockerfile @@ -29,7 +29,7 @@ RUN set -eux; apt-get update; \ # # copy configuation files -COPY supervisord.conf /etc/neko/supervisord/chromium.conf +COPY supervisord.conf /etc/neko/supervisord/ungoogled-chromium.conf COPY preferences.json /usr/lib/chromium/master_preferences COPY policies.json /etc/chromium/policies/managed/policies.json COPY openbox.xml /etc/neko/openbox.xml diff --git a/.m1k1o/chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx b/.m1k1o/ungoogled-chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx similarity index 100% rename from .m1k1o/chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx rename to .m1k1o/ungoogled-chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.crx diff --git a/.m1k1o/chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.json b/.m1k1o/ungoogled-chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.json similarity index 100% rename from .m1k1o/chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.json rename to .m1k1o/ungoogled-chromium/extensions/cjpalhdlnbpafiamejdnhcphjbkeiagm.json diff --git a/.m1k1o/chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.crx b/.m1k1o/ungoogled-chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.crx similarity index 100% rename from .m1k1o/chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.crx rename to .m1k1o/ungoogled-chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.crx diff --git a/.m1k1o/chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.json b/.m1k1o/ungoogled-chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.json similarity index 100% rename from .m1k1o/chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.json rename to .m1k1o/ungoogled-chromium/extensions/fjoaledfpmneenckfbpdfhkmimnjocfa.json diff --git a/.m1k1o/chromium/openbox.xml b/.m1k1o/ungoogled-chromium/openbox.xml similarity index 100% rename from .m1k1o/chromium/openbox.xml rename to .m1k1o/ungoogled-chromium/openbox.xml diff --git a/.m1k1o/chromium/policies.json b/.m1k1o/ungoogled-chromium/policies.json similarity index 100% rename from .m1k1o/chromium/policies.json rename to .m1k1o/ungoogled-chromium/policies.json diff --git a/.m1k1o/chromium/preferences.json b/.m1k1o/ungoogled-chromium/preferences.json similarity index 100% rename from .m1k1o/chromium/preferences.json rename to .m1k1o/ungoogled-chromium/preferences.json diff --git a/.m1k1o/chromium/supervisord.conf b/.m1k1o/ungoogled-chromium/supervisord.conf similarity index 90% rename from .m1k1o/chromium/supervisord.conf rename to .m1k1o/ungoogled-chromium/supervisord.conf index 0ccd6b8d..6637b851 100644 --- a/.m1k1o/chromium/supervisord.conf +++ b/.m1k1o/ungoogled-chromium/supervisord.conf @@ -1,10 +1,10 @@ -[program:chromium] +[program:ungoogled-chromium] environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" command=/usr/lib/chromium/chrome-wrapper --window-position=0,0 --display=%(ENV_DISPLAY)s --start-maximized --bwsi --test-type --force-dark-mode --disable-file-system --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage autorestart=true priority=800 user=%(ENV_USER)s -stdout_logfile=/var/log/neko/chromium.log +stdout_logfile=/var/log/neko/ungoogled-chromium.log stdout_logfile_maxbytes=100MB stdout_logfile_backups=10 redirect_stderr=true From 653e32697fa6e39c3daa6fe65220bf9c32d50d3d Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 20:36:43 +0200 Subject: [PATCH 06/13] add chromium image. --- .m1k1o/chromium/Dockerfile | 25 + .m1k1o/chromium/openbox.xml | 763 +++++++++++++++++++++++++++++++ .m1k1o/chromium/policies.json | 38 ++ .m1k1o/chromium/preferences.json | 110 +++++ .m1k1o/chromium/supervisord.conf | 21 + 5 files changed, 957 insertions(+) create mode 100644 .m1k1o/chromium/Dockerfile create mode 100644 .m1k1o/chromium/openbox.xml create mode 100644 .m1k1o/chromium/policies.json create mode 100644 .m1k1o/chromium/preferences.json create mode 100644 .m1k1o/chromium/supervisord.conf diff --git a/.m1k1o/chromium/Dockerfile b/.m1k1o/chromium/Dockerfile new file mode 100644 index 00000000..df36e933 --- /dev/null +++ b/.m1k1o/chromium/Dockerfile @@ -0,0 +1,25 @@ +FROM m1k1o/neko:base + +# +# install neko chromium +RUN set -eux; apt-get update; \ + apt-get install -y --no-install-recommends unzip chromium openbox; \ + # + # install widevine module + WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1); \ + wget -O /tmp/widevine.zip "https://dl.google.com/widevine-cdm/$WIDEVINE_VERSION-linux-x64.zip"; \ + unzip -p /tmp/widevine.zip libwidevinecdm.so > /usr/lib/chromium/libwidevinecdm.so; \ + chmod 644 /usr/lib/chromium/libwidevinecdm.so; \ + rm /tmp/widevine.zip; \ + # + # clean up + apt-get --purge autoremove -y unzip; \ + apt-get clean -y; \ + rm -rf /var/lib/apt/lists/* /var/cache/apt/* + +# +# copy configuation files +COPY supervisord.conf /etc/neko/supervisord/chromium.conf +COPY --chown=neko preferences.json /home/neko/.config/chromium/Default/Preferences +COPY policies.json /etc/chromium/policies/managed/policies.json +COPY openbox.xml /etc/neko/openbox.xml diff --git a/.m1k1o/chromium/openbox.xml b/.m1k1o/chromium/openbox.xml new file mode 100644 index 00000000..fd1f8941 --- /dev/null +++ b/.m1k1o/chromium/openbox.xml @@ -0,0 +1,763 @@ + + + + + + + + 10 + 20 + + + + + + no + true + yes + normal + + + + + yes + + no + + yes + + no + + 200 + + no + + + + + Smart + +
yes
+ + Primary + + 1 + +
+ + + Clearlooks + NLIMC + + yes + yes + + sans + 8 + + bold + + normal + + + + sans + 8 + + bold + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + normal + + normal + + + + sans + 9 + + bold + + normal + + + + sans + 9 + + bold + + normal + + + + + + + 1 + 1 + + + + 875 + + + + + yes + Nonpixel + + Center + + + + + 10 + + 10 + + + + + + + 0 + 0 + 0 + 0 + + + + TopLeft + + 0 + 0 + no + Above + + Vertical + + no + 300 + + 300 + + Middle + + + + + C-g + + + + leftno + + + rightno + + + upno + + + downno + + + leftno + + + rightno + + + upno + + + downno + + + 1 + + + 2 + + + 3 + + + 4 + + + + + + + + + + + + + + + + + + + + scrot -s + + + + + + + + + + + + + + + + + + + + + + + + yesyes + + + + + + + + + + + + right + + + + + left + + + + + up + + + + + down + + + + + + + + true + Konqueror + + kfmclient openProfile filemanagement + + + + + scrot + + + + + 1 + + 500 + + 400 + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + previous + + + next + + + previous + + + next + + + previous + + + next + + + + + + + + + + + + + + no + + + + + + + + + + + yes + + + + + + + + + + + + + + + + + + + + + + + + + + + top + + + + + + left + + + + + + right + + + + + + bottom + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vertical + + + horizontal + + + + + + + + + + + + + + + + + previous + + + next + + + + previous + + + next + + + previous + + + next + + + + + + + + + + + + + + + + + + + + previous + + + next + + + previous + + + next + + + + + + + + + + + menu.xml + 200 + + no + + 100 + + 400 + + yes + + yes + + + + + + + +
diff --git a/.m1k1o/chromium/policies.json b/.m1k1o/chromium/policies.json new file mode 100644 index 00000000..786c2b15 --- /dev/null +++ b/.m1k1o/chromium/policies.json @@ -0,0 +1,38 @@ +{ + "HomepageLocation": "", + "AutoFillEnabled": false, + "AutofillAddressEnabled": false, + "AutofillCreditCardEnabled": false, + "BrowserSignin": 0, + "DefaultNotificationsSetting": 2, + "DeveloperToolsAvailability": 2, + "EditBookmarksEnabled": false, + "FullscreenAllowed": true, + "IncognitoModeAvailability": 1, + "SyncDisabled": true, + "AutoplayAllowed": true, + "BrowserAddPersonEnabled": false, + "BrowserGuestModeEnabled": false, + "DefaultPopupsSetting": 2, + "DownloadRestrictions": 3, + "VideoCaptureAllowed": true, + "AllowFileSelectionDialogs": false, + "PromptForDownloadLocation": false, + "BookmarkBarEnabled": false, + "PasswordManagerEnabled": false, + "URLBlacklist": [ + "file://*", + "chrome://policy" + ], + "ExtensionInstallForcelist": [ + "cjpalhdlnbpafiamejdnhcphjbkeiagm;https://clients2.google.com/service/update2/crx", + "fjoaledfpmneenckfbpdfhkmimnjocfa;https://clients2.google.com/service/update2/crx" + ], + "ExtensionInstallWhitelist": [ + "cjpalhdlnbpafiamejdnhcphjbkeiagm", + "fjoaledfpmneenckfbpdfhkmimnjocfa" + ], + "ExtensionInstallBlacklist": [ + "*" + ] +} diff --git a/.m1k1o/chromium/preferences.json b/.m1k1o/chromium/preferences.json new file mode 100644 index 00000000..31cd367a --- /dev/null +++ b/.m1k1o/chromium/preferences.json @@ -0,0 +1,110 @@ +{ + "homepage": "http://www.google.com", + "homepage_is_newtabpage": false, + "first_run_tabs": [ + "https://www.google.com/_/chrome/newtab?ie=UTF-8" + ], + "custom_links": { + "initialized": true, + "list": [ + { + "title": "YouTube", + "url": "https://www.youtube.com/" + }, + { + "title": "Netflix", + "url": "https://netflix.com" + }, + { + "title": "Hulu", + "url": "https://www.hulu.com/" + }, + { + "title": "9Anime", + "url": "https://9anime.to/" + }, + { + "title": "Crunchy Roll", + "url": "https://www.crunchyroll.com/" + }, + { + "title": "Funimation", + "url": "https://www.funimation.com/" + }, + { + "title": "Disney+", + "url": "https://www.disneyplus.com/" + }, + { + "title": "HBO Now", + "url": "https://play.hbonow.com/" + }, + { + "title": "Amazon Video", + "url": "https://www.amazon.com/Amazon-Video/b?node=2858778011" + }, + { + "title": "VRV", + "url": "https://vrv.co/" + }, + { + "title": "Twitch", + "url": "https://www.twitch.tv/" + }, + { + "title": "Mixer", + "url": "https://mixer.com/" + } + ] + }, + "browser": { + "custom_chrome_frame": false, + "show_home_button": true, + "window_placement": { + "maximized": true + } + }, + "bookmark_bar": { + "show_on_all_tabs": false + }, + "sync_promo": { + "show_on_first_run_allowed": false + }, + "distribution": { + "import_bookmarks_from_file": "bookmarks.html", + "import_bookmarks": true, + "import_history": true, + "import_home_page": true, + "import_search_engine": true, + "ping_delay": 60, + "do_not_create_desktop_shortcut": true, + "do_not_create_quick_launch_shortcut": true, + "do_not_create_taskbar_shortcut": true, + "do_not_launch_chrome": true, + "do_not_register_for_update_launch": true, + "make_chrome_default": true, + "make_chrome_default_for_user": true, + "system_level": false, + "verbose_logging": false + }, + "profile": { + "avatar_index": 19, + "default_content_setting_values": { + "clipboard": 2, + "cookies": 4, + "geolocation": 2, + "media_stream_camera": 2, + "media_stream_mic": 2, + "midi_sysex": 2, + "payment_handler": 2, + "usb_guard": 2 + }, + "name": "neko", + "using_default_avatar": false, + "using_default_name": false, + "using_gaia_avatar": false + }, + "signin": { + "allowed": false + } +} diff --git a/.m1k1o/chromium/supervisord.conf b/.m1k1o/chromium/supervisord.conf new file mode 100644 index 00000000..a9720173 --- /dev/null +++ b/.m1k1o/chromium/supervisord.conf @@ -0,0 +1,21 @@ +[program:chromium] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/chromium --window-position=0,0 --display=%(ENV_DISPLAY)s --user-data-dir=/home/neko/.config/chromium --no-first-run --start-maximized --bwsi --force-dark-mode --disable-file-system --disable-gpu --disable-software-rasterizer --disable-dev-shm-usage +autorestart=true +priority=800 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/chromium.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true + +[program:openbox] +environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" +command=/usr/bin/openbox --config-file /etc/neko/openbox.xml +autorestart=true +priority=300 +user=%(ENV_USER)s +stdout_logfile=/var/log/neko/openbox.log +stdout_logfile_maxbytes=100MB +stdout_logfile_backups=10 +redirect_stderr=true From 631e8775fe41dbdcd688922b9eabf71725cece30 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 20:37:51 +0200 Subject: [PATCH 07/13] set base image from ARG. --- .m1k1o/chromium/Dockerfile | 3 ++- .m1k1o/ungoogled-chromium/Dockerfile | 3 ++- .m1k1o/vlc/Dockerfile | 3 ++- .m1k1o/vncviewer/Dockerfile | 3 ++- .m1k1o/xfce/Dockerfile | 3 ++- 5 files changed, 10 insertions(+), 5 deletions(-) diff --git a/.m1k1o/chromium/Dockerfile b/.m1k1o/chromium/Dockerfile index df36e933..a6e7d62b 100644 --- a/.m1k1o/chromium/Dockerfile +++ b/.m1k1o/chromium/Dockerfile @@ -1,4 +1,5 @@ -FROM m1k1o/neko:base +ARG BASE_IMAGE=m1k1o/neko:base +FROM $BASE_IMAGE # # install neko chromium diff --git a/.m1k1o/ungoogled-chromium/Dockerfile b/.m1k1o/ungoogled-chromium/Dockerfile index 0aafc7b8..0b6141be 100644 --- a/.m1k1o/ungoogled-chromium/Dockerfile +++ b/.m1k1o/ungoogled-chromium/Dockerfile @@ -1,4 +1,5 @@ -FROM m1k1o/neko:base +ARG BASE_IMAGE=m1k1o/neko:base +FROM $BASE_IMAGE ARG SRC_URL="https://github.com/macchrome/linchrome/releases/download/v89.0.4389.90-r843830-portable-ungoogled-Lin64/ungoogled-chromium_89.0.4389.90_1.vaapi_linux.tar.xz" diff --git a/.m1k1o/vlc/Dockerfile b/.m1k1o/vlc/Dockerfile index c9dccb11..aea2e1d6 100644 --- a/.m1k1o/vlc/Dockerfile +++ b/.m1k1o/vlc/Dockerfile @@ -1,4 +1,5 @@ -FROM m1k1o/neko:base +ARG BASE_IMAGE=m1k1o/neko:base +FROM $BASE_IMAGE # # install vlc diff --git a/.m1k1o/vncviewer/Dockerfile b/.m1k1o/vncviewer/Dockerfile index 6deea331..e6303872 100644 --- a/.m1k1o/vncviewer/Dockerfile +++ b/.m1k1o/vncviewer/Dockerfile @@ -1,4 +1,5 @@ -FROM m1k1o/neko:base +ARG BASE_IMAGE=m1k1o/neko:base +FROM $BASE_IMAGE # # install vncviewer diff --git a/.m1k1o/xfce/Dockerfile b/.m1k1o/xfce/Dockerfile index 6c7da06a..b1aa6a7d 100644 --- a/.m1k1o/xfce/Dockerfile +++ b/.m1k1o/xfce/Dockerfile @@ -1,4 +1,5 @@ -FROM m1k1o/neko:base +ARG BASE_IMAGE=m1k1o/neko:base +FROM $BASE_IMAGE # # install xfce From b6b1cd01acdc6f583479e51588159f5565802396 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 21:00:48 +0200 Subject: [PATCH 08/13] changed ARM builds. --- .m1k1o/{base_arm => arm-base}/Dockerfile | 0 .m1k1o/base_arm/dbus | 11 - .m1k1o/base_arm/default.pa | 7 - .m1k1o/base_arm/supervisord.conf | 53 -- .m1k1o/base_arm/xorg.conf | 88 --- .m1k1o/build | 47 +- .m1k1o/chromium_arm/Dockerfile | 15 - .m1k1o/chromium_arm/openbox.xml | 763 ----------------------- .m1k1o/chromium_arm/supervisord.conf | 21 - 9 files changed, 30 insertions(+), 975 deletions(-) rename .m1k1o/{base_arm => arm-base}/Dockerfile (100%) delete mode 100755 .m1k1o/base_arm/dbus delete mode 100644 .m1k1o/base_arm/default.pa delete mode 100644 .m1k1o/base_arm/supervisord.conf delete mode 100644 .m1k1o/base_arm/xorg.conf delete mode 100644 .m1k1o/chromium_arm/Dockerfile delete mode 100644 .m1k1o/chromium_arm/openbox.xml delete mode 100644 .m1k1o/chromium_arm/supervisord.conf diff --git a/.m1k1o/base_arm/Dockerfile b/.m1k1o/arm-base/Dockerfile similarity index 100% rename from .m1k1o/base_arm/Dockerfile rename to .m1k1o/arm-base/Dockerfile diff --git a/.m1k1o/base_arm/dbus b/.m1k1o/base_arm/dbus deleted file mode 100755 index bf0d4375..00000000 --- a/.m1k1o/base_arm/dbus +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/sh - -if [ ! -d /var/run/dbus ]; then - mkdir -p /var/run/dbus -fi - -if [ -f /var/run/dbus/pid ]; then - rm -f /var/run/dbus/pid -fi - -/usr/bin/dbus-daemon --nofork --print-pid --config-file=/usr/share/dbus-1/system.conf diff --git a/.m1k1o/base_arm/default.pa b/.m1k1o/base_arm/default.pa deleted file mode 100644 index b0a26b10..00000000 --- a/.m1k1o/base_arm/default.pa +++ /dev/null @@ -1,7 +0,0 @@ -#!/usr/bin/pulseaudio -nF - -# Allow pulse audio to be accessed via TCP (from localhost only), to allow other users to access the virtual devices -load-module module-native-protocol-unix socket=/tmp/pulseaudio.socket auth-anonymous=1 - -### Make sure we always have a sink around, even if it is a null sink. -load-module module-always-sink diff --git a/.m1k1o/base_arm/supervisord.conf b/.m1k1o/base_arm/supervisord.conf deleted file mode 100644 index 3df95644..00000000 --- a/.m1k1o/base_arm/supervisord.conf +++ /dev/null @@ -1,53 +0,0 @@ -[supervisord] -nodaemon=true -pidfile=/var/run/supervisord.pid -logfile=/dev/null -logfile_maxbytes=0 -loglevel=debug - -[include] -files=/etc/neko/supervisord/*.conf - -[program:dbus] -environment=HOME="/root",USER="root" -command=/usr/bin/dbus -autorestart=true -priority=100 -user=root -stdout_logfile=/var/log/neko/dbus.log -stdout_logfile_maxbytes=100MB -stdout_logfile_backups=10 -redirect_stderr=true - -[program:x-server] -environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s" -command=/usr/bin/X -config /etc/neko/xorg.conf %(ENV_DISPLAY)s -autorestart=true -priority=300 -user=%(ENV_USER)s -stdout_logfile=/var/log/neko/xorg.log -stdout_logfile_maxbytes=100MB -stdout_logfile_backups=10 -redirect_stderr=true - -[program:pulseaudio] -environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" -command=/usr/bin/pulseaudio --disallow-module-loading -vvvv --disallow-exit --exit-idle-time=-1 -autorestart=true -priority=300 -user=%(ENV_USER)s -stdout_logfile=/var/log/neko/pulseaudio.log -stdout_logfile_maxbytes=100MB -stdout_logfile_backups=10 -redirect_stderr=true - -[program:neko] -environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" -command=/usr/bin/neko serve --static "/var/www" -autorestart=true -priority=800 -user=%(ENV_USER)s -stdout_logfile=/var/log/neko/neko.log -stdout_logfile_maxbytes=100MB -stdout_logfile_backups=10 -redirect_stderr=true diff --git a/.m1k1o/base_arm/xorg.conf b/.m1k1o/base_arm/xorg.conf deleted file mode 100644 index 57016ad1..00000000 --- a/.m1k1o/base_arm/xorg.conf +++ /dev/null @@ -1,88 +0,0 @@ -# This xorg configuration file is meant to be used by xpra -# to start a dummy X11 server. -# For details, please see: -# https://xpra.org/trac/wiki/Xdummy - -Section "ServerFlags" - Option "DontVTSwitch" "true" - Option "AllowMouseOpenFail" "true" - Option "PciForceNone" "true" - Option "AutoEnableDevices" "false" - Option "AutoAddDevices" "false" -EndSection - -Section "InputDevice" - Identifier "dummy_mouse" - Option "CorePointer" "true" - Driver "void" -EndSection - -Section "InputDevice" - Identifier "dummy_keyboard" - Option "CoreKeyboard" "true" - Driver "void" -EndSection - -Section "Device" - Identifier "dummy_videocard" - Driver "dummy" - Option "ConstantDPI" "true" - #VideoRam 4096000 - #VideoRam 256000 - VideoRam 192000 -EndSection - -Section "Monitor" - Identifier "dummy_monitor" - HorizSync 5.0 - 1000.0 - VertRefresh 5.0 - 200.0 - #This can be used to get a specific DPI, but only for the default resolution: - #DisplaySize 508 317 - #NOTE: the highest modes will not work without increasing the VideoRam - # for the dummy video card. - # https://arachnoid.com/modelines/ - - # 1280x720 @ 30.00 Hz (GTF) hsync: 21.99 kHz; pclk: 33.78 MHz - Modeline "1280x720_30.00" 33.78 1280 1288 1408 1536 720 721 724 733 -HSync +Vsync - - # 1280x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 74.48 MHz - Modeline "1280x720_60.00" 74.48 1280 1336 1472 1664 720 721 724 746 -HSync +Vsync - # 1152x648 @ 60.00 Hz (GTF) hsync: 40.26 kHz; pclk: 59.91 MHz - Modeline "1152x648_60.00" 59.91 1152 1200 1320 1488 648 649 652 671 -HSync +Vsync - # 1024x576 @ 60.00 Hz (GTF) hsync: 35.82 kHz; pclk: 47.00 MHz - Modeline "1024x576_60.00" 47.00 1024 1064 1168 1312 576 577 580 597 -HSync +Vsync - # 960x720 @ 60.00 Hz (GTF) hsync: 44.76 kHz; pclk: 55.86 MHz - Modeline "960x720_60.00" 55.86 960 1008 1104 1248 720 721 724 746 -HSync +Vsync - # 800x600 @ 60.00 Hz (GTF) hsync: 37.32 kHz; pclk: 38.22 MHz - Modeline "800x600_60.00" 38.22 800 832 912 1024 600 601 604 622 -HSync +Vsync - - # 1920x1080 @ 30.00 Hz (GTF) hsync: 32.97 kHz; pclk: 80.18 MHz - Modeline "1920x1080_30.00" 80.18 1920 1984 2176 2432 1080 1081 1084 1099 -HSync +Vsync - # 1152x648 @ 30.00 Hz (GTF) hsync: 19.80 kHz; pclk: 26.93 MHz - Modeline "1152x648_30.00" 26.93 1152 1144 1256 1360 648 649 652 660 -HSync +Vsync - # 1024x576 @ 30.00 Hz (GTF) hsync: 17.61 kHz; pclk: 20.85 MHz - Modeline "1024x576_30.00" 20.85 1024 1008 1104 1184 576 577 580 587 -HSync +Vsync - # 960x720 @ 30.00 Hz (GTF) hsync: 21.99 kHz; pclk: 25.33 MHz - Modeline "960x720_30.00" 25.33 960 960 1056 1152 720 721 724 733 -HSync +Vsync - # 800x600 @ 30.00 Hz (GTF) hsync: 18.33 kHz; pclk: 17.01 MHz - Modeline "800x600_30.00" 17.01 800 792 864 928 600 601 604 611 -HSync +Vsync -EndSection - -Section "Screen" - Identifier "dummy_screen" - Device "dummy_videocard" - Monitor "dummy_monitor" - DefaultDepth 24 - SubSection "Display" - Viewport 0 0 - Depth 24 - Modes "1280x720_30.00" "1920x1080_60.00" "1280x720_60.00" "1152x648_60.00" "1024x576_60.00" "960x720_60.00" "800x600_60.00" "1920x1080_30.00" "1152x648_30.00" "1024x576_30.00" "960x720_30.00" "800x600_30.00" - EndSubSection -EndSection - -Section "ServerLayout" - Identifier "dummy_layout" - Screen "dummy_screen" - InputDevice "dummy_mouse" - InputDevice "dummy_keyboard" -EndSection diff --git a/.m1k1o/build b/.m1k1o/build index 89ed410b..1a5f6fa0 100755 --- a/.m1k1o/build +++ b/.m1k1o/build @@ -20,28 +20,41 @@ build_server() { neko-dev-server sh -c "rm -rf /tmp/bin/neko; cp /src/bin/neko /tmp/bin" } -build_base() { - docker build -t "${IMAGE}:base" -f base/Dockerfile "${BASE}" -} - -build_base_arm() { - docker build -t "${IMAGE}:base_arm" -f base_arm/Dockerfile "${BASE}" -} - -build_chromium_arm() { - docker build -t "${IMAGE}:chromium_arm" -f chromium_arm/Dockerfile chromium_arm -} - build() { - docker build -t "${IMAGE}:$1" -f "$1/Dockerfile" "$1/" + IMAGE="${IMAGE}:$1" + echo "Building $IMAGE" + + if [ "$1" = "base" ] + then + # build base + docker build -t "${IMAGE}" -f base/Dockerfile "${BASE}" + else + # buld image + docker build -t "${IMAGE}" -f "$1/Dockerfile" "$1/" + fi +} + +build_arm() { + IMAGE="${IMAGE}:arm-$1" + echo "Building (arm) $IMAGE" + + if [ "$1" = "base" ] + then + # build ARM base + docker build -t "${IMAGE}" -f arm-base/Dockerfile "${BASE}" + else + # buld ARM image + docker build -t "${IMAGE}" --build-arg="BASE_IMAGE=${IMAGE}:arm-base" -f "$1/Dockerfile" "$1/" + fi } case $1 in client) build_client;; server) build_server;; - base) build_base;; - base_arm) build_base_arm;; - chromium_arm) build_chromium_arm;; + + # build arm- images + arm-*) build_arm "${1#arm-}";; + + # build images *) build "$1";; esac - diff --git a/.m1k1o/chromium_arm/Dockerfile b/.m1k1o/chromium_arm/Dockerfile deleted file mode 100644 index 46115213..00000000 --- a/.m1k1o/chromium_arm/Dockerfile +++ /dev/null @@ -1,15 +0,0 @@ -FROM m1k1o/neko:base_arm - -# -# install firefox-esr -RUN set -eux; apt-get update; \ - apt-get install -y --no-install-recommends openbox chromium-browser; \ - # - # clean up - apt-get clean -y; \ - rm -rf /var/lib/apt/lists/* /var/cache/apt/* - -# -# copy configuation files -COPY supervisord.conf /etc/neko/supervisord/firefox.conf -COPY openbox.xml /etc/neko/openbox.xml diff --git a/.m1k1o/chromium_arm/openbox.xml b/.m1k1o/chromium_arm/openbox.xml deleted file mode 100644 index 0e73a076..00000000 --- a/.m1k1o/chromium_arm/openbox.xml +++ /dev/null @@ -1,763 +0,0 @@ - - - - - - - - 10 - 20 - - - - - - no - true - yes - normal - - - - - yes - - no - - yes - - no - - 200 - - no - - - - - Smart - -
yes
- - Primary - - 1 - -
- - - Clearlooks - NLIMC - - yes - yes - - sans - 8 - - bold - - normal - - - - sans - 8 - - bold - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - normal - - normal - - - - sans - 9 - - bold - - normal - - - - sans - 9 - - bold - - normal - - - - - - - 1 - 1 - - - - 875 - - - - - yes - Nonpixel - - Center - - - - - 10 - - 10 - - - - - - - 0 - 0 - 0 - 0 - - - - TopLeft - - 0 - 0 - no - Above - - Vertical - - no - 300 - - 300 - - Middle - - - - - C-g - - - - leftno - - - rightno - - - upno - - - downno - - - leftno - - - rightno - - - upno - - - downno - - - 1 - - - 2 - - - 3 - - - 4 - - - - - - - - - - - - - - - - - - - - scrot -s - - - - - - - - - - - - - - - - - - - - - - - - yesyes - - - - - - - - - - - - right - - - - - left - - - - - up - - - - - down - - - - - - - - true - Konqueror - - kfmclient openProfile filemanagement - - - - - scrot - - - - - 1 - - 500 - - 400 - - false - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - previous - - - next - - - previous - - - next - - - previous - - - next - - - - - - - - - - - - - - no - - - - - - - - - - - yes - - - - - - - - - - - - - - - - - - - - - - - - - - - top - - - - - - left - - - - - - right - - - - - - bottom - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - vertical - - - horizontal - - - - - - - - - - - - - - - - - previous - - - next - - - - previous - - - next - - - previous - - - next - - - - - - - - - - - - - - - - - - - - previous - - - next - - - previous - - - next - - - - - - - - - - - menu.xml - 200 - - no - - 100 - - 400 - - yes - - yes - - - - - - - -
diff --git a/.m1k1o/chromium_arm/supervisord.conf b/.m1k1o/chromium_arm/supervisord.conf deleted file mode 100644 index 0ba73bc1..00000000 --- a/.m1k1o/chromium_arm/supervisord.conf +++ /dev/null @@ -1,21 +0,0 @@ -[program:firefox-esr] -environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" -command=/usr/bin/chromium-browser --window-position=0,0 --display=%(ENV_DISPLAY)s --start-maximized --bwsi --test-type --force-dark-mode --disable-file-system --disable-software-rasterizer -autorestart=true -priority=800 -user=%(ENV_USER)s -stdout_logfile=/var/log/neko/chromium-arm.log -stdout_logfile_maxbytes=100MB -stdout_logfile_backups=10 -redirect_stderr=true - -[program:openbox] -environment=HOME="/home/%(ENV_USER)s",USER="%(ENV_USER)s",DISPLAY="%(ENV_DISPLAY)s" -command=/usr/bin/openbox --config-file /etc/neko/openbox.xml -autorestart=true -priority=300 -user=%(ENV_USER)s -stdout_logfile=/var/log/neko/openbox.log -stdout_logfile_maxbytes=100MB -stdout_logfile_backups=10 -redirect_stderr=true From 67c931350ba8bf0d6d4b67d165644949dd44e80a Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 21:00:57 +0200 Subject: [PATCH 09/13] updated README. --- README.md | 20 ++++++++++++-------- 1 file changed, 12 insertions(+), 8 deletions(-) diff --git a/README.md b/README.md index 17e6fc78..60b47ddd 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms. ### New Features - Clipboard button with text area - for browsers, that don't support clipboard syncing (FireFox, what a shame...) or for HTTP. - Keyboard modifier state synchronization (Num Lock, Caps Lock, Scroll Lock) for each hosting. -- Added chromium ungoogled (with h265 support) an kept up to date by @whalehub. +- Added chromium ungoogled (with h265 support) an kept up to date (by @whalehub). - Added Picture in Picture button (only for watching screen, controlling not possible). - Added RTMP broadcast. Enables broadcasting neko screen to local RTMP server, YouTube or Twitch. - Stereo sound (works properly only in Firefox host). @@ -34,6 +34,9 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms. - Added `MAX_FPS`, where you can specify max WebRTC frame rate. When set to `0`, frame rate won't be capped and you can enjoy your real `60fps` experience. Originally, it was constant at `25fps`. - Invite links. You can invite people and they don't need to enter passwords by themselves (and get confused about user accounts that do not exits). You can put your password in URL using `?pwd=` and it will be automatically used when logging in. - Added `/stats?pwd=` endpoint to get total active connections, host and members. +- Added `m1k1o/neko:vlc` tag, use VLC to watch local files together (by @mbattista). +- Added `m1k1o/neko:xfce` tag, as an non video related showcase (by @mbattista). +- Added ARM-based images, for Raspberry Pi support (by @mbattista). ### Bugs - Fixed minor gst pipeline bug. @@ -59,21 +62,22 @@ For n.eko room management software visit https://github.com/m1k1o/neko-rooms. - Added `m1k1o/neko:vncviewer` tag, use `NEKO_VNC_URL` to specify VNC target and use n.eko as a bridge. - Abiltiy to include neko as a component in another Vue.Js project (by @gbrian). - Added HEALTHCHECK to Dockerfile. -- Added `m1k1o/neko:vlc` tag, use VLC to watch local files together (by @mbattista). -- Added `m1k1o/neko:xfce` tag, as an non video related showcase (by @mbattista). -- Added `m1k1o/neko:firefox_arm` tag, firefox neko for raspberry pi (by @mbattista) # Getting started & FAQ Use following docker images: - `m1k1o/neko:latest` - for Firefox. -- `m1k1o/neko:chromium` - for Chromium Ungoogled (needs `--cap-add=SYS_ADMIN`). +- `m1k1o/neko:chromium` - for Chromium (needs `--cap-add=SYS_ADMIN`). +- `m1k1o/neko:ungoogled-chromium` - for [Ungoogled Chromium](https://github.com/Eloston/ungoogled-chromium) (needs `--cap-add=SYS_ADMIN`) (by @whalehub). - `m1k1o/neko:vncviewer` - for simple VNC viewer (specify `NEKO_VNC_URL` to your VNC target). - `m1k1o/neko:vlc` - for VLC Video player (needs volume mounted to `/media` with local video files, or setting `VLC_MEDIA=/media` path). - `m1k1o/neko:xfce` - for an shared desktop / installing shared software. - `m1k1o/neko:base` - for custom base. -- `m1k1o/neko:base_arm` - for custom arm based -- `m1k1o/neko:firefox_arm` - for Firefox (Raspberry Pi) + +For ARM-based devices (like Raspberry Pi, with GPU hardware acceleration): +- `m1k1o/neko:arm-base` - for custom arm based. +- `m1k1o/neko:arm-firefox` - for Firefox. +- `m1k1o/neko:arm-chromium` - for Chromium. Networking: - If you want to use n.eko in **external** network, you can omit `NEKO_NAT1TO1`. It will automatically get your Public IP. @@ -175,7 +179,7 @@ services: version: "3.4" services: neko: - image: "m1k1o/neko:firefox_arm" + image: "m1k1o/neko:arm-chromium" restart: "unless-stopped" # increase on rpi's with more then 1gb ram shm_size: "520mb" From b2f60d36a5a1e55031e380b92dda2c8a8130e0fe Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 21:07:28 +0200 Subject: [PATCH 10/13] add arm video pipeline to container. --- .m1k1o/arm-base/Dockerfile | 4 ++++ README.md | 29 +++++++++++++++++++---------- 2 files changed, 23 insertions(+), 10 deletions(-) diff --git a/.m1k1o/arm-base/Dockerfile b/.m1k1o/arm-base/Dockerfile index 35ac00b9..58f50dfd 100644 --- a/.m1k1o/arm-base/Dockerfile +++ b/.m1k1o/arm-base/Dockerfile @@ -117,6 +117,10 @@ ENV NEKO_PASSWORD=neko ENV NEKO_PASSWORD_ADMIN=admin ENV NEKO_BIND=:8080 +# +# custom arm values -> video pipeline with GPU encoding +ENV NEKO_VIDEO='ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,framerate=30/1,format=NV12 ! v4l2h264enc extra-controls="controls,h264_profile=0,video_bitrate=1250000;" ! h264parse config-interval=3 ! video/x-h264,profile=baseline,stream-format=byte-stream' + # # copy static files from previous stages COPY --from=server /src/bin/neko /usr/bin/neko diff --git a/README.md b/README.md index 60b47ddd..ab96d169 100644 --- a/README.md +++ b/README.md @@ -75,9 +75,9 @@ Use following docker images: - `m1k1o/neko:base` - for custom base. For ARM-based devices (like Raspberry Pi, with GPU hardware acceleration): -- `m1k1o/neko:arm-base` - for custom arm based. - `m1k1o/neko:arm-firefox` - for Firefox. - `m1k1o/neko:arm-chromium` - for Chromium. +- `m1k1o/neko:arm-base` - for custom arm based. Networking: - If you want to use n.eko in **external** network, you can omit `NEKO_NAT1TO1`. It will automatically get your Public IP. @@ -129,7 +129,7 @@ services: NEKO_NAT1TO1: ``` -## Chromium Ungoogled +## Chromium ```yaml version: "3.4" @@ -175,30 +175,39 @@ services: NEKO_NAT1TO1: ``` +## Raspberry Pi + +Note! Since this pipeline is using H264, that enables GPU HW acceleration for Raspberry Pi, you are only able to connect from browsers supporting H264 for WebRTC. At the time of implementing, [Firefox does not support this](https://developer.mozilla.org/en-US/docs/Web/Media/Formats/WebRTC_codecs#supported-foot-1). + ```yaml version: "3.4" services: neko: image: "m1k1o/neko:arm-chromium" restart: "unless-stopped" - # increase on rpi's with more then 1gb ram + # increase on rpi's with more then 1gb ram. shm_size: "520mb" ports: - "8084:8080" - "52000-52100:52000-52100/udp" - # this is important since we need a GPU for hardware acceleration alternatively mount the devices into the docker + # this is important since we need a GPU for hardware acceleration alternatively mount the devices into the docker. privileged: true environment: NEKO_SCREEN: '1280x720@30' NEKO_PASSWORD: 'neko' NEKO_PASSWORD_ADMIN: 'admin' NEKO_EPR: 52000-52100 - NEKO_VP8: 'false' - NEKO_VP9: 'false' - NEKO_H264: 'true' - # Change target bitrate and framerate on this parameter - NEKO_VIDEO: ' ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,framerate=30/1,format=NV12 ! v4l2h264enc extra-controls="controls,h264_profile=0,video_bitrate=1250000;" ! h264parse config-interval=3 ! video/x-h264,profile=baseline,stream-format=byte-stream ' - NEKO_MAX_FPS: 0 + NEKO_H264: 1 + # optional: Change target bitrate and framerate on this parameter. + NEKO_VIDEO: | + ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false + ! video/x-raw,framerate=30/1 + ! videoconvert + ! queue + ! video/x-raw,framerate=30/1,format=NV12 + ! v4l2h264enc extra-controls="controls,h264_profile=0,video_bitrate=1250000;" + ! h264parse config-interval=3 + ! video/x-h264,profile=baseline,stream-format=byte-stream ``` ## Mobile support From b6c032921dbda8d78bf091a927f3ffb15ab19011 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 21:12:32 +0200 Subject: [PATCH 11/13] bugfix. --- .m1k1o/build | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/.m1k1o/build b/.m1k1o/build index 1a5f6fa0..9952f6d3 100755 --- a/.m1k1o/build +++ b/.m1k1o/build @@ -21,30 +21,24 @@ build_server() { } build() { - IMAGE="${IMAGE}:$1" - echo "Building $IMAGE" - if [ "$1" = "base" ] then # build base - docker build -t "${IMAGE}" -f base/Dockerfile "${BASE}" + docker build -t "${IMAGE}:base" -f base/Dockerfile "${BASE}" else # buld image - docker build -t "${IMAGE}" -f "$1/Dockerfile" "$1/" + docker build -t "${IMAGE}:$1" -f "$1/Dockerfile" "$1/" fi } build_arm() { - IMAGE="${IMAGE}:arm-$1" - echo "Building (arm) $IMAGE" - if [ "$1" = "base" ] then # build ARM base - docker build -t "${IMAGE}" -f arm-base/Dockerfile "${BASE}" + docker build -t "${IMAGE}:arm-base" -f arm-base/Dockerfile "${BASE}" else # buld ARM image - docker build -t "${IMAGE}" --build-arg="BASE_IMAGE=${IMAGE}:arm-base" -f "$1/Dockerfile" "$1/" + docker build -t "${IMAGE}:arm-$1" --build-arg="BASE_IMAGE=${IMAGE}:arm-base" -f "$1/Dockerfile" "$1/" fi } From 24699ec512136309318e1dc2750264944b50f0d7 Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 22:08:35 +0200 Subject: [PATCH 12/13] set H264 in arm base. --- .m1k1o/arm-base/Dockerfile | 1 + README.md | 5 ++--- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/.m1k1o/arm-base/Dockerfile b/.m1k1o/arm-base/Dockerfile index 58f50dfd..db861687 100644 --- a/.m1k1o/arm-base/Dockerfile +++ b/.m1k1o/arm-base/Dockerfile @@ -119,6 +119,7 @@ ENV NEKO_BIND=:8080 # # custom arm values -> video pipeline with GPU encoding +ENV NEKO_H264=1 ENV NEKO_VIDEO='ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 ! videoconvert ! queue ! video/x-raw,framerate=30/1,format=NV12 ! v4l2h264enc extra-controls="controls,h264_profile=0,video_bitrate=1250000;" ! h264parse config-interval=3 ! video/x-h264,profile=baseline,stream-format=byte-stream' # diff --git a/README.md b/README.md index ab96d169..a4cc2c60 100644 --- a/README.md +++ b/README.md @@ -188,7 +188,7 @@ services: # increase on rpi's with more then 1gb ram. shm_size: "520mb" ports: - - "8084:8080" + - "8088:8080" - "52000-52100:52000-52100/udp" # this is important since we need a GPU for hardware acceleration alternatively mount the devices into the docker. privileged: true @@ -197,8 +197,7 @@ services: NEKO_PASSWORD: 'neko' NEKO_PASSWORD_ADMIN: 'admin' NEKO_EPR: 52000-52100 - NEKO_H264: 1 - # optional: Change target bitrate and framerate on this parameter. + # optional: change target bitrate and framerate on this parameter. NEKO_VIDEO: | ximagesrc display-name=%s use-damage=0 show-pointer=true use-damage=false ! video/x-raw,framerate=30/1 From 70860ab83ceece0dc80b4a439700581929aadd6d Mon Sep 17 00:00:00 2001 From: m1k1o Date: Thu, 1 Apr 2021 23:18:50 +0200 Subject: [PATCH 13/13] easy development tools. --- .m1k1o/.env.default | 18 ++++++++++++++++++ .m1k1o/README.md | 39 +++++++++++++++++++++++++++++++++++++++ .m1k1o/build | 27 ++++++++++++++++++++++----- .m1k1o/rebuild-server | 21 +++++++++++++++++++++ .m1k1o/serve-client | 29 +++++++++++++++++++++++++++++ .m1k1o/start-server | 32 ++++++++++++++++++++++++++++++++ README.md | 4 ++++ 7 files changed, 165 insertions(+), 5 deletions(-) create mode 100644 .m1k1o/.env.default create mode 100644 .m1k1o/README.md create mode 100755 .m1k1o/rebuild-server create mode 100755 .m1k1o/serve-client create mode 100755 .m1k1o/start-server diff --git a/.m1k1o/.env.default b/.m1k1o/.env.default new file mode 100644 index 00000000..b15828d9 --- /dev/null +++ b/.m1k1o/.env.default @@ -0,0 +1,18 @@ +# +# you can copy this file to .env.local, if you don't want to have it pushed to repository +# + +# this is how will be your images called. you can change it to your fork. +# only need to do this once. here. +BUILD_IMAGE="m1k1o/neko" + +# this is where your services will be acessible +CLIENT_PORT=8080 +SERVER_PORT=8081 + +# on which image you want to test it +SERVER_TAG="chromium" + +# this is needed for WebRTC. specify your local IP address and free UDP port range. +SERVER_EPR=55000-55009 +SERVER_IP=10.8.0.1 diff --git a/.m1k1o/README.md b/.m1k1o/README.md new file mode 100644 index 00000000..f99db0a3 --- /dev/null +++ b/.m1k1o/README.md @@ -0,0 +1,39 @@ +# How to contribute to neko + +If you want to contribute, but don't want to install anything on your host system, we got you covered. You only need docker. Technically, it could be donw using vs code development in container, but this is more fun:). + +You need to copy `.env.development` to `.env` and customize values. + +## Step 1: Building server + +- `./build` - You can use this command to build your specified `SERVER_TAG` along with base image. + +If you want, you can build other tags. `base` tag needs to be build first: + +- `./build base` +- `./build firefox` +- `./build chromium` +- etc... + +## Step 2: Starting server + +- `./start-server` - Starting server image you specified in `.env`. +- `./start-server -r` - Shortcut for rebuilding server binary and then starting. + +If you are changing something in the server code, you don't want to rebuild container each time. You can just rebuild your binary: + +- `./rebuild-server` - Rebuild only server binary. +- `./rebuild-server -f` - Force to rebuild whole golang environment (you should do this only of you change some dependencies). + +## Step 3: Seving client + +- `./serve-client` - Serving vue.js client. +- `./serve-client -i` - Install all depenencies. + +## Debug + +You can navigate to `CLIENT_PORT` and see live client there. It will be connected to your local server on `SERVER_PORT`. + +If you are leaving client as is and not changing it, you don't need to start `./serve-client` and you can access server's GUI directly on `SERVER_PORT`. + +Feel free to open new PR. diff --git a/.m1k1o/build b/.m1k1o/build index 9952f6d3..70f1a00b 100755 --- a/.m1k1o/build +++ b/.m1k1o/build @@ -2,7 +2,24 @@ cd "$(dirname "$0")" BASE="${PWD}/../" -IMAGE="m1k1o/neko" + +if [ -f ".env.default" ] +then + export $(cat .env.default | sed 's/#.*//g' | xargs) +fi + +if [ -f ".env" ] +then + export $(cat .env | sed 's/#.*//g' | xargs) +fi + +if [ -z "${1}" ] && [ ! -z "${SERVER_TAG}" ] +then + ./build base + ./build ${SERVER_TAG} + exit 0 +fi + build_client() { docker build -t neko-dev-client -f base/Dockerfile --target client "${BASE}" @@ -24,10 +41,10 @@ build() { if [ "$1" = "base" ] then # build base - docker build -t "${IMAGE}:base" -f base/Dockerfile "${BASE}" + docker build -t "${BUILD_IMAGE}:base" -f base/Dockerfile "${BASE}" else # buld image - docker build -t "${IMAGE}:$1" -f "$1/Dockerfile" "$1/" + docker build -t "${BUILD_IMAGE}:$1" --build-arg="BASE_IMAGE=${BUILD_IMAGE}:base" -f "$1/Dockerfile" "$1/" fi } @@ -35,10 +52,10 @@ build_arm() { if [ "$1" = "base" ] then # build ARM base - docker build -t "${IMAGE}:arm-base" -f arm-base/Dockerfile "${BASE}" + docker build -t "${BUILD_IMAGE}:arm-base" -f arm-base/Dockerfile "${BASE}" else # buld ARM image - docker build -t "${IMAGE}:arm-$1" --build-arg="BASE_IMAGE=${IMAGE}:arm-base" -f "$1/Dockerfile" "$1/" + docker build -t "${BUILD_IMAGE}:arm-$1" --build-arg="BASE_IMAGE=${BUILD_IMAGE}:arm-base" -f "$1/Dockerfile" "$1/" fi } diff --git a/.m1k1o/rebuild-server b/.m1k1o/rebuild-server new file mode 100755 index 00000000..a46e15a9 --- /dev/null +++ b/.m1k1o/rebuild-server @@ -0,0 +1,21 @@ +#!/bin/bash + +if [ -f ".env.default" ] +then + export $(cat .env.default | sed 's/#.*//g' | xargs) +fi + +if [ -f ".env" ] +then + export $(cat .env | sed 's/#.*//g' | xargs) +fi + +# use -f to force rebuild +if [ "$(docker images -q neko_dev_server 2> /dev/null)" == "" ] || [ "$1" == "-f" ]; then + docker build -t neko_dev_server -f base/Dockerfile --target server ../ +fi + +docker run --rm -it \ + -v "${PWD}/../server:/src" \ + --entrypoint="go" \ + neko_dev_server build -o "bin/neko" -i "cmd/neko/main.go" diff --git a/.m1k1o/serve-client b/.m1k1o/serve-client new file mode 100755 index 00000000..48053f17 --- /dev/null +++ b/.m1k1o/serve-client @@ -0,0 +1,29 @@ +#!/bin/bash + +if [ -f ".env.default" ] +then + export $(cat .env.default | sed 's/#.*//g' | xargs) +fi + +if [ -f ".env" ] +then + export $(cat .env | sed 's/#.*//g' | xargs) +fi + +# use -i to install +if [ ! -d "${PWD}/../client/node_modules" ] || [ "$1" == "-i" ]; then + docker run --rm -it \ + -v "${PWD}/../client:/app" \ + --workdir="/app" \ + --entrypoint="npm" \ + node:14-buster-slim install +fi + +docker run --rm -it \ + -p "${CLIENT_PORT}:8080" \ + -v "${PWD}/../client:/app" \ + -e "VUE_APP_SERVER_PORT=${SERVER_PORT}" \ + --workdir="/app" \ + --entrypoint="npm" \ + node:14-buster-slim run serve + \ No newline at end of file diff --git a/.m1k1o/start-server b/.m1k1o/start-server new file mode 100755 index 00000000..7613dc8f --- /dev/null +++ b/.m1k1o/start-server @@ -0,0 +1,32 @@ +#!/bin/bash + +if [ -f ".env.default" ] +then + export $(cat .env.default | sed 's/#.*//g' | xargs) +fi + +if [ -f ".env" ] +then + export $(cat .env | sed 's/#.*//g' | xargs) +fi + +BINARY_PATH="${PWD}/../server/bin/neko" + +# use -r to rebuild +if [ ! -f "${BINARY_PATH}" ] || [ "$1" == "-r" ]; then + ./rebuild-server +fi + +docker run --rm -it \ + --name "neko_dev" \ + -p "${SERVER_PORT}:8080" \ + -p "${SERVER_EPR}:${SERVER_EPR}/udp" \ + -e "NEKO_SCREEN=1920x1080@60" \ + -e "NEKO_EPR=${SERVER_EPR}" \ + -e "NEKO_NAT1TO1=${SERVER_IP}" \ + -e "NEKO_ICELITE=true" \ + -e "NEKO_MAX_FPS=25" \ + -v "${BINARY_PATH}:/usr/bin/neko" \ + --shm-size=2G \ + --cap-add SYS_ADMIN \ + ${BUILD_IMAGE}:${SERVER_TAG} diff --git a/README.md b/README.md index a4cc2c60..31ed619c 100644 --- a/README.md +++ b/README.md @@ -272,3 +272,7 @@ NEKO_KEY: - e.g. '/certs/key.pem' ``` + +# How to contribute? + +Navigate to `.m1k1o/README.md` for further information.