Etherpad-lite: 通过反向代理在子目录中暴露并且minify = true时,更新后(1.6.2-> 1.8.3)工具栏图标未显示

创建于 2020-04-28  ·  110评论  ·  资料来源: ether/etherpad-lite

image

工具栏上的图标未显示,我丢失了字体系列错误,但它们都在文件夹中,没有任何更改。 您能帮我解决这个问题吗?

得到/static/font/Roboto-Regular.ttf net :: ERR_ABORTED 404(未找到)

我对所有字体系列都知道这一点。

Bug Special case Bug UI express server

最有用的评论

有完全相同的问题。

我使用反向代理,并且Etherpad实例位于子目录(/ etherpad)中。 我设法正确地将以下内容添加到我的apache配置中。

<Location /static/font>
    ProxyPass http://localhost:9001/static/font
    ProxyPassReverse http://localhost:9001/static/font
</Location>

我没有在settings.json中进行任何更改。

所有110条评论

请提供详细信息。

您是否在反向代理后面运行?
您是在开发还是生产模式下运行。
弄碎了?
安全副本或您的settings.json
等等。

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

它在开发模式下运行,尽管systemd服务中包含“ Environment = NODE_ENV = production”,没有反向代理,最小化了css,几乎没有改动settings.json(仅更改了mysql和admin pw)。

看起来etherpad无法加载所有字体,因为它看起来/static/font/*.ttf代替/ etherpad / src / static / font /

尝试在settings.json中将minify设置为false并将maxage设置为0

我做到了,什么都没改变

现在在我的笔记本电脑上,也许可以提供更多帮助。 最有用的是获取settings.json(但删除所有密码)。 你能提供吗?

FWIW我测试了1.6。*> 1.8.3,并没有遇到这种情况,但这可能与您的settings.json有关::!

如果您不想提供设置,则要做的一件事是:

cp settings.json settings.backup.json
cp settings.json.template settings.json
然后将您的数据库主机/用户/密码从settings.backup.json复制到settings.json

重新启动,看看是否固定。

/*
  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"
              }
            }
          }
        }*/
      ]
    }
}

好的,给我2分钟。

不,那没有复制,工具栏按钮对我来说是存在的。

我可以访问此实例吗? 请随时给我发送电子邮件URL [email protected]

愚蠢的问题。

  • [x]清除浏览器缓存?
  • [x]尝试使用bin/run.sh

谢谢!

遗憾的是,这不是公共实例。
我用新模板替换了settings.json,也将皮肤更改为无皮肤。 仍然没有成功..
是的,我已经运行run.sh,重新启动了服务并清除了现金:)

这是系统服务,顺便说一句:
[单元]
描述= Etherpad
之后= syslog.target network.target

[服务]
类型=简单
用户= etherpad
组= etherpad
WorkingDirectory = / opt / etherpad
环境= NODE_ENV =生产
ExecStart = /选择/etherpad/bin/run.sh
重启=总是

[安装]
WantedBy =多用户目标

您是如何安装的? 您是git clone还是抓住了已发布的.zip并解压缩?

请求网址: https://dev.com:9001/static/font/RobotoMono-Regular.ttf

jose<strong i="7">@server</strong>:~/develop$ locate RobotoMono | grep develop | grep Reg
/home/jose/develop/src/static/font/RobotoMono-Regular.ttf

对我来说一切都很好。

我通过git clone安装它,或者更新了它。 我相信它是几年前(由另一个管理员)通过zip解压缩安装的。 我用rsync更新了一切

啊,我想知道最后一个管理员是否对我进行了黑客入侵? 如果您git status您看到任何修改过的文件吗?

如果您git克隆了一个新的仓库,然后复制了settings.json,会发生什么? 可以,但是显然不能解决奇怪的问题。

我现在要去做。 是的,这很奇怪..好像字体的根文件夹与etherpad不同

该代码是正确的顺便说一句。 src /是根文件夹。

我认为以前的管理员入侵了某些内容,如果看不到git diff,我不能说什么。 我们现在可以关闭吗?

以前的管理员未使用git(未安装),但在干净克隆后仍然无法使用。

@skramsa lulwut。 完全清理克隆并运行,它不起作用吗? :! 我觉得您的设置有些奇怪。日志中是否有任何错误或警告?

如果您执行完全干净的克隆并且不更改任何设置怎么办? 那它还会失败吗?

您是否有机会暂时将其公开供我调试?

