GithubHelp home page GithubHelp logo

Comments (10)

fujiapple852 avatar fujiapple852 commented on June 15, 2024 1

@helixzz thanks for trying. I guess I need to add it to here first and release it:

plugs:
- network-bind
- network
- network-observe

I also need to request auto-connect permission for this plug on the snapcraft forum.

Leave it with me and I’ll figure out what is needed.

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024 1

I am able to reproduce the issue on a ubuntu instance.

I added the home interface to trippy (in #1059) and this was built and released to the edge channel (revision 2643 for amd64).

I switched to the edge channel and refreshed:

snap-id:      MuyJc7aas4HVkKbWZclsIhu0R9WAjX50
tracking:     latest/edge
refresh-date: today at 13:00 UTC
channels:
  latest/stable:    0.9.0 2023-11-30 (1943) 3MB -
  latest/candidate: ↑
  latest/beta:      ↑
  latest/edge:      0.9.0 2024-03-21 (2643) 3MB -
installed:          0.9.0            (2643) 3MB -

I connected the (now available) home interface:

fuji@trippy-dev:~$ sudo snap connections trippy
Interface        Plug                    Slot              Notes
home             trippy:home             :home             -
network          trippy:network          :network          -
network-bind     trippy:network-bind     :network-bind     -
network-observe  trippy:network-observe  :network-observe  -

But it still does not work:

fuji@trippy-dev:~$ sudo trip 1.1.1.1 --config-file /home/fuji/trippy.toml
Error: config file not found: "/home/fuji/trippy.toml"

Caused by:
    Permission denied (os error 13)

The same message is given for files that do not exist:

fuji@trippy-dev:~$ sudo trip 1.1.1.1 --config-file /home/fuji/doesnotexist.toml
Error: config file not found: "/home/fuji/doesnotexist.toml"

Caused by:
    Permission denied (os error 13)

I tried from /tmp as well but that does not work either (which seems expected), however it fails with a different error (the files does exist in this case):

fuji@trippy-dev:~$ sudo trip 1.1.1.1 --config-file /tmp/trippy.toml
Error: config file not found: "/tmp/trippy.toml"

Caused by:
    No such file or directory (os error 2)

Aside, note that I used a non-hidden file and dirs above as the home interface only claims to allow access to non-hidden files. For hidden files it seems another interface, personal-files is needed. However I haven't tried this since I have not even been able to get the non-hidden files to work so far. There is also a removal-media interface which may be needed.

I'll post a question on the snapcraft forum as i'm not a regular snap user or expert and the solution is not obvious.

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024 1

Added #1062 to allow running via snap without requiring sudo such that the home and personal-files interfaces will allow access to configuration files in the /home of the original user rather than the home of the root user.

Edit: this does not help, snap requires elevated privileges even when the network-observe interface is connected.

from trippy.

c-git avatar c-git commented on June 15, 2024 1

Sorry was travelling I knew about this limitation of not being able to access files in folders that start with a dot because Firefox which is installed via Snap by default now on Ubuntu also has the same issue.

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024

Thanks for the report @helixzz.

I suspect trippy needs to connect to the home interface to allow this.

if you connect it manually (as described in https://snapcraft.io/docs/home-interface) does that fix the issue?

if so I will ask for that interface to be added to the snap for the nest version.

from trippy.

helixzz avatar helixzz commented on June 15, 2024

Thanks for the report @helixzz.

I suspect trippy needs to connect to the home interface to allow this.

if you connect it manually (as described in https://snapcraft.io/docs/home-interface) does that fix the issue?

if so I will ask for that interface to be added to the snap for the nest version.

Thanks for your reply!

I've tried sudo snap connect trippy:home :home and it seems produces an error: error: snap "trippy" has no plug named "home". Maybe I haven't get the correct command line?

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024

Posted: https://forum.snapcraft.io/t/access-config-file-from-snap/39418

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024

@helixzz if you are following the thread on the snapcraft forum, there is a solution to allow trippy (or any snap really) to read files from $HOME (that is blocked by default). The catch is it doesn't support hidden files or directories and so you'd need to place your trippy.toml file in your $HOME directory. Not a perfect solution but that appears to be the best we can do within the constraints of snap.

The snap config change to allow this will be included in 0.10.0 release of Trippy (due very soon).

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024

I'm awaiting the change to be approved by the snap folk and without that the 0.10.0 release will not be available in the snap store. Rather than block the whole Trippy release (which I'm planning to do today) i'm going to go ahead and close this issue and add it to the 0.10.0 release note as completed. Once the approval happens I can release 0.10.0 to the snap store.

from trippy.

fujiapple852 avatar fujiapple852 commented on June 15, 2024

@helixzz Trippy 0.10.0 has finally been released on snap and supports the ability to read (non-hidden) configuration files.

from trippy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.