-
-
Notifications
You must be signed in to change notification settings - Fork 14.7k
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
privatebin: init at 1.5.2; nixos/privatebin: init, nixosTests.privatebin: init, pbincli: init at 0.3.5 #234287
base: master
Are you sure you want to change the base?
Conversation
Result of 3 packages marked as broken and skipped:
2 packages blacklisted:
3 packages built:
|
As this is a new module, my understanding is that it is backportable. May we do so when this is merged? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just set-up privatebin from this patch and a couple things bugged me. Overall, though, this is working fine- thank you and very well done!
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Very happy with the solution of sorting by the stated time, it might be worth talking to upstream privatebin if we still want to be able to sort differently but I'm not sure that we need to.
Just this last nit before I'm completely good with this PR :)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you very much for your hard work, this seems good to me!
Can you rebase to fix the merge conflict? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thank you so much for this. I hope I can leverage and test this soon!
binaryWorks = runCommand "${pname}-binary-test" {} '' | ||
export PATH=${pbincli}/bin:$PATH |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
binaryWorks = runCommand "${pname}-binary-test" {} '' | |
export PATH=${pbincli}/bin:$PATH | |
binaryWorks = runCommand "${pname}-binary-test" { | |
nativeBuildInputs = [ pbincli ]; | |
} '' |
pname = "PBinCLI"; | ||
version = "0.3.5"; | ||
format = "setuptools"; | ||
|
||
src = fetchPypi { | ||
inherit pname version; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
pname = "PBinCLI"; | |
version = "0.3.5"; | |
format = "setuptools"; | |
src = fetchPypi { | |
inherit pname version; | |
pname = "pbincli"; | |
version = "0.3.5"; | |
format = "setuptools"; | |
src = fetchPypi { | |
pname = "PBinCLI"; | |
inherit version; |
see python language docs
virtualHosts.privatebin = mkMerge [ | ||
cfg.nginx | ||
{ | ||
root = mkForce "${pkgs.privatebin}/share/privatebin"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
root = mkForce "${pkgs.privatebin}/share/privatebin"; | |
root = mkForce pkgs.privatebin; |
we could also just place it here like other php web things
cfg.nginx | ||
{ | ||
root = mkForce "${pkgs.privatebin}/share/privatebin"; | ||
extraConfig = optionalString (cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL || cfg.nginx.enableACME) "fastcgi_param HTTPS on;"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extraConfig = optionalString (cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL || cfg.nginx.enableACME) "fastcgi_param HTTPS on;"; | |
extraConfig = optionalString (cfg.nginx.addSSL || cfg.nginx.forceSSL || cfg.nginx.onlySSL) "fastcgi_param HTTPS on;"; |
acme is not required for https
"/" = { | ||
index = "index.php"; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"/" = { | |
index = "index.php"; | |
}; | |
"/".index = "index.php"; |
|
||
phpPackage = mkOption { | ||
type = types.package; | ||
relatedPackages = [ "php80" "php81" "php82" ]; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
relatedPackages = [ "php80" "php81" "php82" ]; | |
relatedPackages = [ "php81" "php82" ]; |
that's EOL
|
||
databaseSetup = { | ||
enable = mkEnableOption (lib.mdDoc "Automatic database setup and configuration"); | ||
kind = mkOption { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
How about we default this to sqlite so that things just work?
info = "This instance of PrivateBin is hosted on NixOS!"; | ||
languageselection = true; | ||
icon = "none"; | ||
cspheader = "default-src 'none'; base-uri 'self'; form-action 'none'; manifest-src 'self'; connect-src * blob:; script-src 'self' 'unsafe-eval'; style-src 'self'; font-src 'self'; frame-ancestors 'none'; img-src 'self' data: blob:; media-src blob:; object-src blob:; sandbox allow-same-origin allow-scripts allow-forms allow-popups allow-modals allow-downloads"; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no upstream value we can just copy and enable?
} else if autoDb == "sqlite" then { | ||
model.class = "Database"; | ||
model_options.dsn = "sqlite:/var/lib/privatebin/data/db.sqlite3"; | ||
} else {} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
} else {} | |
}; |
there is no other option
isEnv = v: isAttrs v && v ? _env && isString v._env; | ||
format = | ||
let | ||
iniAtom = (pkgs.formats.ini {}).type/*attrsOf*/.functor.wrapped/*attrsOf*/.functor.wrapped; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
What are the comments here supposed to mean?
, config | ||
, ... | ||
}: | ||
with lib; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
meta.maintainers = with lib.maintainers; [ e1mo ]; | ||
|
||
options.services.privatebin = { | ||
enable = mkEnableOption (mdDoc "PrivateBin web application"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Description of changes
PrivateBin is an end to end encrypted, zero knoweledge, pastebin service. This PR also adds a module and tests. PBinCLI is a third party client to work with PrivateBin, which is used in tests (I am not motivated to implement the clientside crypto by hand in the tests).
Things done
sandbox = true
set innix.conf
? (See Nix manual)nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)