Skip to content
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

Passopolis password manager service #25907

Closed
wants to merge 5 commits into from

Conversation

disassembler
Copy link
Member

@disassembler disassembler commented May 19, 2017

Motivation for this change

Adds passopolis password manager service

Things done
  • Tested using sandboxing
    (nix.useSandbox on NixOS,
    or option build-use-sandbox in nix.conf
    on non-NixOS)
  • Built on platform(s)
    • NixOS
    • macOS
    • Linux
  • Tested compilation of all pkgs that depend on this change using nix-shell -p nox --run "nox-review wip"
  • Tested execution of all binary files (usually in ./result/bin/)
  • Fits CONTRIBUTING.md.


db_url = mkOption {
default = "jdbc:postgresql://localhost:5432/passopolis";
description = "Database URL";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Would not
type = types.str;
be applicable here?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@@ -294,6 +294,7 @@
jackett = 276;
aria2 = 277;
clickhouse = 278;
passopolis = 279;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As it seems to not to persist data to disk, it does not require a fixed uid. If that's the case, just remove this line. The uid will be then allocated dynamically.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Fixed

};

db_url = mkOption {
default = "jdbc:postgresql://localhost:5432/passopolis";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If this url contains database passwords, it would be better if the url can be also stored outside of nix store in a file.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

From what I can tell, the app doesn't support authenticated database url's at this time. I'm not a java programmer, so I could be wrong. Where would you persist the credentials if it could potentially contain user/password?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

According to that url https://www.petefreitag.com/articles/jdbc_urls/ the underlying library can.
I would then look similar to this example: https://github.com/NixOS/nixpkgs/blob/master/nixos/modules/services/misc/gogs.nix#L116

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The only way according the the team developing it to set that db_url is as a runtime parameter (there's no app.properties or anything yet to store parameters), so if someone launches the app and has credentials in the db_url, anyone on the system can run a ps and see those credentials. Once a config system is added for the application, I completely agree that keeping the credentials out of the nix store is the better way to go or better yet encrypting in the store if RFC 0005 gets implemented.

meta = {
homepage = "https://github.com/WeAreWizards/passopolis-server";
description = "A well-designed, well-functioning and secure secret manager.";
license = stdenv.lib.licenses.gpl3;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do you want to maintain this package?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I would. Should I squash the commit and force push so it's only one commit?

Copy link
Member

@Mic92 Mic92 May 20, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I can squash that too when merging. Can you add yourself as maintainer then? https://github.com/nixos-users/wiki/wiki/Get-Involved#becoming-a-nixpkgs-maintainer

url = "https://github.com/WeAreWizards/passopolis-server";
sha256 = "0ywmymbjcfsxv1p1j0l0lw9cb7f79h23ic1c4b5w5nb0k9f4zvfq";
rev = "${version}";
leaveDotGit = true;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will the build fail, if it cannot use git to obtain its commit? Leaving .git can lead to not-reproducible artifacts.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It won't fail, but it will put garbage in the build.properties file. When running the ant jar command, it generates a build.properties file with the build time, git commit and description.

let
version = "b827b3a6176e050deb729009676fad7e86e5393a";
in antBuild {
name = "passopolis-${version}";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We usually use passopolis-unstable-<year>-<month>-<day> here as it is more meaningful then a commit hash (where the date is the date of the commit).

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

@disassembler disassembler force-pushed the passopolis-server branch 2 times, most recently from 133c9a5 to 8b65875 Compare May 21, 2017 04:38

services.passopolis = {

enable = mkOption {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please use mkEnableOption

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

done

{ stdenv, antBuild, fetchgit, git, python }:

let
version = "unstable-2016-05-07";
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove unstable

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I have suggested to add ùnstable because of https://nixos.org/nixpkgs/manual/#sec-package-naming

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you have a better idea how things should be named, please also update the coding conventions. Otherwise it gets inconsistent across reviews.

config.services.postgresql.package
];
preStart = ''
mkdir -p ${cfg.statePath}
chown ${cfg.user} ${cfg.statePath}
if [ "${cfg.databaseHost}" = "127.0.0.1" ]; then
${lib.optionalString cfg.enablePostgreSQLDatabase ''
Copy link
Member

@Mic92 Mic92 May 23, 2017

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this makes the intention of the user a little bit more explicit and convenient.

@Mic92
Copy link
Member

Mic92 commented May 23, 2017

It still requires a database password with the default settings:

org.postgresql.util.PSQLException: The server requested password-based authentication, but no password was provided.

This has to be provided in the database url: https://jdbc.postgresql.org/documentation/80/connect.html

(does require a password)
@disassembler
Copy link
Member Author

I'm going to close this out. Hasn't been updated in 2 years. extension no longer builds for me as well. Going to start making the switch to keepassweb

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants