Compare commits

...

2 Commits

Author SHA1 Message Date
3126f53e48 Remove password, Remove sslOnly, Add DiD, Add motd 2023-10-10 14:53:09 -03:00
56ef71c741 Renormalize LFS 2023-09-29 05:33:20 -03:00
13 changed files with 134 additions and 111 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 562 KiB

After

Width:  |  Height:  |  Size: 131 B

View File

@ -91,7 +91,7 @@ The default username is `designer` and the password is `password`.
### 3. Configure Volare ### 3. Configure Volare
List the available PDKs and choose one to install. Choose a PDK variant from the following list to install.
| PDK Technology | PDK Variant | | PDK Technology | PDK Variant |
|----------------|-------------| |----------------|-------------|
@ -101,10 +101,16 @@ List the available PDKs and choose one to install.
| | gf180mcuB | | | gf180mcuB |
| | gf180mcuC | | | gf180mcuC |
Replace `<pdk_variant>` and `<pdk_tech>` correspondingly by one of the PDKs listed above.
To automatically download and configure the latest version of the PDK to this date, run `volare_set_latest` replacing `<pdk_variant>` for a PDK variant from the list.
```sh ```sh
export PDK=<pdk_variant> volare_set_latest <pdk_variant>
echo 'export PDK=${PDK}' >> ~/.bashrc ```
To manually set any version of the PDK, set the `PDK` environment variable, list the available PDKs and choose one to install replacing `<pdk_variant>` and `<pdk_tech>` correspondingly by one of the PDKs listed above.
```sh
echo 'export PDK=<pdk_variant>' >> ~/.bashrc
source ~/.bashrc
volare ls-remote --pdk <pdk_tech> volare ls-remote --pdk <pdk_tech>
volare enable --pdk <pdk_tech> <version_id> volare enable --pdk <pdk_tech> <version_id>
``` ```
@ -121,6 +127,20 @@ or you can also install packages from the [AUR](https://aur.archlinux.org/) usin
```paru <package_name>``` ```paru <package_name>```
## Updating the image
To update to the latest image version, first make sure you have all your important data linked by a volume or backed up in an external storage, **all your files outside any linked volume will be lost**.
After you backed your data, stop the container, delete it, pull the latest image and finally start the container again as the first step of the usage section.
```
docker stop <container_name>
docker rm <container_name>
docker pull <image>
docker run -d --security-opt seccomp=unconfined -p 8444:8444 -v <path_to_volume>:/home/designer/shared --name <container_name> <image-web>
```
> Container names can be seen with `docker ps -a`
## Custom Images ## Custom Images
For creating an image with your own pre-installed set of packages for your team you can create your own docker image extending the stacks, just as the stacks extend the base image. For reference check the stacks dockerfiles in the `stack` folder. For creating an image with your own pre-installed set of packages for your team you can create your own docker image extending the stacks, just as the stacks extend the base image. For reference check the stacks dockerfiles in the `stack` folder.

View File

@ -6,7 +6,21 @@ FROM greyltc/archlinux-aur:paru as osicstacks-base-desktop
RUN pacman -Syuq --noconfirm RUN pacman -Syuq --noconfirm
# Install packages # Install packages
RUN aur-install sudo git git-lfs python python-pip python-pipx xz gnu-free-fonts gvim ngspice gedit jupyter-notebook xterm RUN aur-install \
sudo \
git \
git-lfs \
python \
python-pip \
python-pipx \
xz \
gnu-free-fonts \
gvim \
ngspice \
gedit \
jupyter-notebook \
xterm
ENV TERM=xterm EDITOR=gedit ENV TERM=xterm EDITOR=gedit
# Clean cache # Clean cache
@ -32,7 +46,16 @@ COPY --chown=designer:designer --chmod=755 scripts/* /home/designer/.scripts
ENV PATH="/home/designer/.scripts:${PATH}" ENV PATH="/home/designer/.scripts:${PATH}"
# Add motd # Add motd
RUN echo "/home/designer/.bashrc" >> "custom_motd" RUN echo "custom_motd" >> "/home/designer/.bashrc"
# Add media includes
RUN mkdir -p /home/designer/.media
COPY --chown=designer:designer include/media/* /home/designer/.media
# Setup Docker in Docker (DiD)
RUN aur-install docker
RUN sudo groupadd docker
RUN sudo usermod -aG docker $USER
# Initialize the enviroment keeping container alive # Initialize the enviroment keeping container alive
ENTRYPOINT ["start_desktop"] ENTRYPOINT ["start_desktop"]

View File

@ -27,11 +27,9 @@ RUN sudo usermod -aG root designer
# Install XFCE # Install XFCE
RUN sudo pacman -S --noconfirm xorg xfce4 RUN sudo pacman -S --noconfirm xorg xfce4
# Copy includes # Copy autostart include
RUN mkdir -p /home/designer/.media
COPY --chown=designer:designer include/media/* /home/designer/.media
RUN mkdir -p /home/designer/.config/autostart RUN mkdir -p /home/designer/.config/autostart
COPY --chown=designer:designer include/desktopinit.desktop /home/designer/.config/autostart COPY --chown=designer:designer include/desktop_init.desktop /home/designer/.config/autostart
# Set login user # Set login user
ENV LOGIN_USER designer ENV LOGIN_USER designer

View File

@ -0,0 +1,8 @@
__ __
__ /\ \__ /\ \
___ ____/\_\ ___ ____\ \ ,_\ __ ___\ \ \/'\ ____
/ __`\ /',__\/\ \ /'___\ /',__\\ \ \/ /'__`\ /'___\ \ , < /',__\
/\ \L\ \/\__, `\ \ \/\ \__/ /\__, `\\ \ \_/\ \L\.\_/\ \__/\ \ \\`\ /\__, `\
\ \____/\/\____/\ \_\ \____\ \/\____/ \ \__\ \__/.\_\ \____\\ \_\ \_\/\____/
\/___/ \/___/ \/_/\/____/ \/___/ \/__/\/__/\/_/\/____/ \/_/\/_/\/___/

BIN
include/media/default_wallpaper.png (Stored with Git LFS) Normal file

Binary file not shown.

Binary file not shown.

Before

Width:  |  Height:  |  Size: 744 KiB

View File

@ -1,20 +1,16 @@
#!/bin/bash #!/bin/bash
cat << EOF
__ __
__ /\ \__ /\ \
___ ____/\_\ ___ ____\ \ ,_\ __ ___\ \ \/'\ ____
/ __`\ /',__\/\ \ /'___\ /',__\\ \ \/ /'__`\ /'___\ \ , < /',__\
/\ \L\ \/\__, `\ \ \/\ \__/ /\__, `\\ \ \_/\ \L\.\_/\ \__/\ \ \\`\ /\__, `\
\ \____/\/\____/\ \_\ \____\ \/\____/ \ \__\ \__/.\_\ \____\\ \_\ \_\/\____/
\/___/ \/___/ \/_/\/____/ \/___/ \/__/\/__/\/_/\/____/ \/_/\/_/\/___/
EOF cat $HOME/.media/ascii_art.txt
if [[ -z "${PDK} "]] if [[ ! -z "${PDK_TECH}" ]]; then
cat << EOF if [[ ! -z "${PDK_VERSION}" ]]; then
volare_set_latest
fi
else
echo "
There is not an active PDK, Use: There is not an active PDK, Use:
volare_set_latest <pdk_variant> volare_set_latest <pdk_variant>
to automatically download and configure the latest version of a PDK. to automatically download and configure the latest version of a PDK.
You can also manually configure a PDK using volare and setting the PDK environment variable You can also manually configure a PDK using volare and setting the PDK_TECH environment variable
EOF "
fi fi

View File

@ -1,3 +1,18 @@
#!/bin/bash #!/bin/bash
setwallpaper /home/designer/.media/defaultwallpaper.png set_wallpaper $HOME/.media/default_wallpaper.png
xfce4-terminal xfce4-terminal
# Add application launcher
mkdir -p $HOME/.config/xfce4/panel/launcher-18
ln /usr/share/applications/klayoutEditor.desktop $HOME/.config/xfce4/panel/launcher-18
xfconf-query -c xfce4-panel -p /plugins/plugin-18 -t string -s "launcher" --create
xfconf-query -c xfce4-panel -p /plugins/plugin-18/items -t string -s "klayoutEditor.desktop" -a --create
# Delete plugin id array
xfconf-query -c xfce4-panel -p /panels/panel-2/plugin-ids -rR
# Recreate id array with new values
xfconf-query -c xfce4-panel -p /panels/panel-2/plugin-ids -t int -s 18
# Restart panel
xfce4-panel -r

View File

@ -1,89 +1,34 @@
#!/bin/bash #!/bin/bash
cd /home/designer cd $HOME
# Run VNC server # Run VNC server
/usr/sbin/Xvnc $DISPLAY \ echo 'Running VNC Server'
-httpd '/usr/share/kasmvnc/www' \ mkdir -p $HOME/.vnc
-DLP_RegionAllowClick '0' \ touch "$HOME/.Xauthority"
-QueryConnect '0' \ touch "$HOME/.vnc/passwd"
-VideoScaling '2' \
-DLP_ClipDelay '0' \
-DLP_Log 'off' \
-KasmPasswordFile '/home/designer/.kasmpasswd' \
-MaxVideoResolution '1920x1080' \
-ImprovedHextile '1' \
-QueryConnectTimeout '10' \
-Log '*:stdout:100' \
-DynamicQualityMin '7' \
-RectThreads '0' \
-WebpVideoQuality '-1' \
-DLP_ClipTypes 'chromium/x-web-custom-data,text/html,image/png' \
-udpFullFrameFrequency '0' \
-UseIPv6 '1' \
-DLP_RegionAllowRelease '0' \
-AcceptCutText '1' \
-DLP_ClipAcceptMax '0' \
-http-header 'Cross-Origin-Embedder-Policy=require-corp' \
-http-header 'Cross-Origin-Opener-Policy=same-origin' \
-MaxConnectionTime '0' \
-fp '/usr/share/fonts/75dpi,/usr/share/fonts/100dpi' \
-TreatLossless '10' \
-interface '0.0.0.0' \
-SendPrimary '0' \
-RawKeyboard '0' \
-DynamicQualityMax '8' \
-MaxDisconnectionTime '0' \
-BlacklistTimeout '10' \
-DisconnectClients '0' \
-DLP_ClipSendMax '0' \
-AcceptKeyEvents '1' \
-IgnoreClientSettingsKasm '0' \
-AcceptPointerEvents '1' \
-websocketPort '8445' \
-BlacklistThreshold '5' \
-depth '24' \
-MaxIdleTime '0' \
-cert '/etc/ssl/certs/ssl-cert-snakeoil.pem' \
-DLP_KeyRateLimit '0' \
-VideoTime '5' \
-auth '/home/designer/.Xauthority' \
-SendCutText '1' \
-VideoOutTime '3' \
-UseIPv4 '1' \
-sslOnly '0' \
-VideoArea '45' \
-desktop "$(hostname):$DISPLAY (designer)" \
-CompareFB '2' \
-PrintVideoArea '0' \
-FrameRate '60' \
-AcceptSetDesktopSize '1' \
-AvoidShiftNumLock '0' \
-key '/etc/ssl/private/ssl-cert-snakeoil.key' \
-JpegVideoQuality '-1' \
-geometry '1024x768' \
-IdleTimeout '0' \
-AllowOverride 'AcceptPointerEvents,SendCutText,AcceptCutText,SendPrimary' \
-rfbauth '/home/designer/.vnc/passwd' \
-rfbwait '30000' \
-rfbport '5901' \
>> "/home/designer/.vnc/$(hostname):$DISPLAY.log" 2>&1
echo -e "${LOGIN_PASSWORD}\n${LOGIN_PASSWORD}\n" | vncpasswd -u ${LOGIN_USER} -w -r echo -e "$LOGIN_PASSWORD\n$LOGIN_PASSWORD\n" | vncpasswd -u $LOGIN_USER -w -r
# Wait for VNC server to start kasm_vnc_options="
sleep 2 -httpd /usr/share/kasmvnc/www \
while ! xset q &>/dev/null; -SecurityTypes None \
do -disableBasicAuth \
echo "XServer not responsive, retrying..." -KasmPasswordFile $HOME/.kasmpasswd \
sleep 2 -MaxVideoResolution 1920x1080 \
done -interface 0.0.0.0 \
-websocketPort 8444 \
-cert /etc/ssl/certs/ssl-cert-snakeoil.pem \
-key /etc/ssl/private/ssl-cert-snakeoil.key \
-auth $HOME/.Xauthority \
-sslOnly 0 \
-desktop osicstacks \
-rfbauth $HOME/.vnc/passwd"
echo "XServer has been found, running desktop environment" vncserver -select-de xfce -fg -xstartup $HOME/.scripts/xstartup $kasm_vnc_options &
# Run desktop environment (XFCE) #if ! docker info > /dev/null 2>&1; then
xfce4-session --display=$DISPLAY sudo dockerd &
#fi
volare_set_latest
# Keep container alive # Keep container alive
sleep infinity sleep infinity

View File

@ -1,6 +1,7 @@
#!/bin/bash #!/bin/bash
if [[ -z "$1"]]; then PDK=$1 fi if [[ ! -z "$1" ]]; then PDK_TECH=$1; fi
if [[ -z "${PDK}" ]]; then if [[ ! -z "${PDK_TECH}" ]]; then
PDK_VERSION=$(volare ls-remote --pdk $PDK | sed -n '1 p') echo "Installing $PDK_TECH ($PDK_VERSION)"
volare enable --pdk $PDK $PDK_VERSION PDK_VERSION=$(volare ls-remote --pdk $PDK_TECH | sed -n '1 p')
volare enable --pdk $PDK_TECH $PDK_VERSION
fi fi

14
scripts/xstartup Normal file
View File

@ -0,0 +1,14 @@
#!/bin/bash
# Wait for VNC server to start
sleep 2
while ! xdpyinfo -display $DISPLAY &> /dev/null;
do
echo "XServer not responsive, retrying..."
sleep 2
done
echo "XServer has been found, running desktop environment"
# Run desktop environment (XFCE)
dbus-launch xfce4-session --display=$DISPLAY