Request 'hardware-observe' for paratextlite

App is designed to work without internet access, doing peer to peer data syncing with other app users, on local network. It finds other apps by doing a udp broadcast (and listens for responses).

The part of the app that does this is using .net core api NetworkInterface.GetAllNetworkInterfaces();

Without hardware-observe we get exceptions of the following type:

System.UnauthorizedAccessException: Access to the path ‘/sys/class/net/vethMIIHDR/mtu’ is denied. —> System.IO.IOException: Permission denied — End of inner exception stack trace — at Interop.ThrowExceptionForIoErrno(ErrorInfo errorInfo, String path, Boolean isDirectory, Func`2 errorRewriter) at
Microsoft.Win32.SafeHandles.SafeFileHandle.Open(String path, OpenFlags
flags, Int32 mode) at System.IO.FileStream.OpenHandle(FileMode mode,
FileShare share, FileOptions options) at
System.IO.FileStream…ctor(String path, FileMode mode, FileAccess
access, FileShare share, Int32 bufferSize, FileOptions options) at
System.IO.StreamReader.ValidateArgsAndOpenPath(String path, Encoding
encoding, Int32 bufferSize) at System.IO.StreamReader…ctor(String
path, Encoding encoding, Boolean detectEncodingFromByteOrderMarks) at
System.IO.File.InternalReadAllText(String path, Encoding encoding) at
System.IO.File.ReadAllText(String path) at
System.Net.NetworkInformation.StringParsingHelpers.ParseRawIntFile(String
filePath) at
System.Net.NetworkInformation.LinuxIPv4InterfaceProperties.GetMtu() at

System.Net.NetworkInformation.LinuxIPv4InterfaceProperties…ctor(LinuxNetworkInterface
linuxNetworkInterface) at
System.Net.NetworkInformation.LinuxIPInterfaceProperties…ctor(LinuxNetworkInterface
lni) at
System.Net.NetworkInformation.LinuxNetworkInterface…ctor(String name,
Int32 index) at
System.Net.NetworkInformation.LinuxNetworkInterface.GetOrCreate(Dictionary`2 interfaces, String name, Int32 index) at System.Net.NetworkInformation.LinuxNetworkInterface.<>cDisplayClass5_0.b1(String name, IpAddressInfo ipAddr, UInt32 scopeId)<— ---> (Inner Exception #43) System.UnauthorizedAccessException: Access to the path ‘/sys/class/net/veth6HVW1D/mtu’ is denied. —>

As GetAllNetworkInterfaces is returning all interfaces, (and we filter for IPv4 ones).

More info about app:
This app is Linux desktop port of android app.

Thanks.

In addition to hardware-observe also requesting removale-media

This is because app needs access to USB drives as alternative way to do data syncing between app instances.

The app is used in places without access to internet. And while, as previously stated, app can use wifi to sync between near instances, for app instances where this isn’t practical (maybe due to being separated by large physical distances), distributed syncing can be done by writing data to USB thumbdrive, which is then taken to other app instance which syncs from it.

typeo: removable-media not removale-media. (just in case that wasn’t clear)

Just to clarify requesting: hardware-observe and removable-media

+1 from me for hardware-observe (although ideally the app could just ignore this error on reading of MTU as this should not be needed to enumerate network interfaces, this should be possible via the existing network-observe interface which is more appropriate to use for this purpose).

As for removable-media, as detailed on Process for aliases, auto-connections and tracks there are pretty clear guidelines on what use-cases are appropriate for auto-connect of removable-media - unfortunately I don’t think paratextlite meets the current guidelines for this, so -1 from me for auto-connect of removable-media (however this does not preclude the snap from using it and users manually connecting this interface, OR the use of portals etc to transparently access files on USB sticks etc).

@alexmurray - ok thanks, so I guess I will have to use the snapctl is-connected removable-media approach for now, while waiting for the “future snapd-prompting mechanisms”.

The Android approach is to restrict direct file access to an application specific folder on the media.
$MOUNTPOINT/Android/data/org.paratext.ptlite/
(Which is actually the only folder paratextlite will be using).

I guess I still need another +1 for hardware-observe.
Is there anything I can do to encourage this?

Ping @reviewers - can you please vote on this request?

+1 from me for hardware-observe, as well.

+1 for auto-connect of hardware-observe

+3 votes for, 0 votes against, granting auto-connect of hardware-observe to paratextlite. This is now live.

1 Like