不,它在安全的Intranet上..从节点6升级到12可能与此有关吗?

不确定..我不太确定这里是否有其他调试步骤。

我唯一的线索是..
https://github.com/ether/etherpad-lite/blob/develop/src/node/utils/Minify.js#L429

但是您说您清理了所有缓存并进行了干净的运行。

您禁用了缩小功能, rm -Rf src/node_modules && rm src/package-lock.json然后运行了bin/run.sh是吗? 我的意思是您做了一个干净的克隆,所以; \

请问您的git shanpm --versionnodejs version值是多少?

npm为6.14.4,节点-v为12.16.2。 愚蠢的问题,但是“我的” git sha到底是什么意思?

我重新滚动到1.6.2,并将minify设置为false,然后突然再次起作用(在此之前,即使是旧版本的图标也没有起作用)。 真是个解脱..下周我将尝试使用此设置进行另一种干净的设置,也许这​​次可以了:D非常感谢您的帮助!

在您的etherpad文件夹中输入git rev-parse HEAD

我想看看您正在进行哪个提交。

你好
我有完全相同的问题,除了我在代理后面。
我通过保存安装并克隆存储库进行了测试。 然后,我只复制了配置文件并重新启动了服务。
尽管是全新安装,但我仍然遇到相同的问题。

但是:
另一方面,有趣的是,当我在不使用代理和不使用https的情况下访问服务时,没问题,图标可以正确显示!

apache代理配置来自文档,对我而言,没有任何异国情调。

有完全相同的问题。

我使用反向代理,并且Etherpad实例位于子目录(/ etherpad)中。 我设法正确地将以下内容添加到我的apache配置中。

<Location /static/font>
    ProxyPass http://localhost:9001/static/font
    ProxyPassReverse http://localhost:9001/static/font
</Location>

我没有在settings.json中进行任何更改。

@skramsa没有提到任何反向代理,所以我认为这没有关系吗? Skramsa请确认您的设置中没有反向代理。

有完全相同的问题。

我使用反向代理,并且Etherpad实例位于子目录(/ etherpad)中。 我设法正确地将以下内容添加到我的apache配置中。

<Location /static/font>
    ProxyPass http://localhost:9001/static/font retry=0 timeout=30
    ProxyPassReverse http://localhost:9001/static/font
</Location>

我没有在settings.json中进行任何更改。

为什么重试和超时规则?

@skramsa没有提到任何反向代理,所以我认为这没有关系吗? Skramsa请确认您的设置中没有反向代理。

是的,但是@julpec在代理后面,所以我虽然有帮助;)

有完全相同的问题。
我使用反向代理,并且Etherpad实例位于子目录(/ etherpad)中。 我设法正确地将以下内容添加到我的apache配置中。

<Location /static/font>
    ProxyPass http://localhost:9001/static/font retry=0 timeout=30
    ProxyPassReverse http://localhost:9001/static/font
</Location>

我没有在settings.json中进行任何更改。

为什么重试和超时规则?

您是对的,我认为这不是必需的,我只是在更新后昨天急着这样做了;)

@skramsa没有提到任何反向代理,所以我认为这没有关系吗? Skramsa请确认您的设置中没有反向代理。

是的,但是@julpec在代理后面,所以我虽然有帮助;)

谢谢

提醒一句 :

另一方面,有趣的是,当我在不使用代理和不使用https的情况下访问服务时,没问题,图标可以正确显示!

以我为例,很明显它与代理相关。

此外,我处于Etherpad实例的迁移情况下,并且迁移了数据库,之后又更新了Etherpad。 我现在在日志中显示了这个:

[2020-04-29 10:43:29.440] [ERROR] console - table is not configured with charset utf8mb4 -- This may lead to crashes when certain characters are pasted in pads

不知道它是否会导致错误...

提醒一句 :

另一方面,有趣的是,当我在不使用代理和不使用https的情况下访问服务时,没问题,图标可以正确显示!

以我为例,很明显它与代理相关。

此外,我处于Etherpad实例的迁移情况下,并且迁移了数据库,之后又更新了Etherpad。 我现在在日志中显示了这个:

[2020-04-29 10:43:29.440] [ERROR] console - table is not configured with charset utf8mb4 -- This may lead to crashes when certain characters are pasted in pads
不知道它是否会导致错误...

为此,请创建一个单独的问题。 它需要解决。

我也有同样的问题。
我在反向代理(Apache)的背后,并且正在使用(当前)最新的docker容器(一分钟前将其拉出):

