Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG] Says Browser Is Outdated When It Is Not #525

Closed
hifihedgehog opened this issue Sep 18, 2022 · 11 comments
Closed

[BUG] Says Browser Is Outdated When It Is Not #525

hifihedgehog opened this issue Sep 18, 2022 · 11 comments
Labels
documentation Improvements or additions to documentation external Issue is outside our code

Comments

@hifihedgehog
Copy link

I am trying to install SnappyMail, but when I extract it and try to access it from any browser or devices (iOS 16 Safari, Windows 11 Edge or Chrome or Firefox), it says all of my browsers are outdated.

@hifihedgehog hifihedgehog changed the title [BUG] Says Browser Is Outdated When They Are Not [BUG] Says Browser Is Outdated When It Is Not Sep 18, 2022
@the-djmaze
Copy link
Owner

This happens in two cases:

  1. The browser is outdated, or
  2. The .js files are not accessible

In your case it is number 2 and you can find out in your browser debug window network tab and your http daemon logs.

@the-djmaze the-djmaze added the needs feedback Further information is requested label Sep 19, 2022
@hifihedgehog
Copy link
Author

I see this in public_html/data/_data_/_default_/logs:

[2022-09-19 15:55:48.571][3ec387da] INFO[DATA]: [DATE:2022-09-19 UTC][SM:2.18.0][IP:***][PID:238022][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-19 15:55:48.571][3ec387da] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/
[2022-09-19 15:55:48.573][3ec387da] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-19 15:55:48.573][3ec387da] INFO[TIME]: Time delta: 0.0055248737335205

[2022-09-19 15:55:48.683][cf0f7ed7] INFO[DATA]: [DATE:2022-09-19 UTC][SM:2.18.0][IP:***][PID:238022][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-19 15:55:48.683][cf0f7ed7] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/?/AppData/0/17473021595995575/
[2022-09-19 15:55:48.684][cf0f7ed7] APPDATA[DATA]: rl.initData({"Auth":false,"AccountHash":"","AccountSignMe":false,"MailToEmail":"","Email":"","DevEmail":"","DevPassword":"","Title":"SnappyMail Webmail","LoadingDescription":"SnappyMail","FaviconUrl":"","LoginDefaultDomain":"","DetermineUserLanguage":true,"DetermineUserDomain":false,"SieveAllowFileintoInbox":false,"ContactsIsAllowed":false,"Admin":[],"Capa":[],"Plugins":[],"System":{"version":"2.18.0","admin":false,"token":"132a83b38c9dc448ae46227d707e3a71b17812b4","inIframe":false,"allowHtmlEditorBitiButtons":false,"allowCtrlEnterOnCompose":true,"useImapThread":true,"allowAppendMessage":false,"folderSpecLimit":50,"listPermanentFiltered":false,"themes":["Default","A","Blurred","DarkShine","Linen","Love","Snow","SnowDarkV1","Squares","SquaresDark","Stripes","Wood","Xv","Clear"],"languages":["ar-SA","bg-BG","cs-CZ","da-DK","de-DE","el-GR","en","en-GB","eo","es-ES","et-EE","fa-IR","fi-FI","fr-FR","hu-HU","id-ID","is-IS","it-IT","ja-JP","ko-KR","lt-LT","lv-LV","nb-NO","nl-NL","pl-PL","pt","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sv-SE","tr-TR","uk-UA","vi-VN","zh-CN","zh-TW"],"languagesAdmin":["cs-CZ","da-DK","de-DE","en","en-GB","es-ES","fa-IR","fi-FI","fr-FR","hu-HU","id-ID","it-IT","ja-JP","lt-LT","nb-NO","nl-NL","pl-PL","pt","pt-BR","pt-PT","ru-RU","sk-SK","sl-SI","sv-SE","vi-VN","zh-CN"],"attachmentsActions":["zip"],"customLogoutLink":""},"NewMoveToFolder":true,"AllowLanguagesOnSettings":true,"AllowLanguagesOnLogin":true,"AttachmentLimit":26214400,"SignMe":"DefaultOff","UseLocalProxyForExternalImages":true,"ViewHTML":true,"ShowImages":false,"RemoveColors":false,"MessagesPerPage":20,"MessageReadDelay":5,"MsgDefaultAction":1,"SoundNotification":true,"NotificationSound":"new-mail","DesktopNotifications":true,"Layout":1,"EditorDefaultType":"Html","UseCheckboxesInList":true,"AutoLogout":30,"UseThreads":false,"AllowDraftAutosave":true,"ReplySameFolder":false,"ContactsAutosave":true,"HideUnsubscribed":false,"HideDeleted":true,"MainEmail":"","UserBackgroundName":"","UserBackgroundHash":"","AdditionalLoginError":"","Theme":"Default","Language":"en","UserLanguage":"en","PluginsLink":"","StaticLibsJs":"/snappymail/v/2.18.0/static/js/min/libs.min.js"});
[2022-09-19 15:55:48.684][cf0f7ed7] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-19 15:55:48.684][cf0f7ed7] INFO[TIME]: Time delta: 0.0030829906463623

[2022-09-19 15:55:48.778][458162f7] INFO[DATA]: [DATE:2022-09-19 UTC][SM:2.18.0][IP:***][PID:238022][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-19 15:55:48.778][458162f7] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/?/BadBrowser
[2022-09-19 15:55:48.779][458162f7] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-19 15:55:48.779][458162f7] INFO[TIME]: Time delta: 0.0031070709228516

I am checking my browser logs now.

@hifihedgehog
Copy link
Author

Browser Log:

Uncaught SyntaxError: illegal character U+0002
libs.js:1:2
Uncaught SyntaxError: illegal character U+001B
app.js:1:4
Content Security Policy: Couldn’t parse invalid host 'nonce-' 2
GEThttps://mail.techandtiny.com/favicon.ico
[HTTP/2 404 Not Found 0ms]

@the-djmaze
Copy link
Owner

Right, your:

snappymail/v/2.18.0/static/js/libs.js has "404 not found" so you are missing files.

snappymail/v/2.15.3/static/js/min/app.min.js is double compressed using brotli.
You should configure litespeed to NOT compress those files as they are pre-compressed for speed.

@the-djmaze the-djmaze added documentation Improvements or additions to documentation external Issue is outside our code labels Sep 20, 2022
@hifihedgehog
Copy link
Author

hifihedgehog commented Sep 20, 2022

snappymail/v/2.18.0/static/js/libs.js has "404 not found" so you are missing files.

No. The files were there in their entirety, specifically those belonging to 2.18.0. If you yourself were checking my hosting domain which was not indicated to me but I have no problem doing, what you actually saw was that I had cleared things out between the time of posting my log files and now. I was testing a number of options including switching out files from CyberPanel’s build (to see what worked in their earlier build), a Docker image, etc. The only reliable information would have been the logs as that was the only thing requested here. In the future, let me know if you plan on looking at the site yourself so I can keep things static there.

snappymail/v/2.15.3/static/js/min/app.min.js is double compressed using brotli.
You should configure litespeed to NOT compress those files as they are pre-compressed for speed.

Thanks for adding this to the documentation.

@hifihedgehog
Copy link
Author

hifihedgehog commented Sep 20, 2022

OK. Compression appears to not be the issue. I first set .htaccess to not use compression:

<IfModule LiteSpeed>
  SetEnv no-brotli
  SetEnv no-gzip 1 
</IfModule>

I second made sure compression was disabled with my virtual host.

image

Neither seems to be the real culprit as I am still getting the bad browser error. The site has been reverted to its original state of 2.18.0 as originally reported so feel free to look at things now there on the domain if you get a notion to. The logging seems to indicate the same issues as before, as well.

Browser logs:

Uncaught SyntaxError: illegal character U+0002
[libs.js:1:2](https://mail.techandtiny.com/snappymail/v/2.18.0/static/js/libs.js)
Uncaught SyntaxError: illegal character U+001B
[app.js:1:4](https://mail.techandtiny.com/snappymail/v/2.18.0/static/js/app.js)
Content Security Policy: Couldn’t parse invalid host 'nonce-' 2
GEThttps://mail.techandtiny.com/favicon.ico

Server logs:

[2022-09-20 13:43:59.715][c8d5f2b2] INFO[DATA]: [DATE:2022-09-20 UTC][SM:2.18.0][IP:***][PID:390578][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-20 13:43:59.715][c8d5f2b2] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/?/BadBrowser
[2022-09-20 13:43:59.716][c8d5f2b2] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-20 13:43:59.716][c8d5f2b2] INFO[TIME]: Time delta: 0.004127025604248

[2022-09-20 13:44:03.708][c2329d97] INFO[DATA]: [DATE:2022-09-20 UTC][SM:2.18.0][IP:***][PID:390578][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-20 13:44:03.708][c2329d97] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/
[2022-09-20 13:44:03.718][c2329d97] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-20 13:44:03.718][c2329d97] INFO[TIME]: Time delta: 0.012064933776855

[2022-09-20 13:44:03.959][9c7a543e] INFO[DATA]: [DATE:2022-09-20 UTC][SM:2.18.0][IP:***][PID:390578][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-20 13:44:03.959][9c7a543e] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/?/AppData/0/24081617066992644/
[2022-09-20 13:44:03.960][9c7a543e] APPDATA[DATA]: rl.initData({"Auth":false,"AccountHash":"","AccountSignMe":false,"MailToEmail":"","Email":"","DevEmail":"","DevPassword":"","Title":"SnappyMail Webmail","LoadingDescription":"SnappyMail","FaviconUrl":"","LoginDefaultDomain":"","DetermineUserLanguage":true,"DetermineUserDomain":false,"SieveAllowFileintoInbox":false,"ContactsIsAllowed":false,"Admin":[],"Capa":[],"Plugins":[],"System":{"version":"2.18.0","admin":false,"token":"fc2e4be4f2986c6883004ab4cd0df24a3ade30c8","inIframe":false,"allowHtmlEditorBitiButtons":false,"allowCtrlEnterOnCompose":true,"useImapThread":true,"allowAppendMessage":false,"folderSpecLimit":50,"listPermanentFiltered":false,"themes":["Default","A","Blurred","DarkShine","Linen","Love","Snow","SnowDarkV1","Squares","SquaresDark","Stripes","Wood","Xv","Clear"],"languages":["ar-SA","bg-BG","cs-CZ","da-DK","de-DE","el-GR","en","en-GB","eo","es-ES","et-EE","fa-IR","fi-FI","fr-FR","hu-HU","id-ID","is-IS","it-IT","ja-JP","ko-KR","lt-LT","lv-LV","nb-NO","nl-NL","pl-PL","pt","pt-BR","pt-PT","ro-RO","ru-RU","sk-SK","sl-SI","sv-SE","tr-TR","uk-UA","vi-VN","zh-CN","zh-TW"],"languagesAdmin":["cs-CZ","da-DK","de-DE","en","en-GB","es-ES","fa-IR","fi-FI","fr-FR","hu-HU","id-ID","it-IT","ja-JP","lt-LT","nb-NO","nl-NL","pl-PL","pt","pt-BR","pt-PT","ru-RU","sk-SK","sl-SI","sv-SE","vi-VN","zh-CN"],"attachmentsActions":["zip"],"customLogoutLink":""},"NewMoveToFolder":true,"AllowLanguagesOnSettings":true,"AllowLanguagesOnLogin":true,"AttachmentLimit":26214400,"SignMe":"DefaultOff","UseLocalProxyForExternalImages":true,"ViewHTML":true,"ShowImages":false,"RemoveColors":false,"MessagesPerPage":20,"MessageReadDelay":5,"MsgDefaultAction":1,"SoundNotification":true,"NotificationSound":"new-mail","DesktopNotifications":true,"Layout":1,"EditorDefaultType":"Html","UseCheckboxesInList":true,"AutoLogout":30,"UseThreads":false,"AllowDraftAutosave":true,"ReplySameFolder":false,"ContactsAutosave":true,"HideUnsubscribed":false,"HideDeleted":true,"MainEmail":"","UserBackgroundName":"","UserBackgroundHash":"","AdditionalLoginError":"","Theme":"Default","Language":"en","UserLanguage":"en","PluginsLink":"","StaticLibsJs":"\/snappymail\/v\/2.18.0\/static\/js\/libs.js"});
[2022-09-20 13:44:03.960][9c7a543e] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-20 13:44:03.960][9c7a543e] INFO[TIME]: Time delta: 0.0044050216674805

[2022-09-20 13:44:04.013][45f0f6bf] INFO[DATA]: [DATE:2022-09-20 UTC][SM:2.18.0][IP:***][PID:390578][LiteSpeed][litespeed][Streams:tcp,udp,unix,udg,ssl,tls,tlsv1.0,tlsv1.1,tlsv1.2,tlsv1.3]
[2022-09-20 13:44:04.013][45f0f6bf] REQUEST[NOTE]: [GET] https://mail.techandtiny.com/?/BadBrowser
[2022-09-20 13:44:04.014][45f0f6bf] INFO[MEMORY]: Memory peak usage: 2MB
[2022-09-20 13:44:04.014][45f0f6bf] INFO[TIME]: Time delta: 0.0028479099273682

@the-djmaze
Copy link
Owner

the-djmaze commented Sep 21, 2022

Somehow something is still screwed up in your configuration.
Now the brotli compressed files are served without the content-encoding: br header.

Remove the .htaccess file in /snappymail/v/2.N.N/static/ and try again.

