-
-
Notifications
You must be signed in to change notification settings - Fork 12.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
Filebrowser service #306615
base: master
Are you sure you want to change the base?
Filebrowser service #306615
Conversation
2563f62
to
4677bda
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/first-pr-anything-else-to-do-or-just-wait/44035/1 |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3852 |
4677bda
to
7b52fd7
Compare
7b52fd7
to
27fba8d
Compare
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3911 |
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.
Please add the following to the filebrowser package
At the top:
-{ buildGoModule, buildNpmPackage, fetchFromGitHub, lib }:
+{ buildGoModule, buildNpmPackage, fetchFromGitHub, lib, nixosTests }:
And in the lower buildGoModule
passthru = {
inherit frontend;
+ tests = {
+ filebrowser = nixosTests.filebrowser;
+ };
};
This would have let the CI catch the other mistakes.
After the above changes i can access the the webpage, but not login.
:-( Edit: |
35edb9d
to
f4b399f
Compare
f4b399f
to
48d4911
Compare
48d4911
to
266268a
Compare
a8531aa
to
0a5f279
Compare
0a5f279
to
1bb59ab
Compare
This was a great catch, and I updated the |
This pull request has been mentioned on NixOS Discourse. There might be relevant details there: https://discourse.nixos.org/t/prs-ready-for-review/3032/3982 |
Ref #289750, not sure about the differences but maybe the changes can be synced up? |
cfg = config.services.filebrowser; | ||
|
||
cmd = | ||
"${cfg.package}/bin/filebrowser --config='${cfg.dataDir}/config.json' --database='${cfg.dataDir}/database.boltdb'"; |
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.
"${cfg.package}/bin/filebrowser --config='${cfg.dataDir}/config.json' --database='${cfg.dataDir}/database.boltdb'"; | |
"${lib.getExe cfg.package} --config='${cfg.dataDir}/config.json' --database='${cfg.dataDir}/database.boltdb'"; |
networking.firewall = | ||
lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.port ]; }; |
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.
networking.firewall = | |
lib.mkIf cfg.openFirewall { allowedTCPPorts = [ cfg.settings.port ]; }; | |
networking.firewall = lib.mkIf cfg.openFirewall { | |
allowedTCPPorts = [ cfg.settings.port ]; | |
}; |
ExecStart = pkgs.writeShellScript "filebrowser-exec-start.sh" '' | ||
${preamble} | ||
|
||
${cmd} config set --address=${cfg.settings.address} || exit $? | ||
${cmd} config set --port=${ | ||
builtins.toString cfg.settings.port | ||
} || exit $? | ||
|
||
exec ${cmd} | ||
''; | ||
}; | ||
|
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.
ExecStart = pkgs.writeShellScript "filebrowser-exec-start.sh" '' | |
${preamble} | |
${cmd} config set --address=${cfg.settings.address} || exit $? | |
${cmd} config set --port=${ | |
builtins.toString cfg.settings.port | |
} || exit $? | |
exec ${cmd} | |
''; | |
}; | |
}; | |
script = '' | |
${preamble} | |
${cmd} config set --address=${cfg.settings.address} || exit $? | |
${cmd} config set --port=${toString cfg.settings.port} || exit $? | |
exec ${cmd} | |
''; |
we don't need the extra wrapper here
Description of changes
Added service configuration for filebrowser. I'm open to suggestions on how to better structure the options since this application is primarily configured through a mutable single-file database.
Things done
nix.conf
? (See Nix manual)sandbox = relaxed
sandbox = true
nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD"
. Note: all changes have to be committed, also see nixpkgs-review usage./result/bin/
)Add a 👍 reaction to pull requests you find important.