$ docker image ls
REPOSITORY           TAG            IMAGE ID            CREATED             SIZE
etherpad/etherpad    latest         878d71df1b8e        44 hours ago        273MB

工具栏的外观与原始报表中的完全相同。 Etherpad被代理在/pad/ ,但是字体是从/static/加载的,这会导致404错误。

我宁愿不使用@lucaguindani的变通方法,因为/static/是非常常见的路径,其他应用程序也使用此路径。

好的,请尽快排序。 应该是今天,但是可能不会在本周合并,因此你们可能需要应用补丁。

发布一周后,我们都试图与家人等在一起。

我无法使用我的apache配置复制它。 有人可以粘贴令人反感的apache配置吗?

也已通过Wiki配置对nginx进行了测试,无法在其中复制; /

image

image

让我觉得你们所有人都经历过怪异的Apache错误配置/怪癖。 你们都是从哪里获得apache subdir配置的? 我们没有在Wiki afaik上提供一个,所以我想也许你们已经流氓了? :P

PS我正在针对开发进行测试,这几乎是atm发行版,nginx的配置是:

server {
        listen       80;
        server_name  pad.example.com;

        access_log  /var/log/nginx/eplite.access.log;
        error_log   /var/log/nginx/eplite.error.log;

    location /pad {
        rewrite                /pad/(.*) /$1 break;
        rewrite                ^/pad$ /pad/ permanent;
        proxy_pass             http://localhost:9001/;
        proxy_pass_header Server;
        proxy_redirect         / /pad/;
        proxy_set_header       Host $host;
        proxy_buffering off;
    }

    location /pad/socket.io {
        rewrite /pad/socket.io/(.*) /socket.io/$1 break;
        proxy_pass http://localhost:9001/;
        proxy_redirect         / /pad/;
        proxy_set_header Host $host;
        proxy_buffering off;
        proxy_set_header X-Real-IP $remote_addr;  # http://wiki.nginx.org/HttpProxyModule
        proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP
        proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used
        proxy_set_header Host $host;  # pass the host header
        proxy_http_version 1.1;  # recommended with keepalive connections
        # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

    location /static {
        rewrite /static/(.*) /static/$1 break;
        proxy_pass http://localhost:9001/;
        proxy_set_header Host $host;
        proxy_buffering off;
    }

}

# we're in the http context here
map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}

我确实注意到tests / frontend / index.html失败了,这看起来很奇怪

我还尝试了/pad/foo/p/blah只是为了确认Etherpad一侧没有错误并且一切看起来都很好...

我无法使用我的apache配置复制它。 有人可以粘贴令人反感的apache配置吗?

这是我的:

<Location /pad/>
    Order allow,deny
    Allow from all
    Options All +MultiViews -ExecCGI
    AuthType Basic
    AuthName "authentification"
    AuthBasicProvider       ldap
    AuthLDAPURL "ldap://127.0.0.1:389/ou=****,dc=****,dc=****,dc=org"
    AuthLDAPGroupAttribute memberUid
    AuthLDAPGroupAttributeIsDN off
    require ldap-group cn=****,ou=***,dc=*****,dc=****,dc=org

    ProxyPass http://localhost:9002/ 
    ProxyPassReverse http://localhost:9002/
    RewriteEngine On
    RewriteCond %{LA-U:REMOTE_USER,NS} (.+)
    RewriteRule . - [E=RU:%1]
    RequestHeader add X-Forwarded-User %{RU}e
</Location>

非常感谢gimme一个小时将在今晚尝试。

让我觉得你们所有人都经历过怪异的Apache错误配置/怪癖。 你们都是从哪里获得apache subdir配置的? 我们没有在Wiki afaik上提供一个,所以我想也许你们已经流氓了? :P

这里

让我觉得你们所有人都经历过怪异的Apache错误配置/怪癖。 你们都是从哪里获得apache subdir配置的? 我们没有在Wiki afaik上提供一个,所以我想也许你们已经流氓了? :P

这里

我看了看那里的例子并没有涵盖将Etherpad放在Apache的子目录中...

image

使用略微修改的剪裁版本

<VirtualHost *:81>
<Location /pad/>
    Order allow,deny
    Allow from all
    Options All +MultiViews -ExecCGI
    ProxyPass http://localhost:9001/
    ProxyPassReverse http://localhost:9001/
    RewriteEngine On
    RewriteCond %{LA-U:REMOTE_USER,NS} (.+)
    RewriteRule . - [E=RU:%1]
