Files
cv-app/onlyoffice-init.sh

24 lines
1.1 KiB
Bash

#!/bin/bash
# ONLYOFFICE init script - runs before the document server starts
# Hides the ONLYOFFICE logo from the editor header
CSS_FILE=/var/www/onlyoffice/documentserver/web-apps/apps/documenteditor/main/resources/css/app.css
if [ -f "$CSS_FILE" ]; then
# Check if already patched
if ! grep -q 'display:none!important' <<< "$(grep '#header-logo{' "$CSS_FILE" | head -1)"; then
sed -i 's/#header-logo{/#header-logo{display:none!important;/g' "$CSS_FILE"
echo "[onlyoffice-init] Patched app.css to hide logo"
fi
fi
# Also patch the spreadsheet and presentation editors if they exist
for CSS in \
/var/www/onlyoffice/documentserver/web-apps/apps/spreadsheeteditor/main/resources/css/app.css \
/var/www/onlyoffice/documentserver/web-apps/apps/presentationeditor/main/resources/css/app.css; do
if [ -f "$CSS" ]; then
if ! grep -q 'display:none!important' <<< "$(grep '#header-logo{' "$CSS" | head -1)"; then
sed -i 's/#header-logo{/#header-logo{display:none!important;/g' "$CSS"
echo "[onlyoffice-init] Patched $(basename $(dirname $(dirname $(dirname $(dirname $CSS))))) to hide logo"
fi
fi
done