Because that file is programmed for Apache and might not work well in LightSpeed.
See the magic of that file here: https://github.com/the-djmaze/snappymail/blob/master/assets/.htaccess

@hifihedgehog
Copy link
Author

Somehow something is still screwed up in your configuration. Now the brotli compressed files are served without the content-encoding: br header.

Remove the .htaccess file in /snappymail/v/2.N.N/static/ and try again.

Because that file is programmed for Apache and might not work well in LightSpeed. See the magic of that file here: https://github.com/the-djmaze/snappymail/blob/master/assets/.htaccess

Strangely enough, the CyberPanel implementation of 2.15.3 of snappymail uses this as their .htaccess in that path:

<IfModule mod_headers.c>
	<IfModule mod_rewrite.c>
		RewriteEngine On

		RewriteCond %{HTTP:Accept-encoding} br
		RewriteCond "%{REQUEST_FILENAME}\.br" -s
		RewriteRule "^(.+\.js)$" "$1\.br" [L,T=application/javascript,QSA]

		RewriteCond %{HTTP:Accept-encoding} gzip
		RewriteCond "%{REQUEST_FILENAME}\.gz" -s
		RewriteRule "^(.+\.js)$" "$1\.gz" [L,T=application/javascript,QSA]

		RewriteCond %{HTTP:Accept-encoding} br
		RewriteCond "%{REQUEST_FILENAME}\.br" -s
		RewriteRule "^(.+\.css)$" "$1\.br" [L,T=text/css,QSA]

		RewriteCond %{HTTP:Accept-encoding} gzip
		RewriteCond "%{REQUEST_FILENAME}\.gz" -s
		RewriteRule "^(.+\.css)$" "$1\.gz" [L,T=text/css,QSA]

		<FilesMatch "(\.js\.br|\.css\.br)$">
			SetEnv no-gzip 1
			SetEnv no-brotli 1
			# Serve correct encoding type.
			Header append Content-Encoding br
			# Force proxies to cache brotli &
			# non-brotli css/js files separately.
			Header append Vary Accept-Encoding
		</FilesMatch>

		<FilesMatch "(\.js\.gz|\.css\.gz)$">
			SetEnv no-gzip 1
			SetEnv no-brotli 1
			# Serve correct encoding type.
			Header append Content-Encoding gzip
			# Force proxies to cache gzipped &
			# non-gzipped css/js files separately.
			Header append Vary Accept-Encoding
		</FilesMatch>

		<FilesMatch "(\.js\.br|\.js\.gz)$">
			Header set Content-Type "application/javascript; charset=utf-8"
			ForceType application/javascript
		</FilesMatch>
		<FilesMatch "(\.css\.br|\.css\.gz)$">
			Header set Content-Type "text/css; charset=utf-8"
			ForceType text/css
		</FilesMatch>
	</IfModule>
</IfModule>

@hifihedgehog
Copy link
Author

hifihedgehog commented Sep 21, 2022

Somehow something is still screwed up in your configuration. Now the brotli compressed files are served without the content-encoding: br header.

Remove the .htaccess file in /snappymail/v/2.N.N/static/ and try again.

Because that file is programmed for Apache and might not work well in LightSpeed. See the magic of that file here: https://github.com/the-djmaze/snappymail/blob/master/assets/.htaccess

That worked! Oddly enough, though, CyberPanel does not have to delete that .htaccess file for it to work in their implementation of Snappymail in the web panel environment. I was "checking my work" against that and that was probably what was throwing my scent off of the trail. I can only assume here, but I strongly suspect that it comes down to CyberPanel using LSCPD while the virtual hosts use OpenLiteSpeed. For context, LSCPD (what CyberPanel uses which is a subset of commercial LiteSpeed which has full Apache .htaccess support) probably reads and understands and uses this .htaccess file properly. On the other hand, OpenLiteSpeed (which has "mostly" full Apache .htaccess support with minor changes here and there, like these: https://openlitespeed.org/kb/apache-rewrite-rules-in-openlitespeed/; https://openlitespeed.org/kb/how-to-set-up-custom-headers/) falls short and likely kicks it to the curb.

@hifihedgehog
Copy link
Author

hifihedgehog commented Sep 21, 2022

Documentation-wise, I think I may found the solution to get OpenLiteSpeed to serve the precompressed JS and CSS content. It would involve a manual modification in the manner of what is shown here within OpenLiteSpeed's web panel:

https://openlitespeed.org/kb/how-to-set-up-custom-headers/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
documentation Improvements or additions to documentation external Issue is outside our code
Projects
None yet
Development

No branches or pull requests

2 participants