</Location>
</VirtualHost>

image

jose<strong i="5">@server</strong>:~/develop$ apache2 -v
Server version: Apache/2.4.29 (Ubuntu)
Server built:   2020-03-13T12:26:16

我看了看那里的例子并没有涵盖将Etherpad放在Apache的子目录中...

这没有意义。 您可以在位置标记中放置任何内容。 但是,我将尝试使用config,并且现在不包含“子目录”。
谢谢您的调查顺便说一句

这没有意义。 您可以在位置标记中放置任何内容。 但是,我将尝试使用config,并且现在不包含“子目录”。

在我的大脑里这没有意义。 但是,在现实世界中,这就是导致问题的原因!
好点:+1:
但是,我不明白为什么以前一切都这么好,它作为配置在反向代理后面运行了多年。
我确实需要一个子目录,因为我在apache“单点登录”后面运行着不同的服务。
是否可以使用“ /”以外的其他位置?

感谢您在此问题上的工作

从上方复制/粘贴我的配置,我使用其他位置...

除了身份验证设置外,我看不出有什么区别。
我现在要尝试

从上方复制/粘贴我的配置,我使用其他位置...

仍然是同样的问题:不显示图标

Apache版本?

服务器版本:Apache / 2.4.38(Debian)
服务器内置:2019-10-15T19:53:42

我与元素检查器一起调查了,这就是他给我的字体URL:

Request URL: https://example.org/static/font/RobotoMono-Regular.ttf

它应该是:

Request URL: https://example.org/pad/static/font/RobotoMono-Regular.ttf

我不明白为什么我没有“ pad”子目录。

因此,我从头开始在新主机上。

docker run --name etherpad -d \
    -e NODE_ENV=production -p 9001:9001 \
    --mount type=bind,src=/etc/localtime,dst=/etc/localtime \
    --restart=unless-stopped \
    etherpad/etherpad

原始配置未做任何更改。

Apache配置:

<VirtualHost _default_:443>
    ServerName host
    <Proxy *>
        Require all granted
    </Proxy>
    ProxyRequests Off
    ProxyPreserveHost On
    ProxyPass             /pad/     http://localhost:9001/
    ProxyPassReverse      /pad/     http://localhost:9001/
    SSLCertificateFile  /etc/apache2/ssl/host.example.com_cert_with_chain.pem
    SSLCertificateKeyFile /etc/apache2/ssl/host.example.com_sec_key.pem
    SSLCertificateChainFile /etc/apache2/ssl/chain.pem
</VirtualHost>

Apache版本是2.4.29。

清除浏览器缓存,结果:

image

奇怪的。 我将尝试在本地使用docker映像来查看是否会更改

@JohnMcLear这真是令人难以置信。 我尝试使用与您完全相同的配置,在端口81上,在单独的虚拟主机中,等等...,问题仍然出现。
我确保每次都清空缓存。

这是我的软件版本:

node: v10.20.1
npm: 6.14.4
apache2: Apache/2.4.38 (Debian)
etherpad: 1.8.3 (6210114)

我有完全一样的问题。 在代理(nginx)上运行并且minify设置为true时,图标丢失。 一旦我将minify设置为false并使用clearRun.sh启动它并清除浏览器缓存,图标就会起作用。 在较旧的版本中,我们使用了一段时间,它与minify:true和以下Nginx配置一起使用:

server {
        listen          80;
        listen          443 ssl;
        include snippets/mortis2-ssl.conf;
        server_name     mortis2;
        location /pad/
        {
                #proxy_pass        http://localhost:9001/;
                proxy_set_header  Host $host;
                proxy_buffering   off;
        }
}

我发现,当我使用@JohnMcLear中的nginx配置并使用重写时,它将起作用。 我猜这个问题只会在我们使用其他位置(例如/ pad)时弹出。

正在运行的Nginx配置:

