abcdesktopio / pyos

abcdesktop API services
https://abcdesktopio.github.io/
GNU General Public License v2.0
2 stars 2 forks source link

Printing and sound broken on 3.2 #18

Open aim29 opened 2 months ago

aim29 commented 2 months ago

Hi

Trying to use 3.2 and printing and sound are not working. They work fine in 3.1 and 3.0. I note that they also don't seem to be working on demo.abcdesktop.io either.

Having looked into the code, this appears to be related to a change in oc/od/orchestrator.py which prepended CUPS_SERVER and PULSE_SERVER with 'unix:' - reverting this so that they are both just '/tmp/.cups.sock' and '/tmp/.pulse.sock' fixed this.

I have tested this change by rebuilding the oc.pyos image and deploying it on my test install.

Happy to submit a pull request to fix if preferred.

Many thanks

alexandredevely commented 2 months ago

Hello aim29,

Thank you for using abcdesktop.io. I confirm this issue, thank you so much. You can use CUPS_SERVER and PULSE_SERVER with unix socket prefix, it will works for ephemeral container. For pod applications, the unix socket are unavailable, so we need to use TCP/IP socket to reach the cups service. The issue come from oc.cupsd in release 3.2, I'm checking that point.

See you Alexandre

alexandredevely commented 2 months ago

Hello aim29,

The latest oc.pyos:3.2 image fixes this issue. I've updated the cupsd image too to change PDF build process and fix a user access error. The od.config has changed to include the printer image 'abcdesktopio/oc.cupsd:3.2'

'printer' : { 
    'image': 'abcdesktopio/oc.cupsd:3.2',
    'imagePullPolicy': 'IfNotPresent',
    'enable': True,
    'tcpport': 681,
    'securityContext': { 'runAsUser': 0, 'runAsGroup': 0 },
    'resources': { 
      'requests': { 'memory': "32Mi", 'cpu': "50m" },  
      'limits'  : { 'memory': "512Mi",  'cpu': "500m" } 
    },
    'acl':  { 'permit': [ 'all' ] } 
  },

After your update, please run a rollout restart on pyos deployment

kubectl rollout restart deployment pyos-od -n abcdesktop

The printer Desktop_PDF_Printer is now listed

Screenshot 2024-04-12 at 12 01 08

and few seconds later, a new window appears from your web browser

Screenshot 2024-04-12 at 12 01 29

In this case, my local printer is an HP ENVY

See you and thank you for this printer issue

Alexandre