getumbrel / umbrel-apps

The official app repository of the Umbrel App Store. Submit apps and updates here. Learn how → https://github.com/getumbrel/umbrel-apps#readme
https://apps.umbrel.com
481 stars 356 forks source link

App submission: scanservjs #1095

Open highghlow opened 1 month ago

highghlow commented 1 month ago

Request: #1085

This app will require the scanner to be connected by usb to the Umbrel. Less that ideal, but that's what usb ports on the Umbrel home are for... right?

Also, btw, can you give me the power to close issues in the umbrel repo? There're a lot of resolved issues where the authors are not responding.

App Submission

App name

scanservjs

256x256 SVG icon

(Submit an icon with no rounded corners as it will be dynamically rounded with CSS. GitHub doesn't allow uploading SVGs directly, so please upload your icon to an alternate service, like https://svgur.com, and paste the link below.) We will help finalize this icon before the app goes live in the Umbrel App Store.

This project doesn't have an icon. There're no google image results for scanservjs. You'll have to make an icon of your own.

Gallery images

(Upload 3 to 5 high-quality gallery images (1440x900px) of your app in PNG format, or just upload 3 to 5 screenshots of your app and we'll help you design the gallery images.) We will help finalize these images before the app goes live in the Umbrel App Store.

image

image

There's not much about scanservjs on the internet

I have tested my app on:

I haven't tested this app. Both because I don't currently have access to my server and because I don't have a scanner. But it should hopefully work.

sund3RRR commented 1 month ago

Probably it will not work, at least for hp scanners. There are different targets in Dockerfile, you can view build instructions here Ideally, it is better to make a choice in umbrel store to install basic image or hp/airscan image, but as I understand, it is impossible.

And I think you also need to map usb device /dev/bus/usb/

highghlow commented 1 month ago

And I think you also need to map usb device /dev/bus/usb/

They said in the docker guide that --priveleged is used for this

sund3RRR commented 1 month ago

It can work without privileged mode. I installed libsane-hpaio in the container and mapped usb device, it works at least for hp scanner.

highghlow commented 1 month ago

It can work without privileged mode. I installed libsane-hpaio in the container and mapped usb device, it works at least for hp scanner.

But we don't want every usb device to be mapped to scanservjs (And we don't which specific device to mount)

sund3RRR commented 1 month ago

It can work without privileged mode. I installed libsane-hpaio in the container and mapped usb device, it works at least for hp scanner.

But we don't want every usb device to be mapped to scanservjs (And we don't which specific device to mount)

Hard question. I think grant container privileged rights is worse than mapping the whole usb bus. At least for ubmrel store application.

highghlow commented 1 month ago

Hard question. I think grant container privileged rights is worse than mapping the whole usb bus. At least for ubmrel store application.

Other apps (and umbrel itself) might want to use usb

nmfretz commented 1 month ago

Thanks for submitting scanservejs @highghlow! And thanks for your input @sund3RRR, much appreciated.

We'll need some help from the community to properly test this app because both @highghlow and I don't have a scanner. This may require some back and forth here. @sund3RRR do you have a SANE compatible scanner?

As I understand it, the idea here is that for this packaging of scanservjs we will assume that a user will plug their scanner directly into their umbrelOS device.

They said in the docker guide that --priveleged is used for this

The increased container privileges may indeed be enough in this case because we have also mapped /var/run/dbus; however, we need to test that this is actually the case.

I have committed some changes to get scanservjs to install correctly and have added what I assume would be the maximum permissions we might need to give this container:

This should allow it to work, but our goal now should be to reduce permissions as much as possible without reducing the functionality of scanservjs. We should test the following:

1) Does this PR work as of https://github.com/getumbrel/umbrel-apps/pull/1095/commits/1bc54379cfe648f4ee0d6aef35a5a3bb7063ec5a with with privileged: true, /var/run/dbus. and /dev?

1) Remove the /dev bind mount. Can you boot the scanservjs container without a scanner plugged in, then plug in a scanner and have it be discovered?

2) Keep the /dev bind mount but remove privileged: true. Does it still work?

3) remove both /dev mapping and privileged: true. Does it still work?

4) If it turns out that the /dev bind mount is required in the testing above, does reducing the mounts scope to /dev/bus/usb still work?