-
Notifications
You must be signed in to change notification settings - Fork 22
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Running Peergos with custom native-lib path still creates native-lib in current path #540
Comments
Currently we only support using a native-lib dir in pwd. Is that a problem for nixos? |
Well, it's not problem with specific OS but rather problem with user experience and consequences. If you run peergos in multiple places (no matter why, today it was ~/Downloads, yesturday ~/Desktop) you'll have multiple places with created Every system have special places to put user applications data:
|
There is also simpler option which fixes problem for all systems and architectures:
|
The file is 32kb so shouldn't cause anyone any problems, even with 1000 copies of it. Peergos creates a bunch of other files in the ~/.peergos dir by default (mainly sqlite files), though this can be controlled with the -PEERGOS_PATH arg or env var. We only use native-lib on x86 + linux. No other arch is supported, but everything still works fine. |
Yeah, it works i am not saying it is not working. But thrust me, if you run |
Yep, people can control the .peergos dir with the arg above. |
the native-lib is the only thing not in that dir we create, but it is an arg to the JVM, not to peergos. So we don't actually get the arg in peergos. |
So how it's created? |
It's basically tweetnacl.c. |
I am not asking what is that file or what is inside this folder. Issue here is that it's created in current |
This is a philosophical question of whether you want to separate data from code. This lib is code and so really belongs where the jar is. At least that's why it is where it is now. I guess we could put it in .peergos, I don't feel strongly either way. |
Native-libs is not created inside the jar path, but it is created in the current directory. If you call It would be nice if it creates |
Yep we assume you run the jar from the current dir. I'll see what I can do. |
This is also an issue in the container version in which we can only add parameters after |
Discovered while packaging peergos on NixOs. When i run
java -Djava.library.path=result/share/peergos/native-lib/ -jar result/share/java/peergos.jar
it creates native-lib/libtweetnacl.so in currentpwd
.#: java -Djava.library.path=result/share/peergos/native-lib -jar result/share/java/peergos.jar Jan 22, 2024 10:11:34 AM peergos.server.util.Logging init INFO: Logging to /home/raspher/.peergos/peergos.0.log Run with -help to show options
What i'm doing:
https://github.com/Peergos/web-ui/releases/download/v${version}/Peergos.jar
to$out/share/java/
mkdir -p $out/share/peergos && cd $out/share/peergos
native-libs
in this directory for current architecture$out/bin/peergos
user can pass arguments without typingjava ...
)As you may saw, running
java -Djava.library.path=result/share/peergos/native-lib -jar result/share/java/peergos.jar
does not spam aboutTo use the native linux-x86-64 crypto implementation use option -Djava.library.path=native-lib
but it still createsnative-lib
inpwd
instead of just using providedjava.library.path
Related work can be found here: NixOS/nixpkgs#282470
The text was updated successfully, but these errors were encountered: