etherpad-lite icon indicating copy to clipboard operation
etherpad-lite copied to clipboard

Toolbar Icons not showing after update (1.6.2 -> 1.8.3) when exposing in a subdir via a reverse proxy and minify = true

Open skramsa opened this issue 6 years ago • 110 comments

image

The toolbar Icons are not showing and I get missing font family errors, but they're all in their folders, nothing was changed. Can you help me fix this issue?

GET /static/font/Roboto-Regular.ttf net::ERR_ABORTED 404 (Not Found)

I get this for all font families.

skramsa avatar Apr 28 '20 07:04 skramsa

Please provide details.

Are you running behind reverse proxy? Are you running in development or production mode. Minified? Secured copy or your settings.json Etc.

https://mclear.co.uk/2015/01/15/how-to-write-a-bug-report/

JohnMcLear avatar Apr 28 '20 08:04 JohnMcLear

It's running in development mode, although the systemd service has "Environment=NODE_ENV=production" in it, no reverse proxy, the css is minified, settings.json is barely touched (only mysql and admin pw is changed).

It looks like etherpad can't load all fonts because it looks at /static/font/*.ttf instead of /etherpad/src/static/font/

skramsa avatar Apr 28 '20 08:04 skramsa

Try turn minify to false and maxage to 0 in settings.json

JohnMcLear avatar Apr 28 '20 08:04 JohnMcLear

I did, nothing changed

skramsa avatar Apr 28 '20 08:04 skramsa

At my laptop now, might be able to help more. Most useful thing is to get your settings.json (but remove any passwords). Can you provide that please?

FWIW I tested 1.6.* > 1.8.3 and didn't experience this but it could be related to your settings.json having some legacy cruft in :!

JohnMcLear avatar Apr 28 '20 09:04 JohnMcLear

If you don't want to provide settings one thing to do is:

cp settings.json settings.backup.json cp settings.json.template settings.json Then copy your database host/user/pass from settings.backup.json into settings.json

Restart and see if it's fixed.

JohnMcLear avatar Apr 28 '20 09:04 JohnMcLear

/*
  This file must be valid JSON. But comments are allowed

  Please edit settings.json, not settings.json.template

  To still commit settings without credentials you can
  store any credential settings in credentials.json
*/
{
  // Name your instance!
  "title": "HelpMe-Etherpad",

  // favicon default name
  // alternatively, set up a fully specified Url to your own favicon
  "favicon": "favicon.ico",

  //IP and port which etherpad should bind at
  "ip": "0.0.0.0",
  "port" : 9001,

  // Option to hide/show the settings.json in admin page, default option is set to true
  "showSettingsInAdminPage" : true,

  /*
  // Node native SSL support
  // this is disabled by default
  //
  // make sure to have the minimum and correct file access permissions set
  // so that the Etherpad server can access them

  "ssl" : {
            "key"  : "/path-to-your/epl-server.key",
            "cert" : "/path-to-your/epl-server.crt",
            "ca": ["/path-to-your/epl-intermediate-cert1.crt", "/path-to-your/epl-intermediate-cert2.crt"]
          },

  */

  //The Type of the database. You can choose between dirty, postgres, sqlite and mysql
  //You shouldn't use "dirty" for for anything else than testing or development
  /*"dbType" : "dirty",
  //the database specific settings
  "dbSettings" : {
                   "filename" : "var/dirty.db"
                 },

   An Example of MySQL Configuration*/
   "dbType" : "mysql",
   "dbSettings" : {
                    "user"    : "etherpad",
                    "host"    : "localhost",
                    "password": "",
                    "database": "etherpad",
                    "charset" : "utf8mb4"
                  },
   "users": {
	"admin": {
		"password": "",
		"is_admin": true
		}
            },

  //the default text of a pad
  "defaultPadText" : "Willkommen zum CN-Etherpad!\n\nDieses Dokument wird beim Tippen laufend aktualisiert, sodass jeder immer denselben Text sieht. So kann man nahtlos zusammen an Dokumenten arbeiten.\n",

  /* Default Pad behavior, users can override by changing */
  "padOptions": {
    "noColors": false,
    "showControls": true,
    "showChat": true,
    "showLineNumbers": true,
    "useMonospaceFont": false,
    "userName": false,
    "userColor": false,
    "rtl": false,
    "alwaysShowChat": false,
    "chatAndUsers": false,
    "lang": "de-de"
  },

  /* Should we suppress errors from being visible in the default Pad Text? */
  "suppressErrorsInPadText" : false,

  /* Users must have a session to access pads. This effectively allows only group pads to be accessed. */
  "requireSession" : false,

  /* Users may edit pads but not create new ones. Pad creation is only via the API. This applies both to group pads and regular pads. */
  "editOnly" : false,

  /* Users, who have a valid session, automatically get granted access to password protected pads */
  "sessionNoPassword" : false,

  /* if true, all css & js will be minified before sending to the client. This will improve the loading performance massivly,
     but makes it impossible to debug the javascript/css */
  "minify" : false,

  /* How long may clients use served javascript code (in seconds)? Without versioning this
     may cause problems during deployment. Set to 0 to disable caching */
  "maxAge" : 21600, // 60 * 60 * 6 = 6 hours

  /* This is the absolute path to the Abiword executable. Setting it to null, disables abiword.
     Abiword is needed to advanced import/export features of pads*/
  "abiword" : "/usr/local/bin/abiword",

  /* This is the absolute path to the soffice executable. Setting it to null, disables LibreOffice exporting.
     LibreOffice can be used in lieu of Abiword to export pads */
  "soffice" : null,

  /* This is the path to the Tidy executable. Setting it to null, disables Tidy.
     Tidy is used to improve the quality of exported pads*/
  "tidyHtml" : "/usr/bin/tidy",

  /* Allow import of file types other than the supported types: txt, doc, docx, rtf, odt, html & htm */
  "allowUnknownFileEnds" : true,

  /* This setting is used if you require authentication of all users.
     Note: /admin always requires authentication. */
  "requireAuthentication" : false,

  /* Require authorization by a module, or a user with is_admin set, see below. */
  "requireAuthorization" : false,

  /*when you use NginX or another proxy/ load-balancer set this to true*/
  "trustProxy" : false,

  /* Privacy: disable IP logging */
  "disableIPlogging" : false,

  /* Users for basic authentication. is_admin = true gives access to /admin.
     If you do not uncomment this, /admin will not be available! */
  

  // restrict socket.io transport methods
  "socketTransportProtocols" : ["xhr-polling", "jsonp-polling", "htmlfile"],

  // Allow Load Testing tools to hit the Etherpad Instance.  Warning this will disable security on the instance.
  "loadTest": false,

  // Disable indentation on new line when previous line ends with some special chars (':', '[', '(', '{')
  /*
  "indentationOnNewLine": false,
  */

  /* The toolbar buttons configuration.
  "toolbar": {
    "left": [
      ["bold", "italic", "underline", "strikethrough"],
      ["orderedlist", "unorderedlist", "indent", "outdent"],
      ["undo", "redo"],
      ["clearauthorship"]
    ],
    "right": [
      ["importexport", "timeslider", "savedrevision"],
      ["settings", "embed"],
      ["showusers"]
    ],
    "timeslider": [
      ["timeslider_export", "timeslider_returnToPad"]
    ]
  },
*/
  /* The log level we are using, can be: DEBUG, INFO, WARN, ERROR */
  "loglevel": "INFO",

  //Logging configuration. See log4js documentation for further information
  // https://github.com/nomiddlename/log4js-node
  // You can add as many appenders as you want here:
  "logconfig" :
    { "appenders": [
        { "type": "console"
        //, "category": "access"// only logs pad access
        }
    /*
      , { "type": "file"
      , "filename": "your-log-file-here.log"
      , "maxLogSize": 1024
      , "backups": 3 // how many log files there're gonna be at max
      //, "category": "test" // only log a specific category
        }*/
    /*
      , { "type": "logLevelFilter"
        , "level": "warn" // filters out all log messages that have a lower level than "error"
        , "appender":
          {  Use whatever appender you want here  }
        }*/
    /*
      , { "type": "logLevelFilter"
        , "level": "error" // filters out all log messages that have a lower level than "error"
        , "appender":
          { "type": "smtp"
          , "subject": "An error occurred in your EPL instance!"
          , "recipients": "[email protected], [email protected]"
          , "sendInterval": 300 // 60 * 5 = 5 minutes -- will buffer log messages; set to 0 to send a mail for every message
          , "transport": "SMTP", "SMTP": { // see https://github.com/andris9/Nodemailer#possible-transport-methods
              "host": "smtp.example.com", "port": 465,
              "secureConnection": true,
              "auth": {
                  "user": "[email protected]",
                  "pass": "bar_foo"
              }
            }
          }
        }*/
      ]
    }
}

skramsa avatar Apr 28 '20 09:04 skramsa

Okay cool, gimme 2 mins.

JohnMcLear avatar Apr 28 '20 09:04 JohnMcLear

Nope, that didn't replicate, toolbar buttons exist for me..

Is this instance public that I can access? feel free to email me URL [email protected]

Stupid question.. Did you

  • [x] Clear browser cache?
  • [x] Attempt to run using bin/run.sh

Thanks!

JohnMcLear avatar Apr 28 '20 09:04 JohnMcLear

Sadly it's not a public instance. I replaced the settings.json with the new template, also changed skin to no-skin. stilll no success.. And yes, I've run run.sh, restarted the service and cleared the cash :)

skramsa avatar Apr 28 '20 09:04 skramsa

This is the systemd service btw: [Unit] Description=Etherpad After=syslog.target network.target

[Service] Type=simple User=etherpad Group=etherpad WorkingDirectory=/opt/etherpad Environment=NODE_ENV=production ExecStart=/opt/etherpad/bin/run.sh Restart=always

[Install] WantedBy=multi-user.target

skramsa avatar Apr 28 '20 09:04 skramsa

How did you install? Did you git clone or did you grab the released .zip and unpack?

JohnMcLear avatar Apr 28 '20 09:04 JohnMcLear

Request URL: https://dev.com:9001/static/font/RobotoMono-Regular.ttf

jose@server:~/develop$ locate RobotoMono | grep develop | grep Reg
/home/jose/develop/src/static/font/RobotoMono-Regular.ttf

All looks fine to me.

JohnMcLear avatar Apr 28 '20 09:04 JohnMcLear

I installed it via git clone, or rather updated it. I believe it was installed a few years ago (by another admin) through zip unpack. I used rsync to update everything

skramsa avatar Apr 28 '20 09:04 skramsa

Ah, I wonder if the last admin put some hacks in? if you git status do you see any modified files?

JohnMcLear avatar Apr 28 '20 10:04 JohnMcLear

What happens if you git clone a fresh repo then copy your settings.json over? That will work but obviously isn't fixing the problem that something is weird..

JohnMcLear avatar Apr 28 '20 10:04 JohnMcLear

I'm going to do that now. yes, it's very weird.. as if the root folder for the fonts is not the same as etherpad

skramsa avatar Apr 28 '20 12:04 skramsa

The code is right btw. src/ is the root folder..

I think the previous admin hacked something, I can't say what without seeing a git diff. Can we close this now?

JohnMcLear avatar Apr 28 '20 12:04 JohnMcLear

previous admin didn't use git (was not installed), still doesn't work after clean clone..

skramsa avatar Apr 28 '20 12:04 skramsa

@skramsa lulwut. Completely clean clone and run and it doesn't work? :! I have a feeling something is weird with your setup.. Any errors or warnings in log?

What if you do a completely clean clone and don't change any settings? Does it still fail then?

Any chance you can make it public temporarily for me to debug?

JohnMcLear avatar Apr 28 '20 12:04 JohnMcLear