From 38bdaab8d660341836a9168d4e421ecd5953131f Mon Sep 17 00:00:00 2001 From: Craig Date: Fri, 31 Jan 2020 00:42:05 +0000 Subject: [PATCH] tweaks for consistency --- .devcontainer/Dockerfile | 41 ++++++++++++++++++------------- .docker/build | 5 ++-- .docker/files/chromium/Dockerfile | 3 ++- .docker/files/chromium/test | 11 ++++++--- .docker/files/firefox/Dockerfile | 2 +- .docker/files/firefox/test | 18 ++++++++------ 6 files changed, 48 insertions(+), 32 deletions(-) diff --git a/.devcontainer/Dockerfile b/.devcontainer/Dockerfile index 5d995e1..c5ba239 100644 --- a/.devcontainer/Dockerfile +++ b/.devcontainer/Dockerfile @@ -2,19 +2,20 @@ FROM debian:stretch-slim # # cluster fuck of packages for neko, node, go and gstreamer -RUN apt-get update; apt-get install -y --no-install-recommends autoconf ca-certificates curl netbase wget \ - bzr git mercurial openssh-client subversion procps automake bzip2 dpkg-dev file g++ gcc \ - libbz2-dev libc6-dev libcurl4-openssl-dev libdb-dev libevent-dev libffi-dev libgdbm-dev libglib2.0-dev libgmp-dev \ - libjpeg-dev libkrb5-dev liblzma-dev libmagickcore-dev libmagickwand-dev libmaxminddb-dev libncurses5-dev libncursesw5-dev \ - libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libtool libwebp-dev libxml2-dev libxslt-dev libyaml-dev \ - make patch unzip xz-utils zlib1g-dev pkg-config \ - build-essential perl python autopoint bison flex \ - gettext openssl libopus-dev libvpx-dev libpulse-dev libx11-dev libxv-dev libxt-dev \ - libxfixes-dev apt-utils x11vnc libxtst-dev dialog \ - pulseaudio openbox chromium firefox-esr dbus-x11 xvfb xclip supervisor unzip; \ - if ! command -v gpg > /dev/null; then \ - apt-get install -y --no-install-recommends gnupg dirmngr; \ - fi +RUN set -eux; apt-get update; apt-get install -y --no-install-recommends \ + autoconf ca-certificates curl netbase wget \ + bzr git mercurial openssh-client subversion procps automake bzip2 dpkg-dev file g++ gcc \ + libbz2-dev libc6-dev libcurl4-openssl-dev libdb-dev libevent-dev libffi-dev libgdbm-dev libglib2.0-dev libgmp-dev \ + libjpeg-dev libkrb5-dev liblzma-dev libmagickcore-dev libmagickwand-dev libmaxminddb-dev libncurses5-dev libncursesw5-dev \ + libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libtool libwebp-dev libxml2-dev libxslt-dev libyaml-dev \ + make patch unzip xz-utils zlib1g-dev pkg-config \ + build-essential perl python autopoint bison flex \ + gettext openssl libopus-dev libvpx-dev libpulse-dev libx11-dev libxv-dev libxt-dev \ + libxfixes-dev apt-utils x11vnc libxtst-dev dialog \ + pulseaudio openbox chromium firefox-esr dbus-x11 xvfb xclip supervisor; \ + if ! command -v gpg > /dev/null; then \ + apt-get install -y --no-install-recommends gnupg dirmngr; \ + fi # # set up env for gst @@ -25,7 +26,8 @@ ENV PKG_CONFIG_PATH=/gst/local/lib/pkgconfig:$PKG_CONFIG_PATH # # add node ENV NODE_VERSION 12.14.1 -RUN ARCH= ; dpkgArch="$(dpkg --print-architecture)" \ +RUN set -eux; \ + ARCH= ; dpkgArch="$(dpkg --print-architecture)" \ ;case "${dpkgArch##*-}" in \ amd64) ARCH='x64';; \ ppc64el) ARCH='ppc64le';; \ @@ -36,7 +38,6 @@ RUN ARCH= ; dpkgArch="$(dpkg --print-architecture)" \ *) echo "unsupported architecture"; exit 1 ;; \ esac;\ # gpg keys listed at https://github.com/nodejs/node#release-keys - set -eux;\ for key in \ 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ FD3A5288F042B6850C66B31F09FE44734EB7990E \ @@ -97,7 +98,8 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH # # install Go tools w/module support -RUN mkdir -p /tmp/gotools; \ +RUN set -eux; \ + mkdir -p /tmp/gotools; \ cd /tmp/gotools; \ GO111MODULE=on go get -v golang.org/x/tools/gopls@latest 2>&1; \ GO111MODULE=on go get -v \ @@ -145,15 +147,19 @@ ARG USERNAME=neko ARG USER_UID=1000 ARG USER_GID=$USER_UID +# # set to false to skip installing zsh and Oh My ZSH! ARG INSTALL_ZSH="true" +# # location and expected SHA for common setup script - SHA generated on release ARG COMMON_SCRIPT_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh" ARG COMMON_SCRIPT_SHA="dev-mode" +# # verify git, common tools / libs installed, add/modify non-root user, optionally install zsh -RUN wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE; \ +RUN set -eux; \ + wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE; \ if [ "$COMMON_SCRIPT_SHA" != "dev-mode" ]; then echo "$COMMON_SCRIPT_SHA /tmp/common-setup.sh" | sha256sum -c - ; fi; \ /bin/bash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID"; \ rm /tmp/common-setup.sh; \ @@ -176,5 +182,6 @@ RUN wget -q -O /tmp/common-setup.sh $COMMON_SCRIPT_SOURCE; \ ENV PATH=/usr/local/share/npm-global/bin:$PATH +# # switch back to dialog for any ad-hoc use of apt-get ENV DEBIAN_FRONTEND=dialog diff --git a/.docker/build b/.docker/build index ad1778d..1766faa 100755 --- a/.docker/build +++ b/.docker/build @@ -2,7 +2,7 @@ # sudo docker run -p 80:8080 -p 59000-59100:59000-59100/udp --cap-add SYS_ADMIN nurdism/neko:chromium # sudo docker run -p 80:8080 -p 59000-59100:59000-59100/udp --shm-size=1gb nurdism/neko:firefox -# sudo docker run --network host --shm-size=1gb -it nurdism/neko:latest /bin/bash +# sudo docker run --network host --shm-size=1gb -it nurdism/neko:base /bin/bash DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.." @@ -13,9 +13,10 @@ build_gst() { sudo chown -R neko /workspace/.build fi + # # build & install gstreamer sudo su -c 'set -eux; \ - sudo rm -rf /gst/local; \ + rm -rf /gst/local; \ cd /gst; \ for MODULE in \ gstreamer \ diff --git a/.docker/files/chromium/Dockerfile b/.docker/files/chromium/Dockerfile index 743f0c7..100e073 100644 --- a/.docker/files/chromium/Dockerfile +++ b/.docker/files/chromium/Dockerfile @@ -1,12 +1,13 @@ FROM nurdism/neko:base +# # install neko chromium RUN set -eux; apt-get update; \ apt-get install -y --no-install-recommends unzip chromium; \ # # install widevine module WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1); \ - wget "https://dl.google.com/widevine-cdm/$WIDEVINE_VERSION-linux-x64.zip" -O /tmp/widevine.zip ; \ + 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; \ diff --git a/.docker/files/chromium/test b/.docker/files/chromium/test index ca152db..86da942 100755 --- a/.docker/files/chromium/test +++ b/.docker/files/chromium/test @@ -1,23 +1,26 @@ #!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + # # chromium mkdir -p /etc/chromium/policies/managed # https://cloud.google.com/docs/chrome-enterprise/policies/ -cp files/chromium/policies.json /etc/chromium/policies/managed/policies.json +cp $DIR/policies.json /etc/chromium/policies/managed/policies.json #rm -f /etc/chromium/policies/managed/policies.json -cp files/chromium/preferences.json /usr/share/chromium/master_preferences +cp $DIR/preferences.json /usr/share/chromium/master_preferences #rm -f /usr/share/chromium/master_preferences -cp files/chromium/supervisord.conf /etc/neko/supervisord/chromium.conf +cp $DIR/supervisord.conf /etc/neko/supervisord/chromium.conf #rm -f /etc/neko/supervisord/firefox.conf +# # install widevine module if [ ! -f /usr/lib/chromium/libwidevinecdm.so ]; then WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1) - wget "https://dl.google.com/widevine-cdm/$WIDEVINE_VERSION-linux-x64.zip" -O /tmp/widevine.zip + 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 diff --git a/.docker/files/firefox/Dockerfile b/.docker/files/firefox/Dockerfile index eebfee7..0b9f29a 100644 --- a/.docker/files/firefox/Dockerfile +++ b/.docker/files/firefox/Dockerfile @@ -1,5 +1,6 @@ FROM nurdism/neko:base +# # install firefox-esr RUN set -eux; apt-get update; \ apt-get install -y --no-install-recommends firefox-esr; \ @@ -10,7 +11,6 @@ RUN set -eux; apt-get update; \ 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 --purge autoremove -y wget ca-certificates; \ apt-get autoremove -y; \ apt-get clean -y; \ rm -rf /var/lib/apt/lists/* /var/cache/apt/* diff --git a/.docker/files/firefox/test b/.docker/files/firefox/test index 8882a75..4e6aaac 100755 --- a/.docker/files/firefox/test +++ b/.docker/files/firefox/test @@ -1,32 +1,36 @@ #!/bin/bash +DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )" + # # firefox -cp files/firefox/neko.js /usr/lib/firefox-esr/mozilla.cfg +cp $DIR/neko.js /usr/lib/firefox-esr/mozilla.cfg #rm -f /usr/lib/firefox-esr/mozilla.cfg -cp files/firefox/autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js +cp $DIR/autoconfig.js /usr/lib/firefox-esr/defaults/pref/autoconfig.js #rm -f /usr/lib/firefox-esr/defaults/pref/autoconfig.js #https://github.com/mozilla/policy-templates -cp files/firefox/policies.json /usr/lib/firefox-esr/distribution/policies.json +cp $DIR/policies.json /usr/lib/firefox-esr/distribution/policies.json #rm -f /usr/lib/firefox-esr/distribution/policies.json -cp files/firefox/supervisord.conf /etc/neko/supervisord/firefox.conf +cp $DIR/supervisord.conf /etc/neko/supervisord/firefox.conf #rm -f /etc/neko/supervisord/firefox.conf # # install extensions mkdir -p /usr/lib/firefox/distribution/extensions -# uBlock0 +# +# uBlock if [ ! -f /usr/lib/firefox/distribution/extensions/uBlock0@raymondhill.net.xpi ]; then - curl -o /usr/lib/firefox/distribution/extensions/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/addon-607454-latest.xpi + wget -O /usr/lib/firefox/distribution/extensions/uBlock0@raymondhill.net.xpi https://addons.mozilla.org/firefox/downloads/latest/ublock-origin/addon-607454-latest.xpi fi +# # nordvpnproxy if [ ! -f /usr/lib/firefox/distribution/extensions/nordvpnproxy@nordvpn.com.xpi ]; then - curl -o /usr/lib/firefox/distribution/extensions/nordvpnproxy@nordvpn.com.xpi https://addons.mozilla.org/firefox/downloads/latest/nordvpn-proxy-extension/latest.xpi + wget -O /usr/lib/firefox/distribution/extensions/nordvpnproxy@nordvpn.com.xpi https://addons.mozilla.org/firefox/downloads/latest/nordvpn-proxy-extension/latest.xpi fi #