From 8a12f91221b8ff877900ec341f85baa3eb716789 Mon Sep 17 00:00:00 2001 From: zeus Date: Sun, 19 Dec 2021 15:30:41 +0200 Subject: [PATCH] edit --- .../files/etc/fonts/conf.d/10-antialias.conf | 8 + .../etc/supervisor/conf.d/supervisord.conf | 59 ++ .../share/swarmlab.io/sec/files/root/.bashrc | 129 +++ .../root/.config/lxpanel/LXDE/panels/panel | 96 +++ .../sec/files/root/.config/openbox/rc.xml | 815 ++++++++++++++++++ .../.config/pcmanfm/LXDE/desktop-items-0.conf | 14 + .../root/.config/pcmanfm/LXDE/pcmanfm.conf | 26 + .../swarmlab.io/sec/files/root/.gtkrc-2.0 | 19 + .../sec/files/root/.gtkrc-2.0.mine | 15 + .../share/swarmlab.io/sec/files/startup.sh | 65 ++ .../doro-lxde-wallpapers/desktop-items-0.conf | 14 + .../usr/share/swarmlab.io/sec/swarmlab-sec | 74 ++ 12 files changed, 1334 insertions(+) create mode 100644 install/usr/share/swarmlab.io/sec/files/etc/fonts/conf.d/10-antialias.conf create mode 100644 install/usr/share/swarmlab.io/sec/files/etc/supervisor/conf.d/supervisord.conf create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.bashrc create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.config/lxpanel/LXDE/panels/panel create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.config/openbox/rc.xml create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/desktop-items-0.conf create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/pcmanfm.conf create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0 create mode 100644 install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0.mine create mode 100755 install/usr/share/swarmlab.io/sec/files/startup.sh create mode 100644 install/usr/share/swarmlab.io/sec/files/usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf diff --git a/install/usr/share/swarmlab.io/sec/files/etc/fonts/conf.d/10-antialias.conf b/install/usr/share/swarmlab.io/sec/files/etc/fonts/conf.d/10-antialias.conf new file mode 100644 index 0000000..3421e2b --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/etc/fonts/conf.d/10-antialias.conf @@ -0,0 +1,8 @@ + + + + + + false + + diff --git a/install/usr/share/swarmlab.io/sec/files/etc/supervisor/conf.d/supervisord.conf b/install/usr/share/swarmlab.io/sec/files/etc/supervisor/conf.d/supervisord.conf new file mode 100644 index 0000000..b6dbec3 --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/etc/supervisor/conf.d/supervisord.conf @@ -0,0 +1,59 @@ +[supervisord] +redirect_stderr=true +stopsignal=QUIT +autorestart=true +directory=/root + +[program:sshd] +priority=2 +command=/usr/sbin/sshd -D + +[program:nginx] +priority=10 +command=nginx -c /etc/nginx/nginx.conf -g 'daemon off;' + +[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:xvfb] +priority=10 +command=/usr/local/bin/xvfb.sh +stopsignal=KILL + +[program:wm] +priority=15 +command=/usr/bin/openbox +environment=DISPLAY=":1",HOME="/root",USER="root" + +[program:lxpanel] +priority=15 +directory=/root +command=/usr/bin/lxpanel --profile LXDE +user=root +environment=DISPLAY=":1",HOME="/root",USER="root" + +[program:pcmanfm] +priority=15 +directory=/root +command=/usr/bin/pcmanfm --desktop --profile LXDE +user=root +environment=DISPLAY=":1",HOME="/root",USER="root" + +[program:x11vnc] +priority=20 +command=x11vnc -display :1 -xkb -forever -shared -repeat -rfbauth /.password2 + +[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 diff --git a/install/usr/share/swarmlab.io/sec/files/root/.bashrc b/install/usr/share/swarmlab.io/sec/files/root/.bashrc new file mode 100644 index 0000000..db37435 --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.bashrc @@ -0,0 +1,129 @@ +# ~/.bashrc: executed by bash(1) for non-login shells. + +# If not running interactively, don't do anything +[ -z "$PS1" ] && return + +# don't put duplicate lines in the history. See bash(1) for more options +# ... or force ignoredups and ignorespace +HISTCONTROL=ignoredups:ignorespace + +# append to the history file, don't overwrite it +shopt -s histappend + +# for setting history length see HISTSIZE and HISTFILESIZE in bash(1) +HISTSIZE=1000 +HISTFILESIZE=2000 + +# check the window size after each command and, if necessary, +# update the values of LINES and COLUMNS. +shopt -s checkwinsize + +# make less more friendly for non-text input files, see lesspipe(1) +[ -x /usr/bin/lesspipe ] && eval "$(SHELL=/bin/sh lesspipe)" + +# set variable identifying the chroot you work in (used in the prompt below) +if [ -z "$debian_chroot" ] && [ -r /etc/debian_chroot ]; then + debian_chroot=$(cat /etc/debian_chroot) +fi + +# set a fancy prompt (non-color, unless we know we "want" color) +case "$TERM" in + xterm-color) color_prompt=yes;; +esac + +if [ -x /usr/bin/tput ] && tput setaf 1 >&/dev/null; then + # We have color support; assume it's compliant with Ecma-48 + # (ISO/IEC-6429). (Lack of such support is extremely rare, and such + # a case would tend to support setf rather than setaf.) + color_prompt=yes +else + color_prompt= +fi + +if [ "$color_prompt" = yes ]; then + PS1='${debian_chroot:+($debian_chroot)}\[\033[01;32m\]\u@\h\[\033[00m\]:\[\033[01;34m\]\w\[\033[00m\]\$ ' +else + PS1='${debian_chroot:+($debian_chroot)}\u@\h:\w\$ ' +fi +unset color_prompt + +# If this is an xterm set the title to user@host:dir +case "$TERM" in +xterm*|rxvt*) + PS1="\[\e]0;${debian_chroot:+($debian_chroot)}\u@\h: \w\a\]$PS1" + ;; +*) + ;; +esac + +# enable color support of ls and also add handy aliases +if [ -x /usr/bin/dircolors ]; then + test -r ~/.dircolors && eval "$(dircolors -b ~/.dircolors)" || eval "$(dircolors -b)" + alias ls='ls --color=auto --time-style=long-iso' + alias dir='ls --color=auto --time-style=long-iso' + #alias vdir='vdir --color=auto --time-style=long-iso' + + alias grep='grep --color=auto' + alias fgrep='fgrep --color=auto' + alias egrep='egrep --color=auto' +fi + +# some more ls aliases +alias ll='ls -alF' +alias la='ls -A' +alias l='ls -CF' + +# Add an "alert" alias for long running commands. Use like so: +# sleep 10; alert +alias alert='notify-send --urgency=low -i "$([ $? = 0 ] && echo terminal || echo error)" "$(history|tail -n1|sed -e '\''s/^\s*[0-9]\+\s*//;s/[;&|]\s*alert$//'\'')"' + +# enable programmable completion features (you don't need to enable +# this, if it's already enabled in /etc/bash.bashrc and /etc/profile +# sources /etc/bash.bashrc). +if [ -f /etc/bash_completion ] && ! shopt -oq posix; then + . /etc/bash_completion +fi + +# Git ############# +alias ga='git add' +alias gaa='git add .' +alias gaaa='git add --all' +alias gau='git add --update' +alias gb='git branch' +alias gbd='git branch --delete ' +alias gc='git commit' +alias gcm='git commit --message' +alias gcf='git commit --fixup' +alias gco='git checkout' +alias gcob='git checkout -b' +alias gcom='git checkout master' +#alias gcos='git checkout staging' +#alias gcod='git checkout develop' +alias gd='git diff' +alias gda='git diff HEAD' +#alias gi='git init' +alias gl='git log --graph --oneline --decorate --all' +alias glg='git log --graph --oneline --decorate --all' +alias gld='git log --decorate --pretty=format:"%h %ad %s" --date=short --all' +alias gm='git merge --no-ff' +alias gma='git merge --abort' +alias gmc='git merge --continue' +alias gp='git pull' +alias gpr='git pull --rebase' +alias gr='git rebase' +alias grs='git reset --hard HEAD' +alias gs='git status' +alias gss='git status --short' +#alias gst='git stash' +#alias gsta='git stash apply' +#alias gstd='git stash drop' +#alias gstl='git stash list' +#alias gstp='git stash pop' +#alias gsts='git stash save' + +# aliases ######### +EB_START_LINE=130 +alias eb="nano +$EB_START_LINE ~/.bashrc ; source ~/.bashrc; echo '.bashrc updated and applied!'" +alias vb="vi +$EB_START_LINE ~/.bashrc ; source ~/.bashrc; echo '.bashrc updated and applied!'" +alias CAPS="xdotool key Caps_Lock" +alias au="sudo apt update ; sudo apt upgrade -y ; sudo apt autoremove -y; sudo apt clean" \ No newline at end of file diff --git a/install/usr/share/swarmlab.io/sec/files/root/.config/lxpanel/LXDE/panels/panel b/install/usr/share/swarmlab.io/sec/files/root/.config/lxpanel/LXDE/panels/panel new file mode 100644 index 0000000..ca75b6d --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.config/lxpanel/LXDE/panels/panel @@ -0,0 +1,96 @@ +Global { + edge=bottom + align=left + margin=0 + widthtype=percent + width=100 + height=26 + transparent=0 + tintcolor=#000000 + alpha=0 + setdocktype=1 + setpartialstrut=1 + autohide=0 + heightwhenhidden=0 + usefontcolor=1 + fontcolor=#ffffff + background=0 + backgroundfile=/usr/share/lxpanel/images/background.png +} +Plugin { + type=menu + Config { + image=/usr/share/lxde/images/lxde-icon.png + system { + } + separator { + } + item { + command=run + } + separator { + } + item { + image=gnome-logout + command=logout + } + } +} +Plugin { + type=launchbar + Config { + Button { + id=pcmanfm.desktop + } + Button { + id=lxde-x-www-browser.desktop + } + Button { + id=code.desktop + } + Button { + id=lxterminal.desktop + } + } +} +Plugin { + type=taskbar + expand=1 + Config { + tooltips=1 + IconsOnly=0 + AcceptSkipPager=1 + ShowIconified=1 + ShowMapped=1 + ShowAllDesks=0 + UseMouseWheel=1 + UseUrgencyHint=1 + FlatButton=0 + MaxTaskWidth=150 + spacing=1 + } +} +Plugin { + type=tray + Config { + } +} +Plugin { + type=monitors + Config { + DisplayCPU=1 + DisplayRAM=1 + CPUColor=#00FF00 + RAMColor=#00FFFF + } +} +Plugin { + type=dclock + Config { + ClockFmt=%H:%M + TooltipFmt=%Y.%m.%d. %a + BoldFont=0 + IconOnly=0 + CenterText=0 + } +} diff --git a/install/usr/share/swarmlab.io/sec/files/root/.config/openbox/rc.xml b/install/usr/share/swarmlab.io/sec/files/root/.config/openbox/rc.xml new file mode 100644 index 0000000..6365224 --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.config/openbox/rc.xml @@ -0,0 +1,815 @@ + + + + + 10 + 20 + + + yes + + no + + yes + + no + + 200 + + no + + + + Smart + +
yes
+ + Primary + + 1 + +
+ + Nightmare-02 + NLIMC + + yes + no + + Ubuntu Medium + 10 + + Normal + + Normal + + + + Ubuntu + 11 + + Normal + + Normal + + + + Ubuntu + 10 + + Normal + + Normal + + + + Ubuntu + 10 + + Normal + + Normal + + + + Ubuntu Medium + 10 + + Normal + + Normal + + + + Ubuntu Medium + 10 + + Normal + + 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 + + + + left + no + + + + + right + no + + + + + up + no + + + + + down + no + + + + + left + no + + + + + right + no + + + + + up + no + + + + + down + no + + + + + 1 + + + + + 2 + + + + + 3 + + + + + 4 + + + + + + + + + + + + + + + + + client-menu + + + + + + scrot -s + + + + + + + + + + + + + + + + + + + + + + + + yes + yes + + + + + + + + + + + right + + + + + left + + + + + up + + + + + down + + + + + + + true + Konqueror + + kfmclient openProfile filemanagement + + + + + + scrot + + + + + 1 + + 500 + + 400 + + false + + + + + + + + + + + + + + + + + + + + + + + + + + + + previous + + + + + next + + + + + previous + + + + + next + + + + + previous + + + + + next + + + + + + + + yes + + + vertical + + center + + current + + + + + + + + + + + + + + no + + + + + + + + + + + yes + + + + + + + + + + + + + + + + + + + + + + + client-menu + + + + + + + top + + + + + + + left + + + + + + + right + + + + + + + bottom + + + + + + + client-menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + client-menu + + + + + + + client-menu + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + vertical + + + + + horizontal + + + + + + + + + + + + + + + + + previous + + + + + next + + + + + previous + + + + + next + + + + + previous + + + + + next + + + + + + + + + + + + + + + + client-list-combined-menu + + + + + root-menu + + + + + + + previous + + + + + next + + + + + previous + + + + + next + + + + + + + + + /var/lib/openbox/debian-menu.xml + menu.xml + 200 + + no + + 100 + + 400 + + yes + + yes + + + + + +
diff --git a/install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/desktop-items-0.conf b/install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/desktop-items-0.conf new file mode 100644 index 0000000..99b8c3c --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/desktop-items-0.conf @@ -0,0 +1,14 @@ +[*] +wallpaper_mode=color +wallpaper_common=0 +wallpapers_configured=1 +wallpaper0=/usr/local/share/doro-lxde-wallpapers/bg1.jpg +desktop_bg=#141414 +desktop_fg=#ffffff +desktop_shadow=#000000 +desktop_font=Sans 10 +show_wm_menu=0 +sort=mtime;ascending;mingle; +show_documents=0 +show_trash=1 +show_mounts=0 \ No newline at end of file diff --git a/install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/pcmanfm.conf b/install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/pcmanfm.conf new file mode 100644 index 0000000..cdc208b --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.config/pcmanfm/LXDE/pcmanfm.conf @@ -0,0 +1,26 @@ +[config] +bm_open_method=0 + +[volume] +mount_on_startup=1 +mount_removable=1 +autorun=1 + +[ui] +always_show_tabs=1 +max_tab_chars=32 +win_width=640 +win_height=480 +splitter_pos=150 +media_in_new_tab=0 +desktop_folder_new_win=0 +change_tab_on_drop=1 +close_on_unmount=1 +focus_previous=0 +side_pane_mode=places +view_mode=list +show_hidden=1 +sort=name;ascending; +toolbar=newtab;navigation;home; +show_statusbar=1 +pathbar_mode_buttons=0 diff --git a/install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0 b/install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0 new file mode 100644 index 0000000..ae893a1 --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0 @@ -0,0 +1,19 @@ +# DO NOT EDIT! This file will be overwritten by LXAppearance. +# Any customization should be done in ~/.gtkrc-2.0.mine instead. + +include "/root/.gtkrc-2.0.mine" +gtk-theme-name="Adwaita-dark" +gtk-icon-theme-name="Papirus-Dark" +gtk-font-name="Sans 10" +gtk-cursor-theme-name="Adwaita" +gtk-cursor-theme-size=18 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=0 +gtk-xft-hinting=0 +gtk-xft-hintstyle="hintfull" +gtk-xft-rgba="rgb" \ No newline at end of file diff --git a/install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0.mine b/install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0.mine new file mode 100644 index 0000000..e0440e9 --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/root/.gtkrc-2.0.mine @@ -0,0 +1,15 @@ +gtk-theme-name="Adwaita-dark" +gtk-icon-theme-name="Papirus-Dark" +gtk-font-name="Sans 10" +gtk-cursor-theme-name="Adwaita" +gtk-cursor-theme-size=18 +gtk-toolbar-style=GTK_TOOLBAR_BOTH_HORIZ +gtk-toolbar-icon-size=GTK_ICON_SIZE_LARGE_TOOLBAR +gtk-button-images=1 +gtk-menu-images=1 +gtk-enable-event-sounds=1 +gtk-enable-input-feedback-sounds=1 +gtk-xft-antialias=0 +gtk-xft-hinting=0 +gtk-xft-hintstyle="hintfull" +gtk-xft-rgba="rgb" \ No newline at end of file diff --git a/install/usr/share/swarmlab.io/sec/files/startup.sh b/install/usr/share/swarmlab.io/sec/files/startup.sh new file mode 100755 index 0000000..cd90b23 --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/startup.sh @@ -0,0 +1,65 @@ +#!/bin/bash + +if [ -n "$VNC_PASSWORD" ]; then + echo -n "$VNC_PASSWORD" > /.password1 + x11vnc -storepasswd $(cat /.password1) /.password2 + chmod 400 /.password* + sed -i 's/^command=x11vnc.*/& -rfbauth \/.password2/' /etc/supervisor/conf.d/supervisord.conf + export VNC_PASSWORD= +fi + +if [ -n "$RESOLUTION" ]; then + sed -i -r "s/\-screen 0 (.*)x(8|16|24|32)$/\-screen 0 ${RESOLUTION}x16/g" /usr/local/bin/xvfb.sh +fi + +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/{.gtkrc-2.0,.asoundrc} ${HOME} + cp -r /root/.config ${HOME}/.config + [ -d "/dev/snd" ] && chgrp -R adm /dev/snd +fi +sed -i "s|%USER%|$USER|" /etc/supervisor/conf.d/supervisord.conf +sed -i "s|%HOME%|$HOME|" /etc/supervisor/conf.d/supervisord.conf + +# home folder +mkdir -p $HOME/.config/pcmanfm/LXDE/ +ln -sf /usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf $HOME/.config/pcmanfm/LXDE/ +if [ -n "$FASTBOOT" ] ; then + 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 + +# novnc websockify +ln -s /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 + +# clearup +PASSWORD= +HTTP_PASSWORD= + +exec /bin/tini -- /usr/bin/supervisord -n -c /etc/supervisor/supervisord.conf diff --git a/install/usr/share/swarmlab.io/sec/files/usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf b/install/usr/share/swarmlab.io/sec/files/usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf new file mode 100644 index 0000000..99b8c3c --- /dev/null +++ b/install/usr/share/swarmlab.io/sec/files/usr/local/share/doro-lxde-wallpapers/desktop-items-0.conf @@ -0,0 +1,14 @@ +[*] +wallpaper_mode=color +wallpaper_common=0 +wallpapers_configured=1 +wallpaper0=/usr/local/share/doro-lxde-wallpapers/bg1.jpg +desktop_bg=#141414 +desktop_fg=#ffffff +desktop_shadow=#000000 +desktop_font=Sans 10 +show_wm_menu=0 +sort=mtime;ascending;mingle; +show_documents=0 +show_trash=1 +show_mounts=0 \ No newline at end of file diff --git a/install/usr/share/swarmlab.io/sec/swarmlab-sec b/install/usr/share/swarmlab.io/sec/swarmlab-sec index 0bbb350..c3c185e 100755 --- a/install/usr/share/swarmlab.io/sec/swarmlab-sec +++ b/install/usr/share/swarmlab.io/sec/swarmlab-sec @@ -169,6 +169,42 @@ if [ -d "$Wdir/project" ]; then && chown -R \${USER1}:\${USER1} \${SSHDIR} COPY .vimrc /home/docker + +# Upgrade installed packages +RUN rm -rf /etc/apt/sources.list.d/fcwu-tw-ubuntu-apps-bionic.list* \ + && sed -i 's/tw.//g' /etc/apt/sources.list \ + && apt-get update -qq \ + && apt-get install -y --no-install-recommends -qq apt-utils \ + && apt-get purge -y -qq fonts-wqy-zenhei \ + && apt-get autoremove -y -qq \ + && apt-get upgrade -y -qq + +# Install required packages +RUN apt-get install -y --no-install-recommends -qq software-properties-common locales \ + && add-apt-repository -y ppa:papirus/papirus \ + && add-apt-repository -y ppa:apt-fast/stable \ + && curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \ + && install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ \ + && sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' \ + && rm -f microsoft.gpg \ + && apt-get update -qq +RUN apt-get install -y --no-install-recommends -qq \ + nano bash-completion wget code lxtask openssh-server git xdotool filezilla putty dnsutils apt-fast \ + papirus-icon-theme fonts-noto-cjk fonts-noto-cjk-extra obconf lxappearance-obconf \ + && apt-get clean + +# Configure vscode extension --DISABLED: error on root +#RUN code --install-extension mhutchie.git-graph \ +# && code --install-extension eamodio.gitlens + +# Customizations : remove unused, change settings, copy conf files +RUN rm /usr/local/share/doro-lxde-wallpapers/bg[2-4].jpg \ + && sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'scale');/g" /usr/local/lib/web/frontend/static/novnc/app/ui.js +COPY files / + +# SSHD run bugfix +RUN mkdir -p /run/sshd + EXPOSE 80 EOF fi @@ -247,6 +283,44 @@ if [ "$Wdir" == "$HOME" ]; then && chown -R \${USER1}:\${USER1} \${SSHDIR} COPY .vimrc /home/docker + + +# Upgrade installed packages +RUN rm -rf /etc/apt/sources.list.d/fcwu-tw-ubuntu-apps-bionic.list* \ + && sed -i 's/tw.//g' /etc/apt/sources.list \ + && apt-get update -qq \ + && apt-get install -y --no-install-recommends -qq apt-utils \ + && apt-get purge -y -qq fonts-wqy-zenhei \ + && apt-get autoremove -y -qq \ + && apt-get upgrade -y -qq + +# Install required packages +RUN apt-get install -y --no-install-recommends -qq software-properties-common locales \ + && add-apt-repository -y ppa:papirus/papirus \ + && add-apt-repository -y ppa:apt-fast/stable \ + && curl https://packages.microsoft.com/keys/microsoft.asc | gpg --dearmor > microsoft.gpg \ + && install -o root -g root -m 644 microsoft.gpg /etc/apt/trusted.gpg.d/ \ + && sh -c 'echo "deb [arch=amd64] https://packages.microsoft.com/repos/vscode stable main" > /etc/apt/sources.list.d/vscode.list' \ + && rm -f microsoft.gpg \ + && apt-get update -qq +RUN apt-get install -y --no-install-recommends -qq \ + nano bash-completion wget code lxtask openssh-server git xdotool filezilla putty dnsutils apt-fast \ + papirus-icon-theme fonts-noto-cjk fonts-noto-cjk-extra obconf lxappearance-obconf \ + && apt-get clean + +# Configure vscode extension --DISABLED: error on root +#RUN code --install-extension mhutchie.git-graph \ +# && code --install-extension eamodio.gitlens + +# Customizations : remove unused, change settings, copy conf files +RUN rm /usr/local/share/doro-lxde-wallpapers/bg[2-4].jpg \ + && sed -i "s/UI.initSetting('resize', 'off');/UI.initSetting('resize', 'scale');/g" /usr/local/lib/web/frontend/static/novnc/app/ui.js +COPY files / + +# SSHD run bugfix +RUN mkdir -p /run/sshd + + EXPOSE 80 EOF fi