diff --git a/Dockerfile b/Dockerfile index 436daa6..204c08c 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,33 +1,32 @@ -FROM cmrglab/cont_release_vnc +FROM cmrglab/cont_release_vnc:latest AS continuity -ADD startup.sh / -ADD default /etc/nginx/sites-enabled -ADD supervisord.conf /etc/supervisor/conf.d +FROM ghcr.io/ucsd-ets/pilot-vnc-desktop:remove-webproxy-patch +USER root -RUN useradd -u 58585 jis269 && \ - useradd -u 68744 dta001 && \ - useradd -u 142 pjamason && \ - useradd -u 41135 aperley && \ - useradd -u 11966 arw020 && \ - useradd -u 30216 ateitgen && \ - useradd -u 8333 eboyd && \ - useradd -u 1009974 ghuber && \ - useradd -u 105661 grader-beng276-01 && \ - useradd -u 92712 ideveci && \ - useradd -u 47369 jbli && \ - useradd -u 91393 k1garcia && \ - useradd -u 31879 kpvincen && \ - useradd -u 61790 m1hock && \ - useradd -u 88078 mbraza && \ - useradd -u 20921 mkbell && \ - useradd -u 7227 ramaro && \ - useradd -u 9999999 rkonecny && \ - useradd -u 18554 s3jain && \ - useradd -u 46958 sjp038 && \ - useradd -u 19647 shc131 && \ - useradd -u 31255 s7hernan && \ - useradd -u 1002977 tsejnowski && \ - useradd -u 8385 w5lu && \ - useradd -u 94457 zyi && \ - chmod -R og+rwX /etc/nginx /etc/supervisor /root /var/log /var/run /var/lib/nginx /usr/local/bin/ +COPY --from=continuity /root/continuity /opt/continuity +RUN apt-get update && \ +# apt-get upgrade -y && \ + apt-get install -yq \ + build-essential \ + ca-certificates \ + gcc \ + git \ + libpq-dev \ + make \ + python2.7 \ + libglu1 \ + autoconf \ + swig \ + filezilla +# && apt-get autoremove \ +# && apt-get clean + +WORKDIR /opt/continuity +RUN /bin/bash -c ./setup && \ + source mglinit && \ + autoconf && \ + ./configure && \ + chown -R jovyan /opt/continuity + +USER jovyan diff --git a/Dockerfile_orig b/Dockerfile_orig new file mode 100644 index 0000000..0055083 --- /dev/null +++ b/Dockerfile_orig @@ -0,0 +1,86 @@ +FROM cmrglab/cont_release_vnc:latest +ADD file:a58c8b447951f9e30c92e7262a2effbb8b403c2e795ebaf58456f096b5b2a720 in / +RUN /bin/sh -c [ -z "$(apt-get indextargets)" ] +RUN /bin/sh -c set -xe \ + && echo '#!/bin/sh' > /usr/sbin/policy-rc.d \ + && echo 'exit 101' >> /usr/sbin/policy-rc.d \ + && chmod +x /usr/sbin/policy-rc.d \ + && dpkg-divert --local --rename --add /sbin/initctl \ + && cp -a /usr/sbin/policy-rc.d /sbin/initctl \ + && sed -i 's/^exit.*/exit 0/' /sbin/initctl \ + && echo 'force-unsafe-io' > /etc/dpkg/dpkg.cfg.d/docker-apt-speedup +\ + && echo 'DPkg::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' > /etc/apt/apt.conf.d/docker-clean \ && echo 'APT::Update::Post-Invoke { "rm -f /var/cache/apt/archives/*.deb /var/cache/apt/archives/partial/*.deb /var/cache/apt/*.bin || true"; };' >> /etc/apt/apt.conf.d/docker-clean \ && echo 'Dir::Cache::pkgcache ""; Dir::Cache::srcpkgcache "";' >> /etc/apt/apt.conf.d/docker-clean +\ + && echo 'Acquire::Languages "none";' > /etc/apt/apt.conf.d/docker-no-languages +\ + && echo 'Acquire::GzipIndexes "true"; Acquire::CompressionTypes::Order:: "gz";' > /etc/apt/apt.conf.d/docker-gzip-indexes +\ + && echo 'Apt::AutoRemove::SuggestsImportant "false";' > /etc/apt/apt.conf.d/docker-autoremove-suggests +RUN /bin/sh -c mkdir -p /run/systemd \ + && echo 'docker' > /run/systemd/container +CMD ["/bin/bash"] +RUN /bin/sh -c sed -i 's#http://archive.ubuntu.com/ubuntu/#mirror://mirrors.ubuntu.com/mirrors.txt#' /etc/apt/sources.list; +ENV DEBIAN_FRONTEND=noninteractive +RUN /bin/sh -c apt update \ + && apt install -y --no-install-recommends software-properties-common curl apache2-utils \ + && apt update \ + && apt install -y --no-install-recommends --allow-unauthenticated supervisor nginx sudo net-tools zenity xz-utils dbus-x11 x11-utils alsa-utils mesa-utils libgl1-mesa-dri \ + && apt autoclean -y \ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* +RUN /bin/sh -c apt update \ + && apt install -y --no-install-recommends --allow-unauthenticated xvfb x11vnc vim-tiny firefox ttf-ubuntu-font-family ttf-wqy-zenhei \ + && apt autoclean -y \ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* +RUN /bin/sh -c apt update \ + && apt install -y gpg-agent \ + && curl -LO https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb \ + && (dpkg -i ./google-chrome-stable_current_amd64.deb || apt-get install -fy) \ + && curl -sSL https://dl.google.com/linux/linux_signing_key.pub | apt-key add \ + && rm google-chrome-stable_current_amd64.deb \ + && rm -rf /var/lib/apt/lists/* +RUN /bin/sh -c apt update \ + && apt install -y --no-install-recommends --allow-unauthenticated lxde gtk2-engines-murrine gnome-themes-standard gtk2-engines-pixbuf gtk2-engines-murrine arc-theme \ + && apt autoclean -y \ + && apt autoremove -y \ + && rm -rf /var/lib/apt/lists/* +ARG TINI_VERSION=v0.18.0 +ADD 11c0b0c43c7c51af4e3d83ce690cf81fa725f41177fe930411b5abe7822fba28 in /bin/tini +RUN |1 TINI_VERSION=v0.18.0 /bin/sh -c chmod +x /bin/tini +RUN |1 TINI_VERSION=v0.18.0 /bin/sh -c apt update \ + && apt install -y --no-install-recommends --allow-unauthenticated ffmpeg \ + && rm -rf /var/lib/apt/lists/* \ + && mkdir /usr/local/ffmpeg \ + && ln -s /usr/bin/ffmpeg /usr/local/ffmpeg/ffmpeg +COPY file:abdf97ac11ee9706394713c0ecc1f055b664382f5465e60b5bf2c40a32c67163 in /tmp/ +RUN |1 TINI_VERSION=v0.18.0 /bin/sh -c apt-get update \ + && dpkg-query -W -f='${Package}\n' > /tmp/a.txt \ + && apt-get install -y python3-pip python3-dev build-essential \ && pip3 install setuptools wheel \ + && pip3 install -r /tmp/requirements.txt \ + && ln -s /usr/bin/python3 /usr/local/bin/python \ + && dpkg-query -W -f='${Package}\n' > /tmp/b.txt \ + && apt-get remove -y `diff --changed-group-format='%>' --unchanged-group-format='' /tmp/a.txt /tmp/b.txt | xargs` \ + && apt-get autoclean -y \ + && apt-get autoremove -y \ + && rm -rf /var/lib/apt/lists/* \ + && rm -rf /var/cache/apt/* /tmp/a.txt /tmp/b.txt +LABEL maintainer=fcwu.tw@gmail.com +COPY dir:184340839665a9f0352b52da2062de99230a993526fbe387210d3322dafc1375 in /usr/local/lib/web/frontend/ +COPY dir:69e8963095a14e9feb929e0abb46f28f2e86bcadb86757cd341932d4938b26e6 in / +RUN /bin/sh -c ln -sf /usr/local/lib/web/frontend/static/websockify /usr/local/lib/web/frontend/static/novnc/utils/websockify \ + && chmod +x /usr/local/lib/web/frontend/static/websockify/run +EXPOSE 80 +WORKDIR /root +ENV HOME=/home/ubuntu SHELL=/bin/bash +HEALTHCHECK &{["CMD-SHELL" "curl --fail http://127.0.0.1:6079/api/health"] "30s" "5s" "0s" '\x00'} +ENTRYPOINT ["/startup.sh"] +RUN /bin/sh -c apt-get update \ + && apt-get upgrade -y \ + && apt-get install -y build-essential ca-certificates gcc git libpq-dev make python2.7 libglu1 autoconf swig filezilla \ + && apt-get autoremove \ + && apt-get clean +ADD dir:1779fcc0c99789b8cd52534615eee01316f1bae24b1d54df93481e2775843586 in continuity +WORKDIR /root/continuity +RUN /bin/bash -c ./setup; source mglinit; autoconf; ./configure; diff --git a/README.md b/README.md index f7b85e6..80164fd 100644 --- a/README.md +++ b/README.md @@ -1,28 +1,15 @@ -# old-continuity +# BENG 276 Continuity Notebook - - - ## Getting Started + 1. Log into vpn.ucsd.edu (required for accesing vnc)
-2. SSH to dsmlp-login.ucsd.edu -3. Find `launch-continuity.sh` script - ```sh - which launch-continuity.sh - ``` -4. Launch the `launch-continuity.sh` script return from step 3 - ```sh - /software/common64/dsmlp/bin/launch-continuity.sh - ``` -5. Wait for the shell output ``` Connected to old-continuity ```
-6. Take first url in shell output (e.g., http://128.54.65.160:16585) and paste into your browser url. Wait for the VNC password window
-7. password can be found in the first line of shell output. Look for ```Building connection to old-continuity; password for current connection:```
-9. press ```Send Password```
+2. ssh username@dsmlp-login.ucsd.edu +3. launch.sh -i ghcr.io/ucsd-ets/beng276-continuity-notebook:reconstructed +4. Navigate to http://dsmlp-login.ucsd.edu:19790/user/m1hock/?token=REDACTED +5. New -> desktop +6. Open terminal, cd /opt/continuity To terminate pod/processes ```sh exit ``` - - - diff --git a/default b/default deleted file mode 100644 index 05018da..0000000 --- a/default +++ /dev/null @@ -1,51 +0,0 @@ -server { - listen 8080 default_server; - # listen [::]:80 default_server ipv6only=on; - - #_SSL_PORT_#listen 443 ssl default_server; - #_SSL_PORT_#listen [::]:443 ssl default_server ipv6only=on; - #_SSL_PORT_#ssl_certificate /etc/nginx/ssl/nginx.crt; - #_SSL_PORT_#ssl_certificate_key /etc/nginx/ssl/nginx.key; - - #_HTTP_PASSWORD_#auth_basic "Private Property"; - #_HTTP_PASSWORD_#auth_basic_user_file /etc/nginx/.htpasswd; - - root /usr/local/lib/web/frontend/; - index index.html index.htm; - - #_RELATIVE_URL_ROOT_location /_RELATIVE_URL_ROOT_/ { - #_RELATIVE_URL_ROOT_ rewrite /_RELATIVE_URL_ROOT_/(.*) /$1 break; - #_RELATIVE_URL_ROOT_ root /usr/local/lib/web/frontend/; - #_RELATIVE_URL_ROOT_} - - location ~ .*/(api/.*|websockify) { - try_files $uri @api$http_upgrade; - } - - location / { - rewrite /approot/(.*) /$1 break; - root /usr/local/lib/web/frontend/; - } - - location @apiwebsocket { - #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break; - proxy_connect_timeout 7d; - proxy_send_timeout 7d; - proxy_read_timeout 7d; - proxy_buffering off; - - proxy_http_version 1.1; - proxy_set_header Upgrade $http_upgrade; - proxy_set_header Connection "upgrade"; - proxy_pass http://127.0.0.1:6081; - } - - location @api { - #_RELATIVE_URL_ROOT_rewrite /_RELATIVE_URL_ROOT_/(.*) $1 break; - proxy_set_header X-Real-IP $remote_addr; - proxy_set_header X-Forwarded-For $remote_addr; - proxy_set_header Host $host; - max_ranges 0; - proxy_pass http://127.0.0.1:6079; - } -} diff --git a/startup.sh b/startup.sh deleted file mode 100755 index 10b8040..0000000 --- a/startup.sh +++ /dev/null @@ -1,81 +0,0 @@ -#!/bin/bash -export LD_PRELOAD="" -USER=${USER:-root} -HOME=/root -if [ "$USER" != "root" ]; then - #echo "* enable custom user: $USER" - #useradd --create-home --shell /bin/bash --user-group --groups adm,sudo $USER - #if [ -z "$PASSWORD" ]; then - # echo " set default password to \"ubuntu\"" - # PASSWORD=ubuntu - #fi - #HOME=/home/$USER - #echo "$USER:$PASSWORD" | chpasswd - cp -r /root/{.config,.gtkrc-2.0,.asoundrc} ${HOME} - #chown -R $USER:$USER ${HOME} - #[ -d "/dev/snd" ] && chgrp -R adm /dev/snd -fi -sed -i -e "s|%USER%|$USER|" -e "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf - -# moved this from before home and root items above -# prepend $HOME to "/" usages here -if [ -n "$VNC_PASSWORD" ]; then - echo -n "$VNC_PASSWORD" > ${HOME}/.password1 - x11vnc -storepasswd $(cat "${HOME}"/.password1) ${HOME}/.password2 - chmod 400 ${HOME}/.password* - # replace delimiter with ":" so we don't have to quote all slashes in $HOME - #sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf - sed -i "s:^command=x11vnc.*:& -rfbauth ${HOME}/.password2:" /etc/supervisor/conf.d/supervisord.conf - export VNC_PASSWORD= -fi - - -if [ -n "$X11VNC_ARGS" ]; then - sed -i "s/^command=x11vnc.*/& ${X11VNC_ARGS}/" /etc/supervisor/conf.d/supervisord.conf -fi - -if [ -n "$OPENBOX_ARGS" ]; then - sed -i "s#^command=/usr/bin/openbox.*#& ${OPENBOX_ARGS}#" /etc/supervisor/conf.d/supervisord.conf -fi - -if [ -n "$RESOLUTION" ]; then - sed -i "s/1024x768/$RESOLUTION/" /usr/local/bin/xvfb.sh -fi - - -# home folder -if [ ! -x "$HOME/.config/pcmanfm/LXDE/" ]; then - mkdir -p $HOME/.config/pcmanfm/LXDE/ - ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/ - chown -R $USER:$USER $HOME -fi - -# nginx workers -sed -i 's|worker_processes .*|worker_processes 1;|' /etc/nginx/nginx.conf - -# nginx ssl -if [ -n "$SSL_PORT" ] && [ -e "/etc/nginx/ssl/nginx.key" ]; then - echo "* enable SSL" - sed -i 's|#_SSL_PORT_#\(.*\)443\(.*\)|\1'$SSL_PORT'\2|' /etc/nginx/sites-enabled/default - sed -i 's|#_SSL_PORT_#||' /etc/nginx/sites-enabled/default -fi - -# nginx http base authentication -if [ -n "$HTTP_PASSWORD" ]; then - echo "* enable HTTP base authentication" - htpasswd -bc /etc/nginx/.htpasswd $USER $HTTP_PASSWORD - sed -i 's|#_HTTP_PASSWORD_#||' /etc/nginx/sites-enabled/default -fi - -# dynamic prefix path renaming -if [ -n "$RELATIVE_URL_ROOT" ]; then - echo "* enable RELATIVE_URL_ROOT: $RELATIVE_URL_ROOT" - sed -i 's|#_RELATIVE_URL_ROOT_||' /etc/nginx/sites-enabled/default - sed -i 's|_RELATIVE_URL_ROOT_|'$RELATIVE_URL_ROOT'|' /etc/nginx/sites-enabled/default -fi - -# clearup -PASSWORD= -HTTP_PASSWORD= - -exec /bin/tini -- supervisord -n -c /etc/supervisor/supervisord.conf diff --git a/supervisord.conf b/supervisord.conf deleted file mode 100644 index 9173edf..0000000 --- a/supervisord.conf +++ /dev/null @@ -1,62 +0,0 @@ -[supervisord] -redirect_stderr=true -stopsignal=QUIT -autorestart=true -directory=/root -user=%USER% - -[program:nginx] -priority=10 -user=%USER% -command=nginx -c /etc/nginx/nginx.conf -g 'daemon off;' -stdout_logfile=/dev/stdout -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/stderr -stderr_logfile_maxbytes=0 - -[program:web] -priority=10 -directory=/usr/local/lib/web/backend -command=/usr/local/lib/web/backend/run.py -stdout_logfile=/dev/fd/1 -stdout_logfile_maxbytes=0 -stderr_logfile=/dev/fd/1 -stderr_logfile_maxbytes=0 - -[group:x] -programs=xvfb,wm,lxpanel,pcmanfm,x11vnc,novnc - -[program:wm] -priority=15 -command=/usr/bin/openbox -environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%" - -[program:lxpanel] -priority=15 -directory=/root -command=/usr/bin/lxpanel --profile LXDE -user=%USER% -environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%" - -[program:pcmanfm] -priority=15 -directory=/root -command=/usr/bin/pcmanfm --desktop --profile LXDE -user=%USER% -stopwaitsecs=3 -environment=DISPLAY=":1",HOME="%HOME%",USER="%USER%" - -[program:xvfb] -priority=10 -command=/usr/local/bin/xvfb.sh -stopsignal=KILL - -[program:x11vnc] -priority=20 -command=x11vnc -display :1 -xkb -forever -shared -repeat -capslock - -[program:novnc] -priority=25 -directory=/usr/local/lib/web/frontend/static/novnc -command=bash /usr/local/lib/web/frontend/static/novnc/utils/launch.sh --listen 6081 -stopasgroup=true