server {
        listen          80;
        listen          443 ssl;
        include snippets/mortis2-ssl.conf;
        server_name     mortis2;
        location /pad/
        {
                rewrite                /pad/(.*) /$1 break;
                rewrite                ^/pad$ /pad/ permanent;
                proxy_pass        http://localhost:9001/;
                proxy_pass_header Server;
                proxy_set_header  Host $host;
                proxy_buffering   off;
        }

        location /pad/socket.io {
                rewrite /pad/socket.io/(.*) /socket.io/$1 break;
                proxy_pass http://localhost:9001/;
                proxy_redirect         / /pad/;
                proxy_set_header Host $host;
                proxy_buffering off;
                proxy_set_header X-Real-IP $remote_addr;  # http://wiki.nginx.org/HttpProxyModule
                proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP
                proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used
                proxy_set_header Host $host;  # pass the host header
                proxy_http_version 1.1;  # recommended with keepalive connections
                # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
                proxy_set_header Upgrade $http_upgrade;
                #proxy_set_header Connection $connection_upgrade;
        }

        location /static {
                rewrite /static/(.*) /static/$1 break;
                proxy_pass http://localhost:9001/;
                proxy_set_header Host $host;
                proxy_buffering off;
        }
}

Op说最小化true / false不会改变结果。 Op还没有提到任何转速代理...。我到家时会检查是否缩小为true。

确认是由缩小引起的。

https://github.com/ether/etherpad-lite/issues/3956#issuecomment -620476150声称minify false没有影响,我应该检查一下自己是否是这种情况。

* facepalm。

将尽快修复。

FWIW Nginx也遭受此失败,并且该失败出现在所有页面(填充,索引,时间滑块等)上。

问题在于我们的clean-css 。 CSS 3至4删除了relativeTo选项,此删除已导致此错误。 在我的示例中,我切换为rebaserebaseTo

https://github.com/JohnMcLear/etherpad-lite/commit/e684a3ba4129d1bae54e7b65a316a7d690217241是一个半修补程序,并且是https://github.com/JohnMcLear/etherpad-lite/commit/a8c66b3b513b058e89f70b8e8d5ab622b33f 将会出现图标,但某些键盘内部和其他项目的字体错误。

有什么建议@jakubpawlowicz @seballot吗?

@JohnMcLear使其适合您的一种方法可能是通过任意转换,请参阅https://github.com/jakubpawlowicz/clean-css#how -to-apply-arbitrary-transformations-to-css-properties

另一个想法是通过哈希将输入选项传递给clean-css,请参见https://github.com/jakubpawlowicz/clean-css/blob/master/test/module-test.js#L620 ,例如

new CleanCSS().minify({"path/to/stylesheet/a.css": { styles: "/* source of a.css goes here */" }})

并使用rebaseTo选项,但没有进一步的了解,我无法确定它是否有效。

祝好运!

封闭的? 真的吗?

OP已关闭...不应关闭。 OP FWIW,您可以单击取消关注或取消订阅,或者如果您不想发出噪音,则可以单击某些内容。

这仍然没有解决,如果EOW没有补丁,我将尝试打补丁。

我真的很想看到一个社区补丁,尽管如果有人可以找时间的话。

@JohnMcLear我真的很想能够提供帮助并花些时间,但是我没有开发人员的技能,甚至在nodejs方面都没有。 我希望其他人也能做到。 我只能以我的想法来支持你…

虽然我很感激,但您的想法不会改变尿布;)

碰碰@seballot

嗨,对这个抱歉,您没有太多想法。有没有办法在本地复制它?

  1. git clone develop
  2. minify变成true
  3. 运行Etherpad并访问板(确保一切正常)
  4. 安装nginx
  5. 将以下内容复制到/ etc / nginx / sites-enabled / default
server {
        listen       80;
        server_name  pad.example.com;

        access_log  /var/log/nginx/eplite.access.log;
        error_log   /var/log/nginx/eplite.error.log;

    location /pad/foo {
        rewrite                /pad/foo/(.*) /$1 break;
        rewrite                ^/pad/foo$ /pad/foo permanent;
        proxy_pass             http://localhost:9001/;
        proxy_pass_header Server;
        proxy_redirect         / /pad/foo;
        proxy_set_header       Host $host;
        proxy_buffering off;
    }

    location /pad/foo/socket.io {
        rewrite /pad/foo/socket.io/(.*) /socket.io/$1 break;
        proxy_pass http://localhost:9001/;
        proxy_redirect         / /pad/foo/;
        proxy_set_header Host $host;
        proxy_buffering off;
        proxy_set_header X-Real-IP $remote_addr;  # http://wiki.nginx.org/HttpProxyModule
        proxy_set_header X-Forwarded-For $remote_addr; # EP logs to show the actual remote IP
        proxy_set_header X-Forwarded-Proto $scheme; # for EP to set secure cookie flag when https is used
        proxy_set_header Host $host;  # pass the host header
        proxy_http_version 1.1;  # recommended with keepalive connections
        # WebSocket proxying - from http://nginx.org/en/docs/http/websocket.html
        proxy_set_header Upgrade $http_upgrade;
        proxy_set_header Connection $connection_upgrade;
    }

    location /static {
        rewrite /static/(.*) /static/$1 break;
        proxy_pass http://localhost:9001/;
        proxy_set_header Host $host;
        proxy_buffering off;
    }

}

