feat: hide ONLYOFFICE logo via direct CSS patch + iframe injection + init script for persistence

This commit is contained in:
root
2026-07-16 19:03:36 +00:00
parent fce938b0c2
commit f6c0bb0c5f
6 changed files with 39 additions and 3 deletions

24
onlyoffice-init.sh Normal file
View File

@@ -0,0 +1,24 @@
#!/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