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

Add printing service in chromium-vm and bussiness-vm #783

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

Nerox9
Copy link
Contributor

@Nerox9 Nerox9 commented Sep 11, 2024

Description of changes

CUPS and Avahi sercvie are enabled in chromium-vm and bussines-vm.
Avahi service reflection is added into net-vm.

Checklist for things done

  • Summary of the proposed changes in the PR description
  • More detailed description in the commit message(s)
  • Commits are squashed into relevant entities - avoid a lot of minimal dev time commits in the PR
  • Contribution guidelines followed
  • Ghaf documentation updated with the commit - https://tiiuae.github.io/ghaf/
  • PR linked to architecture documentation and requirement(s) (ticket id)
  • Test procedure described (or includes tests). Select one or more:
    • Tested on Lenovo X1 x86_64
    • Tested on Jetson Orin NX or AGX aarch64
    • Tested on Polarfire riscv64
  • Author has run make-checks and it passes
  • All automatic Github Action checks pass - see actions
  • Author has added reviewers and removed PR draft status
  • Change requires full re-installation
  • Change can be updated with nixos-rebuild ... switch

Instructions for Testing

Driverless printers doesn't need to be added to printer, otherwise;

  1. Start the chromium and one instance of business-vm (i.e. Teams)
  2. Enter localhost:631 into the chromium and trusted browsers
  3. Go to Administration/Add Printer and select your printer
  4. Enter the information if needed and select driver (Related generic drivers would work if there is no proper one)
  5. Complete the installation and print a page with Ctrl+P
  • List all targets that this applies to:
  • Is this a new feature
    • List the test steps to verify:
  • If it is an improvement how does it impact existing functionality?

@vadika
Copy link
Contributor

vadika commented Sep 13, 2024

I'd suppose to add some sort of icon/shortcut for "Enter localhost:631 into the browser (Use Ctrl+N in business-vm before)" -- otherwise user will not be able to manage printing. A bookmark in a browser bookmark bar as a hotfix?

@@ -99,6 +99,13 @@ in
# Set default PDF XDG handler
xdg.mime.defaultApplications."application/pdf" = "ghaf-pdf.desktop";

services.printing.enable = true;
Copy link
Member

Choose a reason for hiding this comment

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

Is it possible we have one CUPS server only, have that in something like a peripherals-vm. Then app VMs just setup CUPS as client: https://www.cups.org/doc/man-client.conf.html