# we're in the http context here
map $http_upgrade $connection_upgrade {
  default upgrade;
  ''      close;
}
  1. 重新启动nginx
    http://127.0.0.1:9001 / p / blah变为http://127.0.0.1/pad/foo/p/blah
  2. 在浏览器中打开http://127.0.0.1/pad/foo/p/blah
  3. 单击浏览器中的网络标签,并注意到iframe内部字体404。这是由于@import传递了正确的路径,但是cleanCSS将其正确地重写为../../../ -我的理解是那是因为Pad和编辑器都使用相同的@ font.css,并且都具有不同的basePaths? 那么一个就行了,一个就行不通。 我想不出一个很好的解决方法,但我认为您可能能够做到?

@seballot有进步的伙伴吗?

抱歉,我找不到修复程序...

我也不是,cleanCSS在做一些我不了解的魔术(我不是CSS专家),而且我的实例都没有在子目录中运行,因此我也不太感兴趣

我不想,但是我可能需要用csso替换cleanCSS,因为我可以使csso正常工作,但是我认为最终我无法正确解决问题,在我们的用例中,csso的性能不如cleanCSS 。

我碰到了cleanCSS开发人员,看看我们是否可以合作修复:)

真好! 如果它可以与csso配合使用,为什么不选择它呢?

csso会减少但不会减少页面加载数。 另外,我更喜欢cleanCSS作为项目/文档等,并且不介意在一个好的项目上投入一些资源,这意味着我可以专注于以太坊专有的项目

我面临与此线程相同的问题。

  • 从git仓库安装了etherpad,当我不使用./bin/run.sh并在localhost上打开端口9001时,安装良好,并且图标正确显示。
  • 当我在nginx服务器(也正在运行jitsi)上运行此程序时,我看不到工具栏图标。 其他一切似乎都很好。

有人可以指导我如何解决此问题。 settings.json文件没有重大变化。

解决方法是在settings.json中将minify设置为false

今天晚上我会尝试看看。

在同一期中,我能够使用John在https://github.com/ether/etherpad-lite/issues/3956#issuecomment -625163151中给出的John的nginx配置来复制该问题。

我认为发布的Nginx配置和Etherpad的代码存在问题。

稍后会有更多详细信息。

我只花了2秒钟的时间查看nginx代码,它不应该具有/static配置,因为它在我执行的复制/粘贴操作中,但问题的根源在cleanCSS内...

我们这里有各种各样的问题。

  1. 测试的Nginx配置文件对/static重定向有误。 必须从此处删除整个location /static部分。 在这几天收到的电子邮件风暴中,我想记得一个用户抱怨-的确- /static将与许多其他Web应用程序发生冲突。 可能他被与此类似的例子误导了;

    必须通过文档(Wiki?Internet上还有其他吗?)并提高示例的质量来解决此问题

  2. 4177b3f9434e将font-face声明从src/static/css/pad.css移至另一个目录中的两个导入文件( src/static/css/pad/fonts.csssrc/static/css/pad/toolbar.css )中,并将URL移至src相对于样式表路径;

  3. 最重要的是,在为即将发布的1.8.4合并95fd5ce2a45e之后,我们将遇到一个缓存过时的问题,也需要解决。

我正在做一些测试并准备一份PR。

打开#4002来解决此问题。 非常感谢@JohnMcLear的初步工作。

@skramsa@julpec@lucaguindani@ashishhari (显然是John):你们中有人可以测试该PR以查看其是否适用吗? 如果可能的话,我想进行一次独立的验证。

另请注意,反向代理配置不需要“ / static”的特殊规则。

感谢您的确认。 将minify设置为false并不能解决
我的问题。
我在AWS EC2实例上的jitsi安装上使用了此功能,在那里
是Nginx服务器,用于托管jitsi并启动节点
端口9001的同一台机器上的以太板服务的服务器。

这是否意味着我可能需要调整其他一些Nginx设置? (我不
正确理解反向代理,但这可能是这种情况吗?),还是我
只需等待修复程序可用。

2020年5月14日,星期四,6:07 AM muxator [email protected]写道:

我们这里有各种各样的问题。

1。

测试的Nginx配置文件的/ static重定向错误。 的
必须从此处删除整个位置/静态部分
https://github.com/ether/etherpad-lite/issues/3956#issuecomment-625163151
在期间,这些天收到的电子邮件风暴,我觉得要记住用户抱怨-确实-/ static将与许多冲突其他Web应用程序。 可能他被类似的例子误导了
到这个

必须通过文档(Wiki?
互联网上还有其他内容吗?),并提高了例子
2。

4177b3f
https://github.com/ether/etherpad-lite/commit/4177b3f9434e8516f8fe4f8e02b2a75ce5d64173
将字体声明从src / static / css / pad.css移至两个
导入的文件(src / static / css / pad / fonts.css和
src / static / css / pad / toolbar.css)和其他网址
src相对于样式表路径
https://developer.mozilla.org/zh-CN/docs/Web/CSS/@font-face/src ;
3。

最重要的是,合并95fd5ce之后
https://github.com/ether/etherpad-lite/commit/95fd5ce2a45e31980ad8c2562e3fe6f77c52d4ff
对于即将到来的1.8.4 ,我们将遇到缓存陈旧问题
这也需要解决。

我正在做一些测试并准备一份PR。

-
您收到此邮件是因为您发表了评论。
直接回复此电子邮件,在GitHub上查看
https://github.com/ether/etherpad-lite/issues/3956#issuecomment-628317976
或退订
https://github.com/notifications/unsubscribe-auth/AH7VXAS65ZUAR33CPKSI6OLRRM4KZANCNFSM4MSSRTRQ

@skramsa@julpec@lucaguindani@ashishhari (显然是John):你们中有人可以测试该PR以查看其是否适用吗? 如果可能的话,我想进行一次独立的验证。

好的,我可以测试。 我没有static特殊配置。

感谢您的确认。 将minify设置为false并不能解决我的问题。

但这对我有用。 在apache下,我切换为false,一切正常。

我可以测试一下。

2020年5月14日星期四下午1:30 julpec [email protected]写道:

@skramsa https://github.com/skramsa ,@julpec https://github.com/julpec
@lucaguindani https://github.com/lucaguindani,@ashishhari
https://github.com/ashishhari (显然还有John):是你们中的某人
在测试该PR以查看其是否适用的位置? 我会
像是独立验证(如果可能)。

好的,我可以测试。 我没有静态的特殊配置。

感谢您的确认。 将minify设置为false并不能解决
我的问题。

但这对我有用。 在apache下,我切换为false
开始工作正常。

-
您收到此邮件是因为有人提到您。
直接回复此电子邮件,在GitHub上查看
https://github.com/ether/etherpad-lite/issues/3956#issuecomment-628464590
或退订
https://github.com/notifications/unsubscribe-auth/AH7VXAXKTJKZCAZVRXZIJX3RROQLPANCNFSM4MSSRTRQ

还要确认->将minify设置为false确实可以在我的系统上正常工作。
(我上次可能未正确重新启动服务)。

2020年5月14日星期四下午1:30 julpec [email protected]写道:

@skramsa https://github.com/skramsa ,@julpec https://github.com/julpec
@lucaguindani https://github.com/lucaguindani,@ashishhari
https://github.com/ashishhari (显然还有John):是你们中的某人
在测试该PR以查看其是否适用的位置? 我会
像是独立验证(如果可能)。

好的,我可以测试。 我没有静态的特殊配置。

感谢您的确认。 将minify设置为false并不能解决
我的问题。

但这对我有用。 在apache下,我切换为false
开始工作正常。

-
您收到此邮件是因为有人提到您。
直接回复此电子邮件,在GitHub上查看
https://github.com/ether/etherpad-lite/issues/3956#issuecomment-628464590
或退订
https://github.com/notifications/unsubscribe-auth/AH7VXAXKTJKZCAZVRXZIJX3RROQLPANCNFSM4MSSRTRQ

但这对我有用。 在apache下,我切换为false,一切正常。
还要确认->将minify设置为false确实可以在我的系统上正常工作。

@ julpec@ ashishhari :设置解决方法
现在的希望是,当minify = true时,看看#4002是否修复了该错误。

步骤如下,只有在所有步骤都清楚的情况下,才执行此操作:

