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 @@ +<?xml version="1.0"?> +<!DOCTYPE fontconfig SYSTEM "fonts.dtd"> +<fontconfig> +<!-- Use the Antialiasing --> + <match target="pattern"> + <edit name="antialias" mode="append"><bool>false</bool></edit> + </match> +</fontconfig> 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 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- Do not edit this file, it will be overwritten on install. + Copy the file to $HOME/.config/openbox/ instead. --> +<openbox_config xmlns="http://openbox.org/3.4/rc" xmlns:xi="http://www.w3.org/2001/XInclude"> + <resistance> + <strength>10</strength> + <screen_edge_strength>20</screen_edge_strength> + </resistance> + <focus> + <focusNew>yes</focusNew> + <!-- always try to focus new windows when they appear. other rules do + apply --> + <followMouse>no</followMouse> + <!-- move focus to a window when you move the mouse into it --> + <focusLast>yes</focusLast> + <!-- focus the last used window when changing desktops, instead of the one + under the mouse pointer. when followMouse is enabled --> + <underMouse>no</underMouse> + <!-- move focus under the mouse, even when the mouse is not moving --> + <focusDelay>200</focusDelay> + <!-- when followMouse is enabled, the mouse must be inside the window for + this many milliseconds (1000 = 1 sec) before moving focus to it --> + <raiseOnFocus>no</raiseOnFocus> + <!-- when followMouse is enabled, and a window is given focus by moving the + mouse into it, also raise the window --> + </focus> + <placement> + <policy>Smart</policy> + <!-- 'Smart' or 'UnderMouse' --> + <center>yes</center> + <!-- whether to place windows in the center of the free area found or + the top left corner --> + <monitor>Primary</monitor> + <!-- with Smart placement on a multi-monitor system, try to place new windows + on: 'Any' - any monitor, 'Mouse' - where the mouse is, 'Active' - where + the active window is, 'Primary' - only on the primary monitor --> + <primaryMonitor>1</primaryMonitor> + <!-- The monitor where Openbox should place popup dialogs such as the + focus cycling popup, or the desktop switch popup. It can be an index + from 1, specifying a particular monitor. Or it can be one of the + following: 'Mouse' - where the mouse is, or + 'Active' - where the active window is --> + </placement> + <theme> + <name>Nightmare-02</name> + <titleLayout>NLIMC</titleLayout> + <!-- + available characters are NDSLIMC, each can occur at most once. + N: window icon + L: window label (AKA title). + I: iconify + M: maximize + C: close + S: shade (roll up/down) + D: omnipresent (on all desktops). + --> + <keepBorder>yes</keepBorder> + <animateIconify>no</animateIconify> + <font place="ActiveWindow"> + <name>Ubuntu Medium</name> + <size>10</size> + <!-- font size in points --> + <weight>Normal</weight> + <!-- 'bold' or 'normal' --> + <slant>Normal</slant> + <!-- 'italic' or 'normal' --> + </font> + <font place="InactiveWindow"> + <name>Ubuntu</name> + <size>11</size> + <!-- font size in points --> + <weight>Normal</weight> + <!-- 'bold' or 'normal' --> + <slant>Normal</slant> + <!-- 'italic' or 'normal' --> + </font> + <font place="MenuHeader"> + <name>Ubuntu</name> + <size>10</size> + <!-- font size in points --> + <weight>Normal</weight> + <!-- 'bold' or 'normal' --> + <slant>Normal</slant> + <!-- 'italic' or 'normal' --> + </font> + <font place="MenuItem"> + <name>Ubuntu</name> + <size>10</size> + <!-- font size in points --> + <weight>Normal</weight> + <!-- 'bold' or 'normal' --> + <slant>Normal</slant> + <!-- 'italic' or 'normal' --> + </font> + <font place="ActiveOnScreenDisplay"> + <name>Ubuntu Medium</name> + <size>10</size> + <!-- font size in points --> + <weight>Normal</weight> + <!-- 'bold' or 'normal' --> + <slant>Normal</slant> + <!-- 'italic' or 'normal' --> + </font> + <font place="InactiveOnScreenDisplay"> + <name>Ubuntu Medium</name> + <size>10</size> + <!-- font size in points --> + <weight>Normal</weight> + <!-- 'bold' or 'normal' --> + <slant>Normal</slant> + <!-- 'italic' or 'normal' --> + </font> + </theme> + <desktops> + <!-- this stuff is only used at startup, pagers allow you to change them + during a session + + these are default values to use when other ones are not already set + by other applications, or saved in your session + + use obconf if you want to change these without having to log out + and back in --> + <number>1</number> + <firstdesk>1</firstdesk> + <names> + <!-- set names up here if you want to, like this: + <name>desktop 1</name> + <name>desktop 2</name> + --> + </names> + <popupTime>875</popupTime> + <!-- The number of milliseconds to show the popup for when switching + desktops. Set this to 0 to disable the popup. --> + </desktops> + <resize> + <drawContents>yes</drawContents> + <popupShow>Nonpixel</popupShow> + <!-- 'Always', 'Never', or 'Nonpixel' (xterms and such) --> + <popupPosition>Center</popupPosition> + <!-- 'Center', 'Top', or 'Fixed' --> + <popupFixedPosition> + <!-- these are used if popupPosition is set to 'Fixed' --> + <x>10</x> + <!-- positive number for distance from left edge, negative number for + distance from right edge, or 'Center' --> + <y>10</y> + <!-- positive number for distance from top edge, negative number for + distance from bottom edge, or 'Center' --> + </popupFixedPosition> + </resize> + <!-- You can reserve a portion of your screen where windows will not cover when + they are maximized, or when they are initially placed. + Many programs reserve space automatically, but you can use this in other + cases. --> + <margins> + <top>0</top> + <bottom>0</bottom> + <left>0</left> + <right>0</right> + </margins> + <dock> + <position>TopLeft</position> + <!-- (Top|Bottom)(Left|Right|)|Top|Bottom|Left|Right|Floating --> + <floatingX>0</floatingX> + <floatingY>0</floatingY> + <noStrut>no</noStrut> + <stacking>Above</stacking> + <!-- 'Above', 'Normal', or 'Below' --> + <direction>Vertical</direction> + <!-- 'Vertical' or 'Horizontal' --> + <autoHide>no</autoHide> + <hideDelay>300</hideDelay> + <!-- in milliseconds (1000 = 1 second) --> + <showDelay>300</showDelay> + <!-- in milliseconds (1000 = 1 second) --> + <moveButton>Middle</moveButton> + <!-- 'Left', 'Middle', 'Right' --> + </dock> + <keyboard> + <chainQuitKey>C-g</chainQuitKey> + <!-- Keybindings for desktop switching --> + <keybind key="C-A-Left"> + <action name="GoToDesktop"> + <to>left</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="C-A-Right"> + <action name="GoToDesktop"> + <to>right</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="C-A-Up"> + <action name="GoToDesktop"> + <to>up</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="C-A-Down"> + <action name="GoToDesktop"> + <to>down</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="S-A-Left"> + <action name="SendToDesktop"> + <to>left</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="S-A-Right"> + <action name="SendToDesktop"> + <to>right</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="S-A-Up"> + <action name="SendToDesktop"> + <to>up</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="S-A-Down"> + <action name="SendToDesktop"> + <to>down</to> + <wrap>no</wrap> + </action> + </keybind> + <keybind key="W-F1"> + <action name="GoToDesktop"> + <to>1</to> + </action> + </keybind> + <keybind key="W-F2"> + <action name="GoToDesktop"> + <to>2</to> + </action> + </keybind> + <keybind key="W-F3"> + <action name="GoToDesktop"> + <to>3</to> + </action> + </keybind> + <keybind key="W-F4"> + <action name="GoToDesktop"> + <to>4</to> + </action> + </keybind> + <keybind key="W-d"> + <action name="ToggleShowDesktop"/> + </keybind> + <!-- Keybindings for windows --> + <keybind key="A-F4"> + <action name="Close"/> + </keybind> + <keybind key="A-Escape"> + <action name="Lower"/> + <action name="FocusToBottom"/> + <action name="Unfocus"/> + </keybind> + <keybind key="A-space"> + <action name="ShowMenu"> + <menu>client-menu</menu> + </action> + </keybind> + <!-- Take a screenshot of the current window with scrot when Alt+Print are pressed --> + <keybind key="A-Print"> + <action name="Execute"> + <command>scrot -s</command> + </action> + </keybind> + <!-- Keybindings for window switching --> + <keybind key="A-Tab"> + <action name="NextWindow"> + <finalactions> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </finalactions> + </action> + </keybind> + <keybind key="A-S-Tab"> + <action name="PreviousWindow"> + <finalactions> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </finalactions> + </action> + </keybind> + <keybind key="C-A-Tab"> + <action name="NextWindow"> + <panels>yes</panels> + <desktop>yes</desktop> + <finalactions> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </finalactions> + </action> + </keybind> + <!-- Keybindings for window switching with the arrow keys --> + <keybind key="W-S-Right"> + <action name="DirectionalCycleWindows"> + <direction>right</direction> + </action> + </keybind> + <keybind key="W-S-Left"> + <action name="DirectionalCycleWindows"> + <direction>left</direction> + </action> + </keybind> + <keybind key="W-S-Up"> + <action name="DirectionalCycleWindows"> + <direction>up</direction> + </action> + </keybind> + <keybind key="W-S-Down"> + <action name="DirectionalCycleWindows"> + <direction>down</direction> + </action> + </keybind> + <!-- Keybindings for running applications --> + <keybind key="W-e"> + <action name="Execute"> + <startupnotify> + <enabled>true</enabled> + <name>Konqueror</name> + </startupnotify> + <command>kfmclient openProfile filemanagement</command> + </action> + </keybind> + <!-- Launch scrot when Print is pressed --> + <keybind key="Print"> + <action name="Execute"> + <command>scrot</command> + </action> + </keybind> + </keyboard> + <mouse> + <dragThreshold>1</dragThreshold> + <!-- number of pixels the mouse must move before a drag begins --> + <doubleClickTime>500</doubleClickTime> + <!-- in milliseconds (1000 = 1 second) --> + <screenEdgeWarpTime>400</screenEdgeWarpTime> + <!-- Time before changing desktops when the pointer touches the edge of the + screen while moving a window, in milliseconds (1000 = 1 second). + Set this to 0 to disable warping --> + <screenEdgeWarpMouse>false</screenEdgeWarpMouse> + <!-- Set this to TRUE to move the mouse pointer across the desktop when + switching due to hitting the edge of the screen --> + <context name="Frame"> + <mousebind button="A-Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + <mousebind button="A-Left" action="Click"> + <action name="Unshade"/> + </mousebind> + <mousebind button="A-Left" action="Drag"> + <action name="Move"/> + </mousebind> + <mousebind button="A-Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="A-Right" action="Drag"> + <action name="Resize"/> + </mousebind> + <mousebind button="A-Middle" action="Press"> + <action name="Lower"/> + <action name="FocusToBottom"/> + <action name="Unfocus"/> + </mousebind> + <mousebind button="A-Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="A-Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + <mousebind button="C-A-Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="C-A-Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + <mousebind button="A-S-Up" action="Click"> + <action name="SendToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="A-S-Down" action="Click"> + <action name="SendToDesktop"> + <to>next</to> + </action> + </mousebind> + </context> + <context name="Titlebar"> + <mousebind button="Left" action="Drag"> + <!-- Unsnap if snapped--> + <action name="if"> + <maximizedvertical>yes</maximizedvertical> + <then> + <action name="Unmaximize"/> + <direction>vertical</direction> + <action name="MoveResizeTo"> + <x>center</x> + <!-- we center windows in order to mitigate discrepancies + between window placement and mouse cursor --> + <y>current</y> + </action> + <action name="Move"/> + </then> + <else> + <action name="Move"/> + </else> + </action> + </mousebind> + <mousebind button="Left" action="DoubleClick"> + <action name="ToggleMaximize"/> + </mousebind> + <mousebind button="Up" action="Click"> + <action name="if"> + <shaded>no</shaded> + <then> + <action name="Shade"/> + <action name="FocusToBottom"/> + <action name="Unfocus"/> + <action name="Lower"/> + </then> + </action> + </mousebind> + <mousebind button="Down" action="Click"> + <action name="if"> + <shaded>yes</shaded> + <then> + <action name="Unshade"/> + <action name="Raise"/> + </then> + </action> + </mousebind> + </context> + <context name="Titlebar Top Right Bottom Left TLCorner TRCorner BRCorner BLCorner"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Middle" action="Press"> + <action name="Lower"/> + <action name="FocusToBottom"/> + <action name="Unfocus"/> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="ShowMenu"> + <menu>client-menu</menu> + </action> + </mousebind> + </context> + <context name="Top"> + <mousebind button="Left" action="Drag"> + <action name="Resize"> + <edge>top</edge> + </action> + </mousebind> + </context> + <context name="Left"> + <mousebind button="Left" action="Drag"> + <action name="Resize"> + <edge>left</edge> + </action> + </mousebind> + </context> + <context name="Right"> + <mousebind button="Left" action="Drag"> + <action name="Resize"> + <edge>right</edge> + </action> + </mousebind> + </context> + <context name="Bottom"> + <mousebind button="Left" action="Drag"> + <action name="Resize"> + <edge>bottom</edge> + </action> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="ShowMenu"> + <menu>client-menu</menu> + </action> + </mousebind> + </context> + <context name="TRCorner BRCorner TLCorner BLCorner"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Left" action="Drag"> + <action name="Resize"/> + </mousebind> + </context> + <context name="Client"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + <mousebind button="Middle" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + </context> + <context name="Icon"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + <action name="ShowMenu"> + <menu>client-menu</menu> + </action> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="ShowMenu"> + <menu>client-menu</menu> + </action> + </mousebind> + </context> + <context name="AllDesktops"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Left" action="Click"> + <action name="ToggleOmnipresent"/> + </mousebind> + </context> + <context name="Shade"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + <mousebind button="Left" action="Click"> + <action name="ToggleShade"/> + </mousebind> + </context> + <context name="Iconify"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + <mousebind button="Left" action="Click"> + <action name="Iconify"/> + </mousebind> + </context> + <context name="Maximize"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Middle" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Left" action="Click"> + <action name="ToggleMaximize"/> + </mousebind> + <mousebind button="Middle" action="Click"> + <action name="ToggleMaximize"> + <direction>vertical</direction> + </action> + </mousebind> + <mousebind button="Right" action="Click"> + <action name="ToggleMaximize"> + <direction>horizontal</direction> + </action> + </mousebind> + </context> + <context name="Close"> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + <action name="Unshade"/> + </mousebind> + <mousebind button="Left" action="Click"> + <action name="Close"/> + </mousebind> + </context> + <context name="Desktop"> + <mousebind button="Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + <mousebind button="A-Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="A-Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + <mousebind button="C-A-Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="C-A-Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + <mousebind button="Left" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="Focus"/> + <action name="Raise"/> + </mousebind> + </context> + <context name="Root"> + <!-- Menus --> + <mousebind button="Middle" action="Press"> + <action name="ShowMenu"> + <menu>client-list-combined-menu</menu> + </action> + </mousebind> + <mousebind button="Right" action="Press"> + <action name="ShowMenu"> + <menu>root-menu</menu> + </action> + </mousebind> + </context> + <context name="MoveResize"> + <mousebind button="Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + <mousebind button="A-Up" action="Click"> + <action name="GoToDesktop"> + <to>previous</to> + </action> + </mousebind> + <mousebind button="A-Down" action="Click"> + <action name="GoToDesktop"> + <to>next</to> + </action> + </mousebind> + </context> + </mouse> + <menu> + <!-- You can specify more than one menu file in here and they are all loaded, + just don't make menu ids clash or, well, it'll be kind of pointless --> + <!-- default menu file (or custom one in $HOME/.config/openbox/) --> + <!-- system menu files on Debian systems --> + <file>/var/lib/openbox/debian-menu.xml</file> + <file>menu.xml</file> + <hideDelay>200</hideDelay> + <!-- if a press-release lasts longer than this setting (in milliseconds), the + menu is hidden again --> + <middle>no</middle> + <!-- center submenus vertically about the parent entry --> + <submenuShowDelay>100</submenuShowDelay> + <!-- time to delay before showing a submenu after hovering over the parent + entry. + if this is a negative value, then the delay is infinite and the + submenu will not be shown until it is clicked on --> + <submenuHideDelay>400</submenuHideDelay> + <!-- time to delay before hiding a submenu when selecting another + entry in parent menu + if this is a negative value, then the delay is infinite and the + submenu will not be hidden until a different submenu is opened --> + <showIcons>yes</showIcons> + <!-- controls if icons appear in the client-list-(combined-)menu --> + <manageDesktops>yes</manageDesktops> + <!-- show the manage desktops section in the client-list-(combined-)menu --> + </menu> + <applications> + <!-- + # this is an example with comments through out. use these to make your + # own rules, but without the comments of course. + # you may use one or more of the name/class/role/title/type rules to specify + # windows to match + + <application name="the window's _OB_APP_NAME property (see obxprop)" + class="the window's _OB_APP_CLASS property (see obxprop)" + groupname="the window's _OB_APP_GROUP_NAME property (see obxprop)" + groupclass="the window's _OB_APP_GROUP_CLASS property (see obxprop)" + role="the window's _OB_APP_ROLE property (see obxprop)" + title="the window's _OB_APP_TITLE property (see obxprop)" + type="the window's _OB_APP_TYPE property (see obxprob).. + (if unspecified, then it is 'dialog' for child windows)"> + # you may set only one of name/class/role/title/type, or you may use more + # than one together to restrict your matches. + + # the name, class, role, and title use simple wildcard matching such as those + # used by a shell. you can use * to match any characters and ? to match + # any single character. + + # the type is one of: normal, dialog, splash, utility, menu, toolbar, dock, + # or desktop + + # when multiple rules match a window, they will all be applied, in the + # order that they appear in this list + + + # each rule element can be left out or set to 'default' to specify to not + # change that attribute of the window + + <decor>yes</decor> + # enable or disable window decorations + + <shade>no</shade> + # make the window shaded when it appears, or not + + <position force="no"> + # the position is only used if both an x and y coordinate are provided + # (and not set to 'default') + # when force is "yes", then the window will be placed here even if it + # says you want it placed elsewhere. this is to override buggy + # applications who refuse to behave + <x>center</x> + # a number like 50, or 'center' to center on screen. use a negative number + # to start from the right (or bottom for <y>), ie -50 is 50 pixels from + # the right edge (or bottom). use 'default' to specify using value + # provided by the application, or chosen by openbox, instead. + <y>200</y> + <monitor>1</monitor> + # specifies the monitor in a xinerama setup. + # 1 is the first head, or 'mouse' for wherever the mouse is + </position> + + <size> + # the size to make the window. + <width>20</width> + # a number like 20, or 'default' to use the size given by the application. + # you can use fractions such as 1/2 or percentages such as 75% in which + # case the value is relative to the size of the monitor that the window + # appears on. + <height>30%</height> + </size> + + <focus>yes</focus> + # if the window should try be given focus when it appears. if this is set + # to yes it doesn't guarantee the window will be given focus. some + # restrictions may apply, but Openbox will try to + + <desktop>1</desktop> + # 1 is the first desktop, 'all' for all desktops + + <layer>normal</layer> + # 'above', 'normal', or 'below' + + <iconic>no</iconic> + # make the window iconified when it appears, or not + + <skip_pager>no</skip_pager> + # asks to not be shown in pagers + + <skip_taskbar>no</skip_taskbar> + # asks to not be shown in taskbars. window cycling actions will also + # skip past such windows + + <fullscreen>yes</fullscreen> + # make the window in fullscreen mode when it appears + + <maximized>true</maximized> + # 'Horizontal', 'Vertical' or boolean (yes/no) + </application> + + # end of the example +--> + </applications> +</openbox_config> 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