overlays/custom-packages/cups/default.nix Show resolved Hide resolved
overlays/custom-packages/cups/default.nix Outdated Show resolved Hide resolved
@@ -85,6 +85,11 @@ let
firewall.allowedTCPPorts = [ 53 ];
firewall.allowedUDPPorts = [ 53 ];
};
services.avahi = {
Copy link
Member

Choose a reason for hiding this comment

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

Do we really want to have three avahi daemons running on this system? I am also a bit worried about reflect setting in terms of security impact, NixOS option states:

Reflect incoming mDNS requests to all allowed network interfaces.

@emrahbillur
Copy link
Contributor

I tested this PR with all builds of nvidia-agx and nvidia-nx (both cross compile and remote builder) and succeeded in the builds where our system that tests our PRs seem to have a problem of building.

@milva-unikie
Copy link

Tested on Lenovo-X1(nixos-rebuild switch)

I tested with HP Laserjet M15w and with Canon ir-adv c3822.

Issues:

  • Printing pdf files does not work in most cases.
    • When you try to open a pdf "normally", it is automatically downloaded and after that opens in Zathura. In Zathura there is a printing menu (ctrl+P), but the printer can not be found from there.
    • Some pages offer an option to go around that with preview options, but
      • in OneDrive Open -> Open in browser -> 3 dots -> Print -> downloads the file.
      • in Teams Click the file -> only an option to download, no way to print.
      • in Gmail Click the file -> Print -> downloads the file.
      • in Outlook Preview -> Print -> Printing menu opens, so in Outlook this actually does work.
    • Printing from Excel & Powerpoint does not work, because they export the files first to pdf -> downloads -> open in Zathura with no option to print.
  • Printer needs to be added again after every restart. Would it be possible to store the configuration in storage?
  • Bookmark to "CUPS" was added to Chromium and Trusted browser. Could that be renamed to "Printing" or something like that? (The bookmarks did not show up with nixos-rebuild switch but @johannarautanen confirmed that in a flashed image they are there)
  • In Chromium and Trusted browser ctrl+P -> Destination -> See more... -> Manage does not open anything.

Working:

  • Printer can be added.
    • HP Laserjet was detected automatically, Canon needed to be added manually.
    • Adding needs to be done in both Chromium and Trusted browser separately. I assume this is intended behavior?
  • Printing a webpage with ctrl+P works.
  • Printing from Word works.

Note: I did not run the automated tests yet. This pr will need to be retested after printing pdf files has been solved.

@milva-unikie milva-unikie added bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR and removed Needs Testing CI Team to pre-verify labels Sep 19, 2024
@Nerox9 Nerox9 temporarily deployed to internal-build-workflow September 20, 2024 14:26 — with GitHub Actions Inactive
@Nerox9
Copy link
Contributor Author

Nerox9 commented Sep 20, 2024

Tested on Lenovo-X1(nixos-rebuild switch)

I tested with HP Laserjet M15w and with Canon ir-adv c3822.

Issues:

* Printing pdf files does not work in most cases.
  
  * When you try to open a pdf "normally", it is automatically downloaded and after that opens in Zathura. In Zathura there is a printing menu (ctrl+P), but the printer can not be found from there.
  * Some pages offer an option to go around that with preview options, but
    
    * in OneDrive Open -> Open in browser -> 3 dots -> Print -> downloads the file.
    * in Teams Click the file -> only an option to download, no way to print.
    * in Gmail Click the file -> Print ->  downloads the file.
    * in Outlook Preview -> Print -> Printing menu opens, so in Outlook this actually does work.
  * Printing from Excel & Powerpoint does not work, because they export the files first to pdf -> downloads -> open in Zathura with no option to print.

* Printer needs to be added again after every restart. Would it be possible to store the configuration in storage?

* Bookmark to "CUPS" was added to Chromium and Trusted browser. Could that be renamed to "Printing" or something like that? (The bookmarks did not show up with `nixos-rebuild switch` but @johannarautanen confirmed that in a flashed image they are there)

* In Chromium and Trusted browser ctrl+P -> Destination -> See more... -> Manage does not open anything.

Working:

* Printer can be added.
  
  * HP Laserjet  was detected automatically, Canon needed to be added manually.
  * Adding needs to be done in both Chromium and Trusted browser separately. I assume this is intended behavior?

* Printing a webpage with ctrl+P works.

* Printing from Word works.

Note: I did not run the automated tests yet. This pr will need to be retested after printing pdf files has been solved.

I added CUPS into Zathura VM too to solve the issue quickly. It can only be used with driverless printers detected automatically but it will be solved in the future with unified printing service.

Storage VM configurations added.

Manage button redirects to distro settings and we don't have a settings UI yet as far I know. I checked quickly how to manage the button but I don't have a solution yet.

@milva-unikie

@milva-unikie
Copy link

I added CUPS into Zathura VM too to solve the issue quickly. It can only be used with driverless printers detected automatically but it will be solved in the future with unified printing service.

Storage VM configurations added.

Manage button redirects to distro settings and we don't have a settings UI yet as far I know. I checked quickly how to manage the button but I don't have a solution yet.

@milva-unikie

Printing with office printers in Finland & UAE has been confirmed to be working from browser (thanks @jkuro-tii)

Driverless printing does not work in the offices sadly, so there will need to be another solution for that.

The manage button is probably not that important. If there is no easy solution, I think it is fine to leave it as it is.

Printer information is now saved between boots. Thanks also for changing the bookmark name to "Printing".

CUPS is enabled in zathura-vm, chromium-vm and bussines-vm
CUPS overlay is applied due to printer webpage bug.
Avahi service reflection is added in net-vm.
CUPS web page is added into default chromium bookmarks.

Signed-off-by: Berk Arslan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug on Lenovo X1 Carbon Issues found on Lenovo X1 Carbon while checking this PR
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants