diff --git a/.gitea/workflows/build.yml b/.gitea/workflows/build.yml.disabled similarity index 100% rename from .gitea/workflows/build.yml rename to .gitea/workflows/build.yml.disabled diff --git a/.gitea/workflows/mirror-alpine.yml b/.gitea/workflows/mirror-alpine.yml.disabled similarity index 100% rename from .gitea/workflows/mirror-alpine.yml rename to .gitea/workflows/mirror-alpine.yml.disabled diff --git a/Dockerfile b/Dockerfile index fda5732..867f715 100644 --- a/Dockerfile +++ b/Dockerfile @@ -42,6 +42,8 @@ RUN apt-get update && apt-get install -y \ xauth \ # Supervisord to manage processes supervisor \ + # Emoji font support + fonts-noto-color-emoji \ # Utilities wget \ curl \ @@ -72,9 +74,12 @@ COPY supervisord.conf /etc/supervisor/conf.d/supervisord.conf COPY entrypoint.sh /usr/local/bin/entrypoint.sh COPY openbox-rc.xml /home/${USER}/.config/openbox/rc.xml COPY index.html /usr/share/novnc/index.html +COPY vnc-patched.html /usr/share/novnc/vnc.html +COPY vnc-clipboard-bridge.js /usr/share/novnc/vnc-clipboard-bridge.js +COPY log-prefix.sh /usr/local/bin/log-prefix.sh # Set permissions -RUN chmod +x /usr/local/bin/entrypoint.sh \ +RUN chmod +x /usr/local/bin/entrypoint.sh /usr/local/bin/log-prefix.sh \ && chown -R ${USER}:${USER} /home/${USER} /config /downloads /incomplete # Expose noVNC and Soulseek ports diff --git a/entrypoint.sh b/entrypoint.sh index fdf921d..b381ef3 100755 --- a/entrypoint.sh +++ b/entrypoint.sh @@ -32,12 +32,36 @@ if [ ! -z "$VNC_PASSWORD" ]; then fi # Export environment variables for supervisord -export DISPLAY +export DISPLAY=${DISPLAY:-:0} export VNC_PORT export NOVNC_PORT export VNC_RESOLUTION export VNC_DEPTH export USER +# Ensure X11 socket directory exists with the correct permissions (needed by Xvnc) +mkdir -p /tmp/.X11-unix +chmod 1777 /tmp/.X11-unix +chown root:root /tmp/.X11-unix + +# Remove stale X lock files for the configured DISPLAY to avoid "Server is already active" errors +DISPLAY_NUM=${DISPLAY#:} +LOCK_FILE="/tmp/.X${DISPLAY_NUM}-lock" +SOCKET_FILE="/tmp/.X11-unix/X${DISPLAY_NUM}" +if [ -f "$LOCK_FILE" ]; then + LOCK_PID=$(cat "$LOCK_FILE" 2>/dev/null || true) + if pgrep -f "Xvnc :${DISPLAY_NUM}" >/dev/null 2>&1; then + echo "Existing Xvnc server detected for display :${DISPLAY_NUM}; leaving lock file intact" + elif [ -n "$LOCK_PID" ] && kill -0 "$LOCK_PID" 2>/dev/null; then + echo "Lock file $LOCK_FILE points to PID $LOCK_PID, but no Xvnc found; removing stale lock" + rm -f "$LOCK_FILE" + rm -f "$SOCKET_FILE" + else + echo "Removing stale X lock file $LOCK_FILE" + rm -f "$LOCK_FILE" + rm -f "$SOCKET_FILE" + fi +fi + # Start supervisord as root (which will start processes as nicotine user) exec "$@" diff --git a/index.html b/index.html index 82fe46a..d885c20 100644 --- a/index.html +++ b/index.html @@ -6,7 +6,8 @@
Redirecting to noVNC with remote resize enabled...
-If not redirected automatically, click here.
+Redirecting to Nicotine+ VNC interface...
+If not redirected automatically, click here.
+Note: Seamless clipboard sync is enabled when accessing via HTTPS.