├── .github ├── FUNDING.yml └── workflows │ └── build-baseimage.yml ├── DOCKERHUB.md ├── Dockerfile ├── LICENSE ├── README.md ├── baseimagedefs.yml ├── helpers └── install_app_icon.sh ├── rootfs ├── defaults │ ├── default_audio.conf │ ├── default_auth.conf │ ├── default_fmgr.conf │ ├── default_ssl.conf │ └── default_stream.conf ├── etc │ ├── cont-env.d │ │ ├── DISPLAY │ │ ├── EGL_LOG_LEVEL │ │ ├── GSK_RENDERER │ │ ├── GTK2_RC_FILES │ │ ├── GTK_THEME │ │ ├── PULSE_CONFIG_PATH │ │ ├── PULSE_COOKIE │ │ ├── PULSE_SERVER │ │ └── QT_STYLE_OVERRIDE │ ├── cont-init.d │ │ ├── 10-certs.sh │ │ ├── 10-fontconfig-cache-dir.sh │ │ ├── 10-nginx.sh │ │ ├── 10-openbox.sh │ │ ├── 10-pulse.sh │ │ ├── 10-vnc-password.sh │ │ ├── 10-web-data.sh │ │ ├── 10-webauth.sh │ │ ├── 10-x11-unix.sh │ │ └── 15-cjk-font.sh │ ├── cont-logrotate.d │ │ └── nginx │ ├── gtk-4.0 │ │ └── settings.ini │ ├── logmonitor │ │ └── targets.d │ │ │ └── yad │ │ │ ├── debouncing │ │ │ └── send │ └── services.d │ │ ├── app │ │ └── gui.dep │ │ ├── audiorecorder │ │ ├── disabled │ │ ├── params │ │ ├── pulseaudio.dep │ │ ├── respawn │ │ └── run │ │ ├── certsmonitor │ │ ├── disabled │ │ ├── interval │ │ └── run │ │ ├── gui │ │ ├── audiorecorder.dep │ │ ├── certsmonitor.dep │ │ ├── nginx.dep │ │ ├── openbox.dep │ │ ├── pulseaudio.dep │ │ ├── webservices.dep │ │ ├── xcompmgr.dep │ │ ├── xrdb.dep │ │ └── xvnc.dep │ │ ├── nginx │ │ ├── certsmonitor.dep │ │ ├── is_ready │ │ ├── params │ │ ├── respawn │ │ ├── run │ │ ├── webauth.dep │ │ └── xvnc.dep │ │ ├── openbox │ │ ├── is_ready │ │ ├── params │ │ ├── respawn │ │ ├── run │ │ └── xvnc.dep │ │ ├── pulseaudio │ │ ├── disabled │ │ ├── params │ │ ├── respawn │ │ └── run │ │ ├── webauth │ │ ├── disabled │ │ ├── params │ │ ├── respawn │ │ └── run │ │ ├── webservices │ │ ├── disabled │ │ ├── params │ │ ├── respawn │ │ └── run │ │ ├── xcompmgr │ │ ├── openbox.dep │ │ ├── respawn │ │ └── run │ │ ├── xrdb │ │ ├── params │ │ ├── run │ │ └── xvnc.dep │ │ └── xvnc │ │ ├── is_ready │ │ ├── params │ │ ├── respawn │ │ └── run └── opt │ ├── base │ ├── bin │ │ └── webauth-user │ ├── etc │ │ ├── Xresources │ │ ├── daemon.conf │ │ ├── nginx │ │ │ ├── default_site.conf │ │ │ └── nginx.conf │ │ └── openbox │ │ │ ├── menu.xml │ │ │ └── rc.xml.template │ └── share │ │ └── themes │ │ ├── Dark │ │ ├── gtk-2.0 │ │ │ ├── assets │ │ │ │ ├── arrow_down_glow_normal.png │ │ │ │ ├── arrow_down_glow_prelight.png │ │ │ │ ├── arrow_down_insensitive_normal.png │ │ │ │ ├── arrow_down_light_normal.png │ │ │ │ ├── arrow_left_glow_normal.png │ │ │ │ ├── arrow_left_glow_prelight.png │ │ │ │ ├── arrow_left_insensitive_normal.png │ │ │ │ ├── arrow_left_light_normal.png │ │ │ │ ├── arrow_right_dark_selected.png │ │ │ │ ├── arrow_right_glow_normal.png │ │ │ │ ├── arrow_right_glow_prelight.png │ │ │ │ ├── arrow_right_insensitive_normal.png │ │ │ │ ├── arrow_right_light_normal.png │ │ │ │ ├── arrow_up_glow_normal.png │ │ │ │ ├── arrow_up_glow_prelight.png │ │ │ │ ├── arrow_up_insensitive_normal.png │ │ │ │ ├── arrow_up_light_normal.png │ │ │ │ ├── bevel_in.png │ │ │ │ ├── bevel_out.png │ │ │ │ ├── bevel_out_hollow.png │ │ │ │ ├── bg-entry.png │ │ │ │ ├── bg-spin.png │ │ │ │ ├── button_active.png │ │ │ │ ├── button_active_insensitive.png │ │ │ │ ├── button_default_glow.png │ │ │ │ ├── button_insensitive.png │ │ │ │ ├── button_normal.png │ │ │ │ ├── button_normal_prelight.png │ │ │ │ ├── button_spin_down_normal.png │ │ │ │ ├── button_spin_up_normal.png │ │ │ │ ├── frame_gap.png │ │ │ │ ├── hole_tiny.png │ │ │ │ ├── inset_shadow.png │ │ │ │ ├── inset_shadow_circle_tiny.png │ │ │ │ ├── inset_shadow_circle_tiny_in.png │ │ │ │ ├── inset_shadow_circle_tiny_ins.png │ │ │ │ ├── inset_shadow_circle_tiny_ins_glow.png │ │ │ │ ├── inset_shadow_square_tiny.png │ │ │ │ ├── inset_shadow_square_tiny_glow_in.png │ │ │ │ ├── inset_shadow_square_tiny_in.png │ │ │ │ ├── inset_shadow_tiny.png │ │ │ │ ├── items.png │ │ │ │ ├── knob.png │ │ │ │ ├── knob_insensitive.png │ │ │ │ ├── knob_prelight.png │ │ │ │ ├── menu.png │ │ │ │ ├── outline_glow.png │ │ │ │ ├── progressbar_bar.png │ │ │ │ ├── progressbar_trough_horiz.png │ │ │ │ ├── progressbar_trough_vert.png │ │ │ │ ├── scale_trough.png │ │ │ │ ├── scale_trough_vert.png │ │ │ │ ├── separated_bar_small_glow_bottom.png │ │ │ │ ├── separator_horiz.png │ │ │ │ ├── separator_vert.png │ │ │ │ ├── shadow_angled_in_sides_glow.png │ │ │ │ ├── shadow_angled_in_sides_left.png │ │ │ │ ├── shadow_angled_in_sides_right.png │ │ │ │ ├── shadow_angled_in_sides_top.png │ │ │ │ ├── slider_horiz.png │ │ │ │ ├── slider_horiz_active.png │ │ │ │ ├── slider_run_base_horiz.png │ │ │ │ ├── slider_run_base_vert.png │ │ │ │ ├── slider_vert.png │ │ │ │ ├── slider_vert_active.png │ │ │ │ ├── toolbar.png │ │ │ │ ├── trough_horiz.png │ │ │ │ └── trough_vert.png │ │ │ └── gtkrc │ │ └── openbox-3 │ │ │ ├── close.xbm │ │ │ ├── close_hover.xbm │ │ │ ├── desk.xbm │ │ │ ├── desk_hover.xbm │ │ │ ├── desk_toggled.xbm │ │ │ ├── iconify.xbm │ │ │ ├── iconify_hover.xbm │ │ │ ├── max.xbm │ │ │ ├── max_hover.xbm │ │ │ ├── max_toggled.xbm │ │ │ ├── shade.xbm │ │ │ ├── shade_hover.xbm │ │ │ └── themerc │ │ └── Light │ │ └── openbox-3 │ │ ├── close.xbm │ │ ├── close_hover.xbm │ │ ├── desk.xbm │ │ ├── desk_hover.xbm │ │ ├── desk_toggled.xbm │ │ ├── iconify.xbm │ │ ├── iconify_hover.xbm │ │ ├── max.xbm │ │ ├── max_hover.xbm │ │ ├── max_toggled.xbm │ │ ├── shade.xbm │ │ ├── shade_hover.xbm │ │ └── themerc │ └── noVNC │ ├── app │ ├── error-handler.js │ ├── fileManager.js │ ├── images │ │ ├── error.svg │ │ ├── info.svg │ │ └── warning.svg │ ├── msgpack-ygoe.min.js │ ├── pcm-player.js │ ├── styles │ │ ├── base.css │ │ └── base.css.orig │ ├── ui.js │ ├── unmute.js │ └── webutil.js │ ├── index.html │ ├── login │ ├── fonts │ │ ├── pxiByp8kv8JHgFVrLGT9V1s.ttf │ │ └── pxiEyp8kv8JHgFVrFJA.ttf │ ├── index.html │ ├── js.cookie.min.js │ ├── master_icon.png │ ├── styles │ │ ├── bootstrap.min.css │ │ └── login.css │ └── webdata.json │ └── webdata.json ├── src ├── audiorecorder │ ├── Makefile │ ├── audiorecorder-pulse.cpp │ ├── build.sh │ ├── cxxopts.hpp │ ├── plog │ │ ├── Appenders │ │ │ ├── AndroidAppender.h │ │ │ ├── ArduinoAppender.h │ │ │ ├── ColorConsoleAppender.h │ │ │ ├── ConsoleAppender.h │ │ │ ├── DebugOutputAppender.h │ │ │ ├── DynamicAppender.h │ │ │ ├── EventLogAppender.h │ │ │ ├── IAppender.h │ │ │ └── RollingFileAppender.h │ │ ├── Converters │ │ │ ├── NativeEOLConverter.h │ │ │ └── UTF8Converter.h │ │ ├── Formatters │ │ │ ├── CsvFormatter.h │ │ │ ├── FuncMessageFormatter.h │ │ │ ├── MessageOnlyFormatter.h │ │ │ └── TxtFormatter.h │ │ ├── Helpers │ │ │ ├── AscDump.h │ │ │ ├── HexDump.h │ │ │ └── PrintVar.h │ │ ├── Init.h │ │ ├── Initializers │ │ │ ├── ConsoleInitializer.h │ │ │ └── RollingFileInitializer.h │ │ ├── Log.h │ │ ├── Logger.h │ │ ├── Record.h │ │ ├── Severity.h │ │ ├── Util.h │ │ └── WinApi.h │ └── pulseaudio.patch ├── fontconfig │ └── build.sh ├── hsetroot │ ├── build.sh │ └── hsetroot.c ├── htpasswd │ └── build.sh ├── nginx │ └── build.sh ├── openbox │ ├── build.sh │ ├── config.sub │ ├── disable-x-locale.patch │ └── menu-file-order.patch ├── pulseaudio │ ├── Makefile │ ├── build.sh │ ├── daemon.patch │ ├── ltdl-static.c │ ├── meson-build.patch │ └── static-modules.patch ├── tigervnc │ ├── build.sh │ ├── disable-pam.patch │ ├── internal-conn-sec-types.patch │ ├── static-build.patch │ └── vncpasswd-static.patch ├── webauth │ ├── go.mod │ ├── go.sum │ ├── log │ │ └── log.go │ └── webauth.go ├── webservices │ ├── go.mod │ ├── go.sum │ ├── log │ │ └── log.go │ └── webservices.go ├── xcompmgr │ └── build.sh ├── xdpyprobe │ ├── Makefile │ ├── config.h │ └── xdpyprobe.c ├── xkbcomp │ └── build.sh ├── xkeyboard-config │ └── build.sh ├── xrdb │ └── build.sh └── yad │ ├── build.sh │ ├── cairo-meson-fix.patch │ └── gtk+-2.24.33-Fix-casts.patch ├── tests ├── setup_common.bash ├── setup_container_daemon.bash ├── teardown_common.bash ├── teardown_container_daemon.bash ├── test_cjk_font.bats ├── test_env_var_script.bats ├── test_env_var_script_exit_code.bats ├── test_exit_code.bats ├── test_init_scripts.bats ├── test_install_pkgs.bats ├── test_login_env_vars.bats ├── test_logmonitor_log_file.bats ├── test_logmonitor_status_file.bats ├── test_niceness.bats ├── test_pkgs_mirror.bats ├── test_port_availability.bats ├── test_secure_port_availability.bats └── test_tmp_dir_clean.bats └── tools └── ssvnc_windows_only-1.0.30-r1.zip /.github/FUNDING.yml: -------------------------------------------------------------------------------- 1 | # These are supported funding model platforms 2 | 3 | github: jlesage 4 | patreon: # Replace with a single Patreon username 5 | open_collective: # Replace with a single Open Collective username 6 | ko_fi: # Replace with a single Ko-fi username 7 | tidelift: # Replace with a single Tidelift platform-name/package-name e.g., npm/babel 8 | community_bridge: # Replace with a single Community Bridge project-name e.g., cloud-foundry 9 | liberapay: # Replace with a single Liberapay username 10 | issuehunt: # Replace with a single IssueHunt username 11 | otechie: # Replace with a single Otechie username 12 | custom: ["https://paypal.me/JocelynLeSage", "https://www.tesla.com/referral/jocelyn4590"] 13 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2024 Jocelyn Le Sage 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | 23 | -------------------------------------------------------------------------------- /rootfs/defaults/default_audio.conf: -------------------------------------------------------------------------------- 1 | location = /websockify-audio { 2 | websockify_pass unix:/tmp/vnc-audio.sock; 3 | websockify_read_timeout 5d; 4 | websockify_send_timeout 5d; 5 | } 6 | -------------------------------------------------------------------------------- /rootfs/defaults/default_fmgr.conf: -------------------------------------------------------------------------------- 1 | # Endpoints for file manager. 2 | location = /ws-filemanager { 3 | # Pass information of the sender. 4 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 5 | proxy_set_header X-Real-IP $remote_addr; 6 | proxy_set_header Upgrade $http_upgrade; 7 | proxy_set_header Connection $connection_upgrade; 8 | proxy_read_timeout 86400; 9 | 10 | # Forward request to the web services server. 11 | proxy_pass http://unix:/tmp/webservices.sock:/ws-filemanager; 12 | } 13 | 14 | location /download/ { 15 | # Pass information of the sender. 16 | proxy_set_header X-Forwarded-For $proxy_add_x_forwarded_for; 17 | proxy_set_header X-Real-IP $remote_addr; 18 | 19 | # Forward request to the web services server. 20 | proxy_pass http://unix:/tmp/webservices.sock:/download/; 21 | } 22 | -------------------------------------------------------------------------------- /rootfs/defaults/default_ssl.conf: -------------------------------------------------------------------------------- 1 | # Path to certificate files. 2 | ssl_certificate /config/certs/web-fullchain.pem; 3 | ssl_certificate_key /config/certs/web-privkey.pem; 4 | 5 | # Path of the file with Diffie-Hellman parameters for EDH ciphers. 6 | ssl_dhparam /config/certs/dhparam.pem; 7 | 8 | # Redirect HTTP traffic. 9 | # https://serverfault.com/a/664936 10 | error_page 497 301 =307 https://$http_host$request_uri; 11 | -------------------------------------------------------------------------------- /rootfs/defaults/default_stream.conf: -------------------------------------------------------------------------------- 1 | # This is the default stream configuration. This is used to terminate the SSL 2 | # connection for the VNC session. 3 | 4 | server { 5 | include /var/tmp/nginx/stream_listen.conf; 6 | 7 | proxy_pass unix:/tmp/vnc.sock; 8 | 9 | # Path to certificate files. 10 | ssl_certificate /config/certs/vnc-fullchain.pem; 11 | ssl_certificate_key /config/certs/vnc-privkey.pem; 12 | 13 | # Path of the file with Diffie-Hellman parameters for EDH ciphers. 14 | ssl_dhparam /config/certs/dhparam.pem; 15 | 16 | # SSL handshake timeout. 17 | ssl_handshake_timeout 10s; 18 | } 19 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/DISPLAY: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | # When running the container with host network mode, the Unix sockets from the 7 | # host somehow interfere with the container: event though they are not visible 8 | # in the container's file system, they can be seen by netstat. If the container 9 | # creates a socket matching one of the host, data written to it are handled by 10 | # the host, not the container. 11 | # Thus, we need to select a X display that is not already used. 12 | 13 | for D in $(seq 0 16) 14 | do 15 | if ! netstat -x | grep -q "/tmp/.X11-unix/X$D" 16 | then 17 | echo ":$D" 18 | exit 0 19 | fi 20 | done 21 | 22 | echo "ERROR: Could not find available display." 23 | exit 1 24 | 25 | # vim:ft=sh:ts=4:sw=4:et:sts=4 26 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/EGL_LOG_LEVEL: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${CONTAINER_DEBUG:-0}"; then 7 | exit 100 8 | else 9 | echo "fatal" 10 | fi 11 | 12 | # vim:ft=sh:ts=4:sw=4:et:sts=4 13 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/GSK_RENDERER: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # For GTK4 applications, this forces to use the cairo fallback renderer. Without 4 | # this, GTK tries to use the GL renderer, which fails and produces non fatal 5 | # errors. The GL render uses the X GLX extension, which is not supported by the 6 | # X # server of the baseimage. 7 | # 8 | 9 | set -e # Exit immediately if a command exits with a non-zero status. 10 | set -u # Treat unset variables as an error. 11 | 12 | echo "cairo" 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/GTK2_RC_FILES: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${DARK_MODE:-0}"; then 7 | # Dark mode enabled. 8 | echo "/opt/base/share/themes/Dark/gtk-2.0/gtkrc" 9 | else 10 | # Dark mode *not* enabled. Do not set the variable. 11 | exit 100 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/GTK_THEME: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${DARK_MODE:-0}"; then 7 | # Dark mode enabled. 8 | echo "Adwaita:dark" 9 | else 10 | # Dark mode *not* enabled. Do not set the variable. 11 | exit 100 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/PULSE_CONFIG_PATH: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 7 | # Audio support enabled. 8 | echo "/opt/base/etc/pulse" 9 | else 10 | # Audio support not enabled. Do not set the variable. 11 | exit 100 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/PULSE_COOKIE: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 7 | # Audio support enabled. 8 | echo "/tmp/pulseaudio.cookie" 9 | else 10 | # Audio support not enabled. Do not set the variable. 11 | exit 100 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/PULSE_SERVER: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 7 | # Audio support enabled. 8 | echo "unix:/tmp/pulseaudio.sock" 9 | else 10 | # Audio support not enabled. Do not set the variable. 11 | exit 100 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-env.d/QT_STYLE_OVERRIDE: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${DARK_MODE:-0}"; then 7 | # Dark mode enabled. 8 | echo "Adwaita-Dark" 9 | else 10 | # Dark mode *not* enabled. Do not set the variable. 11 | exit 100 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-certs.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Generate default certificate(s) when missing. 4 | # 5 | 6 | set -e # Exit immediately if a command exits with a non-zero status. 7 | set -u # Treat unset variables as an error. 8 | 9 | # Exit now if secure connection not enabled. 10 | is-bool-val-true "${SECURE_CONNECTION:-0}" || exit 0 11 | 12 | CERT_DIR=/config/certs 13 | TMP_DIR="$(mktemp -d)" 14 | 15 | mkdir -p "$CERT_DIR" 16 | 17 | # Generate DH parameters. 18 | if [ ! -f "$CERT_DIR"/dhparam.pem ]; then 19 | echo "generating DH parameters (2048 bits), this is going to take a long time..." 20 | env HOME="$TMP_DIR" openssl dhparam \ 21 | -out "$CERT_DIR"/dhparam.pem \ 22 | 2048 \ 23 | > /dev/null 2>&1 24 | fi 25 | 26 | # Generate certificate used by the WEB server (nginx). 27 | if [ ! -f "$CERT_DIR"/web-privkey.pem ] && [ ! -f "$CERT_DIR"/web-fullchain.pem ]; then 28 | echo "generating self-signed certificate for WEB server..." 29 | env HOME="$TMP_DIR" openssl req \ 30 | -x509 \ 31 | -nodes \ 32 | -days 3650 \ 33 | -newkey rsa:2048 \ 34 | -subj "/C=CA/O=github.com\\/jlesage\\/$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')/OU=Docker container web access/CN=web.$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-').example.com" \ 35 | -keyout "$CERT_DIR"/web-privkey.pem \ 36 | -out "$CERT_DIR"/web-fullchain.pem \ 37 | > /dev/null 2>&1 38 | chmod 400 "$CERT_DIR"/web-privkey.pem 39 | fi 40 | 41 | # If certificate from previous version is found, split it. 42 | if [ -f "$CERT_DIR"/vnc-server.pem ]; then 43 | echo "splitting $CERT_DIR/vnc-server.pem..." 44 | 45 | # Extract the private key. 46 | env HOME="$TMP_DIR" openssl pkey \ 47 | -in "$CERT_DIR"/vnc-server.pem \ 48 | -out "$CERT_DIR"/vnc-privkey.pem 49 | chmod 400 "$CERT_DIR"/vnc-privkey.pem 50 | 51 | # Extract certificates. 52 | env HOME="$TMP_DIR" openssl crl2pkcs7 \ 53 | -nocrl \ 54 | -certfile "$CERT_DIR"/vnc-server.pem \ 55 | | \ 56 | env HOME="$TMP_DIR" openssl pkcs7 \ 57 | -print_certs \ 58 | -out "$CERT_DIR"/vnc-fullchain.pem 59 | 60 | mv "$CERT_DIR"/vnc-server.pem "$CERT_DIR"/vnc-server.pem.converted 61 | fi 62 | 63 | # Generate certificate used by the VNC server. 64 | if [ ! -f "$CERT_DIR"/vnc-privkey.pem ] && [ ! -f "$CERT_DIR"/vnc-fullchain.pem ] ; then 65 | echo "generating self-signed certificate for VNC server..." 66 | env HOME="$TMP_DIR" openssl req \ 67 | -x509 \ 68 | -nodes \ 69 | -days 3650 \ 70 | -newkey rsa:2048 \ 71 | -subj "/C=CA/O=github.com\\/jlesage\\/$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-')/OU=Docker container VNC access/CN=vnc.$(echo "$APP_NAME" | tr '[:upper:]' '[:lower:]' | tr ' ' '-').example.com" \ 72 | -keyout "$CERT_DIR"/vnc-privkey.pem \ 73 | -out "$CERT_DIR"/vnc-fullchain.pem \ 74 | > /dev/null 2>&1 75 | chmod 400 "$CERT_DIR"/vnc-privkey.pem 76 | fi 77 | 78 | rm -rf "$TMP_DIR" 79 | 80 | [-d /var/run/certsmonitor ] || mkdir --mode=755 /var/run/certsmonitor 81 | chown "$USER_ID:$GROUP_ID" /var/run/certsmonitor 82 | 83 | # vim:ft=sh:ts=4:sw=4:et:sts=4 84 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-fontconfig-cache-dir.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | FONTCONFIG_CACHE_DIR=/config/xdg/cache/fontconfig 7 | 8 | # Make sure the fontconfig cache directory exists. This prevent the error 9 | # "Fontconfig error: No writable cache directories" that programs might 10 | # raise (e.g openbox). 11 | if [ ! -d "$FONTCONFIG_CACHE_DIR" ]; then 12 | mkdir -p "$FONTCONFIG_CACHE_DIR" 13 | fi 14 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-nginx.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | # 7 | # Adjust nginx virtual server configuration. 8 | # 9 | 10 | NGINX_DIRS="\ 11 | /config/log \ 12 | /config/log/nginx \ 13 | /var/run/nginx \ 14 | /var/tmp/nginx \ 15 | " 16 | 17 | LISTEN_CONF=/var/tmp/nginx/listen.conf 18 | SSL_CONF=/var/tmp/nginx/ssl.conf 19 | STREAM_CONF=/var/tmp/nginx/stream.conf 20 | STREAM_LISTEN_CONF=/var/tmp/nginx/stream_listen.conf 21 | AUDIO_CONF=/var/tmp/nginx/audio.conf 22 | AUTH_CONF=/var/tmp/nginx/auth.conf 23 | FMGR_CONF=/var/tmp/nginx/fmgr.conf 24 | 25 | # Make sure required directories exist. 26 | for DIR in $NGINX_DIRS; do 27 | [ -d "$DIR" ] || mkdir --mode=755 "$DIR" 28 | done 29 | 30 | # First, clear all dynamic config files. 31 | rm -f /var/tmp/nginx/*.conf 32 | 33 | # Generate the listen directive for HTTP access. 34 | if true; then 35 | # Determine the listen port. 36 | if [ "${WEB_LISTENING_PORT:-5800}" -eq -1 ]; then 37 | # Port disabled: listen only on a unix socket to make nginx happy. 38 | LISTEN_PORT="unix:/var/run/nginx/nginx.sock" 39 | else 40 | LISTEN_PORT="${WEB_LISTENING_PORT:-5800}" 41 | fi 42 | 43 | # Determine if secure port is used. 44 | if is-bool-val-true "${SECURE_CONNECTION:-0}"; then 45 | LISTEN_SSL="ssl" 46 | else 47 | LISTEN_SSL= 48 | fi 49 | 50 | # Add the listen directive. 51 | echo "listen $LISTEN_PORT $LISTEN_SSL default_server;" >> "$LISTEN_CONF" 52 | 53 | # Add the listen directive for IPv6. 54 | if [ "${WEB_LISTENING_PORT:-5800}" -ne -1 ] && ifconfig -a | grep -wq inet6; then 55 | echo "listen [::]:$LISTEN_PORT $LISTEN_SSL default_server;" >> "$LISTEN_CONF" 56 | fi 57 | fi 58 | 59 | # Handle SSL configuration. 60 | if is-bool-val-true "${SECURE_CONNECTION:-0}"; then 61 | cp -a /defaults/default_ssl.conf "$SSL_CONF" 62 | fi 63 | 64 | # Handle stream configuration. 65 | # The stream config is needed only when secure connection is enabled, with the 66 | # VNC method set to SSL. 67 | if is-bool-val-true "${SECURE_CONNECTION:-0}" && [ "${SECURE_CONNECTION_VNC_METHOD:-SSL}" = "SSL" ] && [ "${VNC_LISTENING_PORT:-5900}" -ne -1 ] 68 | then 69 | # Copy the default config. 70 | cp -a /defaults/default_stream.conf "$STREAM_CONF" 71 | 72 | # Generate the listen directive for stream config. 73 | echo "listen ${VNC_LISTENING_PORT:-5900} ssl;" >> "$STREAM_LISTEN_CONF" 74 | fi 75 | 76 | # Handle configuration for audio support. 77 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 78 | cp -a /defaults/default_audio.conf "$AUDIO_CONF" 79 | fi 80 | 81 | # Handle configuration for web authentication. 82 | if is-bool-val-true "${WEB_AUTHENTICATION:-0}"; then 83 | cp -a /defaults/default_auth.conf "$AUTH_CONF" 84 | else 85 | # Feature is disabled, so we need to prevent access to the login page. 86 | printf "location /login/ {" >> "$AUTH_CONF" 87 | printf "\treturn 404;" >> "$AUTH_CONF" 88 | printf "}" >> "$AUTH_CONF" 89 | fi 90 | 91 | # Handle configuration for file manager support. 92 | if is-bool-val-true "${WEB_FILE_MANAGER:-0}"; then 93 | cp -a /defaults/default_fmgr.conf "$FMGR_CONF" 94 | fi 95 | 96 | # Make sure required directories are properly owned. 97 | for DIR in $NGINX_DIRS; do 98 | chown $USER_ID:$GROUP_ID "$DIR" 99 | done 100 | 101 | # vim:ft=sh:ts=4:sw=4:et:sts=4 102 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-openbox.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | [ -d /var/run/openbox ] || mkdir --mode=755 /var/run/openbox 7 | chown $USER_ID:$GROUP_ID /var/run/openbox 8 | 9 | # 10 | # Setup the Openbox theme. 11 | # 12 | mkdir -p "$XDG_DATA_HOME"/themes 13 | rm -rf "$XDG_DATA_HOME"/themes/OpenboxTheme 14 | if is-bool-val-true "${DARK_MODE:-0}"; then 15 | cp -a /opt/base/share/themes/Dark "$XDG_DATA_HOME"/themes/OpenboxTheme 16 | else 17 | cp -a /opt/base/share/themes/Light "$XDG_DATA_HOME"/themes/OpenboxTheme 18 | fi 19 | 20 | # 21 | # Setup selection criterias of the main window. 22 | # 23 | 24 | APP_DEF_NAME= 25 | APP_DEF_CLASS= 26 | APP_DEF_GROUP_NAME= 27 | APP_DEF_GROUP_CLASS= 28 | APP_DEF_ROLE= 29 | APP_DEF_TITLE= 30 | APP_DEF_TYPE= 31 | 32 | set_app_def_vars() { 33 | F="$1" 34 | 35 | APP_DEF_NAME="$(cat "$F" | awk -F "[><]" '/Name/{print $3}')" 36 | APP_DEF_CLASS="$(cat "$F" | awk -F "[><]" '/Class/{print $3}')" 37 | APP_DEF_GROUP_NAME="$(cat "$F" | awk -F "[><]" '/GroupName/{print $3}')" 38 | APP_DEF_GROUP_CLASS="$(cat "$F" | awk -F "[><]" '/GroupClass/{print $3}')" 39 | APP_DEF_ROLE="$(cat "$F" | awk -F "[><]" '/Role/{print $3}')" 40 | APP_DEF_TITLE="$(cat "$F" | awk -F "[><]" '/Title/{print $3}')" 41 | APP_DEF_TYPE="$(cat "$F" | awk -F "[><]" '/Type/{print $3}')" 42 | 43 | # If using the JWM config, remove the begining `^` and ending `$` regex 44 | # characters, because they are not supported by Openbox. 45 | if [ "$F" = /etc/jwm/main-window-selection.jwmrc ]; then 46 | APP_DEF_NAME="$(echo "$APP_DEF_NAME" | sed 's/^\^//' | sed 's/\$$//')" 47 | APP_DEF_CLASS="$(echo "$APP_DEF_CLASS" | sed 's/^\^//' | sed 's/\$$//')" 48 | APP_DEF_GROUP_NAME="$(echo "$APP_DEF_GROUP_NAME" | sed 's/^\^//' | sed 's/\$$//')" 49 | APP_DEF_GROUP_CLASS="$(echo "$APP_DEF_GROUP_CLASS" | sed 's/^\^//' | sed 's/\$$//')" 50 | APP_DEF_ROLE="$(echo "$APP_DEF_ROLE" | sed 's/^\^//' | sed 's/\$$//')" 51 | APP_DEF_TITLE="$(echo "$APP_DEF_TITLE" | sed 's/^\^//' | sed 's/\$$//')" 52 | APP_DEF_TYPE="$(echo "$APP_DEF_TYPE" | sed 's/^\^//' | sed 's/\$$//')" 53 | fi 54 | } 55 | 56 | if [ -f /etc/openbox/main-window-selection.xml ]; then 57 | set_app_def_vars /etc/openbox/main-window-selection.xml 58 | elif [ -f /etc/jwm/main-window-selection.jwmrc ]; then 59 | set_app_def_vars /etc/jwm/main-window-selection.jwmrc 60 | else 61 | APP_DEF_TYPE=normal 62 | fi 63 | 64 | # Generate matching criterias. 65 | CRITERIAS= 66 | if [ -n "$APP_DEF_NAME" ]; then 67 | CRITERIAS="$CRITERIAS name=\"$APP_DEF_NAME\"" 68 | fi 69 | if [ -n "$APP_DEF_CLASS" ]; then 70 | CRITERIAS="$CRITERIAS class=\"$APP_DEF_CLASS\"" 71 | fi 72 | if [ -n "$APP_DEF_GROUP_NAME" ]; then 73 | CRITERIAS="$CRITERIAS groupname=\"$APP_DEF_GROUP_NAME\"" 74 | fi 75 | if [ -n "$APP_DEF_GROUP_CLASS" ]; then 76 | CRITERIAS="$CRITERIAS groupclass=\"$APP_DEF_GROUP_CLASS\"" 77 | fi 78 | if [ -n "$APP_DEF_ROLE" ]; then 79 | CRITERIAS="$CRITERIAS role=\"$APP_DEF_ROLE\"" 80 | fi 81 | if [ -n "$APP_DEF_TITLE" ]; then 82 | CRITERIAS="$CRITERIAS title=\"$APP_DEF_TITLE\"" 83 | fi 84 | if [ -n "$APP_DEF_TYPE" ]; then 85 | CRITERIAS="$CRITERIAS type=\"$APP_DEF_TYPE\"" 86 | fi 87 | 88 | # Write the final Openbox config file. 89 | cat /opt/base/etc/openbox/rc.xml.template | sed "s/%MAIN_APP_WINDOW_MATCH_CRITERIAS%/$CRITERIAS/" > /var/run/openbox/rc.xml 90 | 91 | # vim:ft=sh:ts=4:sw=4:et:sts=4 92 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-pulse.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | # Nothing to do if audio support is disabled. 7 | if is-bool-val-false "${WEB_AUDIO:-0}"; then 8 | exit 0 9 | fi 10 | 11 | # Create a new random cookie. 12 | dd if=/dev/urandom of="$PULSE_COOKIE" bs=256 count=1 2>/dev/null 13 | 14 | # Adjust ownership and permissions. 15 | chmod 400 "$PULSE_COOKIE" 16 | chown $USER_ID:$GROUP_ID "$PULSE_COOKIE" 17 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-vnc-password.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | # 4 | # Handle the VNC password. 5 | # 6 | 7 | set -e # Exit immediately if a command exits with a non-zero status. 8 | set -u # Treat unset variables as an error. 9 | 10 | VNCPASSWD_BIN=/opt/base/bin/vncpasswd 11 | 12 | # If password is saved in clear, obfuscate it to a new file. 13 | if [ -f /config/.vncpass_clear ]; then 14 | echo "obfuscating VNC password..." 15 | rm -f /config/.vncpass 16 | cat /config/.vncpass_clear | "$VNCPASSWD_BIN" -f > /config/.vncpass 17 | rm /config/.vncpass_clear 18 | fi 19 | 20 | # If password is set in a file, use it. Else, use the password stored in the 21 | # environment variable. 22 | if [ -f /config/.vncpass ]; then 23 | echo "VNC password file found." 24 | elif [ -n "${VNC_PASSWORD:-}" ]; then 25 | echo "creating VNC password file from environment variable..." 26 | echo "$VNC_PASSWORD" | "$VNCPASSWD_BIN" -f > /tmp/.vncpass 27 | fi 28 | 29 | # Adjust ownership and permissions of password files. 30 | for FILE in /config/.vncpass /tmp/.vncpass; do 31 | if [ -f "$FILE" ]; then 32 | chown $USER_ID:$GROUP_ID "$FILE" 33 | chmod 400 "$FILE" 34 | fi 35 | done 36 | 37 | # vim:ft=sh:ts=4:sw=4:et:sts=4 38 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-web-data.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | is_number() { 7 | case "${1:-}" in 8 | ''|*[!0-9]*) return 1 ;; 9 | *) return 0 ;; 10 | esac 11 | } 12 | 13 | WEB_DATA_FILE="/tmp/.webdata.json" 14 | 15 | rm -f "$WEB_DATA_FILE" 16 | 17 | # Beginning of the JSON file. 18 | printf '{\n' >> "$WEB_DATA_FILE" 19 | 20 | # Container instance UID. 21 | printf ' "containerInstanceUID": "%s"' "$(cat /.docker-instance/uuid)" >> "$WEB_DATA_FILE" 22 | 23 | # Add application name. 24 | printf ',\n "applicationName": "%s"' "$APP_NAME" >> "$WEB_DATA_FILE" 25 | 26 | # Add application version. 27 | if [ -n "${APP_VERSION:-}" ]; then 28 | printf ',\n "applicationVersion": "%s"' "$APP_VERSION" >> "$WEB_DATA_FILE" 29 | fi 30 | 31 | # Add Docker image version. 32 | if [ -n "${DOCKER_IMAGE_VERSION:-}" ]; then 33 | printf ',\n "dockerImageVersion": "%s"' "$DOCKER_IMAGE_VERSION" >> "$WEB_DATA_FILE" 34 | fi 35 | 36 | # Add dark mode. 37 | if is-bool-val-true "${DARK_MODE:-0}"; then 38 | printf ',\n "darkMode": true' >> "$WEB_DATA_FILE" 39 | else 40 | printf ',\n "darkMode": false' >> "$WEB_DATA_FILE" 41 | fi 42 | 43 | # Add application's window width. 44 | if is_number "${DISPLAY_WIDTH:-}"; then 45 | printf ',\n "applicationWindowWidth": %s' "$DISPLAY_WIDTH" >> "$WEB_DATA_FILE" 46 | fi 47 | 48 | # Add application's window height. 49 | if is_number "${DISPLAY_HEIGHT:-}"; then 50 | printf ',\n "applicationWindowHeight": %s' "$DISPLAY_HEIGHT" >> "$WEB_DATA_FILE" 51 | fi 52 | 53 | # Add audio support. 54 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 55 | printf ',\n "audioSupport": true' >> "$WEB_DATA_FILE" 56 | else 57 | printf ',\n "audioSupport": false' >> "$WEB_DATA_FILE" 58 | fi 59 | 60 | # Add web authentication support. 61 | if is-bool-val-true "${WEB_AUTHENTICATION:-0}"; then 62 | printf ',\n "webAuthSupport": true' >> "$WEB_DATA_FILE" 63 | else 64 | printf ',\n "webAuthSupport": false' >> "$WEB_DATA_FILE" 65 | fi 66 | 67 | # Add file manager support. 68 | if is-bool-val-true "${WEB_FILE_MANAGER:-0}"; then 69 | printf ',\n "fileManager": true' >> "$WEB_DATA_FILE" 70 | else 71 | printf ',\n "fileManager": false' >> "$WEB_DATA_FILE" 72 | fi 73 | 74 | # End of the JSON file. 75 | printf '\n}\n' >> "$WEB_DATA_FILE" 76 | 77 | # Make sure the file has the right permissions. 78 | chmod 444 "$WEB_DATA_FILE" 79 | 80 | # vim:ft=sh:ts=4:sw=4:et:sts=4 81 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-webauth.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | PASSWORD_FILE="/config/webauth-htpasswd" 7 | 8 | # Nothing to do if web authentication is disabled. 9 | if is-bool-val-false "${WEB_AUTHENTICATION:-0}"; then 10 | exit 0 11 | fi 12 | 13 | # Verify that secure connection is enabled. 14 | if is-bool-val-false "${SECURE_CONNECTION:-0}"; then 15 | echo "ERROR: web authentication requires secure connection to be enabled." 16 | echo " make sure to set SECURE_CONNECTION=1 environment variable." 17 | exit 1 18 | fi 19 | 20 | # Make sure the password db exists. 21 | [ -f "$PASSWORD_FILE" ] || touch "$PASSWORD_FILE" 22 | 23 | # Set permissions of the password db. 24 | chmod 600 "$PASSWORD_FILE" 25 | 26 | if [ -z "${WEB_AUTHENTICATION_USERNAME:-}" ] && [ -z "${WEB_AUTHENTICATION_PASSWORD:-}" ]; then 27 | if [ "$(stat -c "%s" "$PASSWORD_FILE")" -eq 0 ]; then 28 | echo "WARNING: no user configured for web authentication" 29 | fi 30 | elif [ -z "${WEB_AUTHENTICATION_USERNAME:-}" ] || [ -z "${WEB_AUTHENTICATION_PASSWORD:-}" ]; then 31 | echo "ERROR: missing username/password for configured web authentication user" 32 | echo " make sure that both WEB_AUTHENTICATION_USERNAME and WEB_AUTHENTICATION_PASSWORD" 33 | echo " environment variables are set." 34 | exit 1 35 | else 36 | # Add password to database. 37 | echo "$WEB_AUTHENTICATION_PASSWORD" | htpasswd -i "$PASSWORD_FILE" "$WEB_AUTHENTICATION_USERNAME" 38 | fi 39 | 40 | # vim:ft=sh:ts=4:sw=4:et:sts=4 41 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/10-x11-unix.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | # Since Xvnc is not running as root, we need to create /tmp/.X11-unix before 7 | # it starts to avoid complains. 8 | mkdir -p /tmp/.X11-unix 9 | chmod 1777 /tmp/.X11-unix 10 | -------------------------------------------------------------------------------- /rootfs/etc/cont-init.d/15-cjk-font.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${ENABLE_CJK_FONT:-0}"; then 7 | if [ -d /usr/share/fonts/truetype/wqy ] || [ -d /usr/share/fonts/wenquanyi ] || [ -d /usr/share/fonts/wqy-zenhei ] 8 | then 9 | echo "CJK font already installed." 10 | else 11 | echo "installing CJK font..." 12 | if command -v apk >/dev/null; then 13 | if apk --no-cache info font-wqy-zenhei > /dev/null 14 | then 15 | add-pkg font-wqy-zenhei 16 | else 17 | add-pkg font-wqy-zenhei --repository "${PACKAGES_MIRROR:-https://dl-cdn.alpinelinux.org/alpine}/v3.19/community" 18 | fi 19 | else 20 | add-pkg fonts-wqy-zenhei 21 | fi 22 | fi 23 | fi 24 | 25 | # vim:ft=sh:ts=4:sw=4:et:sts=4 26 | -------------------------------------------------------------------------------- /rootfs/etc/cont-logrotate.d/nginx: -------------------------------------------------------------------------------- 1 | /config/log/nginx/access.log /config/log/nginx/error.log { 2 | monthly 3 | rotate 6 4 | compress 5 | missingok 6 | notifempty 7 | sharedscripts 8 | postrotate 9 | [ ! -f /var/run/nginx/nginx.pid ] || kill -USR1 `cat /var/run/nginx/nginx.pid` 10 | endscript 11 | } 12 | -------------------------------------------------------------------------------- /rootfs/etc/gtk-4.0/settings.ini: -------------------------------------------------------------------------------- 1 | # 2 | # Default settings for GTK4 applications. 3 | # https://docs.gtk.org/gtk4/class.Settings.html 4 | # 5 | [Settings] 6 | gtk-decoration-layout = menu:maximize,close 7 | gtk-titlebar-right-click = none 8 | gtk-titlebar-middle-click = none 9 | gtk-titlebar-double-click = toggle-maximize 10 | -------------------------------------------------------------------------------- /rootfs/etc/logmonitor/targets.d/yad/debouncing: -------------------------------------------------------------------------------- 1 | 0 2 | -------------------------------------------------------------------------------- /rootfs/etc/logmonitor/targets.d/yad/send: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | TITLE="$1" 7 | MSG="$2" 8 | LEVEL="$3" 9 | 10 | exec /opt/base/bin/yad \ 11 | --on-top \ 12 | --fixed \ 13 | --center \ 14 | --title "$APP_NAME" \ 15 | --window-icon /opt/noVNC/app/images/icons/master_icon.png \ 16 | --borders 10 \ 17 | --image dialog-warning \ 18 | --image-on-top \ 19 | --text "$TITLE" \ 20 | --form \ 21 | --field "$MSG:LBL" \ 22 | --button=gtk-ok:0 > /dev/null 2>&1 23 | 24 | # vim:ft=sh:ts=4:sw=4:et:sts=4 25 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/app/gui.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/app/gui.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/audiorecorder/disabled: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 7 | echo "false" 8 | else 9 | echo "true" 10 | fi 11 | 12 | # vim:ft=sh:ts=4:sw=4:et:sts=4 13 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/audiorecorder/params: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | echo "--latency-msec" 6 | echo "10" 7 | 8 | if is-bool-val-true "${CONTAINER_DEBUG:-0}"; then 9 | echo "--debug" 10 | else 11 | echo "--info" 12 | fi 13 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/audiorecorder/pulseaudio.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/audiorecorder/pulseaudio.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/audiorecorder/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/audiorecorder/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/audiorecorder/run: -------------------------------------------------------------------------------- 1 | /opt/base/bin/audiorecorder -------------------------------------------------------------------------------- /rootfs/etc/services.d/certsmonitor/disabled: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-false "${SECURE_CONNECTION:-0}"; then 7 | echo "true" 8 | elif [ "${SECURE_CONNECTION_CERTS_CHECK_INTERVAL:-10}" -eq 0 ]; then 9 | echo "true" 10 | else 11 | echo "false" 12 | fi 13 | 14 | # vim:ft=sh:ts=4:sw=4:et:sts=4 15 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/certsmonitor/interval: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | echo "${SECURE_CONNECTION_CERTS_CHECK_INTERVAL:-60}" 7 | 8 | # vim:ft=sh:ts=4:sw=4:et:sts=4 9 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/certsmonitor/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | WEB_CERTS="/config/certs/web-privkey.pem /config/certs/web-fullchain.pem" 6 | VNC_CERTS="/config/certs/vnc-privkey.pem /config/certs/vnc-fullchain.pem" 7 | DH_PARAMS="/config/certs/dhparam.pem" 8 | 9 | RUN_DIR=/var/run/certsmonitor 10 | 11 | WEB_CERTS_HASH_FILE="$RUN_DIR"/web_certs_hash 12 | VNC_CERTS_HASH_FILE="$RUN_DIR"/vnc_certs_hash 13 | DH_PARAMS_HASH_FILE="$RUN_DIR"/dh_params_hash 14 | 15 | hash() { 16 | stat -c '%n %s %Y' "$@" | md5sum | cut -d' ' -f1 17 | } 18 | 19 | restart_nginx() { 20 | echo "Restarting nginx..." 21 | /usr/sbin/nginx -s reload 22 | } 23 | 24 | restart_xvnc() { 25 | echo "Restarting Xvnc..." 26 | killall Xvnc 27 | } 28 | 29 | [ -d "$RUN_DIR" ] || mkdir --mode=755 "$RUN_DIR" 30 | 31 | # Get previous hashes. 32 | WEB_CERTS_HASH="$(cat "$WEB_CERTS_HASH_FILE" 2>/dev/null || true)" 33 | VNC_CERTS_HASH="$(cat "$VNC_CERTS_HASH_FILE" 2>/dev/null || true)" 34 | DH_PARAMS_HASH="$(cat "$DH_PARAMS_HASH_FILE" 2>/dev/null || true)" 35 | 36 | # Get new hashes. 37 | WEB_CERTS_NEW_HASH="$(hash $WEB_CERTS)" 38 | VNC_CERTS_NEW_HASH="$(hash $VNC_CERTS)" 39 | DH_PARAMS_NEW_HASH="$(hash $DH_PARAMS)" 40 | 41 | UPDATE_HASHES=0 42 | 43 | if [ -n "$WEB_CERTS_HASH" ] && [ -n "$VNC_CERTS_HASH" ] && [ -n "$DH_PARAMS_HASH" ]; then 44 | # Restart nginx if certificates changed. 45 | if [ "$WEB_CERTS_NEW_HASH" != "$WEB_CERTS_HASH" ]; then 46 | echo "Web certificates changed." 47 | UPDATE_HASHES=1 48 | restart_nginx 49 | elif [ "$DH_PARAMS_NEW_HASH" != "$DH_PARAMS_HASH" ]; then 50 | echo "DH parameters changed." 51 | UPDATE_HASHES=1 52 | restart_nginx 53 | fi 54 | 55 | # Restart xvnc if certificates changed. 56 | if [ "$VNC_CERTS_NEW_HASH" != "$VNC_CERTS_HASH" ]; then 57 | echo "VNC certificates changed." 58 | UPDATE_HASHES=1 59 | restart_xvnc 60 | fi 61 | else 62 | UPDATE_HASHES=1 63 | fi 64 | 65 | # Save new hashes. 66 | if [ "$UPDATE_HASHES" -eq 1 ]; then 67 | echo "$WEB_CERTS_NEW_HASH" > "$WEB_CERTS_HASH_FILE" 68 | echo "$VNC_CERTS_NEW_HASH" > "$VNC_CERTS_HASH_FILE" 69 | echo "$DH_PARAMS_NEW_HASH" > "$DH_PARAMS_HASH_FILE" 70 | fi 71 | 72 | # vim:ft=sh:ts=4:sw=4:et:sts=4 73 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/audiorecorder.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/audiorecorder.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/certsmonitor.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/certsmonitor.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/nginx.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/nginx.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/openbox.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/openbox.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/pulseaudio.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/pulseaudio.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/webservices.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/webservices.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/xcompmgr.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/xcompmgr.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/xrdb.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/xrdb.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/gui/xvnc.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/gui/xvnc.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/certsmonitor.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/nginx/certsmonitor.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/is_ready: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | if [ "${WEB_LISTENING_PORT:-5800}" -eq -1 ]; then 6 | [ -S /var/run/nginx/nginx.sock ] 7 | else 8 | nc -w5 -z 127.0.0.1 "${WEB_LISTENING_PORT:-5800}" 9 | fi 10 | 11 | # vim:ft=sh:ts=4:sw=4:et:sts=4 12 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/params: -------------------------------------------------------------------------------- 1 | -c 2 | /opt/base/etc/nginx/nginx.conf 3 | -g 4 | daemon off; 5 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/nginx/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if [ "${WEB_LISTENING_PORT:-5800}" -eq -1 ]; then 7 | echo "Not listening for web connections." 8 | else 9 | if is-bool-val-false "${SECURE_CONNECTION:-0}"; then 10 | CONN_TYPE="HTTP" 11 | else 12 | CONN_TYPE="HTTPs" 13 | fi 14 | echo "Listening for $CONN_TYPE connections on port ${WEB_LISTENING_PORT:-5800}." 15 | fi 16 | 17 | exec /opt/base/sbin/nginx "$@" 18 | 19 | # vim:ft=sh:ts=4:sw=4:et:sts=4 20 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/webauth.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/nginx/webauth.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/nginx/xvnc.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/nginx/xvnc.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/openbox/is_ready: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | [ -f /var/run/openbox/openbox.ready ] 4 | 5 | # vim:ft=sh:ts=4:sw=4:et:sts=4 6 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/openbox/params: -------------------------------------------------------------------------------- 1 | --config-file 2 | /var/run/openbox/rc.xml 3 | --startup 4 | touch /var/run/openbox/openbox.ready 5 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/openbox/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/openbox/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/openbox/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | rm -f /var/run/openbox/openbox.ready 7 | 8 | exec /opt/base/bin/openbox "$@" 9 | 10 | # vim:ft=sh:ts=4:sw=4:et:sts=4 11 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/openbox/xvnc.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/openbox/xvnc.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/pulseaudio/disabled: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_AUDIO:-0}"; then 7 | echo "false" 8 | else 9 | echo "true" 10 | fi 11 | 12 | # vim:ft=sh:ts=4:sw=4:et:sts=4 13 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/pulseaudio/params: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | echo "--disallow-module-loading" 6 | echo "--disallow-exit" 7 | echo "--exit-idle-time=-1" 8 | echo "--realtime=false" 9 | echo "-n" # Don't load default script file 10 | echo "--load=module-null-sink" 11 | echo "--load=module-native-protocol-unix socket=/tmp/pulseaudio.sock auth-anonymous=1 auth-cookie=$PULSE_COOKIE" 12 | 13 | if is-bool-val-true "${CONTAINER_DEBUG:-0}"; then 14 | echo "--log-level=4" 15 | echo "--verbose" 16 | fi 17 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/pulseaudio/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/pulseaudio/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/pulseaudio/run: -------------------------------------------------------------------------------- 1 | /opt/base/bin/pulseaudio -------------------------------------------------------------------------------- /rootfs/etc/services.d/webauth/disabled: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_AUTHENTICATION:-0}" && is-bool-val-true "${SECURE_CONNECTION:-0}"; then 7 | echo "false" 8 | else 9 | echo "true" 10 | fi 11 | 12 | # vim:ft=sh:ts=4:sw=4:et:sts=4 13 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/webauth/params: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | if is-bool-val-true "${CONTAINER_DEBUG:-0}"; then 6 | echo "--log-level" 7 | echo "debug" 8 | fi 9 | 10 | # Token validity time. 11 | echo "--token-validity-time" 12 | echo "${WEB_AUTHENTICATION_TOKEN_VALIDITY_TIME:-24}" 13 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/webauth/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/webauth/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/webauth/run: -------------------------------------------------------------------------------- 1 | /opt/base/bin/webauth -------------------------------------------------------------------------------- /rootfs/etc/services.d/webservices/disabled: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | if is-bool-val-true "${WEB_FILE_MANAGER:-0}"; then 7 | echo "false" 8 | else 9 | echo "true" 10 | fi 11 | 12 | # vim:ft=sh:ts=4:sw=4:et:sts=4 13 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/webservices/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/webservices/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/webservices/run: -------------------------------------------------------------------------------- 1 | /opt/base/bin/webservices -------------------------------------------------------------------------------- /rootfs/etc/services.d/xcompmgr/openbox.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/xcompmgr/openbox.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/xcompmgr/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/xcompmgr/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/xcompmgr/run: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | # Prevent background to turn grey when starting xcompmgr. 7 | hsetroot -solid black 8 | 9 | exec /opt/base/bin/xcompmgr "$@" 10 | 11 | # vim:ft=sh:ts=4:sw=4:et:sts=4 12 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/xrdb/params: -------------------------------------------------------------------------------- 1 | /opt/base/etc/Xresources 2 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/xrdb/run: -------------------------------------------------------------------------------- 1 | /opt/base/bin/xrdb -------------------------------------------------------------------------------- /rootfs/etc/services.d/xrdb/xvnc.dep: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/xrdb/xvnc.dep -------------------------------------------------------------------------------- /rootfs/etc/services.d/xvnc/is_ready: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | /opt/base/bin/xdpyprobe --quiet 6 | 7 | # vim:ft=sh:ts=4:sw=4:et:sts=4 8 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/xvnc/params: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -u # Treat unset variables as an error. 4 | 5 | # Activate debug logging. 6 | if is-bool-val-true "${CONTAINER_DEBUG:-0}"; then 7 | echo "-Log" 8 | echo "*:stderr:100" 9 | echo "-verbose" 10 | echo "10" 11 | fi 12 | 13 | # Make sure the X server listens on Unix only. 14 | echo "-nolisten" 15 | echo "tcp" 16 | echo "-nolisten" 17 | echo "local" 18 | echo "-listen" 19 | echo "unix" 20 | 21 | # Window size. 22 | echo "-geometry" 23 | echo "${DISPLAY_WIDTH}x${DISPLAY_HEIGHT}" 24 | 25 | # Color depth. 26 | echo "-depth" 27 | echo "24" 28 | 29 | # VNC listening port. 30 | if [ "${VNC_LISTENING_PORT:-5900}" -eq -1 ]; then 31 | # VNC port is disabled. 32 | echo "-rfbport=-1" 33 | elif is-bool-val-true "${SECURE_CONNECTION:-0}" && [ "${SECURE_CONNECTION_VNC_METHOD:-SSL}" = "SSL" ]; then 34 | # SSL secure connection enabled: disable TCP listening. Nginx is handling 35 | # the SSL connection and forward VNC to Xvnc via Unix socket. 36 | echo "-rfbport=-1" 37 | else 38 | echo "-rfbport=${VNC_LISTENING_PORT:-5900}" 39 | 40 | # Support for IPv6. 41 | if ifconfig -a | grep -wq inet6; then 42 | echo "-UseIPv6=yes" 43 | else 44 | echo "-UseIPv6=no" 45 | fi 46 | fi 47 | 48 | # VNC Unix socket. 49 | echo "-rfbunixpath=/tmp/vnc.sock" 50 | echo "-rfbunixmode=0660" 51 | 52 | # VNC security. 53 | # 54 | # None: No authentication, no encryption. 55 | # VncAuth: Standard VNC authentication, no encryption. 56 | # Plain: 57 | # TLSNone: No authentication, TLS encryption. 58 | # TLSVnc: Standard VNC authentication, TLS encryption 59 | # TLSPlain: 60 | # X509None: No authentication, TLS encryption with server certificate verification. 61 | # X509Vnc: Standard VNC authentication, TLS encryption with server certificate verification. 62 | # X509Plain: 63 | # 64 | PASSWORD_FILE= 65 | if [ -f /config/.vncpass ] && [ -n "$( cat /config/.vncpass )" ]; then 66 | PASSWORD_FILE=/config/.vncpass 67 | elif [ -f /tmp/.vncpass ] && [ -n "$( cat /tmp/.vncpass )" ]; then 68 | PASSWORD_FILE=/tmp/.vncpass 69 | fi 70 | 71 | if [ -n "$PASSWORD_FILE" ]; then 72 | # With password. 73 | if is-bool-val-false "${SECURE_CONNECTION:-0}" || [ "${SECURE_CONNECTION_VNC_METHOD:-SSL}" = "SSL" ]; then 74 | echo "-SecurityTypes=VncAuth" 75 | else 76 | echo "-SecurityTypes=X509Vnc,TLSVnc" 77 | fi 78 | if is-bool-val-true "${WEB_AUTHENTICATION:-0}"; then 79 | echo "-InternalConnectionSecurityTypes=None" 80 | else 81 | echo "-InternalConnectionSecurityTypes=VncAuth" 82 | fi 83 | echo "-rfbauth=$PASSWORD_FILE" 84 | else 85 | # Without password. 86 | if is-bool-val-false "${SECURE_CONNECTION:-0}" || [ "${SECURE_CONNECTION_VNC_METHOD:-SSL}" = "SSL" ]; then 87 | echo "-SecurityTypes=None" 88 | else 89 | echo "-SecurityTypes=X509None,TLSNone" 90 | fi 91 | echo "-InternalConnectionSecurityTypes=None" 92 | fi 93 | 94 | if is-bool-val-true "${SECURE_CONNECTION:-0}" && [ "${SECURE_CONNECTION_VNC_METHOD:-SSL}" != "SSL" ]; then 95 | echo "-X509Key" 96 | echo "/config/certs/vnc-privkey.pem" 97 | echo "-X509Cert" 98 | echo "/config/certs/vnc-fullchain.pem" 99 | fi 100 | 101 | # Desktop (app) name. 102 | echo "-desktop=$APP_NAME" 103 | 104 | # X11 display. 105 | echo "$DISPLAY" 106 | -------------------------------------------------------------------------------- /rootfs/etc/services.d/xvnc/respawn: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/etc/services.d/xvnc/respawn -------------------------------------------------------------------------------- /rootfs/etc/services.d/xvnc/run: -------------------------------------------------------------------------------- 1 | /opt/base/bin/Xvnc -------------------------------------------------------------------------------- /rootfs/opt/base/bin/webauth-user: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | 3 | set -e # Exit immediately if a command exits with a non-zero status. 4 | set -u # Treat unset variables as an error. 5 | 6 | CMD="${1:-}" 7 | USERNAME="${2:-}" 8 | PASSWORD_FILE="/config/webauth-htpasswd" 9 | 10 | die() { 11 | echo "ERROR: $*" 12 | exit 1 13 | } 14 | 15 | [ -n "$CMD" ] || die "Command must be specified: add, del, update or list." 16 | 17 | case "$CMD" in 18 | add|update) 19 | # Do some validations. 20 | [ -t 0 ] || die "This must be run interactively." 21 | [ -n "$USERNAME" ] || die "Username must be specified." 22 | [ -f "$PASSWORD_FILE" ] || die "Password database not found." 23 | 24 | # Add user. 25 | /opt/base/bin/htpasswd -B "$PASSWORD_FILE" "$USERNAME" 26 | 27 | # Reload the password file. 28 | killall -SIGHUP webauth 29 | ;; 30 | del) 31 | # Do some validations. 32 | [ -n "$USERNAME" ] || die "Username must be specified." 33 | [ -f "$PASSWORD_FILE" ] || die "Password database not found." 34 | 35 | # Remove user. 36 | /opt/base/bin/htpasswd -D "$PASSWORD_FILE" "$USERNAME" 37 | 38 | # Reload the password file. 39 | killall -SIGHUP webauth 40 | ;; 41 | list) 42 | # Do some validations. 43 | [ -f "$PASSWORD_FILE" ] || die "Password database not found." 44 | 45 | # Display list of users. 46 | cat "$PASSWORD_FILE" | cut -d':' -f1 47 | ;; 48 | *) 49 | die "Invalid command. Must be add, del, update or list." 50 | ;; 51 | esac 52 | -------------------------------------------------------------------------------- /rootfs/opt/base/etc/Xresources: -------------------------------------------------------------------------------- 1 | Xft.antialias: 1 2 | Xft.rgba: rgb 3 | Xft.autohint: 1 4 | Xft.hinting: 1 5 | Xft.hintstyle: hintslight 6 | -------------------------------------------------------------------------------- /rootfs/opt/base/etc/daemon.conf: -------------------------------------------------------------------------------- 1 | # Intentionally left blank. 2 | -------------------------------------------------------------------------------- /rootfs/opt/base/etc/nginx/default_site.conf: -------------------------------------------------------------------------------- 1 | # This is a default site configuration. 2 | 3 | map $http_upgrade $connection_upgrade { 4 | default upgrade; 5 | '' close; 6 | } 7 | 8 | server { 9 | # Include listen directives. 10 | include /var/tmp/nginx/listen.conf; 11 | 12 | # Include optional ssl config. 13 | include /var/tmp/nginx/ssl[.]conf; 14 | 15 | # https://github.com/novnc/noVNC/blob/master/docs/EMBEDDING.md#browser-cache-issue 16 | add_header Cache-Control no-cache; 17 | 18 | root /opt/noVNC; 19 | index index.html; 20 | 21 | location = /websockify { 22 | websockify_pass unix:/tmp/vnc.sock; 23 | websockify_read_timeout 5d; 24 | websockify_send_timeout 5d; 25 | } 26 | 27 | # Optional include for audio support. 28 | include /var/tmp/nginx/audio[.]conf; 29 | 30 | # Optional include for web authentication support. 31 | include /var/tmp/nginx/auth[.]conf; 32 | 33 | # Optional include for file manager support. 34 | include /var/tmp/nginx/fmgr[.]conf; 35 | 36 | # Access to favicons. 37 | location ~* ^/(browserconfig.xml|site.webmanifest|safari-pinned-tab.svg|((favicon|apple-touch-icon|android-chrome|mstile)(.*)\.(ico|png)))$ { 38 | root /opt/noVNC/app/images/icons; 39 | 40 | # Authentication check not required for favicons. 41 | auth_request off; 42 | 43 | # Uncomment if access to favicon.ico generates too many logs. 44 | #log_not_found off; 45 | #access_log off; 46 | } 47 | } 48 | -------------------------------------------------------------------------------- /rootfs/opt/base/etc/nginx/nginx.conf: -------------------------------------------------------------------------------- 1 | # /etc/nginx/nginx.conf 2 | 3 | # Set number of worker processes. 4 | worker_processes 2; 5 | 6 | # Enables the use of JIT for regular expressions to speed-up their processing. 7 | pcre_jit on; 8 | 9 | # Configures default error logger. 10 | error_log /config/log/nginx/error.log warn; 11 | 12 | events { 13 | # The maximum number of simultaneous connections that can be opened by 14 | # a worker process. 15 | worker_connections 1024; 16 | } 17 | 18 | http { 19 | # Includes mapping of file name extensions to MIME types of responses 20 | # and defines the default type. 21 | include /opt/base/etc/nginx/mime.types; 22 | default_type application/octet-stream; 23 | 24 | # Name servers used to resolve names of upstream servers into addresses. 25 | # It's also needed when using tcpsocket and udpsocket in Lua modules. 26 | #resolver 208.67.222.222 208.67.220.220; 27 | 28 | # Don't tell nginx version to clients. 29 | server_tokens off; 30 | 31 | # Specifies the maximum accepted body size of a client request, as 32 | # indicated by the request header Content-Length. If the stated content 33 | # length is greater than this size, then the client receives the HTTP 34 | # error code 413. Set to 0 to disable. 35 | client_max_body_size 1m; 36 | 37 | # Timeout for keep-alive connections. Server will close connections after 38 | # this time. 39 | keepalive_timeout 65; 40 | 41 | # Sendfile copies data between one FD and other from within the kernel, 42 | # which is more efficient than read() + write(). 43 | sendfile on; 44 | 45 | # Don't buffer data-sends (disable Nagle algorithm). 46 | # Good for sending frequent small bursts of data in real time. 47 | tcp_nodelay on; 48 | 49 | # Causes nginx to attempt to send its HTTP response head in one packet, 50 | # instead of using partial frames. 51 | #tcp_nopush on; 52 | 53 | # Specifies that our cipher suits should be preferred over client ciphers. 54 | ssl_prefer_server_ciphers on; 55 | 56 | # Protocol and ciphers. 57 | # This is what Mozilla calls "Modern configuration". 58 | ssl_protocols TLSv1.2; 59 | ssl_ciphers 'ECDHE-ECDSA-AES256-GCM-SHA384:ECDHE-RSA-AES256-GCM-SHA384:ECDHE-ECDSA-CHACHA20-POLY1305:ECDHE-RSA-CHACHA20-POLY1305:ECDHE-ECDSA-AES128-GCM-SHA256:ECDHE-RSA-AES128-GCM-SHA256:ECDHE-ECDSA-AES256-SHA384:ECDHE-RSA-AES256-SHA384:ECDHE-ECDSA-AES128-SHA256:ECDHE-RSA-AES128-SHA256'; 60 | 61 | # Enables a shared SSL cache with size that can hold around 8000 sessions. 62 | ssl_session_cache shared:SSL:2m; 63 | 64 | # Enable checking the existence of precompressed files. 65 | #gzip_static on; 66 | 67 | # Specifies the main log format. 68 | log_format main '$remote_addr - $remote_user [$time_local] "$request" ' 69 | '$status $body_bytes_sent "$http_referer" ' 70 | '"$http_user_agent" "$http_x_forwarded_for"'; 71 | 72 | # Sets the path, format, and configuration for a buffered log write. 73 | access_log /config/log/nginx/access.log main; 74 | 75 | # Includes virtual host config. 76 | include /opt/base/etc/nginx/default_site.conf; 77 | } 78 | 79 | stream { 80 | # Include optional stream to handle encrypted VNC connection. 81 | include /var/tmp/nginx/stream[.]conf; 82 | } 83 | 84 | -------------------------------------------------------------------------------- /rootfs/opt/base/etc/openbox/menu.xml: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_glow_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_glow_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_glow_prelight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_glow_prelight.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_insensitive_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_insensitive_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_light_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_down_light_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_glow_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_glow_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_glow_prelight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_glow_prelight.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_insensitive_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_insensitive_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_light_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_left_light_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_dark_selected.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_dark_selected.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_glow_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_glow_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_glow_prelight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_glow_prelight.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_insensitive_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_insensitive_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_light_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_right_light_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_glow_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_glow_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_glow_prelight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_glow_prelight.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_insensitive_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_insensitive_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_light_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/arrow_up_light_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bevel_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bevel_in.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bevel_out.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bevel_out.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bevel_out_hollow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bevel_out_hollow.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bg-entry.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bg-entry.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bg-spin.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/bg-spin.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_active.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_active_insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_active_insensitive.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_default_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_default_glow.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_insensitive.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_normal_prelight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_normal_prelight.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_spin_down_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_spin_down_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_spin_up_normal.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/button_spin_up_normal.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/frame_gap.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/frame_gap.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/hole_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/hole_tiny.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny_in.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny_ins.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny_ins.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny_ins_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_circle_tiny_ins_glow.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_square_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_square_tiny.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_square_tiny_glow_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_square_tiny_glow_in.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_square_tiny_in.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_square_tiny_in.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_tiny.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/inset_shadow_tiny.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/items.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/items.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/knob.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/knob.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/knob_insensitive.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/knob_insensitive.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/knob_prelight.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/knob_prelight.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/menu.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/menu.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/outline_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/outline_glow.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/progressbar_bar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/progressbar_bar.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/progressbar_trough_horiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/progressbar_trough_horiz.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/progressbar_trough_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/progressbar_trough_vert.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/scale_trough.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/scale_trough.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/scale_trough_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/scale_trough_vert.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/separated_bar_small_glow_bottom.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/separated_bar_small_glow_bottom.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/separator_horiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/separator_horiz.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/separator_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/separator_vert.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_glow.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_glow.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_left.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_left.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_right.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_right.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_top.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/shadow_angled_in_sides_top.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_horiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_horiz.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_horiz_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_horiz_active.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_run_base_horiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_run_base_horiz.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_run_base_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_run_base_vert.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_vert.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_vert_active.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/slider_vert_active.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/toolbar.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/toolbar.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/trough_horiz.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/trough_horiz.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/trough_vert.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/base/share/themes/Dark/gtk-2.0/assets/trough_vert.png -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/close.xbm: -------------------------------------------------------------------------------- 1 | #define close_width 8 2 | #define close_height 8 3 | static unsigned char close_bits[] = { 4 | 0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/close_hover.xbm: -------------------------------------------------------------------------------- 1 | #define close_hover_width 10 2 | #define close_hover_height 10 3 | static unsigned char close_hover_bits[] = { 4 | 0x03, 0x03, 0x87, 0x03, 0xce, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x78, 0x00, 5 | 0xfc, 0x00, 0xce, 0x01, 0x87, 0x03, 0x03, 0x03 }; 6 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/desk.xbm: -------------------------------------------------------------------------------- 1 | #define desk_width 8 2 | #define desk_height 8 3 | static unsigned char desk_bits[] = { 4 | 0x00, 0x00, 0x48, 0x78, 0x7e, 0x78, 0x48, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/desk_hover.xbm: -------------------------------------------------------------------------------- 1 | #define desk_hover_width 8 2 | #define desk_hover_height 8 3 | static unsigned char desk_hover_bits[] = { 4 | 0x00, 0x88, 0x88, 0xf8, 0xff, 0xf8, 0x88, 0x88 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/desk_toggled.xbm: -------------------------------------------------------------------------------- 1 | #define desk_toggled_width 8 2 | #define desk_toggled_height 8 3 | static unsigned char desk_toggled_bits[] = { 4 | 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/iconify.xbm: -------------------------------------------------------------------------------- 1 | #define iconify_width 8 2 | #define iconify_height 8 3 | static unsigned char iconify_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/iconify_hover.xbm: -------------------------------------------------------------------------------- 1 | #define iconify_hover_width 8 2 | #define iconify_hover_height 8 3 | static unsigned char iconify_hover_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/max.xbm: -------------------------------------------------------------------------------- 1 | #define max_width 8 2 | #define max_height 8 3 | static unsigned char max_bits[] = { 4 | 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0xff }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/max_hover.xbm: -------------------------------------------------------------------------------- 1 | #define max_hover_width 10 2 | #define max_hover_height 10 3 | static unsigned char max_hover_bits[] = { 4 | 0xff, 0x03, 0xff, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 5 | 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xff, 0x03 }; 6 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/max_toggled.xbm: -------------------------------------------------------------------------------- 1 | #define max_toggled_width 8 2 | #define max_toggled_height 8 3 | static unsigned char max_toggled_bits[] = { 4 | 0xfc, 0xfc, 0x84, 0x9f, 0x91, 0xf1, 0x11, 0x1f }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/shade.xbm: -------------------------------------------------------------------------------- 1 | #define shade_width 8 2 | #define shade_height 8 3 | static unsigned char shade_bits[] = { 4 | 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/shade_hover.xbm: -------------------------------------------------------------------------------- 1 | #define shade_hover_width 8 2 | #define shade_hover_height 8 3 | static unsigned char shade_hover_bits[] = { 4 | 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Dark/openbox-3/themerc: -------------------------------------------------------------------------------- 1 | !! GrayBox by athmane 2 | !! vim: set ft=xdefaults: 3 | 4 | !! Global Width 5 | window.handle.width: 1 6 | 7 | window.client.padding.width: 0 8 | window.client.padding.height: 0 9 | border.Width: 1 10 | padding.width: 2 11 | 12 | window.active.border.color: #000000 13 | window.inactive.border.color: #000000 14 | menu.border.color: #000000 15 | menu.overlap: 0 16 | window.frameColor: #cccccc 17 | window.*.client.color: #cccccc 18 | *.text.justify: center 19 | 20 | !! Menu 21 | menu.title.bg: flat vertical gradient 22 | menu.title.bg.color: #444444 23 | menu.title.bg.colorTo: #222222 24 | menu.title.text.color: #ffffff 25 | 26 | menu.items.bg: flat gradient vertical 27 | menu.items.bg.color: #555555 28 | menu.items.bg.colorTo: #222222 29 | 30 | menu.items.text.color: #ffffff 31 | menu.items.disabled.text.color: #777777 32 | 33 | menu.items.active.bg: flat gradient vertical 34 | menu.items.active.bg.color: #888888 35 | menu.items.active.bg.colorTo: #777777 36 | menu.items.active.text.color: #ffffff 37 | 38 | !! Active Windows 39 | window.active.title.bg: flat vertical gradient 40 | window.active.title.bg.color: #555555 41 | window.active.title.bg.colorTo: #222222 42 | window.active.*.bg.border.color: #000000 43 | 44 | window.active.label.bg: parentrelative 45 | window.active.label.text.color: #ffffff 46 | 47 | window.active.button.*.bg: parentrelative 48 | window.active.button.*.image.color: #cccccc 49 | window.active.button.*.bg.border.color: #444444 50 | 51 | window.active.button.hover.bg.color: #555555 52 | window.active.button.hover.bg.border.color: #999999 53 | window.active.button.pressed.bg.color: #333333 54 | window.active.button.pressed.bg.colorTo: #000000 55 | window.active.button.pressed.image.color: #bbbbbb 56 | window.active.button.pressed.bg.border.color: #bbbbbb 57 | 58 | window.active.button.disabled.bg: parentrelative 59 | window.active.button.disabled.image.color: #777777 60 | 61 | window.active.handle.bg: flat solid 62 | window.active.handle.bg.color: #222222 63 | 64 | window.*.grip.bg: flat solid 65 | window.*.grip.bg.color: #222222 66 | 67 | !! Inactive Windows 68 | window.inactive.title.bg: flat gradient vertical 69 | window.inactive.title.bg.color: #999999 70 | window.inactive.title.bg.colorTo: #999999 71 | window.inactive.*.border.color: #bbbbbb 72 | 73 | window.inactive.label.bg: parentrelative 74 | window.inactive.label.text.color: #bbbbbb 75 | 76 | window.inactive.button.*.bg: parentrelative 77 | window.inactive.button.*.bg.color: #cccccc 78 | window.inactive.button.*.image.color: #bbbbbb 79 | window.inactive.button.*.bg.border.color: #cccccc 80 | 81 | window.inactive.button.pressed.bg.color: #cccccc 82 | window.inactive.button.pressed.bg.border.color: #777777 83 | window.inactive.button.pressed.image.color: #999999 84 | 85 | window.inactive.button.hover.bg.color: #aaaaaa 86 | window.inactive.button.hover.bg.border.color: #dddddd 87 | window.inactive.button.hover.image.color: #aaaaaa 88 | window.inactive.button.disabled.bg: parentrelative 89 | window.inactive.button.disabled.image.color: #dddddd 90 | 91 | window.inactive.handle.bg: flat solid 92 | window.inactive.handle.bg.color: #cccccc 93 | window.inactive.grip.bg: parentrelative 94 | 95 | !! Fonts 96 | window.active.label.text.font: shadow=y:shadowoffset=1:shadowtint=75 97 | window.inactive.label.text.font: shadow=y:shadowoffset=1:shadowtint=0 98 | menu.items.font: 99 | menu.title.text.font: shadow=y:shadowoffset=1:shadowtint=75 100 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/close.xbm: -------------------------------------------------------------------------------- 1 | #define close_width 8 2 | #define close_height 8 3 | static unsigned char close_bits[] = { 4 | 0xc3, 0xe7, 0x7e, 0x3c, 0x3c, 0x7e, 0xe7, 0xc3 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/close_hover.xbm: -------------------------------------------------------------------------------- 1 | #define close_hover_width 10 2 | #define close_hover_height 10 3 | static unsigned char close_hover_bits[] = { 4 | 0x03, 0x03, 0x87, 0x03, 0xce, 0x01, 0xfc, 0x00, 0x78, 0x00, 0x78, 0x00, 5 | 0xfc, 0x00, 0xce, 0x01, 0x87, 0x03, 0x03, 0x03 }; 6 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/desk.xbm: -------------------------------------------------------------------------------- 1 | #define desk_width 8 2 | #define desk_height 8 3 | static unsigned char desk_bits[] = { 4 | 0x00, 0x00, 0x48, 0x78, 0x7e, 0x78, 0x48, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/desk_hover.xbm: -------------------------------------------------------------------------------- 1 | #define desk_hover_width 8 2 | #define desk_hover_height 8 3 | static unsigned char desk_hover_bits[] = { 4 | 0x00, 0x88, 0x88, 0xf8, 0xff, 0xf8, 0x88, 0x88 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/desk_toggled.xbm: -------------------------------------------------------------------------------- 1 | #define desk_toggled_width 8 2 | #define desk_toggled_height 8 3 | static unsigned char desk_toggled_bits[] = { 4 | 0x00, 0x66, 0x66, 0x00, 0x00, 0x66, 0x66, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/iconify.xbm: -------------------------------------------------------------------------------- 1 | #define iconify_width 8 2 | #define iconify_height 8 3 | static unsigned char iconify_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0x7e, 0x7e, 0x7e }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/iconify_hover.xbm: -------------------------------------------------------------------------------- 1 | #define iconify_hover_width 8 2 | #define iconify_hover_height 8 3 | static unsigned char iconify_hover_bits[] = { 4 | 0x00, 0x00, 0x00, 0x00, 0x00, 0xff, 0xff, 0xff }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/max.xbm: -------------------------------------------------------------------------------- 1 | #define max_width 8 2 | #define max_height 8 3 | static unsigned char max_bits[] = { 4 | 0xff, 0xff, 0x81, 0x81, 0x81, 0x81, 0x81, 0xff }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/max_hover.xbm: -------------------------------------------------------------------------------- 1 | #define max_hover_width 10 2 | #define max_hover_height 10 3 | static unsigned char max_hover_bits[] = { 4 | 0xff, 0x03, 0xff, 0x03, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 5 | 0x01, 0x02, 0x01, 0x02, 0x01, 0x02, 0xff, 0x03 }; 6 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/max_toggled.xbm: -------------------------------------------------------------------------------- 1 | #define max_toggled_width 8 2 | #define max_toggled_height 8 3 | static unsigned char max_toggled_bits[] = { 4 | 0xfc, 0xfc, 0x84, 0x9f, 0x91, 0xf1, 0x11, 0x1f }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/shade.xbm: -------------------------------------------------------------------------------- 1 | #define shade_width 8 2 | #define shade_height 8 3 | static unsigned char shade_bits[] = { 4 | 0x7e, 0x7e, 0x7e, 0x00, 0x00, 0x00, 0x00, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/base/share/themes/Light/openbox-3/shade_hover.xbm: -------------------------------------------------------------------------------- 1 | #define shade_hover_width 8 2 | #define shade_hover_height 8 3 | static unsigned char shade_hover_bits[] = { 4 | 0xff, 0xff, 0xff, 0x00, 0x00, 0x00, 0x00, 0x00 }; 5 | -------------------------------------------------------------------------------- /rootfs/opt/noVNC/app/error-handler.js: -------------------------------------------------------------------------------- 1 | /* 2 | * noVNC: HTML5 VNC client 3 | * Copyright (C) 2019 The noVNC authors 4 | * Licensed under MPL 2.0 (see LICENSE.txt) 5 | * 6 | * See README.md for usage and integration instructions. 7 | */ 8 | 9 | // Fallback for all uncought errors 10 | function handleError(event, err) { 11 | try { 12 | const msg = document.getElementById('noVNC_fallback_errormsg'); 13 | 14 | // Work around Firefox bug: 15 | // https://bugzilla.mozilla.org/show_bug.cgi?id=1685038 16 | if (event.message === "ResizeObserver loop completed with undelivered notifications.") { 17 | return false; 18 | } 19 | 20 | // Only show the initial error 21 | if (msg.hasChildNodes()) { 22 | return false; 23 | } 24 | 25 | let div = document.createElement("div"); 26 | div.classList.add('noVNC_message'); 27 | div.appendChild(document.createTextNode(event.message)); 28 | msg.appendChild(div); 29 | 30 | if (event.filename) { 31 | div = document.createElement("div"); 32 | div.className = 'noVNC_location'; 33 | let text = event.filename; 34 | if (event.lineno !== undefined) { 35 | text += ":" + event.lineno; 36 | if (event.colno !== undefined) { 37 | text += ":" + event.colno; 38 | } 39 | } 40 | div.appendChild(document.createTextNode(text)); 41 | msg.appendChild(div); 42 | } 43 | 44 | if (err && err.stack) { 45 | div = document.createElement("div"); 46 | div.className = 'noVNC_stack'; 47 | div.appendChild(document.createTextNode(err.stack)); 48 | msg.appendChild(div); 49 | } 50 | 51 | document.getElementById('noVNC_fallback_error') 52 | .classList.add("noVNC_open"); 53 | 54 | } catch (exc) { 55 | document.write("Unexpected error encountered."); 56 | } 57 | 58 | // Try to disable keyboard interaction, best effort 59 | try { 60 | // Remove focus from the currently focused element in order to 61 | // prevent keyboard interaction from continuing 62 | if (document.activeElement) { document.activeElement.blur(); } 63 | 64 | // Don't let any element be focusable when showing the error 65 | let keyboardFocusable = 'a[href], button, input, textarea, select, details, [tabindex]'; 66 | document.querySelectorAll(keyboardFocusable).forEach((elem) => { 67 | elem.setAttribute("tabindex", "-1"); 68 | }); 69 | } catch (exc) { 70 | // Do nothing 71 | } 72 | 73 | // Don't return true since this would prevent the error 74 | // from being printed to the browser console. 75 | return false; 76 | } 77 | 78 | window.addEventListener('error', evt => handleError(evt, evt.error)); 79 | window.addEventListener('unhandledrejection', evt => handleError(evt.reason, evt.reason)); 80 | -------------------------------------------------------------------------------- /rootfs/opt/noVNC/app/images/error.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /rootfs/opt/noVNC/app/images/info.svg: -------------------------------------------------------------------------------- 1 | 2 | 3 | 4 | 22 | 24 | 54 | 57 | 58 | 60 | 61 | 63 | image/svg+xml 64 | 66 | 67 | 68 | 69 | 70 | 75 | 80 | 81 | 82 | -------------------------------------------------------------------------------- /rootfs/opt/noVNC/login/fonts/pxiByp8kv8JHgFVrLGT9V1s.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/noVNC/login/fonts/pxiByp8kv8JHgFVrLGT9V1s.ttf -------------------------------------------------------------------------------- /rootfs/opt/noVNC/login/fonts/pxiEyp8kv8JHgFVrFJA.ttf: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/rootfs/opt/noVNC/login/fonts/pxiEyp8kv8JHgFVrFJA.ttf -------------------------------------------------------------------------------- /rootfs/opt/noVNC/login/js.cookie.min.js: -------------------------------------------------------------------------------- 1 | /*! js-cookie v3.0.5 | MIT */ 2 | !function(e,t){"object"==typeof exports&&"undefined"!=typeof module?module.exports=t():"function"==typeof define&&define.amd?define(t):(e="undefined"!=typeof globalThis?globalThis:e||self,function(){var n=e.Cookies,o=e.Cookies=t();o.noConflict=function(){return e.Cookies=n,o}}())}(this,(function(){"use strict";function e(e){for(var t=1;t 3 | #include 4 | 5 | namespace plog 6 | { 7 | template 8 | class PLOG_LINKAGE_HIDDEN AndroidAppender : public IAppender 9 | { 10 | public: 11 | AndroidAppender(const char* tag) : m_tag(tag) 12 | { 13 | } 14 | 15 | virtual void write(const Record& record) PLOG_OVERRIDE 16 | { 17 | std::string str = Formatter::format(record); 18 | 19 | __android_log_print(toPriority(record.getSeverity()), m_tag, "%s", str.c_str()); 20 | } 21 | 22 | private: 23 | static android_LogPriority toPriority(Severity severity) 24 | { 25 | switch (severity) 26 | { 27 | case fatal: 28 | return ANDROID_LOG_FATAL; 29 | case error: 30 | return ANDROID_LOG_ERROR; 31 | case warning: 32 | return ANDROID_LOG_WARN; 33 | case info: 34 | return ANDROID_LOG_INFO; 35 | case debug: 36 | return ANDROID_LOG_DEBUG; 37 | case verbose: 38 | return ANDROID_LOG_VERBOSE; 39 | default: 40 | return ANDROID_LOG_UNKNOWN; 41 | } 42 | } 43 | 44 | private: 45 | const char* const m_tag; 46 | }; 47 | } 48 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Appenders/ArduinoAppender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | template 8 | class PLOG_LINKAGE_HIDDEN ArduinoAppender : public IAppender 9 | { 10 | public: 11 | ArduinoAppender(Stream &stream) : m_stream(stream) 12 | { 13 | } 14 | 15 | virtual void write(const Record &record) PLOG_OVERRIDE 16 | { 17 | m_stream.print(Formatter::format(record).c_str()); 18 | } 19 | 20 | private: 21 | Stream &m_stream; 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Appenders/ConsoleAppender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | 7 | namespace plog 8 | { 9 | enum OutputStream 10 | { 11 | streamStdOut, 12 | streamStdErr 13 | }; 14 | 15 | template 16 | class PLOG_LINKAGE_HIDDEN ConsoleAppender : public IAppender 17 | { 18 | public: 19 | #ifdef _WIN32 20 | # ifdef _MSC_VER 21 | # pragma warning(suppress: 26812) // Prefer 'enum class' over 'enum' 22 | # endif 23 | ConsoleAppender(OutputStream outStream = streamStdOut) 24 | : m_isatty(!!_isatty(_fileno(outStream == streamStdOut ? stdout : stderr))) 25 | , m_outputStream(outStream == streamStdOut ? std::cout : std::cerr) 26 | , m_outputHandle() 27 | { 28 | if (m_isatty) 29 | { 30 | m_outputHandle = GetStdHandle(outStream == streamStdOut ? stdHandle::kOutput : stdHandle::kErrorOutput); 31 | } 32 | } 33 | #else 34 | ConsoleAppender(OutputStream outStream = streamStdOut) 35 | : m_isatty(!!isatty(fileno(outStream == streamStdOut ? stdout : stderr))) 36 | , m_outputStream(outStream == streamStdOut ? std::cout : std::cerr) 37 | {} 38 | #endif 39 | 40 | virtual void write(const Record& record) PLOG_OVERRIDE 41 | { 42 | util::nstring str = Formatter::format(record); 43 | util::MutexLock lock(m_mutex); 44 | 45 | writestr(str); 46 | } 47 | 48 | protected: 49 | void writestr(const util::nstring& str) 50 | { 51 | #ifdef _WIN32 52 | if (m_isatty) 53 | { 54 | const std::wstring& wstr = util::toWide(str); 55 | WriteConsoleW(m_outputHandle, wstr.c_str(), static_cast(wstr.size()), NULL, NULL); 56 | } 57 | else 58 | { 59 | # if PLOG_CHAR_IS_UTF8 60 | m_outputStream << str << std::flush; 61 | # else 62 | m_outputStream << util::toNarrow(str, codePage::kActive) << std::flush; 63 | # endif 64 | } 65 | #else 66 | m_outputStream << str << std::flush; 67 | #endif 68 | } 69 | 70 | private: 71 | #ifdef __BORLANDC__ 72 | static int _isatty(int fd) { return ::isatty(fd); } 73 | #endif 74 | 75 | protected: 76 | util::Mutex m_mutex; 77 | const bool m_isatty; 78 | std::ostream& m_outputStream; 79 | #ifdef _WIN32 80 | HANDLE m_outputHandle; 81 | #endif 82 | }; 83 | } 84 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Appenders/DebugOutputAppender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | template 8 | class PLOG_LINKAGE_HIDDEN DebugOutputAppender : public IAppender 9 | { 10 | public: 11 | virtual void write(const Record& record) PLOG_OVERRIDE 12 | { 13 | OutputDebugStringW(util::toWide(Formatter::format(record)).c_str()); 14 | } 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Appenders/DynamicAppender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | class PLOG_LINKAGE_HIDDEN DynamicAppender : public IAppender 8 | { 9 | public: 10 | DynamicAppender& addAppender(IAppender* appender) 11 | { 12 | assert(appender != this); 13 | 14 | util::MutexLock lock(m_mutex); 15 | m_appenders.insert(appender); 16 | 17 | return *this; 18 | } 19 | 20 | DynamicAppender& removeAppender(IAppender* appender) 21 | { 22 | util::MutexLock lock(m_mutex); 23 | m_appenders.erase(appender); 24 | 25 | return *this; 26 | } 27 | 28 | virtual void write(const Record& record) PLOG_OVERRIDE 29 | { 30 | util::MutexLock lock(m_mutex); 31 | 32 | for (std::set::iterator it = m_appenders.begin(); it != m_appenders.end(); ++it) 33 | { 34 | (*it)->write(record); 35 | } 36 | } 37 | 38 | private: 39 | mutable util::Mutex m_mutex; 40 | std::set m_appenders; 41 | }; 42 | } 43 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Appenders/IAppender.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | class PLOG_LINKAGE IAppender 8 | { 9 | public: 10 | virtual ~IAppender() 11 | { 12 | } 13 | 14 | virtual void write(const Record& record) = 0; 15 | }; 16 | } 17 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Converters/NativeEOLConverter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | template 8 | class NativeEOLConverter : public NextConverter 9 | { 10 | #ifdef _WIN32 11 | public: 12 | static std::string header(const util::nstring& str) 13 | { 14 | return NextConverter::header(fixLineEndings(str)); 15 | } 16 | 17 | static std::string convert(const util::nstring& str) 18 | { 19 | return NextConverter::convert(fixLineEndings(str)); 20 | } 21 | 22 | private: 23 | static util::nstring fixLineEndings(const util::nstring& str) 24 | { 25 | util::nstring output; 26 | output.reserve(str.length() * 2); // the worst case requires 2x chars 27 | 28 | for (size_t i = 0; i < str.size(); ++i) 29 | { 30 | util::nchar ch = str[i]; 31 | 32 | if (ch == PLOG_NSTR('\n')) 33 | { 34 | output.push_back(PLOG_NSTR('\r')); 35 | } 36 | 37 | output.push_back(ch); 38 | } 39 | 40 | return output; 41 | } 42 | #endif 43 | }; 44 | } 45 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Converters/UTF8Converter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace plog 5 | { 6 | class UTF8Converter 7 | { 8 | public: 9 | static std::string header(const util::nstring& str) 10 | { 11 | const char kBOM[] = "\xEF\xBB\xBF"; 12 | 13 | return std::string(kBOM) + convert(str); 14 | } 15 | 16 | #if PLOG_CHAR_IS_UTF8 17 | static const std::string& convert(const util::nstring& str) 18 | { 19 | return str; 20 | } 21 | #else 22 | static std::string convert(const util::nstring& str) 23 | { 24 | return util::toNarrow(str, codePage::kUTF8); 25 | } 26 | #endif 27 | }; 28 | } 29 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Formatters/CsvFormatter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace plog 7 | { 8 | template 9 | class CsvFormatterImpl 10 | { 11 | public: 12 | static util::nstring header() 13 | { 14 | return PLOG_NSTR("Date;Time;Severity;TID;This;Function;Message\n"); 15 | } 16 | 17 | static util::nstring format(const Record& record) 18 | { 19 | tm t; 20 | useUtcTime ? util::gmtime_s(&t, &record.getTime().time) : util::localtime_s(&t, &record.getTime().time); 21 | 22 | util::nostringstream ss; 23 | ss << t.tm_year + 1900 << PLOG_NSTR("/") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mon + 1 << PLOG_NSTR("/") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mday << PLOG_NSTR(";"); 24 | ss << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_hour << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_min << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_sec << PLOG_NSTR(".") << std::setfill(PLOG_NSTR('0')) << std::setw(3) << static_cast (record.getTime().millitm) << PLOG_NSTR(";"); 25 | ss << severityToString(record.getSeverity()) << PLOG_NSTR(";"); 26 | ss << record.getTid() << PLOG_NSTR(";"); 27 | ss << record.getObject() << PLOG_NSTR(";"); 28 | ss << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR(";"); 29 | 30 | util::nstring message = record.getMessage(); 31 | 32 | if (message.size() > kMaxMessageSize) 33 | { 34 | message.resize(kMaxMessageSize); 35 | message.append(PLOG_NSTR("...")); 36 | } 37 | 38 | util::nistringstream split(message); 39 | util::nstring token; 40 | 41 | while (!split.eof()) 42 | { 43 | std::getline(split, token, PLOG_NSTR('"')); 44 | ss << PLOG_NSTR("\"") << token << PLOG_NSTR("\""); 45 | } 46 | 47 | ss << PLOG_NSTR("\n"); 48 | 49 | return ss.str(); 50 | } 51 | 52 | static const size_t kMaxMessageSize = 32000; 53 | }; 54 | 55 | class CsvFormatter : public CsvFormatterImpl {}; 56 | class CsvFormatterUtcTime : public CsvFormatterImpl {}; 57 | } 58 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Formatters/FuncMessageFormatter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | class FuncMessageFormatter 8 | { 9 | public: 10 | static util::nstring header() 11 | { 12 | return util::nstring(); 13 | } 14 | 15 | static util::nstring format(const Record& record) 16 | { 17 | util::nostringstream ss; 18 | ss << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR(": ") << record.getMessage() << PLOG_NSTR("\n"); 19 | 20 | return ss.str(); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Formatters/MessageOnlyFormatter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | class MessageOnlyFormatter 8 | { 9 | public: 10 | static util::nstring header() 11 | { 12 | return util::nstring(); 13 | } 14 | 15 | static util::nstring format(const Record& record) 16 | { 17 | util::nostringstream ss; 18 | ss << record.getMessage() << PLOG_NSTR("\n"); 19 | 20 | return ss.str(); 21 | } 22 | }; 23 | } 24 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Formatters/TxtFormatter.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | namespace plog 7 | { 8 | template 9 | class TxtFormatterImpl 10 | { 11 | public: 12 | static util::nstring header() 13 | { 14 | return util::nstring(); 15 | } 16 | 17 | static util::nstring format(const Record& record) 18 | { 19 | tm t; 20 | useUtcTime ? util::gmtime_s(&t, &record.getTime().time) : util::localtime_s(&t, &record.getTime().time); 21 | 22 | util::nostringstream ss; 23 | ss << t.tm_year + 1900 << "-" << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mon + 1 << PLOG_NSTR("-") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_mday << PLOG_NSTR(" "); 24 | ss << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_hour << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_min << PLOG_NSTR(":") << std::setfill(PLOG_NSTR('0')) << std::setw(2) << t.tm_sec << PLOG_NSTR(".") << std::setfill(PLOG_NSTR('0')) << std::setw(3) << static_cast (record.getTime().millitm) << PLOG_NSTR(" "); 25 | ss << std::setfill(PLOG_NSTR(' ')) << std::setw(5) << std::left << severityToString(record.getSeverity()) << PLOG_NSTR(" "); 26 | ss << PLOG_NSTR("[") << record.getTid() << PLOG_NSTR("] "); 27 | ss << PLOG_NSTR("[") << record.getFunc() << PLOG_NSTR("@") << record.getLine() << PLOG_NSTR("] "); 28 | ss << record.getMessage() << PLOG_NSTR("\n"); 29 | 30 | return ss.str(); 31 | } 32 | }; 33 | 34 | class TxtFormatter : public TxtFormatterImpl {}; 35 | class TxtFormatterUtcTime : public TxtFormatterImpl {}; 36 | } 37 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Helpers/AscDump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | class AscDump 8 | { 9 | public: 10 | AscDump(const void* ptr, size_t size) 11 | : m_ptr(static_cast(ptr)) 12 | , m_size(size) 13 | { 14 | } 15 | 16 | friend util::nostringstream& operator<<(util::nostringstream& stream, const AscDump& ascDump); 17 | 18 | private: 19 | const char* m_ptr; 20 | size_t m_size; 21 | }; 22 | 23 | inline util::nostringstream& operator<<(util::nostringstream& stream, const AscDump& ascDump) 24 | { 25 | for (size_t i = 0; i < ascDump.m_size; ++i) 26 | { 27 | stream << (std::isprint(ascDump.m_ptr[i]) ? ascDump.m_ptr[i] : '.'); 28 | } 29 | 30 | return stream; 31 | } 32 | 33 | inline AscDump ascdump(const void* ptr, size_t size) { return AscDump(ptr, size); } 34 | 35 | template 36 | inline AscDump ascdump(const Container& container) { return AscDump(container.data(), container.size() * sizeof(*container.data())); } 37 | 38 | template 39 | inline AscDump ascdump(const T (&arr)[N]) { return AscDump(arr, N * sizeof(*arr)); } 40 | } 41 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Helpers/HexDump.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | class HexDump 8 | { 9 | public: 10 | HexDump(const void* ptr, size_t size) 11 | : m_ptr(static_cast(ptr)) 12 | , m_size(size) 13 | , m_group(8) 14 | , m_digitSeparator(" ") 15 | , m_groupSeparator(" ") 16 | { 17 | } 18 | 19 | HexDump& group(size_t group) 20 | { 21 | m_group = group; 22 | return *this; 23 | } 24 | 25 | HexDump& separator(const char* digitSeparator) 26 | { 27 | m_digitSeparator = digitSeparator; 28 | return *this; 29 | } 30 | 31 | HexDump& separator(const char* digitSeparator, const char* groupSeparator) 32 | { 33 | m_digitSeparator = digitSeparator; 34 | m_groupSeparator = groupSeparator; 35 | return *this; 36 | } 37 | 38 | friend util::nostringstream& operator<<(util::nostringstream& stream, const HexDump&); 39 | 40 | private: 41 | const unsigned char* m_ptr; 42 | size_t m_size; 43 | size_t m_group; 44 | const char* m_digitSeparator; 45 | const char* m_groupSeparator; 46 | }; 47 | 48 | inline util::nostringstream& operator<<(util::nostringstream& stream, const HexDump& hexDump) 49 | { 50 | stream << std::hex << std::setfill(PLOG_NSTR('0')); 51 | 52 | for (size_t i = 0; i < hexDump.m_size;) 53 | { 54 | stream << std::setw(2) << static_cast(hexDump.m_ptr[i]); 55 | 56 | if (++i < hexDump.m_size) 57 | { 58 | if (hexDump.m_group > 0 && i % hexDump.m_group == 0) 59 | { 60 | stream << hexDump.m_groupSeparator; 61 | } 62 | else 63 | { 64 | stream << hexDump.m_digitSeparator; 65 | } 66 | } 67 | } 68 | 69 | return stream; 70 | } 71 | 72 | inline HexDump hexdump(const void* ptr, size_t size) { return HexDump(ptr, size); } 73 | 74 | template 75 | inline HexDump hexdump(const Container& container) { return HexDump(container.data(), container.size() * sizeof(*container.data())); } 76 | 77 | template 78 | inline HexDump hexdump(const T (&arr)[N]) { return HexDump(arr, N * sizeof(*arr)); } 79 | } 80 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Helpers/PrintVar.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | 3 | #define PLOG_IMPL_PRINT_VAR_1(a1) #a1 ": " << a1 4 | #define PLOG_IMPL_PRINT_VAR_2(a1, a2) PLOG_IMPL_PRINT_VAR_1(a1) PLOG_IMPL_PRINT_VAR_TAIL(a2) 5 | #define PLOG_IMPL_PRINT_VAR_3(a1, a2, a3) PLOG_IMPL_PRINT_VAR_2(a1, a2) PLOG_IMPL_PRINT_VAR_TAIL(a3) 6 | #define PLOG_IMPL_PRINT_VAR_4(a1, a2, a3, a4) PLOG_IMPL_PRINT_VAR_3(a1, a2, a3) PLOG_IMPL_PRINT_VAR_TAIL(a4) 7 | #define PLOG_IMPL_PRINT_VAR_5(a1, a2, a3, a4, a5) PLOG_IMPL_PRINT_VAR_4(a1, a2, a3, a4) PLOG_IMPL_PRINT_VAR_TAIL(a5) 8 | #define PLOG_IMPL_PRINT_VAR_6(a1, a2, a3, a4, a5, a6) PLOG_IMPL_PRINT_VAR_5(a1, a2, a3, a4, a5) PLOG_IMPL_PRINT_VAR_TAIL(a6) 9 | #define PLOG_IMPL_PRINT_VAR_7(a1, a2, a3, a4, a5, a6, a7) PLOG_IMPL_PRINT_VAR_6(a1, a2, a3, a4, a5, a6) PLOG_IMPL_PRINT_VAR_TAIL(a7) 10 | #define PLOG_IMPL_PRINT_VAR_8(a1, a2, a3, a4, a5, a6, a7, a8) PLOG_IMPL_PRINT_VAR_7(a1, a2, a3, a4, a5, a6, a7) PLOG_IMPL_PRINT_VAR_TAIL(a8) 11 | #define PLOG_IMPL_PRINT_VAR_9(a1, a2, a3, a4, a5, a6, a7, a8, a9) PLOG_IMPL_PRINT_VAR_8(a1, a2, a3, a4, a5, a6, a7, a8) PLOG_IMPL_PRINT_VAR_TAIL(a9) 12 | #define PLOG_IMPL_PRINT_VAR_TAIL(a) << ", " PLOG_IMPL_PRINT_VAR_1(a) 13 | 14 | #define PLOG_IMPL_PRINT_VAR_EXPAND(x) x 15 | 16 | #ifdef __GNUC__ 17 | #pragma GCC system_header // disable warning: variadic macros are a C99 feature 18 | #endif 19 | 20 | #define PLOG_IMPL_PRINT_VAR_GET_MACRO(x1, x2, x3, x4, x5, x6, x7, x8, x9, NAME, ...) NAME 21 | 22 | #define PLOG_PRINT_VAR(...) PLOG_IMPL_PRINT_VAR_EXPAND(PLOG_IMPL_PRINT_VAR_GET_MACRO(__VA_ARGS__,\ 23 | PLOG_IMPL_PRINT_VAR_9, PLOG_IMPL_PRINT_VAR_8, PLOG_IMPL_PRINT_VAR_7, PLOG_IMPL_PRINT_VAR_6, PLOG_IMPL_PRINT_VAR_5,\ 24 | PLOG_IMPL_PRINT_VAR_4, PLOG_IMPL_PRINT_VAR_3, PLOG_IMPL_PRINT_VAR_2, PLOG_IMPL_PRINT_VAR_1, UNUSED)(__VA_ARGS__)) 25 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Init.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace plog 5 | { 6 | template 7 | PLOG_LINKAGE_HIDDEN inline Logger& init(Severity maxSeverity = none, IAppender* appender = NULL) 8 | { 9 | static Logger logger(maxSeverity); 10 | return appender ? logger.addAppender(appender) : logger; 11 | } 12 | 13 | inline Logger& init(Severity maxSeverity = none, IAppender* appender = NULL) 14 | { 15 | return init(maxSeverity, appender); 16 | } 17 | } 18 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Initializers/ConsoleInitializer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | 5 | namespace plog 6 | { 7 | ////////////////////////////////////////////////////////////////////////// 8 | // ColorConsoleAppender with any Formatter 9 | 10 | template 11 | PLOG_LINKAGE_HIDDEN inline Logger& init(Severity maxSeverity, OutputStream outputStream) 12 | { 13 | static ColorConsoleAppender appender(outputStream); 14 | return init(maxSeverity, &appender); 15 | } 16 | 17 | template 18 | inline Logger& init(Severity maxSeverity, OutputStream outputStream) 19 | { 20 | return init(maxSeverity, outputStream); 21 | } 22 | } 23 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Initializers/RollingFileInitializer.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | #include 6 | #include 7 | 8 | namespace plog 9 | { 10 | ////////////////////////////////////////////////////////////////////////// 11 | // RollingFileAppender with any Formatter 12 | 13 | template 14 | PLOG_LINKAGE_HIDDEN inline Logger& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0) 15 | { 16 | static RollingFileAppender rollingFileAppender(fileName, maxFileSize, maxFiles); 17 | return init(maxSeverity, &rollingFileAppender); 18 | } 19 | 20 | template 21 | inline Logger& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0) 22 | { 23 | return init(maxSeverity, fileName, maxFileSize, maxFiles); 24 | } 25 | 26 | ////////////////////////////////////////////////////////////////////////// 27 | // RollingFileAppender with TXT/CSV chosen by file extension 28 | 29 | namespace 30 | { 31 | inline bool isCsv(const util::nchar* fileName) 32 | { 33 | const util::nchar* dot = util::findExtensionDot(fileName); 34 | #if PLOG_CHAR_IS_UTF8 35 | return dot && 0 == std::strcmp(dot, ".csv"); 36 | #else 37 | return dot && 0 == std::wcscmp(dot, L".csv"); 38 | #endif 39 | } 40 | } 41 | 42 | template 43 | inline Logger& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0) 44 | { 45 | return isCsv(fileName) ? init(maxSeverity, fileName, maxFileSize, maxFiles) : init(maxSeverity, fileName, maxFileSize, maxFiles); 46 | } 47 | 48 | inline Logger& init(Severity maxSeverity, const util::nchar* fileName, size_t maxFileSize = 0, int maxFiles = 0) 49 | { 50 | return init(maxSeverity, fileName, maxFileSize, maxFiles); 51 | } 52 | 53 | ////////////////////////////////////////////////////////////////////////// 54 | // CHAR variants for Windows 55 | 56 | #if defined(_WIN32) && !PLOG_CHAR_IS_UTF8 57 | template 58 | inline Logger& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0) 59 | { 60 | return init(maxSeverity, util::toWide(fileName).c_str(), maxFileSize, maxFiles); 61 | } 62 | 63 | template 64 | inline Logger& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0) 65 | { 66 | return init(maxSeverity, fileName, maxFileSize, maxFiles); 67 | } 68 | 69 | template 70 | inline Logger& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0) 71 | { 72 | return init(maxSeverity, util::toWide(fileName).c_str(), maxFileSize, maxFiles); 73 | } 74 | 75 | inline Logger& init(Severity maxSeverity, const char* fileName, size_t maxFileSize = 0, int maxFiles = 0) 76 | { 77 | return init(maxSeverity, fileName, maxFileSize, maxFiles); 78 | } 79 | #endif 80 | } 81 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Logger.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | #include 4 | #include 5 | 6 | #ifdef PLOG_DEFAULT_INSTANCE // for backward compatibility 7 | # define PLOG_DEFAULT_INSTANCE_ID PLOG_DEFAULT_INSTANCE 8 | #endif 9 | 10 | #ifndef PLOG_DEFAULT_INSTANCE_ID 11 | # define PLOG_DEFAULT_INSTANCE_ID 0 12 | #endif 13 | 14 | namespace plog 15 | { 16 | template 17 | class PLOG_LINKAGE Logger : public util::Singleton >, public IAppender 18 | { 19 | public: 20 | Logger(Severity maxSeverity = none) : m_maxSeverity(maxSeverity) 21 | { 22 | } 23 | 24 | Logger& addAppender(IAppender* appender) 25 | { 26 | assert(appender != this); 27 | m_appenders.push_back(appender); 28 | return *this; 29 | } 30 | 31 | Severity getMaxSeverity() const 32 | { 33 | return m_maxSeverity; 34 | } 35 | 36 | void setMaxSeverity(Severity severity) 37 | { 38 | m_maxSeverity = severity; 39 | } 40 | 41 | bool checkSeverity(Severity severity) const 42 | { 43 | return severity <= m_maxSeverity; 44 | } 45 | 46 | virtual void write(const Record& record) PLOG_OVERRIDE 47 | { 48 | if (checkSeverity(record.getSeverity())) 49 | { 50 | *this += record; 51 | } 52 | } 53 | 54 | void operator+=(const Record& record) 55 | { 56 | for (std::vector::iterator it = m_appenders.begin(); it != m_appenders.end(); ++it) 57 | { 58 | (*it)->write(record); 59 | } 60 | } 61 | 62 | private: 63 | Severity m_maxSeverity; 64 | #ifdef _MSC_VER 65 | # pragma warning(push) 66 | # pragma warning(disable:4251) // needs to have dll-interface to be used by clients of class 67 | #endif 68 | std::vector m_appenders; 69 | #ifdef _MSC_VER 70 | # pragma warning(pop) 71 | #endif 72 | }; 73 | 74 | template 75 | inline Logger* get() 76 | { 77 | return Logger::getInstance(); 78 | } 79 | 80 | inline Logger* get() 81 | { 82 | return Logger::getInstance(); 83 | } 84 | } 85 | -------------------------------------------------------------------------------- /src/audiorecorder/plog/Severity.h: -------------------------------------------------------------------------------- 1 | #pragma once 2 | #include 3 | 4 | namespace plog 5 | { 6 | enum Severity 7 | { 8 | none = 0, 9 | fatal = 1, 10 | error = 2, 11 | warning = 3, 12 | info = 4, 13 | debug = 5, 14 | verbose = 6 15 | }; 16 | 17 | #ifdef _MSC_VER 18 | # pragma warning(suppress: 26812) // Prefer 'enum class' over 'enum' 19 | #endif 20 | inline const char* severityToString(Severity severity) 21 | { 22 | switch (severity) 23 | { 24 | case fatal: 25 | return "FATAL"; 26 | case error: 27 | return "ERROR"; 28 | case warning: 29 | return "WARN"; 30 | case info: 31 | return "INFO"; 32 | case debug: 33 | return "DEBUG"; 34 | case verbose: 35 | return "VERB"; 36 | default: 37 | return "NONE"; 38 | } 39 | } 40 | 41 | inline Severity severityFromString(const char* str) 42 | { 43 | switch (std::toupper(str[0])) 44 | { 45 | case 'F': 46 | return fatal; 47 | case 'E': 48 | return error; 49 | case 'W': 50 | return warning; 51 | case 'I': 52 | return info; 53 | case 'D': 54 | return debug; 55 | case 'V': 56 | return verbose; 57 | default: 58 | return none; 59 | } 60 | } 61 | } 62 | -------------------------------------------------------------------------------- /src/audiorecorder/pulseaudio.patch: -------------------------------------------------------------------------------- 1 | diff --git a/meson.build b/meson.build 2 | index d4cdbd6a5..c0b5ef999 100644 3 | --- a/meson.build 4 | +++ b/meson.build 5 | @@ -165,7 +165,6 @@ cdata.set_quoted('PA_ALSA_PROFILE_SETS_DIR', join_paths(alsadatadir, 'profile-se 6 | cdata.set_quoted('DESKTOPFILEDIR', join_paths(datadir, 'applications')) 7 | cdata.set_quoted('PULSE_LOCALEDIR', localedir) 8 | cdata.set_quoted('GETTEXT_PACKAGE', 'pulseaudio') 9 | -cdata.set('ENABLE_NLS', 1) 10 | cdata.set('top_srcdir', meson.source_root()) 11 | 12 | # Platform specifics 13 | diff --git a/src/meson.build b/src/meson.build 14 | index 96dcec354..d9ff56f43 100644 15 | --- a/src/meson.build 16 | +++ b/src/meson.build 17 | @@ -57,6 +57,7 @@ libpulsecommon_sources = [ 18 | 'pulsecore/shm.c', 19 | 'pulsecore/bitset.c', 20 | 'pulsecore/socket-client.c', 21 | + 'pulsecore/socket-server.c', 22 | 'pulsecore/socket-util.c', 23 | 'pulsecore/strbuf.c', 24 | 'pulsecore/strlist.c', 25 | @@ -136,6 +137,7 @@ libpulsecommon_headers = [ 26 | 'pulsecore/shm.h', 27 | 'pulsecore/bitset.h', 28 | 'pulsecore/socket-client.h', 29 | + 'pulsecore/socket-server.h', 30 | 'pulsecore/socket-util.h', 31 | 'pulsecore/strbuf.h', 32 | 'pulsecore/strlist.h', 33 | @@ -193,7 +195,7 @@ if not get_option('client') 34 | libpulse_dep = dependency('libpulse', required : true) 35 | libpulse_simple_dep = dependency('libpulse-simple', required : true) 36 | else 37 | - libpulsecommon = shared_library('pulsecommon-' + pa_version_major_minor, 38 | + libpulsecommon = static_library('pulsecommon-' + pa_version_major_minor, 39 | libpulsecommon_sources, 40 | libpulsecommon_headers, 41 | include_directories : [configinc, topinc], 42 | @@ -211,6 +213,19 @@ else 43 | 44 | libpulsecommon_dep = declare_dependency(link_with: libpulsecommon) 45 | 46 | + install_headers( 47 | + 'pulsecore/core-util.h', 48 | + 'pulsecore/creds.h', 49 | + 'pulsecore/dynarray.h', 50 | + 'pulsecore/i18n.h', 51 | + 'pulsecore/log.h', 52 | + 'pulsecore/macro.h', 53 | + 'pulsecore/socket.h', 54 | + 'pulsecore/socket-server.h', 55 | + 'pulsecore/iochannel.h', 56 | + subdir : 'pulsecore' 57 | + ) 58 | + 59 | subdir('pulse') 60 | endif 61 | 62 | diff --git a/src/pulse/meson.build b/src/pulse/meson.build 63 | index c2128e087..81c5ce9df 100644 64 | --- a/src/pulse/meson.build 65 | +++ b/src/pulse/meson.build 66 | @@ -76,10 +76,9 @@ run_target('update-map-file', 67 | 68 | versioning_link_args = '-Wl,-version-script=' + join_paths(meson.source_root(), 'src', 'pulse', 'map-file') 69 | 70 | -libpulse = shared_library('pulse', 71 | +libpulse = static_library('pulse', 72 | libpulse_sources, 73 | libpulse_headers, 74 | - version : libpulse_version, 75 | include_directories : [configinc, topinc], 76 | c_args : [pa_c_args], 77 | link_args : [nodelete_link_args, versioning_link_args], 78 | @@ -95,10 +94,9 @@ install_headers( 79 | subdir : 'pulse' 80 | ) 81 | 82 | -libpulse_simple = shared_library('pulse-simple', 83 | +libpulse_simple = static_library('pulse-simple', 84 | 'simple.c', 85 | 'simple.h', 86 | - version : libpulse_simple_version, 87 | c_args : [pa_c_args], 88 | link_args : [nodelete_link_args, versioning_link_args], 89 | include_directories : [configinc, topinc], 90 | @@ -113,7 +111,6 @@ if glib_dep.found() 91 | libpulse_mainloop_glib = shared_library('pulse-mainloop-glib', 92 | 'glib-mainloop.c', 93 | 'glib-mainloop.h', 94 | - version : libpulse_mainloop_glib_version, 95 | c_args : [pa_c_args], 96 | link_args : [nodelete_link_args, versioning_link_args], 97 | include_directories : [configinc, topinc], 98 | -------------------------------------------------------------------------------- /src/fontconfig/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds Fontconfig as a static library. 4 | # 5 | # A customized fontconfig library is used. This is required to allows baseimage 6 | # programs (like openbox and yad) to use independant fonts and font configuration 7 | # files. This way, these programs don't depend on distro of the baseimage. 8 | # 9 | # NOTE: This script is expected to be run under Alpine Linux. 10 | # 11 | 12 | set -e # Exit immediately if a command exits with a non-zero status. 13 | set -u # Treat unset variables as an error. 14 | 15 | # Define software versions. 16 | FONTCONFIG_VERSION=2.15.0 17 | 18 | # Define software download URLs. 19 | FONTCONFIG_URL=https://www.freedesktop.org/software/fontconfig/release/fontconfig-${FONTCONFIG_VERSION}.tar.gz 20 | 21 | # Set same default compilation flags as abuild. 22 | export CFLAGS="-Os -fomit-frame-pointer" 23 | export CXXFLAGS="$CFLAGS" 24 | export CPPFLAGS="$CFLAGS" 25 | export LDFLAGS="-Wl,--strip-all -Wl,--as-needed,-O1,--sort-common" 26 | 27 | export CC=xx-clang 28 | export CXX=xx-clang++ 29 | 30 | function log { 31 | echo ">>> $*" 32 | } 33 | 34 | # 35 | # Install required packages. 36 | # 37 | HOST_PKGS="\ 38 | curl \ 39 | build-base \ 40 | clang \ 41 | pkgconfig \ 42 | gperf \ 43 | python3 \ 44 | font-croscore \ 45 | " 46 | 47 | TARGET_PKGS="\ 48 | glib-dev \ 49 | g++ \ 50 | freetype-dev \ 51 | expat-dev \ 52 | " 53 | 54 | log "Installing required Alpine packages..." 55 | apk --no-cache add $HOST_PKGS 56 | xx-apk --no-cache --no-scripts add $TARGET_PKGS 57 | 58 | # 59 | # Install Noto fonts. 60 | # Only the fonts used by Openbox are installed. 61 | # 62 | log "Installing Noto fonts..." 63 | mkdir -p /tmp/fontconfig-install/opt/base/share/fonts 64 | for FONT in Arimo-Regular Arimo-Bold 65 | do 66 | cp -v /usr/share/fonts/croscore/$FONT.ttf /tmp/fontconfig-install/opt/base/share/fonts/ 67 | done 68 | 69 | # 70 | # Build fontconfig. 71 | # The static library will be used by some baseimage programs. We need to 72 | # compile our own version to adjust different paths used by fontconfig. 73 | # Note that the fontconfig cache generated by fc-cache is architecture 74 | # dependent. Thus, we won't generate one, but it's not a problem since 75 | # we have very few fonts installed. 76 | # 77 | mkdir /tmp/fontconfig 78 | log "Downloading fontconfig..." 79 | curl -# -L -f ${FONTCONFIG_URL} | tar -xz --strip 1 -C /tmp/fontconfig 80 | 81 | log "Configuring fontconfig..." 82 | ( 83 | cd /tmp/fontconfig && ./configure \ 84 | --build=$(TARGETPLATFORM= xx-clang --print-target-triple) \ 85 | --host=$(xx-clang --print-target-triple) \ 86 | --prefix=/usr \ 87 | --with-default-fonts=/opt/base/share/fonts \ 88 | --with-baseconfigdir=/opt/base/share/fontconfig \ 89 | --with-configdir=/opt/base/share/fontconfig/conf.d \ 90 | --with-templatedir=/opt/base/share/fontconfig/conf.avail \ 91 | --with-cache-dir=/config/xdg/cache/fontconfig \ 92 | --disable-shared \ 93 | --enable-static \ 94 | --disable-docs \ 95 | --disable-nls \ 96 | --disable-cache-build \ 97 | ) 98 | 99 | log "Compiling fontconfig..." 100 | make -C /tmp/fontconfig -j$(nproc) 101 | 102 | log "Installing fontconfig..." 103 | make DESTDIR=/tmp/fontconfig-install -C /tmp/fontconfig install 104 | 105 | # 106 | # Cleanup. 107 | # 108 | log "Performing cleanup..." 109 | apk --no-cache del $HOST_PKGS 110 | xx-apk --no-cache --no-scripts del $TARGET_PKGS 111 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 112 | rm -rf /tmp/fontconfig 113 | -------------------------------------------------------------------------------- /src/hsetroot/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds hsetroot as a static binary. 4 | # 5 | # NOTE: This script is expected to be run under Alpine Linux. 6 | # 7 | 8 | set -e # Exit immediately if a command exits with a non-zero status. 9 | set -u # Treat unset variables as an error. 10 | 11 | # Set same default compilation flags as abuild. 12 | export CFLAGS="-Os -fomit-frame-pointer -Wno-expansion-to-defined -Wall" 13 | export CXXFLAGS="$CFLAGS" 14 | export CPPFLAGS="$CFLAGS" 15 | export LDFLAGS="-fuse-ld=lld -Wl,--as-needed,-O1,--sort-common --static -static -Wl,--strip-all" 16 | 17 | export CC=xx-clang 18 | export CXX=xx-clang++ 19 | 20 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 21 | 22 | function log { 23 | echo ">>> $*" 24 | } 25 | 26 | # 27 | # Install required packages. 28 | # 29 | HOST_PKGS="\ 30 | curl \ 31 | build-base \ 32 | clang \ 33 | lld \ 34 | xz \ 35 | " 36 | 37 | TARGET_PKGS="\ 38 | g++ \ 39 | libx11-dev \ 40 | libx11-static \ 41 | libxcb-static \ 42 | " 43 | 44 | log "Installing required Alpine packages..." 45 | apk --no-cache add $HOST_PKGS 46 | xx-apk --no-cache --no-scripts add $TARGET_PKGS 47 | 48 | # 49 | # Build hsetroot. 50 | # 51 | log "Compiling hsetroot..." 52 | mkdir /tmp/hsetroot 53 | LIBS="-lX11 -lxcb -lXdmcp -lXau" 54 | xx-clang $CFLAGS "$SCRIPT_DIR"/hsetroot.c -o /tmp/hsetroot/hsetroot $LDFLAGS $LIBS 55 | 56 | log "Installing hsetroot..." 57 | mkdir -p /tmp/hsetroot-install/usr/bin 58 | cp -v /tmp/hsetroot/hsetroot /tmp/hsetroot-install/usr/bin/ 59 | 60 | # 61 | # Cleanup. 62 | # 63 | log "Performing cleanup..." 64 | apk --no-cache del $HOST_PKGS 65 | xx-apk --no-cache --no-scripts del $TARGET_PKGS 66 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 67 | rm -rf /tmp/hsetroot 68 | -------------------------------------------------------------------------------- /src/htpasswd/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds htpasswd tool as a static binary. 4 | # 5 | # NOTE: This script is expected to be run under Alpine Linux. 6 | # 7 | 8 | set -e # Exit immediately if a command exits with a non-zero status. 9 | set -u # Treat unset variables as an error. 10 | 11 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 12 | 13 | # Define software versions. 14 | HTTPD_VERSION=2.4.63 15 | 16 | # Define software download URLs. 17 | HTTPD_URL=https://dlcdn.apache.org/httpd/httpd-${HTTPD_VERSION}.tar.gz 18 | 19 | # Set same default compilation flags as abuild. 20 | export CFLAGS="-Os -fomit-frame-pointer" 21 | export CXXFLAGS="$CFLAGS" 22 | export CPPFLAGS="$CFLAGS" 23 | export LDFLAGS="-Wl,--as-needed,-O1,--sort-common --static -static -Wl,--strip-all" 24 | 25 | export CC=xx-clang 26 | export CXX=xx-clang++ 27 | 28 | function log { 29 | echo ">>> $*" 30 | } 31 | 32 | # 33 | # Install required packages. 34 | # 35 | HOST_PKGS="\ 36 | curl \ 37 | build-base \ 38 | clang \ 39 | " 40 | 41 | TARGET_PKGS="\ 42 | g++ \ 43 | apr-dev \ 44 | apr-util-dev \ 45 | pcre2-dev \ 46 | expat-static \ 47 | util-linux-static \ 48 | " 49 | 50 | log "Installing required Alpine packages..." 51 | apk --no-cache add $HOST_PKGS 52 | xx-apk --no-cache --no-scripts add $TARGET_PKGS 53 | 54 | # 55 | # Build httpd. 56 | # 57 | mkdir /tmp/httpd 58 | log "Downloading httpd..." 59 | curl -# -L -f ${HTTPD_URL} | tar -xz --strip 1 -C /tmp/httpd 60 | 61 | log "Configuring httpd..." 62 | ( 63 | cd /tmp/httpd && PCRE_CONFIG=$(xx-info sysroot)usr/bin/pcre2-config ap_cv_void_ptr_lt_long=no ./configure \ 64 | --build=$(TARGETPLATFORM= xx-clang --print-target-triple) \ 65 | --host=$(xx-clang --print-target-triple) \ 66 | --with-apr=$(xx-info sysroot)usr \ 67 | --with-apr-util=$(xx-info sysroot)usr \ 68 | --enable-static-htpasswd \ 69 | ) 70 | 71 | # Fix paths to use for cross-compilation. 72 | sed -i "s|-L/usr/lib|-L$(xx-info sysroot)usr/lib|" /tmp/httpd/build/config_vars.mk 73 | sed -i "s|-R/usr/lib|-R$(xx-info sysroot)usr/lib|" /tmp/httpd/build/config_vars.mk 74 | 75 | log "Compiling httpd..." 76 | make -C /tmp/httpd/support -j$(nproc) htpasswd 77 | 78 | log "Installing httpd..." 79 | mkdir -p /tmp/httpd-install/usr/bin 80 | cp -v /tmp/httpd/support/htpasswd /tmp/httpd-install/usr/bin/ 81 | 82 | # 83 | # Cleanup. 84 | # 85 | log "Performing cleanup..." 86 | apk --no-cache del $HOST_PKGS 87 | xx-apk --no-cache --no-scripts del $TARGET_PKGS 88 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 89 | rm -rf /tmp/httpd 90 | -------------------------------------------------------------------------------- /src/openbox/disable-x-locale.patch: -------------------------------------------------------------------------------- 1 | --- a/openbox/openbox.c 2022-12-22 11:46:46.892818478 -0500 2 | +++ b/openbox/openbox.c 2022-12-22 12:15:31.042028173 -0500 3 | @@ -189,10 +189,12 @@ 4 | XSynchronize(obt_display, xsync); 5 | 6 | /* check for locale support */ 7 | +#if 0 8 | if (!XSupportsLocale()) 9 | g_message(_("X server does not support locale.")); 10 | if (!XSetLocaleModifiers("")) 11 | g_message(_("Cannot set locale modifiers for the X server.")); 12 | +#endif 13 | 14 | /* set the DISPLAY environment variable for any lauched children, to the 15 | display we're using, so they open in the right place. */ 16 | --- a/obt/keyboard.c 2022-12-22 12:29:48.922096234 -0500 17 | +++ b/obt/keyboard.c 2022-12-22 12:29:57.197569708 -0500 18 | @@ -70,7 +70,9 @@ 19 | if (started) obt_keyboard_shutdown(); /* free stuff */ 20 | started = TRUE; 21 | 22 | +#if 0 23 | xim_init(); 24 | +#endif 25 | 26 | /* reset the keys to not be bound to any masks */ 27 | for (i = 0; i < OBT_KEYBOARD_NUM_MODKEYS; ++i) 28 | -------------------------------------------------------------------------------- /src/openbox/menu-file-order.patch: -------------------------------------------------------------------------------- 1 | Try to load the specified config menu file as-is first, instead of assuming the 2 | file is under an XDG path. 3 | --- a/openbox/menu.c 2022-12-22 13:03:36.348184964 -0500 4 | +++ b/openbox/menu.c 2022-12-22 13:04:18.636053984 -0500 5 | @@ -82,18 +82,18 @@ 6 | parse_menu_separator, &menu_parse_state); 7 | 8 | for (it = config_menu_files; it; it = g_slist_next(it)) { 9 | - if (obt_xml_load_config_file(menu_parse_inst, 10 | - "openbox", 11 | - it->data, 12 | - "openbox_menu")) 13 | + if (obt_xml_load_file(menu_parse_inst, 14 | + it->data, 15 | + "openbox_menu")) 16 | { 17 | loaded = TRUE; 18 | obt_xml_tree_from_root(menu_parse_inst); 19 | obt_xml_close(menu_parse_inst); 20 | } 21 | - else if (obt_xml_load_file(menu_parse_inst, 22 | - it->data, 23 | - "openbox_menu")) 24 | + else if (obt_xml_load_config_file(menu_parse_inst, 25 | + "openbox", 26 | + it->data, 27 | + "openbox_menu")) 28 | { 29 | loaded = TRUE; 30 | obt_xml_tree_from_root(menu_parse_inst); 31 | -------------------------------------------------------------------------------- /src/pulseaudio/daemon.patch: -------------------------------------------------------------------------------- 1 | index 924a4d4aa..e1205d2d6 100644 2 | --- a/src/daemon/main.c 3 | +++ b/src/daemon/main.c 4 | @@ -555,7 +555,7 @@ int main(int argc, char *argv[]) { 5 | pa_log_set_level(PA_LOG_NOTICE); 6 | pa_log_set_flags(PA_LOG_COLORS|PA_LOG_PRINT_FILE|PA_LOG_PRINT_LEVEL, PA_LOG_RESET); 7 | 8 | -#if !defined(HAVE_BIND_NOW) && defined(__linux__) && defined(__OPTIMIZE__) 9 | +#if 0 //!defined(HAVE_BIND_NOW) && defined(__linux__) && defined(__OPTIMIZE__) 10 | /* 11 | Disable lazy relocations to make usage of external libraries 12 | more deterministic for our RT threads. We abuse __OPTIMIZE__ as 13 | -------------------------------------------------------------------------------- /src/pulseaudio/meson-build.patch: -------------------------------------------------------------------------------- 1 | index d4cdbd6a5..fbc10a5c2 100644 2 | --- a/meson.build 3 | +++ b/meson.build 4 | @@ -165,7 +165,7 @@ cdata.set_quoted('PA_ALSA_PROFILE_SETS_DIR', join_paths(alsadatadir, 'profile-se 5 | cdata.set_quoted('DESKTOPFILEDIR', join_paths(datadir, 'applications')) 6 | cdata.set_quoted('PULSE_LOCALEDIR', localedir) 7 | cdata.set_quoted('GETTEXT_PACKAGE', 'pulseaudio') 8 | -cdata.set('ENABLE_NLS', 1) 9 | +#cdata.set('ENABLE_NLS', 1) 10 | cdata.set('top_srcdir', meson.source_root()) 11 | 12 | # Platform specifics 13 | @@ -644,9 +644,6 @@ endif 14 | # Daemon and module dependencies 15 | 16 | if get_option('daemon') 17 | - # FIXME: make sure it's >= 2.2 18 | - ltdl_dep = cc.find_library('ltdl', required : true) 19 | - 20 | # FIXME: can meson support libtool -dlopen/-dlpreopen things? 21 | # and do we still want to support this at all? 22 | cdata.set('DISABLE_LIBTOOL_PRELOAD', 1) 23 | diff --git a/src/daemon/meson.build b/src/daemon/meson.build 24 | index e8f70a453..94225933e 100644 25 | --- a/src/daemon/meson.build 26 | +++ b/src/daemon/meson.build 27 | @@ -31,7 +31,7 @@ executable('pulseaudio', 28 | include_directories : [configinc, topinc], 29 | link_args : ['-ffast-math'], 30 | link_with : [libpulsecore], 31 | - dependencies : [ltdl_dep, cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep], 32 | + dependencies : [cap_dep, dbus_dep, libsystemd_dep, dl_dep, libintl_dep, platform_dep, platform_socket_dep, libpulsecommon_dep, libpulse_dep], 33 | c_args : pa_c_args, 34 | ) 35 | 36 | diff --git a/src/meson.build b/src/meson.build 37 | index 96dcec354..dd95ad784 100644 38 | --- a/src/meson.build 39 | +++ b/src/meson.build 40 | @@ -217,9 +217,9 @@ endif 41 | if get_option('daemon') 42 | subdir('pulsecore') 43 | subdir('daemon') 44 | - subdir('modules') 45 | + #subdir('modules') 46 | endif 47 | if get_option('tests') 48 | subdir('tests') 49 | endif 50 | -subdir('utils') 51 | +#subdir('utils') 52 | diff --git a/src/pulsecore/meson.build b/src/pulsecore/meson.build 53 | index b30264b3a..4e5923284 100644 54 | --- a/src/pulsecore/meson.build 55 | +++ b/src/pulsecore/meson.build 56 | @@ -224,7 +224,7 @@ libpulsecore = shared_library('pulsecore-' + pa_version_major_minor, 57 | install_rpath : privlibdir, 58 | install_dir : privlibdir, 59 | link_with : libpulsecore_simd_lib, 60 | - dependencies : [libm_dep, libpulsecommon_dep, ltdl_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libsystemd_dep, libintl_dep, platform_dep, tcpwrap_dep, platform_socket_dep,], 61 | + dependencies : [libm_dep, libpulsecommon_dep, shm_dep, sndfile_dep, database_dep, dbus_dep, libatomic_ops_dep, orc_dep, samplerate_dep, soxr_dep, speex_dep, x11_dep, libsystemd_dep, libintl_dep, platform_dep, tcpwrap_dep, platform_socket_dep,], 62 | implicit_include_directories : false) 63 | 64 | libpulsecore_dep = declare_dependency(link_with: libpulsecore) 65 | -------------------------------------------------------------------------------- /src/tigervnc/disable-pam.patch: -------------------------------------------------------------------------------- 1 | --- a/CMakeLists.txt 2023-02-15 13:02:43.460281768 -0500 2 | +++ b/CMakeLists.txt 2023-02-15 13:07:14.323272704 -0500 3 | @@ -284,7 +284,7 @@ 4 | endif() 5 | 6 | # Check for PAM library 7 | -if(UNIX AND NOT APPLE) 8 | +if(ENABLE_UNIX_PASSWORD_VALIDATOR) 9 | check_include_files(security/pam_appl.h HAVE_PAM_H) 10 | set(CMAKE_REQUIRED_LIBRARIES -lpam) 11 | check_function_exists(pam_start HAVE_PAM_START) 12 | --- a/common/rfb/CMakeLists.txt 2023-02-15 13:47:44.408913330 -0500 13 | +++ b/common/rfb/CMakeLists.txt 2023-02-15 13:48:26.906919800 -0500 14 | @@ -91,7 +91,7 @@ 15 | target_sources(rfb PRIVATE WinPasswdValidator.cxx) 16 | endif(WIN32) 17 | 18 | -if(UNIX AND NOT APPLE) 19 | +if(ENABLE_UNIX_PASSWORD_VALIDATOR) 20 | target_sources(rfb PRIVATE UnixPasswordValidator.cxx pam.c) 21 | target_link_libraries(rfb ${PAM_LIBS}) 22 | endif() 23 | --- a/common/rfb/SSecurityPlain.cxx 2023-02-15 13:08:20.122930689 -0500 24 | +++ b/common/rfb/SSecurityPlain.cxx 2023-02-15 13:10:03.848414138 -0500 25 | @@ -26,7 +26,7 @@ 26 | #include 27 | #include 28 | #include 29 | -#if !defined(WIN32) && !defined(__APPLE__) 30 | +#if(ENABLE_UNIX_PASSWORD_VALIDATOR) 31 | #include 32 | #include 33 | #include 34 | @@ -55,7 +55,7 @@ 35 | for (size_t i = 0; i < users.size(); i++) { 36 | if (users[i] == "*") 37 | return true; 38 | -#if !defined(WIN32) && !defined(__APPLE__) 39 | +#if defined(ENABLE_UNIX_PASSWORD_VALIDATOR) 40 | if (users[i] == "%u") { 41 | struct passwd *pw = getpwnam(username); 42 | if (pw && pw->pw_uid == getuid()) 43 | @@ -72,7 +72,7 @@ 44 | { 45 | #ifdef WIN32 46 | valid = new WinPasswdValidator(); 47 | -#elif !defined(__APPLE__) 48 | +#elif(ENABLE_UNIX_PASSWORD_VALIDATOR) 49 | valid = new UnixPasswordValidator(); 50 | #else 51 | valid = NULL; 52 | --- a/common/rfb/SSecurityRSAAES.cxx 2023-02-18 15:14:38.894594813 -0500 53 | +++ b/common/rfb/SSecurityRSAAES.cxx 2023-02-18 15:15:29.606928303 -0500 54 | @@ -39,7 +39,7 @@ 55 | #include 56 | #include 57 | #include 58 | -#if !defined(WIN32) && !defined(__APPLE__) 59 | +#if defined(ENABLE_UNIX_PASSWORD_VALIDATOR) 60 | #include 61 | #endif 62 | #ifdef WIN32 63 | @@ -554,10 +554,10 @@ 64 | 65 | void SSecurityRSAAES::verifyUserPass() 66 | { 67 | -#ifndef __APPLE__ 68 | +#if defined(WIN32) || defined(ENABLE_UNIX_PASSWORD_VALIDATOR) 69 | #ifdef WIN32 70 | WinPasswdValidator* valid = new WinPasswdValidator(); 71 | -#elif !defined(__APPLE__) 72 | +#elif defined(ENABLE_UNIX_PASSWORD_VALIDATOR) 73 | UnixPasswordValidator *valid = new UnixPasswordValidator(); 74 | #endif 75 | if (!valid->validate(sc, username.buf, password.buf)) { 76 | -------------------------------------------------------------------------------- /src/tigervnc/static-build.patch: -------------------------------------------------------------------------------- 1 | --- a/CMakeLists.txt 2023-02-15 13:02:43.460281768 -0500 2 | +++ b/CMakeLists.txt 2023-02-18 13:34:01.074642043 -0500 3 | @@ -69,6 +69,9 @@ 4 | add_definitions(-D_DEBUG) 5 | ENDIF() 6 | 7 | +# Prefer static libraries. 8 | +set(CMAKE_FIND_LIBRARY_SUFFIXES ${CMAKE_STATIC_LIBRARY_SUFFIX}) 9 | + 10 | # Make sure we get a sane C version 11 | set(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -std=gnu99") 12 | 13 | -------------------------------------------------------------------------------- /src/tigervnc/vncpasswd-static.patch: -------------------------------------------------------------------------------- 1 | --- a/unix/vncpasswd/CMakeLists.txt 2023-02-15 12:59:50.403972755 -0500 2 | +++ b/unix/vncpasswd/CMakeLists.txt 2023-02-15 13:00:02.040382803 -0500 3 | @@ -3,7 +3,7 @@ 4 | vncpasswd.cxx) 5 | 6 | target_include_directories(vncpasswd PUBLIC ${CMAKE_SOURCE_DIR}/common) 7 | -target_link_libraries(vncpasswd tx rfb os) 8 | +target_link_libraries(vncpasswd -static tx rfb os) 9 | 10 | install(TARGETS vncpasswd DESTINATION ${CMAKE_INSTALL_FULL_BINDIR}) 11 | install(FILES vncpasswd.man DESTINATION ${CMAKE_INSTALL_FULL_MANDIR}/man1 RENAME vncpasswd.1) 12 | -------------------------------------------------------------------------------- /src/webauth/go.mod: -------------------------------------------------------------------------------- 1 | module webauth 2 | 3 | go 1.21 4 | 5 | toolchain go1.21.6 6 | 7 | require ( 8 | github.com/gorilla/securecookie v1.1.2 9 | github.com/jasonlvhit/gocron v0.0.1 10 | github.com/julienschmidt/httprouter v1.3.0 11 | github.com/tg123/go-htpasswd v1.2.3 12 | golang.org/x/time v0.8.0 13 | ) 14 | 15 | require ( 16 | github.com/GehirnInc/crypt v0.0.0-20230320061759-8cc1b52080c5 // indirect 17 | golang.org/x/crypto v0.31.0 // indirect 18 | ) 19 | -------------------------------------------------------------------------------- /src/webauth/log/log.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "errors" 7 | "strings" 8 | ) 9 | 10 | const ( 11 | FatalLevel = iota 12 | ErrorLevel 13 | WarnLevel 14 | InfoLevel 15 | DebugLevel 16 | ) 17 | 18 | var ( 19 | FatalLogger *log.Logger 20 | ErrorLogger *log.Logger 21 | WarningLogger *log.Logger 22 | GenericLogger *log.Logger 23 | 24 | Level int 25 | ) 26 | 27 | func Debug(v ...interface{}) { 28 | if Level >= DebugLevel { 29 | GenericLogger.Println(v...) 30 | } 31 | } 32 | 33 | func Debugf(format string, v ...interface{}) { 34 | if Level >= DebugLevel { 35 | GenericLogger.Printf(format, v...) 36 | } 37 | } 38 | 39 | func Info(v ...interface{}) { 40 | if Level >= InfoLevel { 41 | GenericLogger.Println(v...) 42 | } 43 | } 44 | 45 | func Infof(format string, v ...interface{}) { 46 | if Level >= InfoLevel { 47 | GenericLogger.Printf(format, v...) 48 | } 49 | } 50 | 51 | func Warn(v ...interface{}) { 52 | if Level >= WarnLevel { 53 | WarningLogger.Println(v...) 54 | } 55 | } 56 | 57 | func Warnf(format string, v ...interface{}) { 58 | if Level >= WarnLevel { 59 | WarningLogger.Printf(format, v...) 60 | } 61 | } 62 | 63 | func Error(v ...interface{}) { 64 | if Level >= ErrorLevel { 65 | ErrorLogger.Println(v...) 66 | } 67 | } 68 | 69 | func Errorf(format string, v ...interface{}) { 70 | if Level >= ErrorLevel { 71 | ErrorLogger.Printf(format, v...) 72 | } 73 | } 74 | 75 | func Fatal(v ...interface{}) { 76 | FatalLogger.Println(v...) 77 | os.Exit(1) 78 | } 79 | 80 | func Fatalf(format string, v ...interface{}) { 81 | FatalLogger.Printf(format, v...) 82 | os.Exit(1) 83 | } 84 | 85 | func Println(v ...interface{}) { 86 | GenericLogger.Println(v...) 87 | } 88 | 89 | func Printf(format string, v ...interface{}) { 90 | GenericLogger.Printf(format, v...) 91 | } 92 | 93 | func SetLevel(levelName string) error { 94 | levelName = strings.ToLower(levelName) 95 | 96 | if levelName == "fatal" { 97 | Level = FatalLevel 98 | } else if levelName == "error" || levelName == "err" { 99 | Level = ErrorLevel 100 | } else if levelName == "warning" || levelName == "warn" { 101 | Level = WarnLevel 102 | } else if levelName == "info" { 103 | Level = InfoLevel 104 | } else if levelName == "debug" { 105 | Level = DebugLevel 106 | } else { 107 | return errors.New("invalid log level") 108 | } 109 | return nil 110 | } 111 | 112 | func init() { 113 | FatalLogger = log.New(os.Stderr, "FATAL: ", 0) 114 | ErrorLogger = log.New(os.Stderr, "ERROR: ", 0) 115 | WarningLogger = log.New(os.Stdout, "WARNING: ", 0) 116 | GenericLogger = log.New(os.Stdout, "", 0) 117 | 118 | Level = ErrorLevel 119 | } 120 | -------------------------------------------------------------------------------- /src/webservices/go.mod: -------------------------------------------------------------------------------- 1 | module webservices 2 | 3 | go 1.21 4 | 5 | require ( 6 | github.com/google/uuid v1.6.0 7 | github.com/gorilla/websocket v1.5.3 8 | github.com/hashicorp/golang-lru/v2 v2.0.7 9 | github.com/julienschmidt/httprouter v1.3.0 10 | github.com/vmihailenco/msgpack/v5 v5.4.1 11 | ) 12 | 13 | require github.com/vmihailenco/tagparser/v2 v2.0.0 // indirect 14 | -------------------------------------------------------------------------------- /src/webservices/go.sum: -------------------------------------------------------------------------------- 1 | github.com/davecgh/go-spew v1.1.0 h1:ZDRjVQ15GmhC3fiQ8ni8+OwkZQO4DARzQgrnXU1Liz8= 2 | github.com/davecgh/go-spew v1.1.0/go.mod h1:J7Y8YcW2NihsgmVo/mv3lAwl/skON4iLHjSsI+c5H38= 3 | github.com/google/uuid v1.6.0 h1:NIvaJDMOsjHA8n1jAhLSgzrAzy1Hgr+hNrb57e+94F0= 4 | github.com/google/uuid v1.6.0/go.mod h1:TIyPZe4MgqvfeYDBFedMoGGpEw/LqOeaOT+nhxU+yHo= 5 | github.com/gorilla/websocket v1.5.3 h1:saDtZ6Pbx/0u+bgYQ3q96pZgCzfhKXGPqt7kZ72aNNg= 6 | github.com/gorilla/websocket v1.5.3/go.mod h1:YR8l580nyteQvAITg2hZ9XVh4b55+EU/adAjf1fMHhE= 7 | github.com/hashicorp/golang-lru/v2 v2.0.7 h1:a+bsQ5rvGLjzHuww6tVxozPZFVghXaHOwFs4luLUK2k= 8 | github.com/hashicorp/golang-lru/v2 v2.0.7/go.mod h1:QeFd9opnmA6QUJc5vARoKUSoFhyfM2/ZepoAG6RGpeM= 9 | github.com/julienschmidt/httprouter v1.3.0 h1:U0609e9tgbseu3rBINet9P48AI/D3oJs4dN7jwJOQ1U= 10 | github.com/julienschmidt/httprouter v1.3.0/go.mod h1:JR6WtHb+2LUe8TCKY3cZOxFyyO8IZAc4RVcycCCAKdM= 11 | github.com/pmezard/go-difflib v1.0.0 h1:4DBwDE0NGyQoBHbLQYPwSUPoCMWR5BEzIk/f1lZbAQM= 12 | github.com/pmezard/go-difflib v1.0.0/go.mod h1:iKH77koFhYxTK1pcRnkKkqfTogsbg7gZNVY4sRDYZ/4= 13 | github.com/stretchr/testify v1.6.1 h1:hDPOHmpOpP40lSULcqw7IrRb/u7w6RpDC9399XyoNd0= 14 | github.com/stretchr/testify v1.6.1/go.mod h1:6Fq8oRcR53rry900zMqJjRRixrwX3KX962/h/Wwjteg= 15 | github.com/vmihailenco/msgpack/v5 v5.4.1 h1:cQriyiUvjTwOHg8QZaPihLWeRAAVoCpE00IUPn0Bjt8= 16 | github.com/vmihailenco/msgpack/v5 v5.4.1/go.mod h1:GaZTsDaehaPpQVyxrf5mtQlH+pc21PIudVV/E3rRQok= 17 | github.com/vmihailenco/tagparser/v2 v2.0.0 h1:y09buUbR+b5aycVFQs/g70pqKVZNBmxwAhO7/IwNM9g= 18 | github.com/vmihailenco/tagparser/v2 v2.0.0/go.mod h1:Wri+At7QHww0WTrCBeu4J6bNtoV6mEfg5OIWRZA9qds= 19 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c h1:dUUwHk2QECo/6vqA44rthZ8ie2QXMNeKRTHCNY2nXvo= 20 | gopkg.in/yaml.v3 v3.0.0-20200313102051-9f266ea9e77c/go.mod h1:K4uyk7z7BCEPqu6E+C64Yfv1cQ7kz7rIZviUmN+EgEM= 21 | -------------------------------------------------------------------------------- /src/webservices/log/log.go: -------------------------------------------------------------------------------- 1 | package log 2 | 3 | import ( 4 | "os" 5 | "log" 6 | "errors" 7 | "strings" 8 | ) 9 | 10 | const ( 11 | FatalLevel = iota 12 | ErrorLevel 13 | WarnLevel 14 | InfoLevel 15 | DebugLevel 16 | ) 17 | 18 | var ( 19 | FatalLogger *log.Logger 20 | ErrorLogger *log.Logger 21 | WarningLogger *log.Logger 22 | GenericLogger *log.Logger 23 | 24 | Level int 25 | ) 26 | 27 | func Debug(v ...interface{}) { 28 | if Level >= DebugLevel { 29 | GenericLogger.Println(v...) 30 | } 31 | } 32 | 33 | func Debugf(format string, v ...interface{}) { 34 | if Level >= DebugLevel { 35 | GenericLogger.Printf(format, v...) 36 | } 37 | } 38 | 39 | func Info(v ...interface{}) { 40 | if Level >= InfoLevel { 41 | GenericLogger.Println(v...) 42 | } 43 | } 44 | 45 | func Infof(format string, v ...interface{}) { 46 | if Level >= InfoLevel { 47 | GenericLogger.Printf(format, v...) 48 | } 49 | } 50 | 51 | func Warn(v ...interface{}) { 52 | if Level >= WarnLevel { 53 | WarningLogger.Println(v...) 54 | } 55 | } 56 | 57 | func Warnf(format string, v ...interface{}) { 58 | if Level >= WarnLevel { 59 | WarningLogger.Printf(format, v...) 60 | } 61 | } 62 | 63 | func Error(v ...interface{}) { 64 | if Level >= ErrorLevel { 65 | ErrorLogger.Println(v...) 66 | } 67 | } 68 | 69 | func Errorf(format string, v ...interface{}) { 70 | if Level >= ErrorLevel { 71 | ErrorLogger.Printf(format, v...) 72 | } 73 | } 74 | 75 | func Fatal(v ...interface{}) { 76 | FatalLogger.Println(v...) 77 | os.Exit(1) 78 | } 79 | 80 | func Fatalf(format string, v ...interface{}) { 81 | FatalLogger.Printf(format, v...) 82 | os.Exit(1) 83 | } 84 | 85 | func Println(v ...interface{}) { 86 | GenericLogger.Println(v...) 87 | } 88 | 89 | func Printf(format string, v ...interface{}) { 90 | GenericLogger.Printf(format, v...) 91 | } 92 | 93 | func SetLevel(levelName string) error { 94 | levelName = strings.ToLower(levelName) 95 | 96 | if levelName == "fatal" { 97 | Level = FatalLevel 98 | } else if levelName == "error" || levelName == "err" { 99 | Level = ErrorLevel 100 | } else if levelName == "warning" || levelName == "warn" { 101 | Level = WarnLevel 102 | } else if levelName == "info" { 103 | Level = InfoLevel 104 | } else if levelName == "debug" { 105 | Level = DebugLevel 106 | } else { 107 | return errors.New("invalid log level") 108 | } 109 | return nil 110 | } 111 | 112 | func init() { 113 | FatalLogger = log.New(os.Stderr, "FATAL: ", 0) 114 | ErrorLogger = log.New(os.Stderr, "ERROR: ", 0) 115 | WarningLogger = log.New(os.Stdout, "WARNING: ", 0) 116 | GenericLogger = log.New(os.Stdout, "", 0) 117 | 118 | Level = ErrorLevel 119 | } 120 | -------------------------------------------------------------------------------- /src/xcompmgr/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds xcompmgr as a static binary. 4 | # 5 | # NOTE: This script is expected to be run under Alpine Linux. 6 | # 7 | 8 | set -e # Exit immediately if a command exits with a non-zero status. 9 | set -u # Treat unset variables as an error. 10 | 11 | # Define software versions. 12 | XCOMPMGR_VERSION=1.1.9 13 | 14 | # Use the same versions has Alpine 3.20. 15 | LIBXDAMAGE_VERSION=1.1.6 16 | 17 | # Define software download URLs. 18 | XCOMPMGR_URL=https://xorg.freedesktop.org/releases/individual/app/xcompmgr-${XCOMPMGR_VERSION}.tar.xz 19 | LIBXDAMAGE_URL=https://www.x.org/releases/individual/lib/libXdamage-${LIBXDAMAGE_VERSION}.tar.xz 20 | 21 | # Set same default compilation flags as abuild. 22 | export CFLAGS="-Os -fomit-frame-pointer -Wno-expansion-to-defined" 23 | export CXXFLAGS="$CFLAGS" 24 | export CPPFLAGS="$CFLAGS" 25 | export LDFLAGS="-fuse-ld=lld -Wl,--as-needed,-O1,--sort-common --static -static -Wl,--strip-all" 26 | 27 | export CC=xx-clang 28 | export CXX=xx-clang++ 29 | 30 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 31 | 32 | function log { 33 | echo ">>> $*" 34 | } 35 | 36 | # 37 | # Install required packages. 38 | # 39 | HOST_PKGS="\ 40 | curl \ 41 | build-base \ 42 | clang \ 43 | lld \ 44 | pkgconfig \ 45 | " 46 | 47 | TARGET_PKGS="\ 48 | g++ \ 49 | libx11-static \ 50 | libxcomposite-dev \ 51 | libxrender-dev \ 52 | libxext-dev \ 53 | libxext-static \ 54 | libxcb-static \ 55 | " 56 | 57 | log "Installing required Alpine packages..." 58 | apk --no-cache add $HOST_PKGS 59 | xx-apk --no-cache --no-scripts add $TARGET_PKGS 60 | 61 | # 62 | # Build libXdamage. 63 | # The static library is not provided by Alpine repository, so we need to build 64 | # it ourself. 65 | # 66 | mkdir /tmp/libxdamage 67 | log "Downloading libXdamage..." 68 | curl -# -L -f ${LIBXDAMAGE_URL} | tar -xJ --strip 1 -C /tmp/libxdamage 69 | 70 | log "Configuring libXdamage..." 71 | ( 72 | cd /tmp/libxdamage && LDFLAGS= ./configure \ 73 | --build=$(TARGETPLATFORM= xx-clang --print-target-triple) \ 74 | --host=$(xx-clang --print-target-triple) \ 75 | --prefix=/usr \ 76 | --disable-shared \ 77 | --enable-static \ 78 | ) 79 | 80 | log "Compiling libXdamage..." 81 | make -C /tmp/libxdamage -j$(nproc) 82 | 83 | log "Installing libXdamage..." 84 | make DESTDIR=$(xx-info sysroot) -C /tmp/libxdamage install 85 | 86 | # 87 | # Build xcompmgr. 88 | # 89 | mkdir /tmp/xcompmgr 90 | log "Downloading xcompmgr..." 91 | curl -# -L -f ${XCOMPMGR_URL} | tar xJ --strip 1 -C /tmp/xcompmgr 92 | log "Configuring xcompmgr..." 93 | ( 94 | cd /tmp/xcompmgr && \ 95 | LIBS="-lxcb -lXdmcp -lXau" \ 96 | ./configure \ 97 | --build=$(TARGETPLATFORM= xx-clang --print-target-triple) \ 98 | --host=$(xx-clang --print-target-triple) \ 99 | --prefix=/usr \ 100 | ) 101 | log "Compiling xcompmgr..." 102 | make -C /tmp/xcompmgr -j$(nproc) 103 | log "Installing xcompmgr..." 104 | make DESTDIR=/tmp/xcompmgr-install -C /tmp/xcompmgr install 105 | 106 | # 107 | # Cleanup. 108 | # 109 | log "Performing cleanup..." 110 | apk --no-cache del $HOST_PKGS 111 | xx-apk --no-cache --no-scripts del $TARGET_PKGS 112 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 113 | rm -rf /tmp/xcompmgr 114 | -------------------------------------------------------------------------------- /src/xdpyprobe/Makefile: -------------------------------------------------------------------------------- 1 | TARGET = xdpyprobe 2 | 3 | RM = rm -f 4 | 5 | CPPFLAGS = -MMD 6 | CFLAGS = -Wall -Werror -std=gnu11 -Os -fomit-frame-pointer 7 | LDFLAGS = -fuse-ld=lld -static -Wl,--strip-all 8 | LDLIBS = -lX11 -lxcb -lXau -lXdmcp 9 | 10 | SOURCES = xdpyprobe.c 11 | OBJECTS = $(patsubst %.c, %.o, $(SOURCES)) 12 | DEPENDS = $(OBJECTS:.o=.d) 13 | 14 | $(TARGET): $(OBJECTS) 15 | $(CC) $(LDFLAGS) $(OBJECTS) $(LDLIBS) -o $@ 16 | 17 | clean: 18 | -$(RM) $(OBJECTS) 19 | -$(RM) $(TARGET) 20 | -$(RM) $(DEPENDS) 21 | 22 | -include $(DEPENDS) 23 | -------------------------------------------------------------------------------- /src/xdpyprobe/config.h: -------------------------------------------------------------------------------- 1 | /* src/config.h. Generated from config.h.in by configure. */ 2 | /* src/config.h.in. Generated from configure.ac by autoheader. */ 3 | 4 | /* Year in the copyright message */ 5 | #define COPYRIGHT_YEAR 2016 6 | 7 | /* Name of package */ 8 | #define PACKAGE "xdpyprobe" 9 | 10 | /* Define to the address where bug reports for this package should be sent. */ 11 | #define PACKAGE_BUGREPORT "" 12 | 13 | /* Define to the full name of this package. */ 14 | #define PACKAGE_NAME "xdpyprobe" 15 | 16 | /* Define to the full name and version of this package. */ 17 | #define PACKAGE_STRING "xdpyprobe 0.1" 18 | 19 | /* Define to the one symbol short name of this package. */ 20 | #define PACKAGE_TARNAME "xdpyprobe" 21 | 22 | /* Define to the home page for this package. */ 23 | #define PACKAGE_URL "" 24 | 25 | /* Define to the version of this package. */ 26 | #define PACKAGE_VERSION "0.1" 27 | 28 | /* Version number of package */ 29 | #define VERSION "0.1" 30 | -------------------------------------------------------------------------------- /src/xkbcomp/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds xkbcomp as a static binary. 4 | # 5 | # Used by the X server. 6 | # 7 | # NOTE: This script is expected to be run under Alpine Linux. 8 | # 9 | 10 | set -e # Exit immediately if a command exits with a non-zero status. 11 | set -u # Treat unset variables as an error. 12 | 13 | # Define software versions. 14 | # Use the same versions has Alpine 3.20. 15 | XKBCOMP_VERSION=1.4.7 16 | 17 | # Define software download URLs. 18 | XKBCOMP_URL=https://www.x.org/releases/individual/app/xkbcomp-${XKBCOMP_VERSION}.tar.xz 19 | 20 | # Set same default compilation flags as abuild. 21 | export CFLAGS="-Os -fomit-frame-pointer -Wno-expansion-to-defined" 22 | export CXXFLAGS="$CFLAGS" 23 | export CPPFLAGS="$CFLAGS" 24 | export LDFLAGS="-fuse-ld=lld -Wl,--as-needed,-O1,--sort-common --static -static -Wl,--strip-all" 25 | 26 | export CC=xx-clang 27 | export CXX=xx-clang++ 28 | 29 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 30 | 31 | function log { 32 | echo ">>> $*" 33 | } 34 | 35 | # 36 | # Install required packages. 37 | # 38 | HOST_PKGS="\ 39 | curl \ 40 | build-base \ 41 | clang \ 42 | lld \ 43 | pkgconfig \ 44 | " 45 | 46 | TARGET_PKGS="\ 47 | g++ \ 48 | libx11-static \ 49 | libxcb-static \ 50 | libxkbfile-dev \ 51 | " 52 | 53 | log "Installing required Alpine packages..." 54 | apk --no-cache add $HOST_PKGS 55 | xx-apk --no-cache --no-scripts add $TARGET_PKGS 56 | 57 | # 58 | # Build xkbcomp. 59 | # 60 | mkdir /tmp/xkbcomp 61 | log "Downloading xkbcomp..." 62 | curl -# -L -f ${XKBCOMP_URL} | tar xJ --strip 1 -C /tmp/xkbcomp 63 | 64 | log "Configuring xkbcomp..." 65 | ( 66 | cd /tmp/xkbcomp && \ 67 | LIBS="-lX11 -lxcb -lXdmcp -lXau" \ 68 | ./configure \ 69 | --build=$(TARGETPLATFORM= xx-clang --print-target-triple) \ 70 | --host=$(xx-clang --print-target-triple) \ 71 | --prefix=/usr \ 72 | ) 73 | 74 | log "Compiling xkbcomp..." 75 | make -C /tmp/xkbcomp -j$(nproc) 76 | 77 | log "Installing xkbcomp..." 78 | make DESTDIR=/tmp/xkbcomp-install -C /tmp/xkbcomp install 79 | 80 | # 81 | # Cleanup. 82 | # 83 | log "Performing cleanup..." 84 | apk --no-cache del $HOST_PKGS 85 | xx-apk --no-cache --no-scripts del $TARGET_PKGS 86 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 87 | rm -rf /tmp/xkbcomp 88 | -------------------------------------------------------------------------------- /src/xkeyboard-config/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds a customized version of XKeyboard config files 4 | # that are used by the X server. The goal is to prevent version mismatch issues 5 | # that could occur when using XKeyboard config files installed to the "standard" 6 | # location. 7 | # 8 | # NOTE: This script is expected to be run under Alpine Linux. 9 | # 10 | 11 | set -e # Exit immediately if a command exits with a non-zero status. 12 | set -u # Treat unset variables as an error. 13 | 14 | # Define software versions. 15 | # Use the same versions has Alpine 3.20. 16 | # If the XKeyboardConfig version is too recent compared to xorgproto/libX11, 17 | # xkbcomp will complain with warnings like "Could not resolve keysym ...". 18 | XKEYBOARDCONFIG_VERSION=2.41 19 | 20 | # Define software download URLs. 21 | XKEYBOARDCONFIG_URL=https://www.x.org/archive/individual/data/xkeyboard-config/xkeyboard-config-${XKEYBOARDCONFIG_VERSION}.tar.xz 22 | 23 | # Set same default compilation flags as abuild. 24 | export CFLAGS="-Os -fomit-frame-pointer" 25 | export CXXFLAGS="$CFLAGS" 26 | export CPPFLAGS="$CFLAGS" 27 | export LDFLAGS="-Wl,--as-needed,-O1,--sort-common -Wl,--strip-all" 28 | 29 | export CC=xx-clang 30 | export CXX=xx-clang++ 31 | 32 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 33 | 34 | function log { 35 | echo ">>> $*" 36 | } 37 | 38 | # 39 | # Install required packages. 40 | # 41 | HOST_PKGS="\ 42 | curl \ 43 | build-base \ 44 | abuild \ 45 | meson \ 46 | perl \ 47 | xz \ 48 | " 49 | 50 | log "Installing required Alpine packages..." 51 | apk --no-cache add $HOST_PKGS 52 | 53 | # 54 | # Build XKeyboardConfig. 55 | # 56 | mkdir /tmp/xkb 57 | log "Downloading XKeyboardConfig..." 58 | curl -# -L -f ${XKEYBOARDCONFIG_URL} | tar -xJ --strip 1 -C /tmp/xkb 59 | log "Configuring XKeyboardConfig..." 60 | ( 61 | cd /tmp/xkb && abuild-meson . build 62 | ) 63 | log "Compiling XKeyboardConfig..." 64 | meson compile -C /tmp/xkb/build 65 | log "Installing XKeyboardConfig..." 66 | DESTDIR="/tmp/xkb-install" meson install --no-rebuild -C /tmp/xkb/build 67 | 68 | log "Stripping XKeyboardConfig..." 69 | # We keep only the files needed by Xvnc. 70 | TO_KEEP=" 71 | geometry/pc 72 | symbols/pc 73 | symbols/us 74 | symbols/srvr_ctrl 75 | symbols/keypad 76 | symbols/altwin 77 | symbols/inet 78 | compat/accessx 79 | compat/basic 80 | compat/caps 81 | compat/complete 82 | compat/iso9995 83 | compat/ledcaps 84 | compat/lednum 85 | compat/ledscroll 86 | compat/level5 87 | compat/misc 88 | compat/mousekeys 89 | compat/xfree86 90 | keycodes/evdev 91 | keycodes/aliases 92 | types/basic 93 | types/complete 94 | types/extra 95 | types/iso9995 96 | types/level5 97 | types/mousekeys 98 | types/numpad 99 | types/pc 100 | rules/evdev 101 | " 102 | find /tmp/xkb-install/usr/share/X11/xkb -mindepth 2 -maxdepth 2 -type d -print -exec rm -r {} ';' 103 | find /tmp/xkb-install/usr/share/X11/xkb -mindepth 1 ! -type d $(printf "! -wholename /tmp/xkb-install/usr/share/X11/xkb/%s " $(echo "$TO_KEEP")) -print -delete 104 | 105 | # 106 | # Cleanup. 107 | # 108 | log "Performing cleanup..." 109 | apk --no-cache del $HOST_PKGS 110 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 111 | rm -rf /tmp/xkb 112 | -------------------------------------------------------------------------------- /src/xrdb/build.sh: -------------------------------------------------------------------------------- 1 | #!/bin/sh 2 | # 3 | # Helper script that builds xrdb as a static binary. 4 | # 5 | # NOTE: This script is expected to be run under Alpine Linux. 6 | # 7 | 8 | set -e # Exit immediately if a command exits with a non-zero status. 9 | set -u # Treat unset variables as an error. 10 | 11 | # Define software versions. 12 | # Use the same versions has Alpine 3.20. 13 | XRDB_VERSION=1.2.2 14 | 15 | # Define software download URLs. 16 | XRDB_URL=https://www.x.org/releases/individual/app/xrdb-${XRDB_VERSION}.tar.xz 17 | 18 | # Set same default compilation flags as abuild. 19 | export CFLAGS="-Os -fomit-frame-pointer -Wno-expansion-to-defined" 20 | export CXXFLAGS="$CFLAGS" 21 | export CPPFLAGS="$CFLAGS" 22 | export LDFLAGS="-fuse-ld=lld -Wl,--as-needed,-O1,--sort-common --static -static -Wl,--strip-all" 23 | 24 | export CC=xx-clang 25 | export CXX=xx-clang++ 26 | 27 | SCRIPT_DIR="$(cd "$(dirname "$0")" && pwd)" 28 | 29 | function log { 30 | echo ">>> $*" 31 | } 32 | 33 | # 34 | # Install required packages. 35 | # 36 | HOST_PKGS="\ 37 | curl \ 38 | build-base \ 39 | clang \ 40 | lld \ 41 | pkgconfig \ 42 | " 43 | 44 | TARGET_PKGS="\ 45 | g++ \ 46 | libx11-static \ 47 | libxcb-static \ 48 | libxmu-dev \ 49 | " 50 | 51 | # libxkbfile-dev \ 52 | 53 | log "Installing required Alpine packages..." 54 | apk --no-cache add $HOST_PKGS 55 | xx-apk --no-cache --no-scripts add $TARGET_PKGS 56 | 57 | # 58 | # Build xrdb. 59 | # 60 | mkdir /tmp/xrdb 61 | log "Downloading xrdb..." 62 | curl -# -L -f ${XRDB_URL} | tar xJ --strip 1 -C /tmp/xrdb 63 | 64 | # LIBS="-lX11 -lxcb -lXdmcp -lXau" \ 65 | 66 | log "Configuring xrdb..." 67 | ( 68 | cd /tmp/xrdb && \ 69 | LIBS="-lX11 -lxcb -lXdmcp -lXau" \ 70 | ./configure \ 71 | --build=$(TARGETPLATFORM= xx-clang --print-target-triple) \ 72 | --host=$(xx-clang --print-target-triple) \ 73 | --prefix=/usr \ 74 | ) 75 | 76 | log "Compiling xrdb..." 77 | make -C /tmp/xrdb -j$(nproc) 78 | 79 | log "Installing xrdb..." 80 | make DESTDIR=/tmp/xrdb-install -C /tmp/xrdb install 81 | 82 | # 83 | # Cleanup. 84 | # 85 | log "Performing cleanup..." 86 | apk --no-cache del $HOST_PKGS 87 | xx-apk --no-cache --no-scripts del $TARGET_PKGS 88 | apk --no-cache add util-linux # Linux tools still needed and they might be removed if pulled by dependencies. 89 | rm -rf /tmp/xrdb 90 | -------------------------------------------------------------------------------- /src/yad/cairo-meson-fix.patch: -------------------------------------------------------------------------------- 1 | From 8d5037ed642b02cdb018e49866aa286f30a7b59a Mon Sep 17 00:00:00 2001 2 | From: Thomas Devoogdt 3 | Date: Mon, 5 Feb 2024 17:47:07 +0100 4 | Subject: [PATCH] meson: always skip IPC_RMID_DEFERRED_RELEASE check when 5 | cross-compiling 6 | 7 | ../../br-test-pkg/bootlin-armv5-uclibc/build/cairo-1.17.4/meson.build:279:13: 8 | ERROR: Can not run test applications in this cross environment. 9 | 10 | Commit 1bec56ea8a931e1ae1c74cc740134497ec365267 added support to define 11 | ipc_rmid_deferred_release in a cross-compile config, but still kept 12 | the default to auto, which anyhow results in an error when cross-compiling. 13 | 14 | There is only one usage of the ipc_rmid_deferred_release compile declarative 15 | which was originally added in this commit: 5041b462d084de8552336275914d30c23bf5dd35. 16 | 17 | If ipc_rmid_deferred_release is set to FALSE, an additional XSync is performed. 18 | This doesn't sound very harmful, so that is why this commit defaults to FALSE 19 | and thus avoids any cross-compile errors. 20 | 21 | Signed-off-by: Thomas Devoogdt 22 | --- 23 | meson.build | 2 +- 24 | 1 file changed, 1 insertion(+), 1 deletion(-) 25 | 26 | diff --git a/meson.build b/meson.build 27 | index 9efe91978..6a670bf94 100644 28 | --- a/meson.build 29 | +++ b/meson.build 30 | @@ -369,7 +369,7 @@ if x11_dep.found() and xext_dep.found() 31 | 32 | # Can skip the run check by providing the result in a cross file or 33 | # native file as bool property value. 34 | - prop = meson.get_external_property('ipc_rmid_deferred_release', 'auto') 35 | + prop = meson.get_external_property('ipc_rmid_deferred_release', meson.is_cross_build() ? 'false' : 'auto') 36 | # We don't know the type of prop (bool, string) but need to differentiate 37 | # between a set value (bool) or the fallback value (string), so convert to 38 | # a string and check the string value. 39 | -- 40 | GitLab 41 | 42 | -------------------------------------------------------------------------------- /tests/setup_common.bash: -------------------------------------------------------------------------------- 1 | 2 | no_stderr() { 3 | "$@" 2>/dev/null 4 | } 5 | 6 | get_init_script_exit_code() { 7 | script=$1 8 | lines=$2 9 | regex_success=".* $script: terminated successfully" 10 | regex_failure=".* $script: terminated with error ([0-9]+)" 11 | 12 | for item in "${lines[@]}"; do 13 | if [[ "$item" =~ $regex_failure ]]; then 14 | echo ${BASH_REMATCH[1]} 15 | return 0 16 | elif [[ "$item" =~ $regex_success ]]; then 17 | echo "0" 18 | return 0 19 | fi 20 | done 21 | 22 | echo "ERROR: No exit code found for init script '$script'." >&2 23 | return 1 24 | } 25 | 26 | docker_run() { 27 | run docker run "$@" 28 | } 29 | 30 | [ -n "$DOCKER_IMAGE" ] 31 | 32 | # Make sure the docker image exists. 33 | docker inspect "$DOCKER_IMAGE" > /dev/null 34 | 35 | # Create workdir to store temporary stuff. 36 | TESTS_WORKDIR="$(mktemp -d)" 37 | 38 | -------------------------------------------------------------------------------- /tests/setup_container_daemon.bash: -------------------------------------------------------------------------------- 1 | 2 | CONTAINER_DAEMON_NAME=dockertest 3 | 4 | exec_container_daemon() { 5 | [ -n "$CONTAINER_DAEMON_NAME" ] 6 | docker exec "$CONTAINER_DAEMON_NAME" "$@" 7 | } 8 | 9 | getlog_container_daemon() { 10 | [ -n "$CONTAINER_DAEMON_NAME" ] 11 | docker logs "$CONTAINER_DAEMON_NAME" 12 | } 13 | 14 | wait_for_container_daemon() { 15 | echo "Waiting for the docker container daemon to be ready..." 16 | TIMEOUT=90 17 | while [ "$TIMEOUT" -ne 0 ]; do 18 | run exec_container_daemon sh -c "[ -f /tmp/appready ]" 19 | if [ "$status" -eq 0 ]; then 20 | break 21 | fi 22 | echo "waiting $TIMEOUT..." 23 | sleep 1 24 | TIMEOUT="$(expr "$TIMEOUT" - 1 || true)" 25 | done 26 | 27 | if [ "$TIMEOUT" -eq 0 ]; then 28 | echo "Docker container daemon wait timeout." 29 | echo "=====================================================================" 30 | echo " DOCKER LOGS" 31 | echo "=====================================================================" 32 | getlog_container_daemon 33 | echo "=====================================================================" 34 | echo " END DOCKER LOGS" 35 | echo "=====================================================================" 36 | false 37 | else 38 | echo "Docker container ready." 39 | fi 40 | } 41 | 42 | restart_container_daemon() { 43 | [ -n "$CONTAINER_DAEMON_NAME" ] 44 | 45 | echo "Restarting docker container daemon..." 46 | exec_container_daemon sh -c "rm /tmp/appready" 47 | docker restart "$CONTAINER_DAEMON_NAME" 48 | echo "Docker container daemon restarted." 49 | 50 | wait_for_container_daemon 51 | } 52 | 53 | # Make sure there is no existing instance. 54 | docker stop "$CONTAINER_DAEMON_NAME" >/dev/null 2>&1 && docker rm "$CONTAINER_DAEMON_NAME" >/dev/null 2>&1 || true 55 | 56 | # Create a fake startapp.h 57 | cat << EOF > "$TESTS_WORKDIR"/startapp.sh 58 | #!/bin/sh 59 | touch /tmp/appready 60 | echo "Ready!" 61 | while true;do sleep 999; done 62 | EOF 63 | chmod a+rx "$TESTS_WORKDIR"/startapp.sh 64 | 65 | # Start the container in daemon mode. 66 | echo "Starting docker container daemon..." 67 | docker_run -d --name "$CONTAINER_DAEMON_NAME" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh "${DOCKER_EXTRA_OPTS[@]}" $DOCKER_IMAGE "${DOCKER_CMD[@]}" 2>/dev/null 68 | echo "$output" 69 | [ "$status" -eq 0 ] 70 | 71 | # Wait for the container to be ready. 72 | wait_for_container_daemon 73 | -------------------------------------------------------------------------------- /tests/teardown_common.bash: -------------------------------------------------------------------------------- 1 | # Remove temporary work directory. 2 | rm -r "$TESTS_WORKDIR" 3 | -------------------------------------------------------------------------------- /tests/teardown_container_daemon.bash: -------------------------------------------------------------------------------- 1 | [ -n "$CONTAINER_DAEMON_NAME" ] 2 | 3 | echo "Stopping docker container..." 4 | docker stop "$CONTAINER_DAEMON_NAME" 5 | 6 | echo "Removing docker container..." 7 | docker rm "$CONTAINER_DAEMON_NAME" 8 | 9 | # Clear the container ID. 10 | CONTAINER_DAEMON_NAME= 11 | -------------------------------------------------------------------------------- /tests/test_cjk_font.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | echo "#!/bin/sh 7 | exit 0" > "$TESTS_WORKDIR"/startapp.sh 8 | chmod a+rx "$TESTS_WORKDIR"/startapp.sh 9 | } 10 | 11 | teardown() { 12 | load teardown_common 13 | } 14 | 15 | @test "Checking that CJK fonts can be installed successfully..." { 16 | docker_run --rm -e "ENABLE_CJK_FONT=1" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 17 | echo "=====================================================================" 18 | echo " OUTPUT" 19 | echo "=====================================================================" 20 | echo "$output" 21 | echo "=====================================================================" 22 | echo " END OUTPUT" 23 | echo "=====================================================================" 24 | echo "STATUS: $status" 25 | [ "$status" -eq 0 ] 26 | } 27 | 28 | @test "Checking that CJK fonts can be installed successfully with a mirror..." { 29 | docker_run --rm $DOCKER_IMAGE uname -m 30 | [ "$status" -eq 0 ] 31 | ARCH="${lines[0]}" 32 | 33 | docker_run --rm $DOCKER_IMAGE cat /etc/os-release 34 | [ "$status" -eq 0 ] 35 | 36 | regex="^ID=.*" 37 | for item in "${lines[@]}"; do 38 | if [[ "$item" =~ $regex ]]; then 39 | OS="${item#*=}" 40 | break; 41 | fi 42 | done 43 | 44 | case "$OS" in 45 | alpine) 46 | MIRROR="http://uk.alpinelinux.org/alpine/" 47 | ;; 48 | debian) 49 | MIRROR="http://ftp.us.debian.org/debian/" 50 | ;; 51 | ubuntu) 52 | case "$ARCH" in 53 | i386|i686|x86_64) 54 | MIRROR="http://mirror.math.princeton.edu/pub/ubuntu/" 55 | ;; 56 | *) 57 | MIRROR="http://in.mirror.coganng.com/ubuntu-ports/" 58 | ;; 59 | esac 60 | ;; 61 | *) 62 | echo "ERROR: Unknown OS '$OS'." 63 | exit 1 64 | ;; 65 | esac 66 | 67 | docker_run --rm -e "PACKAGES_MIRROR=$MIRROR" -e "ENABLE_CJK_FONT=1" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 68 | echo "=====================================================================" 69 | echo " OUTPUT" 70 | echo "=====================================================================" 71 | echo "$output" 72 | echo "=====================================================================" 73 | echo " END OUTPUT" 74 | echo "=====================================================================" 75 | echo "STATUS: $status" 76 | [ "$status" -eq 0 ] 77 | } 78 | 79 | # vim:ft=sh:ts=4:sw=4:et:sts=4 80 | -------------------------------------------------------------------------------- /tests/test_env_var_script.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | echo "#!/bin/sh 7 | echo TEST_VAL" > "$TESTS_WORKDIR"/TEST_VAR_SUCCESS 8 | chmod a+rx "$TESTS_WORKDIR"/TEST_VAR_SUCCESS 9 | 10 | echo "#!/bin/sh 11 | echo TEST_VAL 12 | exit 100" > "$TESTS_WORKDIR"/TEST_VAR_UNSET 13 | chmod a+rx "$TESTS_WORKDIR"/TEST_VAR_UNSET 14 | 15 | DOCKER_EXTRA_OPTS=() 16 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR"/TEST_VAR_SUCCESS:/etc/cont-env.d/TEST_VAR_SUCCESS) 17 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR"/TEST_VAR_UNSET:/etc/cont-env.d/TEST_VAR_UNSET) 18 | 19 | load setup_container_daemon 20 | } 21 | 22 | teardown() { 23 | load teardown_container_daemon 24 | load teardown_common 25 | } 26 | 27 | @test "Checking that environment variable is loaded from script..." { 28 | # Dump docker logs before proceeding to validations. 29 | echo "=====================================================================" 30 | echo " DOCKER LOGS" 31 | echo "=====================================================================" 32 | getlog_container_daemon 33 | echo "=====================================================================" 34 | echo " END DOCKER LOGS" 35 | echo "=====================================================================" 36 | 37 | run exec_container_daemon sh -c "cat /proc/1/environ | tr '\0' '\n' | grep '^TEST_VAR_SUCCESS=TEST_VAL$'" 38 | [ "$status" -eq 0 ] 39 | } 40 | 41 | @test "Checking that environment variable is not loaded from script..." { 42 | # Dump docker logs before proceeding to validations. 43 | echo "=====================================================================" 44 | echo " DOCKER LOGS" 45 | echo "=====================================================================" 46 | getlog_container_daemon 47 | echo "=====================================================================" 48 | echo " END DOCKER LOGS" 49 | echo "=====================================================================" 50 | 51 | run exec_container_daemon sh -c "cat /proc/1/environ | tr '\0' '\n' | grep '^TEST_VAR_UNSET='" 52 | [ "$status" -ne 0 ] 53 | } 54 | 55 | # vim:ft=sh:ts=4:sw=4:et:sts=4 56 | -------------------------------------------------------------------------------- /tests/test_env_var_script_exit_code.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | echo "#!/bin/sh 7 | exit 0" > "$TESTS_WORKDIR"/startapp.sh 8 | chmod a+rx "$TESTS_WORKDIR"/startapp.sh 9 | 10 | echo "#!/bin/sh 11 | echo TEST_VAL" > "$TESTS_WORKDIR"/TEST_VAR_SUCCESS 12 | chmod a+rx "$TESTS_WORKDIR"/TEST_VAR_SUCCESS 13 | 14 | echo "#!/bin/sh 15 | exit 100" > "$TESTS_WORKDIR"/TEST_VAR_UNSET 16 | chmod a+rx "$TESTS_WORKDIR"/TEST_VAR_UNSET 17 | 18 | echo "#!/bin/sh 19 | exit 50" > "$TESTS_WORKDIR"/TEST_VAR_FAIL 20 | chmod a+rx "$TESTS_WORKDIR"/TEST_VAR_FAIL 21 | } 22 | 23 | teardown() { 24 | load teardown_common 25 | } 26 | 27 | @test "Checking environment variable script execution with exit code 0..." { 28 | docker_run --rm -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh -v "$TESTS_WORKDIR"/TEST_VAR_SUCCESS:/etc/cont-env.d/TEST_VAR_SUCCESS $DOCKER_IMAGE 29 | echo "=====================================================================" 30 | echo " OUTPUT" 31 | echo "=====================================================================" 32 | echo "$output" 33 | echo "=====================================================================" 34 | echo " END OUTPUT" 35 | echo "=====================================================================" 36 | echo "STATUS: $status" 37 | [ "$status" -eq 0 ] 38 | } 39 | 40 | @test "Checking environment variable script execution with exit code 100..." { 41 | docker_run --rm -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh -v "$TESTS_WORKDIR"/TEST_VAR_UNSET:/etc/cont-env.d/TEST_VAR_UNSET $DOCKER_IMAGE 42 | echo "=====================================================================" 43 | echo " OUTPUT" 44 | echo "=====================================================================" 45 | echo "$output" 46 | echo "=====================================================================" 47 | echo " END OUTPUT" 48 | echo "=====================================================================" 49 | echo "STATUS: $status" 50 | [ "$status" -eq 0 ] 51 | } 52 | 53 | @test "Checking environment variable script execution with exit code 50..." { 54 | docker_run --rm -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh -v "$TESTS_WORKDIR"/TEST_VAR_FAIL:/etc/cont-env.d/TEST_VAR_FAIL $DOCKER_IMAGE 55 | echo "=====================================================================" 56 | echo " OUTPUT" 57 | echo "=====================================================================" 58 | echo "$output" 59 | echo "=====================================================================" 60 | echo " END OUTPUT" 61 | echo "=====================================================================" 62 | echo "STATUS: $status" 63 | [ "$status" -ne 0 ] 64 | } 65 | 66 | # vim:ft=sh:ts=4:sw=4:et:sts=4 67 | -------------------------------------------------------------------------------- /tests/test_exit_code.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | } 6 | 7 | teardown() { 8 | load teardown_common 9 | } 10 | 11 | @test "Checking container's exit code when /startapp.sh script is missing..." { 12 | docker_run --rm $DOCKER_IMAGE 13 | echo "=====================================================================" 14 | echo " OUTPUT" 15 | echo "=====================================================================" 16 | echo "$output" 17 | echo "=====================================================================" 18 | echo " END OUTPUT" 19 | echo "=====================================================================" 20 | echo "STATUS: $status" 21 | [ "$status" -eq 5 ] 22 | } 23 | 24 | @test "Checking container's exit code when forcing application's termination with success..." { 25 | STARTAPP_SCRIPT="$(mktemp)" 26 | echo '#!/bin/sh' >> "$STARTAPP_SCRIPT" 27 | echo 'exit 0' >> "$STARTAPP_SCRIPT" 28 | chmod a+rx "$STARTAPP_SCRIPT" 29 | docker_run --rm -v "$STARTAPP_SCRIPT":/startapp.sh $DOCKER_IMAGE 30 | rm "$STARTAPP_SCRIPT" 31 | echo "=====================================================================" 32 | echo " OUTPUT" 33 | echo "=====================================================================" 34 | echo "$output" 35 | echo "=====================================================================" 36 | echo " END OUTPUT" 37 | echo "=====================================================================" 38 | echo "STATUS: $status" 39 | [ "$status" -eq 0 ] 40 | } 41 | 42 | @test "Checking container's exit code when forcing application's termination with custom error..." { 43 | STARTAPP_SCRIPT="$(mktemp)" 44 | echo '#!/bin/sh' >> "$STARTAPP_SCRIPT" 45 | echo 'exit 10' >> "$STARTAPP_SCRIPT" 46 | chmod a+rx "$STARTAPP_SCRIPT" 47 | docker_run --rm -v "$STARTAPP_SCRIPT":/startapp.sh $DOCKER_IMAGE 48 | rm "$STARTAPP_SCRIPT" 49 | echo "=====================================================================" 50 | echo " OUTPUT" 51 | echo "=====================================================================" 52 | echo "$output" 53 | echo "=====================================================================" 54 | echo " END OUTPUT" 55 | echo "=====================================================================" 56 | echo "STATUS: $status" 57 | [ "$status" -eq 10 ] 58 | } 59 | 60 | # vim:ft=sh:ts=4:sw=4:et:sts=4 61 | -------------------------------------------------------------------------------- /tests/test_init_scripts.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | } 6 | 7 | teardown() { 8 | load teardown_common 9 | } 10 | 11 | @test "Checking that all init scripts terminate successfully..." { 12 | docker_run --rm $DOCKER_IMAGE 13 | regex=".* all container initialization scripts executed." 14 | for item in "${lines[@]}"; do 15 | if [[ "$item" =~ $regex ]]; then 16 | break; 17 | fi 18 | done 19 | echo "=====================================================================" 20 | echo " OUTPUT" 21 | echo "=====================================================================" 22 | echo "$output" 23 | echo "=====================================================================" 24 | echo " END OUTPUT" 25 | echo "=====================================================================" 26 | [[ "$item" =~ $regex ]] 27 | } 28 | 29 | # vim:ft=sh:ts=4:sw=4:et:sts=4 30 | -------------------------------------------------------------------------------- /tests/test_install_pkgs.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | echo "#!/bin/sh 7 | exit 0" > "$TESTS_WORKDIR"/startapp.sh 8 | chmod a+rx "$TESTS_WORKDIR"/startapp.sh 9 | } 10 | 11 | teardown() { 12 | load teardown_common 13 | } 14 | 15 | @test "Checking that installation of unknown package causes a failure..." { 16 | docker_run --rm -e "INSTALL_PACKAGES=nonexistingpackagetest" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 17 | echo "=====================================================================" 18 | echo " OUTPUT" 19 | echo "=====================================================================" 20 | echo "$output" 21 | echo "=====================================================================" 22 | echo " END OUTPUT" 23 | echo "=====================================================================" 24 | echo "STATUS: $status" 25 | [ "$status" -ne 0 ] 26 | } 27 | 28 | @test "Checking that package can be installed successfully..." { 29 | docker_run --rm -e "INSTALL_PACKAGES=xterm" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 30 | echo "=====================================================================" 31 | echo " OUTPUT" 32 | echo "=====================================================================" 33 | echo "$output" 34 | echo "=====================================================================" 35 | echo " END OUTPUT" 36 | echo "=====================================================================" 37 | echo "STATUS: $status" 38 | [ "$status" -eq 0 ] 39 | } 40 | 41 | # vim:ft=sh:ts=4:sw=4:et:sts=4 42 | -------------------------------------------------------------------------------- /tests/test_login_env_vars.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | load setup_container_daemon 6 | } 7 | 8 | teardown() { 9 | load teardown_container_daemon 10 | load teardown_common 11 | } 12 | 13 | @test "Checking that internal environment variables are exposed when logging in..." { 14 | exec_container_daemon sh -c "[ -f /root/.profile ] && . /root/.profile || . /root/.docker_rc; env | grep -w XDG_DATA_HOME" 15 | } 16 | 17 | # vim:ft=sh:ts=4:sw=4:et:sts=4 18 | -------------------------------------------------------------------------------- /tests/test_logmonitor_log_file.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | # This will be used to disabled YAD. 7 | echo "#!/bin/sh" > "$TESTS_WORKDIR"/yad-send 8 | chmod +x "$TESTS_WORKDIR"/yad-send 9 | 10 | # Create first notification definition. 11 | mkdir "$TESTS_WORKDIR"/test1 12 | echo 'Test1 title' > "$TESTS_WORKDIR"/test1/title 13 | echo 'Test description' > "$TESTS_WORKDIR"/test1/desc 14 | echo ERROR > "$TESTS_WORKDIR"/test1/level 15 | cat << EOF > "$TESTS_WORKDIR"/test1/filter 16 | #!/bin/sh 17 | echo RUNNING_FILTER1 on: \$1 18 | echo "\$1" | grep -q TriggerWord 19 | EOF 20 | echo "/tmp/test1.log" > "$TESTS_WORKDIR"/test1/source 21 | chmod +x "$TESTS_WORKDIR"/test1/filter 22 | 23 | # Create second notification definition. 24 | mkdir "$TESTS_WORKDIR"/test2 25 | cat << EOF > "$TESTS_WORKDIR"/test2/title 26 | #!/bin/sh 27 | echo 'Test2 title' 28 | EOF 29 | cat << EOF > "$TESTS_WORKDIR"/test2/desc 30 | #!/bin/sh 31 | echo 'Test description' 32 | EOF 33 | cat << EOF > "$TESTS_WORKDIR"/test2/level 34 | #!/bin/sh 35 | echo ERROR 36 | EOF 37 | cat << EOF > "$TESTS_WORKDIR"/test2/filter 38 | #!/bin/sh 39 | echo RUNNING_FILTER2 on: \$1 40 | echo "\$1" | grep -q TriggerAnotherWord 41 | EOF 42 | echo "log:/tmp/test1.log" > "$TESTS_WORKDIR"/test2/source 43 | echo "log:/tmp/test2.log" >> "$TESTS_WORKDIR"/test2/source 44 | chmod +x "$TESTS_WORKDIR"/test2/title 45 | chmod +x "$TESTS_WORKDIR"/test2/desc 46 | chmod +x "$TESTS_WORKDIR"/test2/level 47 | chmod +x "$TESTS_WORKDIR"/test2/filter 48 | 49 | DOCKER_EXTRA_OPTS=() 50 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR/yad-send:/etc/logmonitor/targets.d/yad/send") 51 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR/test1:/etc/logmonitor/notifications.d/test1") 52 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR/test2:/etc/logmonitor/notifications.d/test2") 53 | 54 | load setup_container_daemon 55 | } 56 | 57 | teardown() { 58 | load teardown_container_daemon 59 | load teardown_common 60 | } 61 | 62 | @test "Checking log monitor functionality with log files..." { 63 | exec_container_daemon sh -c "touch /tmp/test1.log" 64 | exec_container_daemon sh -c "touch /tmp/test2.log" 65 | sleep 20 66 | 67 | exec_container_daemon sh -c "echo ThisIsALine1 >> /tmp/test1.log" 68 | exec_container_daemon sh -c "echo TriggerWord >> /tmp/test1.log" 69 | exec_container_daemon sh -c "echo ThisIsALine2 >> /tmp/test2.log" 70 | exec_container_daemon sh -c "echo TriggerAnotherWord >> /tmp/test2.log" 71 | sleep 20 72 | 73 | # Dump docker logs before proceeding to validations. 74 | echo "=====================================================================" 75 | echo " DOCKER LOGS" 76 | echo "=====================================================================" 77 | getlog_container_daemon 78 | echo "=====================================================================" 79 | echo " END DOCKER LOGS" 80 | echo "=====================================================================" 81 | 82 | run getlog_container_daemon 83 | count1=0 84 | count2=0 85 | for item in "${lines[@]}"; do 86 | regex1=".*ERROR: Test1 title Test description" 87 | regex2=".*ERROR: Test2 title Test description" 88 | if [[ "$item" =~ $regex1 ]]; then 89 | count1="$(expr $count1 + 1)" 90 | elif [[ "$item" =~ $regex2 ]]; then 91 | count2="$(expr $count2 + 1)" 92 | fi 93 | done 94 | [ "$count1" -eq 1 ] 95 | [ "$count2" -eq 1 ] 96 | } 97 | 98 | # vim:ft=sh:ts=4:sw=4:et:sts=4 99 | -------------------------------------------------------------------------------- /tests/test_logmonitor_status_file.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | # This will be used to disabled YAD. 7 | echo "#!/bin/sh" > "$TESTS_WORKDIR"/yad-send 8 | chmod +x "$TESTS_WORKDIR"/yad-send 9 | 10 | # Create first notification definition. 11 | mkdir "$TESTS_WORKDIR"/test1 12 | echo 'Test1 title' > "$TESTS_WORKDIR"/test1/title 13 | echo 'Test description' > "$TESTS_WORKDIR"/test1/desc 14 | echo ERROR > "$TESTS_WORKDIR"/test1/level 15 | cat << EOF > "$TESTS_WORKDIR"/test1/filter 16 | #!/bin/sh 17 | echo RUNNING_FILTER1 on: \$1 18 | echo "\$1" | grep -q TriggerWord 19 | EOF 20 | echo "status:/tmp/test1.status" > "$TESTS_WORKDIR"/test1/source 21 | chmod +x "$TESTS_WORKDIR"/test1/filter 22 | 23 | # Create second notification definition. 24 | mkdir "$TESTS_WORKDIR"/test2 25 | cat << EOF > "$TESTS_WORKDIR"/test2/title 26 | #!/bin/sh 27 | echo 'Test2 title' 28 | EOF 29 | cat << EOF > "$TESTS_WORKDIR"/test2/desc 30 | #!/bin/sh 31 | echo 'Test description' 32 | EOF 33 | cat << EOF > "$TESTS_WORKDIR"/test2/level 34 | #!/bin/sh 35 | echo ERROR 36 | EOF 37 | cat << EOF > "$TESTS_WORKDIR"/test2/filter 38 | #!/bin/sh 39 | echo RUNNING_FILTER2 on: \$1 40 | echo "\$1" | grep -q TriggerAnotherWord 41 | EOF 42 | echo "status:/tmp/test1.status" > "$TESTS_WORKDIR"/test2/source 43 | echo "status:/tmp/test2.status" >> "$TESTS_WORKDIR"/test2/source 44 | chmod +x "$TESTS_WORKDIR"/test2/title 45 | chmod +x "$TESTS_WORKDIR"/test2/desc 46 | chmod +x "$TESTS_WORKDIR"/test2/level 47 | chmod +x "$TESTS_WORKDIR"/test2/filter 48 | 49 | DOCKER_EXTRA_OPTS=() 50 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR/yad-send:/etc/logmonitor/targets.d/yad/send") 51 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR/test1:/etc/logmonitor/notifications.d/test1") 52 | DOCKER_EXTRA_OPTS+=("-v" "$TESTS_WORKDIR/test2:/etc/logmonitor/notifications.d/test2") 53 | 54 | load setup_container_daemon 55 | } 56 | 57 | teardown() { 58 | load teardown_container_daemon 59 | load teardown_common 60 | } 61 | 62 | @test "Checking log monitor functionality with status files..." { 63 | exec_container_daemon sh -c "echo TriggerWord > /tmp/test1.status" 64 | exec_container_daemon sh -c "echo TriggerAnotherWord > /tmp/test2.status" 65 | sleep 20 66 | 67 | # Dump docker logs before proceeding to validations. 68 | echo "=====================================================================" 69 | echo " DOCKER LOGS" 70 | echo "=====================================================================" 71 | getlog_container_daemon 72 | echo "=====================================================================" 73 | echo " END DOCKER LOGS" 74 | echo "=====================================================================" 75 | 76 | run getlog_container_daemon 77 | count1=0 78 | count2=0 79 | for item in "${lines[@]}"; do 80 | regex1=".*ERROR: Test1 title Test description" 81 | regex2=".*ERROR: Test2 title Test description" 82 | if [[ "$item" =~ $regex1 ]]; then 83 | count1="$(expr $count1 + 1)" 84 | elif [[ "$item" =~ $regex2 ]]; then 85 | count2="$(expr $count2 + 1)" 86 | fi 87 | done 88 | [ "$count1" -eq 1 ] 89 | [ "$count2" -eq 1 ] 90 | } 91 | 92 | # vim:ft=sh:ts=4:sw=4:et:sts=4 93 | -------------------------------------------------------------------------------- /tests/test_niceness.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | echo "#!/bin/sh 7 | exit 0" > "$TESTS_WORKDIR"/startapp.sh 8 | chmod a+rx "$TESTS_WORKDIR"/startapp.sh 9 | } 10 | 11 | teardown() { 12 | load teardown_common 13 | } 14 | 15 | @test "Checking that a positive niceness value can be set successfully..." { 16 | docker_run --rm -e "APP_NICENESS=19" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 17 | script_rc="$(get_init_script_exit_code '10-check-app-niceness.sh' $lines)" 18 | echo "=====================================================================" 19 | echo " OUTPUT" 20 | echo "=====================================================================" 21 | echo "$output" 22 | echo "=====================================================================" 23 | echo " END OUTPUT" 24 | echo "=====================================================================" 25 | echo "STATUS: $status" 26 | echo "SCRIPT_RC: $script_rc" 27 | [ "$status" -eq 0 ] 28 | [ "$script_rc" -eq 0 ] 29 | } 30 | 31 | @test "Checking that a negative niceness value fails without the --cap-add=SYS_NICE option..." { 32 | docker_run --rm -e "APP_NICENESS=-1" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 33 | script_rc="$(get_init_script_exit_code '10-check-app-niceness.sh' $lines)" 34 | echo "=====================================================================" 35 | echo " OUTPUT" 36 | echo "=====================================================================" 37 | echo "$output" 38 | echo "=====================================================================" 39 | echo " END OUTPUT" 40 | echo "=====================================================================" 41 | echo "STATUS: $status" 42 | echo "SCRIPT_RC: $script_rc" 43 | [ "$status" -eq 6 ] 44 | [ "$script_rc" -eq 6 ] 45 | } 46 | 47 | @test "Checking that a negative niceness value succeed with the --cap-add=SYS_NICE option..." { 48 | docker_run --rm -e "APP_NICENESS=-1" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh --cap-add=SYS_NICE $DOCKER_IMAGE 49 | script_rc="$(get_init_script_exit_code '10-check-app-niceness.sh' $lines)" 50 | echo "=====================================================================" 51 | echo " OUTPUT" 52 | echo "=====================================================================" 53 | echo "$output" 54 | echo "=====================================================================" 55 | echo " END OUTPUT" 56 | echo "=====================================================================" 57 | echo "STATUS: $status" 58 | echo "SCRIPT_RC: $script_rc" 59 | [ "$status" -eq 0 ] 60 | [ "$script_rc" -eq 0 ] 61 | } 62 | 63 | # vim:ft=sh:ts=4:sw=4:et:sts=4 64 | -------------------------------------------------------------------------------- /tests/test_pkgs_mirror.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | echo "#!/bin/sh 7 | exit 0" > "$TESTS_WORKDIR"/startapp.sh 8 | chmod a+rx "$TESTS_WORKDIR"/startapp.sh 9 | } 10 | 11 | teardown() { 12 | load teardown_common 13 | } 14 | 15 | @test "Checking that packages mirror can be set successfully..." { 16 | docker_run --rm -e "PACKAGES_MIRROR=https://example.com" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 17 | echo "=====================================================================" 18 | echo " OUTPUT" 19 | echo "=====================================================================" 20 | echo "$output" 21 | echo "=====================================================================" 22 | echo " END OUTPUT" 23 | echo "=====================================================================" 24 | echo "STATUS: $status" 25 | [ "$status" -eq 0 ] 26 | 27 | regex=".* setting packages mirror to 'https://example.com'" 28 | for item in "${lines[@]}"; do 29 | if [[ "$item" =~ $regex ]]; then 30 | break; 31 | fi 32 | done 33 | [[ "$item" =~ $regex ]] 34 | } 35 | 36 | @test "Checking that package can be installed successfully when a mirror is set..." { 37 | docker_run --rm $DOCKER_IMAGE uname -m 38 | [ "$status" -eq 0 ] 39 | ARCH="${lines[0]}" 40 | 41 | docker_run --rm $DOCKER_IMAGE cat /etc/os-release 42 | [ "$status" -eq 0 ] 43 | 44 | regex="^ID=.*" 45 | for item in "${lines[@]}"; do 46 | if [[ "$item" =~ $regex ]]; then 47 | OS="${item#*=}" 48 | break; 49 | fi 50 | done 51 | 52 | case "$OS" in 53 | alpine) 54 | MIRROR="http://uk.alpinelinux.org/alpine/" 55 | ;; 56 | debian) 57 | MIRROR="http://ftp.us.debian.org/debian/" 58 | ;; 59 | ubuntu) 60 | case "$ARCH" in 61 | i386|i686|x86_64) 62 | MIRROR="http://mirror.math.princeton.edu/pub/ubuntu/" 63 | ;; 64 | *) 65 | MIRROR="http://in.mirror.coganng.com/ubuntu-ports/" 66 | ;; 67 | esac 68 | ;; 69 | arch) 70 | MIRROR="http://arch.mirror.square-r00t.net" 71 | ;; 72 | *) 73 | echo "ERROR: Unknown OS '$OS'." 74 | exit 1 75 | ;; 76 | esac 77 | 78 | docker_run --rm -e "PACKAGES_MIRROR=$MIRROR" -e "INSTALL_PACKAGES=patchelf" -v "$TESTS_WORKDIR"/startapp.sh:/startapp.sh $DOCKER_IMAGE 79 | echo "=====================================================================" 80 | echo " OUTPUT" 81 | echo "=====================================================================" 82 | echo "$output" 83 | echo "=====================================================================" 84 | echo " END OUTPUT" 85 | echo "=====================================================================" 86 | echo "STATUS: $status" 87 | [ "$status" -eq 0 ] 88 | } 89 | 90 | # vim:ft=sh:ts=4:sw=4:et:sts=4 91 | -------------------------------------------------------------------------------- /tests/test_port_availability.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | DOCKER_EXTRA_OPTS=("-p" "5900:5900" "-p" "5800:5800") 4 | 5 | setup() { 6 | load setup_common 7 | load setup_container_daemon 8 | } 9 | 10 | teardown() { 11 | load teardown_container_daemon 12 | } 13 | 14 | @test "Checking availability of HTTP port 5800..." { 15 | TIMEOUT=15 16 | while (( TIMEOUT > 0 )); do 17 | run curl --silent --connect-timeout 2 http://127.0.0.1:5800 18 | [ "$status" -eq 0 ] && break 19 | sleep 1 20 | (( TIMEOUT-- )) 21 | done 22 | (( TIMEOUT > 0 )) 23 | } 24 | 25 | @test "Checking availability of VNC port 5900..." { 26 | TIMEOUT=15 27 | while (( TIMEOUT > 0 )); do 28 | run nc -w1 -n 127.0.0.1 5900 29 | [ "$status" -eq 0 ] && [ "$output" == "RFB 003.008" ] && break 30 | sleep 1 31 | (( TIMEOUT-- )) 32 | done 33 | (( TIMEOUT > 0 )) 34 | } 35 | 36 | # vim:ft=sh:ts=4:sw=4:et:sts=4 37 | -------------------------------------------------------------------------------- /tests/test_secure_port_availability.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | 6 | if [ ! -f "$TESTS_WORKDIR"/dhparam.pem ]; then 7 | openssl dhparam -dsaparam -out "$TESTS_WORKDIR"/dhparam.pem 2048 > /dev/null 2>&1 8 | fi 9 | 10 | DOCKER_EXTRA_OPTS=("-p" "5900:5900" "-p" "5800:5800" "-e" "SECURE_CONNECTION=1" "-e" "USE_DEFAULT_DH_PARAMS=1" "-v" "$TESTS_WORKDIR/dhparam.pem:/config/certs/dhparam.pem:rw") 11 | load setup_container_daemon 12 | } 13 | 14 | teardown() { 15 | load teardown_container_daemon 16 | } 17 | 18 | @test "Checking availability of HTTPs port 5800..." { 19 | TIMEOUT=30 20 | while (( TIMEOUT > 0 )); do 21 | run curl --silent --insecure --connect-timeout 2 https://127.0.0.1:5800 22 | [ "$status" -eq 0 ] && break 23 | sleep 1 24 | (( TIMEOUT-- )) 25 | done 26 | (( TIMEOUT > 0 )) 27 | } 28 | 29 | @test "Checking availability of VNC SSL port 5900..." { 30 | TIMEOUT=30 31 | while (( TIMEOUT > 0 )); do 32 | run no_stderr timeout 2 openssl s_client -quiet -verify_quiet -connect 127.0.0.1:5900 2>/dev/null 33 | [ "$output" == "RFB 003.008" ] && break 34 | sleep 1 35 | (( TIMEOUT-- )) 36 | done 37 | (( TIMEOUT > 0 )) 38 | } 39 | 40 | # vim:ft=sh:ts=4:sw=4:et:sts=4 41 | -------------------------------------------------------------------------------- /tests/test_tmp_dir_clean.bats: -------------------------------------------------------------------------------- 1 | #!/bin/env bats 2 | 3 | setup() { 4 | load setup_common 5 | load setup_container_daemon 6 | } 7 | 8 | teardown() { 9 | load teardown_container_daemon 10 | load teardown_common 11 | } 12 | 13 | @test "Checking that the /tmp directory is cleaned..." { 14 | exec_container_daemon sh -c "touch /tmp/test_file" 15 | 16 | restart_container_daemon 17 | 18 | exec_container_daemon sh -c "[ ! -f /tmp/test_file ]" 19 | } 20 | 21 | # vim:ft=sh:ts=4:sw=4:et:sts=4 22 | -------------------------------------------------------------------------------- /tools/ssvnc_windows_only-1.0.30-r1.zip: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/jlesage/docker-baseimage-gui/fac19696bc22bc0c0c628186f728f085ab600a67/tools/ssvnc_windows_only-1.0.30-r1.zip --------------------------------------------------------------------------------