Skip to content

Dynamic cert support, rewrite installers #504

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

Merged
merged 32 commits into from
Dec 12, 2019
Merged

Conversation

tresf
Copy link
Contributor

@tresf tresf commented Oct 18, 2019

Moves all installation tasks to Java, allows certs to renew automatically. There's a bunch of enhancements in this PR, but I'll try to high-level them...

Download: https://github.com/tresf/tray/releases/tag/v2.10-RC8

features

certgen

Out with the old widows-keygen.js, linux-keygen.sh and apple-keygen.sh, in with the new, standardized scripts.

java -jar qz-tray.jar certgen --key "privkey.pem" --cert "fullchain.pem"
java -jar qz-tray.jar certgen --pfx "mycert.pfx" --pass "12345"
java -jar qz-tray.jar certgen --host "192.168.1.5"
java -jar qz-tray.jar certgen --hosts "domain1;domain2;..."

... called as sudo or as a regular user. It'll install the cert in the user's certstore now, meaning ssl from IntelliJ is now possible.


uninstall

java -jar qz-tray.jar uninstall

... called as sudo/admin of course


advanced

Internally we now use java for all install tasks...

java -jar qz-tray.jar preinstall # kills all instances of qz
java -jar qz-tray.jar install    # deploys qz to a sane location

... called as sudo/admin of course


launchers

Platform launchers have been improved to pass parameters directly to qz-tray.jar...

C:\Program Files\qz-tray.exe "certgen"
/opt/qz-tray/qz-tray "certgen"
/Applications/QZ\ Tray.app/QZ\ Tray "certgen"

@tresf tresf requested a review from akberenz October 18, 2019 00:28
Copy link
Member

@akberenz akberenz left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Still have about 10 more files to review (namely the cert installer classes and props loader), but most of what I've seen so far looks good. I'm going to just post what I have for now, until I can finish up the review later this week.

@tresf
Copy link
Contributor Author

tresf commented Nov 5, 2019

All comments addressed. @bberenz three comments still remain unresolved.

@tresf
Copy link
Contributor Author

tresf commented Nov 6, 2019

All conversations have been resolved. This is ready for merge.

@lite1979
Copy link
Contributor

lite1979 commented Nov 20, 2019

Raw>Raster Print> HTML printing fails with AdoptOpenJDK 11 on Windows 10

First attempt resulted in an error complaining Java FX did not start, but I did not get the error after that.Error message coincided with logs finally giving up, but they logged "Waiting for JavaFX to start" for almost 90 seconds before letting the processor go; might be a problem if it happened on a machine with less RAM, but I was able to send other print jobs while it was waiting.

Regular HTML prints are working fine, though. Do we check elsewhere for JavaFX when doing Raster Print on the Raw tab?

@tresf
Copy link
Contributor Author

tresf commented Nov 20, 2019

@lite1979 thanks. Patched via #520 directly on the 2.1 branch. This seems to be a long-standing 2.1 bug since we've added Java 11 support.

@tresf
Copy link
Contributor Author

tresf commented Nov 20, 2019

Testing this branch with a LetsEncrypt certificate and it works, but the following error occurs:

[ERROR] 2019-11-20 12:55:35,084 @ qz.installer.Installer:?
	Something went wrong obtaining the certificate.  HTTPS will fail.
org.bouncycastle.util.io.pem.PemGenerationException: encoding exception: unknown object passed - can't encode.
	at org.bouncycastle.openssl.MiscPEMGenerator.generate(Unknown Source)
	at qz.installer.certificate.CertificateManager.writeCert(Unknown Source)
	at qz.installer.Installer.certGen(Unknown Source)
	at qz.ws.PrintSocketServer.main(Unknown Source)
Caused by: org.bouncycastle.util.io.pem.PemGenerationException: unknown object passed - can't encode.
	at org.bouncycastle.openssl.MiscPEMGenerator.createPemObject(Unknown Source)
	... 4 more

@tresf
Copy link
Contributor Author

tresf commented Dec 12, 2019

Print-Server steps updated with 2.1.0-RC9+ commands. https://github.com/qzind/tray/wiki/Print-Server

@tresf tresf deleted the certs-rewrite branch December 12, 2019 19:59
@tresf
Copy link
Contributor Author

tresf commented Jan 21, 2020

There seems to be an edge-case issue where Firefox may not be detected on MacOS during the installation process.

The problem seems to stem from the Spotlight service not listing Firefox as installed. You can test this by calling the following command:

system_profiler SPApplicationsDataType -xml |grep "Firefox"

The fix is to stop and start the Spotlight service using the following command:

sudo mdutil -a -i off
sudo mdutil -a -i on

Then test for Firefox again:

system_profiler SPApplicationsDataType -xml |grep "Firefox"

Should output:

        			<string>Firefox</string>
				<string>Firefox 72.0.2</string>
				<string>/Applications/Firefox.app</string>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants