Giter Club home page Giter Club logo

Comments (13)

clayt0nk avatar clayt0nk commented on May 30, 2024 1

All that was missing. So what I just did on NixOS was:

  • change XDG_DOCUMENTS_DIR="$HOME/ to XDG_DOCUMENTS_DIR="$HOME/Documents" in ~/.config/user-dirs.dirs
  • export XDG_CONFIG_HOME=~/.config in a terminal
  • in the same terminal, flatpak run io.github.glitterware.Passy

Passy files appear in ~/Documents/Passy/, and they are read when I restart Passy in the same terminal.

Methinks a less fragile location for these files would be nice, or some sort of graceful fallback if the preferred location does not work. Personally I don't care if the fallback is in ~/.var/app/, this behavior is I think actually the norm in flatpaks.

from passy.

umlaeute avatar umlaeute commented on May 30, 2024 1

thanks for the quick response (and the heads up)

i'm currently stuck with the flatpak version (as i don't use arch, and don't really feel like building passy myself)

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024 1

I have good news regarding this issue: I have figured out a way to fix it! It is indeed Flatpak's fault as far as it seems as apparently Flatpak does not seem to account properly for xdg-documents when it is specified as $HOME. I might open a bug report on this later. More good news is: there's a new release coming soon! I am currently cleaning Passy up and getting it ready for a new release build, which will include this bug fix.

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

Hello @clayt0nk !

This is most curious to me, I've just tested this on my local machine with the latest upstream version of Passy on flathub and it is able to successful create and save an account.

May I ask, did you use any special characters in the account username? I'm not entirely confident in the support for all special characters. If you provide me any special characters you have used then I will be able to test them locally and see if the problem transfers to my installation.

from passy.

clayt0nk avatar clayt0nk commented on May 30, 2024

No special characters, though when I discovered that spaces were not permitted, I replaced the two spaces in my intended username with the zero digit, ie. "0". I just tried again without zeroes in the username, and it still fails. I already tried under two different Linux distros, NixOS and Debian, same behavior. I am thinking there is some error-checking missing here, I should be seeing an error either when the save fails, and / or when the read fails on the next app start. Especially the former.

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

Curious.

The interesting part is that LoadedAccount (the account database interfacing class) has a constructor with no error checking, and the constructor call itself is wrapped in a try catch that logs any errors to a snackbar.

What this means is that if there was a file io error (which dart:io throws normally), it would be logged in an instant. There would be no possibility to proceed to any further screens (they'd show a flutter exception), as the failed LoadedAccount construction would cause the static account property to be null, which doesn't seem to be the case on your end.

If possible, adjust your username to not contain any information you don't want to share, test if it still doesn't work and if it does not, please send it here so that I am able to try and reproduce the problem on my end.

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

@clayt0nk I apologize, I've missed one detail that might be crucial - you do not normally have a Documents directory.

Have you set your XDG_DOCUMENTS_DIR="$HOME/Documents"?

Edit 1:

Just to make sure you're aware, this line needs to be in ~/.config/user-dirs.dirs to be read correctly. Also, it's best to set XDG_CONFIG_HOME environment variable to ~/.config.

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

I'm glad that we have managed to pinpoint the problem. I'll see what I can do about this, however I'll need to check more about flatpak sandboxing permissions in order to make it work. Thank you for your contribution!

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

Added fallback path for database directory - ce1c767

from passy.

umlaeute avatar umlaeute commented on May 30, 2024

urgh, i was just beaten by this, using Passy-1.6.0.

i wholeheartedly dislike applications putting stuff in a ~/Documents/ folder (therefore i would very much prefer to leave XDG_DOCUMENTS_DIR="$HOME/ in my userdir config.
it's a bit of a bummer, if "some random app" forces me to change this.
after all, the entire idea of the userdir configuration is to allow the user to pick their own (so: applications must follow the users decision, not the other way round).

in the specific case of passy, i see very little^Wno use in using the Documents dir for storing password information at all.
imho, "Documents" are files of which the user is aware, and which they can (ideally) open with multiple applications and share between people.
i think a good test for using the Documents dir, is: does the application have a File->Open dialog (or similar), that allows the user to chose files? if yes, these files can go into Documents; otherwise don't.

Since Passy has no way to chose among different files, Documents is clearly the wrong directory.

looking at the files stored by Passy, i see a wagonfull of json and encrypted stuff (which are obviously not meant for simplistic sharing among users).
i also see a temp folder with some binary files in there. ???

i think the proper place to put the user data would be $XDG_DATA_HOME.
the temporary files should probably go to $XDG_RUNTIME_DIR, or $TMPDIR or /tmp.
or is there a specific reason that they need to persist between runs?
it seems to me that the file in the flatpak archive (/var/lib/flatpak/app/io.github.glitterware.Passy/x86_64/stable/66f0ecf12cd7dbf905d64d6b27b788e90364396dea9c93e7da2cab1c00ad7a0e/files/Passy/passy_cli) and the persisted file in my Documents directory (~/Documents/Passy/passy_cli/temp/bin/passy_cli/*/passy_cli) are identical: so why can't you just run the binary directly (from the flatpak archive)?

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

Hello @umlaeute ! I am very sorry for this inconvenience.

I will see what I can do about custom XDG_DOCUMENTS_DIR location. I believe it is indeed right to have the location be more flexible in that sense. I can not promise any fixes regarding this for the next release but I will definitely keep this in mind and will notify you if there's any related changes. In theory, adding support for custom XDG_DOCUMENTS_DIR shouldn't be too hard, but I'll have to investigate it myself later.

Regarding passy_cli - it is used as a browser extension connector for Passy and with the next release will also have a standalone server capability. It is copied into a temporary directory to prevent app updates from failing if the browser extension is running. It is a small executable and doesn't take up much space so it shouldn't be an issue.

Expect to hear more about the XDG_DOCUMENTS_DIR fix later, and thank you for reminding me! I must admit, I forgot this was a problem in the first place.

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

I must note that this is a flatpak specific issue - Passy is able to save files for custom XDG documents paths, I have just tested and confirmed this with an AUR installation

from passy.

GleammerRay avatar GleammerRay commented on May 30, 2024

@clayt0nk @umlaeute Fixed in https://github.com/GlitterWare/Passy/releases/tag/v1.7.0

from passy.

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.