开始复制错误:

  • 确保minify = true settings.json
  • 重新启动Etherapd
  • 访问Etherpad页面并确认显示工具栏图标

尝试解决:

  • minify = true保留在settings.json
  • 申请#4002(仅在您满意的情况下执行)
  • 重新启动Etherpad
  • 参观EtherPad的页面,以确认是否工具栏图标现在可以正确显示

我想要但不知道申请PR的程序:(

谢谢@muxator,我将在一小时内进行测试。

哦,我永远不会想出那种解决方法! 那是傻瓜。

git remote add mux https://github.com/muxator/etherpad-lite/
git fetch mux
git checkout mux/fix/fonts-behind-reverse-proxy

对于那些也想测试的人。

经过测试后,请记住git checkout develop否则您将进入muxs的陈旧分支

谢谢,我今天下午测试

嗯,我认为@muxator的性能不高。.我看到了〜54个请求,而〜49个请求(在当前develop )-请注意,我启用了插件以提供额外的请求。 因此,此PR将是页面加载性能的回归,以满足IMHO不可接受的未记录/不受支持的用例。

image

注意对同一个文件的多个请求... :(这是默认进度,但对同一个文件的多个请求不是我们想要的解决方案。

多重请求来自我认为不同的iframe。 主页和编辑器iframe都需要字体,这一直是这样的吗?

afaik cleanCSS用于修复该问题@seballot

一直以来都是这样吗?

是的,总是这样。

我认为cleanCss可以避免加载每个CSS部分(pad / popups.css,pad / editbar.css,pad / chat.css ...),而只加载一个pad.css

但是使用iframe时,浏览器必须与iframe每次请求两次文件共享。 但是第二个调用应该使用本地缓存(“从缓存加载”)

我应用了拉取请求,它没有任何问题(使用Apache)

谢谢@julpec。

今天晚上,我将尝试解决有关@JohnMcLear提出的请求

真棒tnx多路复用器

有没有办法在Github的某个地方上传HAR文件? 我已经测试了#4002,并且愿意分享录音,但是我不知道将录音上传到哪里。

共同要素:

  • 访问了http:// localhost :9001 / p / ciao
  • 没有反向代理
  • 生产方式:假
  • 从空的浏览器缓存开始

变量:

  • 版本: 4816785aef45与#4002
  • 缓存:冷(第一次加载)与热(> =第二次加载
  • 缩小:正确错误
  • 浏览器:铬81 vs Firefox 76

这是四个二进制变量-> 2 ^ 4 = 16种可能性
这花了很多时间!

这是更相关的情况:
|描述|当前开发(4816785aef45)| PR#4002 |
| ---- | ---- | ---- |
| Firefox,最小化,首次加载| 34个请求
1,61兆字节
1.61 MB传输| 36个请求
1,61兆字节
1.53 MB传输|
| Firefox,缩小,热缓存| 29个请求
1,12兆字节
传输216 KB | 31个请求
1,18兆字节
传输216 KB |
|铬,最小化,首次加载| 44个请求
2.0 MB
1,5 MB传输的| 109 Richieste
3.0 MB
1,1 MB传输|
|铬,小型热缓存| 45个请求
2,2兆字节
传输5,7 KB | 129个请求
4.7兆字节
传输4,7 KB |

底线是:

  • Chrome和Firefox使用完全不同的方式来衡量其流量
  • PR#4002向服务器引入更多请求
  • 高速缓存命中率提高传输的列减少!
  • 负载时间保持不变,在测量噪声的范围内

这些也是我的发现,我还花了一些时间研究页面加载速度性能分析工具(除了开发人员工具以外),并决定,如果开发人员工具没有给我带来明显的均值偏差,那么结果就足够适合我们的应用程序。

减小总传输大小显然是一件好事,但是由于延迟,http请求开销可能会很高。 我们可以将其合并,但是请注意,当我们重写前端时(由于最终将需要转移的所有内联JS,这是不可避免的),这是我们应该努力改进的领域。

总而言之,Etherpad与htis领域中的其他大多数工具相比都很棒,唯一例外的是Google docs,这是绝对令人震惊的“编辑时间”的黄金标准,这在世界上是首要的,而不是页面“加载”的结尾。

因此,TLDR; 合并@muxator-该线程作为资源提供给那些寻求优化Etherpad实例的人,而不是子文件夹中的人。

做得好 !

+1 tnx!

:+1:

此页面是否有帮助?
0 / 5 - 0 等级