Archived
2
0

tweaks for consistency

This commit is contained in:
Craig 2020-01-31 00:42:05 +00:00
parent 7f26b8bb7b
commit 38bdaab8d6
6 changed files with 48 additions and 32 deletions

View File

@ -2,19 +2,20 @@ FROM debian:stretch-slim
# #
# cluster fuck of packages for neko, node, go and gstreamer # 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 \ RUN set -eux; apt-get update; apt-get install -y --no-install-recommends \
bzr git mercurial openssh-client subversion procps automake bzip2 dpkg-dev file g++ gcc \ autoconf ca-certificates curl netbase wget \
libbz2-dev libc6-dev libcurl4-openssl-dev libdb-dev libevent-dev libffi-dev libgdbm-dev libglib2.0-dev libgmp-dev \ bzr git mercurial openssh-client subversion procps automake bzip2 dpkg-dev file g++ gcc \
libjpeg-dev libkrb5-dev liblzma-dev libmagickcore-dev libmagickwand-dev libmaxminddb-dev libncurses5-dev libncursesw5-dev \ libbz2-dev libc6-dev libcurl4-openssl-dev libdb-dev libevent-dev libffi-dev libgdbm-dev libglib2.0-dev libgmp-dev \
libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libtool libwebp-dev libxml2-dev libxslt-dev libyaml-dev \ libjpeg-dev libkrb5-dev liblzma-dev libmagickcore-dev libmagickwand-dev libmaxminddb-dev libncurses5-dev libncursesw5-dev \
make patch unzip xz-utils zlib1g-dev pkg-config \ libpng-dev libpq-dev libreadline-dev libsqlite3-dev libssl-dev libtool libwebp-dev libxml2-dev libxslt-dev libyaml-dev \
build-essential perl python autopoint bison flex \ make patch unzip xz-utils zlib1g-dev pkg-config \
gettext openssl libopus-dev libvpx-dev libpulse-dev libx11-dev libxv-dev libxt-dev \ build-essential perl python autopoint bison flex \
libxfixes-dev apt-utils x11vnc libxtst-dev dialog \ gettext openssl libopus-dev libvpx-dev libpulse-dev libx11-dev libxv-dev libxt-dev \
pulseaudio openbox chromium firefox-esr dbus-x11 xvfb xclip supervisor unzip; \ libxfixes-dev apt-utils x11vnc libxtst-dev dialog \
if ! command -v gpg > /dev/null; then \ pulseaudio openbox chromium firefox-esr dbus-x11 xvfb xclip supervisor; \
apt-get install -y --no-install-recommends gnupg dirmngr; \ if ! command -v gpg > /dev/null; then \
fi apt-get install -y --no-install-recommends gnupg dirmngr; \
fi
# #
# set up env for gst # set up env for gst
@ -25,7 +26,8 @@ ENV PKG_CONFIG_PATH=/gst/local/lib/pkgconfig:$PKG_CONFIG_PATH
# #
# add node # add node
ENV NODE_VERSION 12.14.1 ENV NODE_VERSION 12.14.1
RUN ARCH= ; dpkgArch="$(dpkg --print-architecture)" \ RUN set -eux; \
ARCH= ; dpkgArch="$(dpkg --print-architecture)" \
;case "${dpkgArch##*-}" in \ ;case "${dpkgArch##*-}" in \
amd64) ARCH='x64';; \ amd64) ARCH='x64';; \
ppc64el) ARCH='ppc64le';; \ ppc64el) ARCH='ppc64le';; \
@ -36,7 +38,6 @@ RUN ARCH= ; dpkgArch="$(dpkg --print-architecture)" \
*) echo "unsupported architecture"; exit 1 ;; \ *) echo "unsupported architecture"; exit 1 ;; \
esac;\ esac;\
# gpg keys listed at https://github.com/nodejs/node#release-keys # gpg keys listed at https://github.com/nodejs/node#release-keys
set -eux;\
for key in \ for key in \
94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \ 94AE36675C464D64BAFA68DD7434390BDBE9B9C5 \
FD3A5288F042B6850C66B31F09FE44734EB7990E \ FD3A5288F042B6850C66B31F09FE44734EB7990E \
@ -97,7 +98,8 @@ ENV PATH $GOPATH/bin:/usr/local/go/bin:$PATH
# #
# install Go tools w/module support # install Go tools w/module support
RUN mkdir -p /tmp/gotools; \ RUN set -eux; \
mkdir -p /tmp/gotools; \
cd /tmp/gotools; \ cd /tmp/gotools; \
GO111MODULE=on go get -v golang.org/x/tools/gopls@latest 2>&1; \ GO111MODULE=on go get -v golang.org/x/tools/gopls@latest 2>&1; \
GO111MODULE=on go get -v \ GO111MODULE=on go get -v \
@ -145,15 +147,19 @@ ARG USERNAME=neko
ARG USER_UID=1000 ARG USER_UID=1000
ARG USER_GID=$USER_UID ARG USER_GID=$USER_UID
#
# set to false to skip installing zsh and Oh My ZSH! # set to false to skip installing zsh and Oh My ZSH!
ARG INSTALL_ZSH="true" ARG INSTALL_ZSH="true"
#
# location and expected SHA for common setup script - SHA generated on release # 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_SOURCE="https://raw.githubusercontent.com/microsoft/vscode-dev-containers/master/script-library/common-debian.sh"
ARG COMMON_SCRIPT_SHA="dev-mode" ARG COMMON_SCRIPT_SHA="dev-mode"
#
# verify git, common tools / libs installed, add/modify non-root user, optionally install zsh # 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; \ 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"; \ /bin/bash /tmp/common-setup.sh "$INSTALL_ZSH" "$USERNAME" "$USER_UID" "$USER_GID"; \
rm /tmp/common-setup.sh; \ 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 ENV PATH=/usr/local/share/npm-global/bin:$PATH
#
# switch back to dialog for any ad-hoc use of apt-get # switch back to dialog for any ad-hoc use of apt-get
ENV DEBIAN_FRONTEND=dialog ENV DEBIAN_FRONTEND=dialog

View File

@ -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 --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 -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 )/.." DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )/.."
@ -13,9 +13,10 @@ build_gst() {
sudo chown -R neko /workspace/.build sudo chown -R neko /workspace/.build
fi fi
#
# build & install gstreamer # build & install gstreamer
sudo su -c 'set -eux; \ sudo su -c 'set -eux; \
sudo rm -rf /gst/local; \ rm -rf /gst/local; \
cd /gst; \ cd /gst; \
for MODULE in \ for MODULE in \
gstreamer \ gstreamer \

View File

@ -1,12 +1,13 @@
FROM nurdism/neko:base FROM nurdism/neko:base
#
# install neko chromium # install neko chromium
RUN set -eux; apt-get update; \ RUN set -eux; apt-get update; \
apt-get install -y --no-install-recommends unzip chromium; \ apt-get install -y --no-install-recommends unzip chromium; \
# #
# install widevine module # install widevine module
WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1); \ 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; \ unzip -p /tmp/widevine.zip libwidevinecdm.so > /usr/lib/chromium/libwidevinecdm.so; \
chmod 644 /usr/lib/chromium/libwidevinecdm.so; \ chmod 644 /usr/lib/chromium/libwidevinecdm.so; \
rm /tmp/widevine.zip; \ rm /tmp/widevine.zip; \

View File

@ -1,23 +1,26 @@
#!/bin/bash #!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# #
# chromium # chromium
mkdir -p /etc/chromium/policies/managed mkdir -p /etc/chromium/policies/managed
# https://cloud.google.com/docs/chrome-enterprise/policies/ # 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 #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 #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 #rm -f /etc/neko/supervisord/firefox.conf
#
# install widevine module # install widevine module
if [ ! -f /usr/lib/chromium/libwidevinecdm.so ]; then if [ ! -f /usr/lib/chromium/libwidevinecdm.so ]; then
WIDEVINE_VERSION=$(wget --quiet -O - https://dl.google.com/widevine-cdm/versions.txt | tail -n 1) 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 unzip -p /tmp/widevine.zip libwidevinecdm.so > /usr/lib/chromium/libwidevinecdm.so
chmod 644 /usr/lib/chromium/libwidevinecdm.so chmod 644 /usr/lib/chromium/libwidevinecdm.so
rm /tmp/widevine.zip rm /tmp/widevine.zip

View File

@ -1,5 +1,6 @@
FROM nurdism/neko:base FROM nurdism/neko:base
#
# install firefox-esr # install firefox-esr
RUN set -eux; apt-get update; \ RUN set -eux; apt-get update; \
apt-get install -y --no-install-recommends firefox-esr; \ 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; \ 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 # clean up
apt-get --purge autoremove -y wget ca-certificates; \
apt-get autoremove -y; \ apt-get autoremove -y; \
apt-get clean -y; \ apt-get clean -y; \
rm -rf /var/lib/apt/lists/* /var/cache/apt/* rm -rf /var/lib/apt/lists/* /var/cache/apt/*

View File

@ -1,32 +1,36 @@
#!/bin/bash #!/bin/bash
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" >/dev/null 2>&1 && pwd )"
# #
# firefox # 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 #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 #rm -f /usr/lib/firefox-esr/defaults/pref/autoconfig.js
#https://github.com/mozilla/policy-templates #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 #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 #rm -f /etc/neko/supervisord/firefox.conf
# #
# install extensions # install extensions
mkdir -p /usr/lib/firefox/distribution/extensions mkdir -p /usr/lib/firefox/distribution/extensions
# uBlock0 #
# uBlock
if [ ! -f /usr/lib/firefox/distribution/extensions/uBlock0@raymondhill.net.xpi ]; then 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 fi
#
# nordvpnproxy # nordvpnproxy
if [ ! -f /usr/lib/firefox/distribution/extensions/nordvpnproxy@nordvpn.com.xpi ]; then 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 fi
# #