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

transfer-sh: init at 1.6.0 #239916

Closed
wants to merge 4 commits into from
Closed

transfer-sh: init at 1.6.0 #239916

wants to merge 4 commits into from

Conversation

pinpox
Copy link
Member

@pinpox pinpox commented Jun 26, 2023

Description of changes

Added a package and module for transfer.sh, addressing #239627
I'm sure there are things that can be done in a cleaner way, please let me know and I'll iterate over the code until it fits the quality standards.

Things done
  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandbox = true set in nix.conf? (See Nix manual)
  • Tested, as applicable:
  • Tested compilation of all packages that depend on this change using nix-shell -p nixpkgs-review --run "nixpkgs-review rev HEAD". Note: all changes have to be committed, also see nixpkgs-review usage
  • Tested basic functionality of all binary files (usually in ./result/bin/)
  • 23.11 Release Notes (or backporting 23.05 Release notes)
    • (Package updates) Added a release notes entry if the change is major or breaking
    • (Module updates) Added a release notes entry if the change is significant
    • (Module addition) Added a release notes entry if adding a new NixOS module
  • Fits CONTRIBUTING.md.

@github-actions github-actions bot added 6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (update) This PR changes an existing module in `nixos/` labels Jun 26, 2023
@ofborg ofborg bot added 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 8.has: package (new) This PR adds a new package 11.by: package-maintainer This PR was created by the maintainer of the package it changes labels Jun 26, 2023
@pinpox pinpox marked this pull request as ready for review June 26, 2023 13:20
@pinpox pinpox requested review from mweinelt, AndersonTorres, SebTM and Lassulus and removed request for mweinelt and AndersonTorres June 26, 2023 13:24
@SuperSandro2000 SuperSandro2000 changed the title transfer-sh: init at v1.6.0 transfer-sh: init at 1.6.0 Jun 26, 2023
@mweinelt
Copy link
Member

The commit messages do not fit CONTRIBUTING.md.

@mweinelt mweinelt removed their request for review June 26, 2023 13:29
Copy link
Member

@tilpner tilpner left a comment

Choose a reason for hiding this comment

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

The firewall bit is important, the rest are just style nitpicks

nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
Copy link
Member

@SuperSandro2000 SuperSandro2000 left a comment

Choose a reason for hiding this comment

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

Please follow the contributing guide when naming your commits.

Could this module use freeform settings instead?

pkgs/servers/transfer-sh/default.nix Outdated Show resolved Hide resolved
pkgs/servers/transfer-sh/default.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
type = types.string;
};

LISTENER = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

LISTENER is not a great name for the port option

Copy link
Member Author

Choose a reason for hiding this comment

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

That is true, but I sticked to the upstream namings to make it easy to look up the docs. Unless you have a strong opinion against it, I'd just stick with the name to be consistent with upstream docs

Comment on lines +177 to +180
AWS_SECRET_KEY = mkOption {
description = "aws access key";
default = null;
type = types.nullOr types.str;
};
Copy link
Member

Choose a reason for hiding this comment

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

This promotes setting configuration in an insecure way

Copy link
Member Author

Choose a reason for hiding this comment

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

Should I take it out? I added a warning further down

nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Show resolved Hide resolved
type = types.nullOr types.int;
};

PROFILE_LISTENER = mkOption {
Copy link
Member

Choose a reason for hiding this comment

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

Don't use uppercase.

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 settings is called like this upstream. I'd vouch for keeping it as is so the docs are consistent.

Copy link
Member

Choose a reason for hiding this comment

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

This is irrelevant.

No one here calls an attribute --enable-simd-specific-optimizations just "for keeping it as is so the docs are consistent" with Autoconf-like scripts, or -DENABLE_SIMD_SPECIFIC_OPTIMIZATIONS just "for keeping it as is so the docs are consistent" with CMake scripts.
Just look at any package.nix | default.nix elsewhere.

On the other hand, the usage you are doing around the code is a repeating sequence of things like

PROFILE_LISTENER = toString cfg.PROFILE_LISTENER;

and no one will die if you use

PROFILE_LISTENER = toString cfg.profileListener;

pkgs/servers/transfer-sh/default.nix Outdated Show resolved Hide resolved
@ofborg ofborg bot added 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 and removed 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin labels Jun 26, 2023
@pinpox
Copy link
Member Author

pinpox commented Jun 26, 2023

The commit messages do not fit CONTRIBUTING.md.

Noted. I'll squash when everything else is done. Should module and pkg be separate commits or can I "init at xxx" both at once?

@AndersonTorres
Copy link
Member

Should module and pkg be separate commits or can I "init at xxx" both at once?

  1. One commit for the Nixpkgs package itself
  2. One commit for the NixOS module with title nixos/<moduleName>: init (when applicable)
  3. One commit for the NixOS tests nixos/tests/<moduleName>: init (when applicable)

@pinpox
Copy link
Member Author

pinpox commented Jun 27, 2023

The commit messages do not fit CONTRIBUTING.md.

Should match the format now.

@Lassulus
Copy link
Member

can we maybe put all the CAPSLOCK option inside a freeform submodule? and just document the couple ones which are important?

@h7x4 h7x4 added the 8.has: module (new) This PR adds a module in `nixos/` label Oct 19, 2023
@ocfox ocfox mentioned this pull request Jan 25, 2024
13 tasks
nixos/modules/services/misc/transfer-sh.nix Show resolved Hide resolved
nixos/modules/services/misc/transfer-sh.nix Outdated Show resolved Hide resolved
HTTP_AUTH_IP_WHITELIST = mkOption {
description = "comma separated list of ips allowed to upload without being challenged an http auth";
default = [ ];
type = with types; listOf str;
Copy link
Member

Choose a reason for hiding this comment

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

I'd prefer uses of with like this are also removed but its much less important than the top most one and is a preference thing.

Comment on lines +159 to +161
GA_KEY = mkOption {
description = "google analytics key for the front end";
default = null;
type = types.nullOr types.str;
Copy link
Member

Choose a reason for hiding this comment

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

plain text secrets are never fun. If an alternative way to get the secret to the service exists you should certainly be using that, I'd say this should be removed if there is any alternative.

@pinpox
Copy link
Member Author

pinpox commented Feb 14, 2024

Should I close this PR in favor of #283660 ? I don't mind and think it makes sense to decide on one of the two PRs and focus work there to push it over the finish line.

@SuperSandro2000
Copy link
Member

The other PR got merged instead. Please see if there are any missing bits.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
6.topic: nixos Issues or PRs affecting NixOS modules, or package usability issues specific to NixOS 8.has: module (new) This PR adds a module in `nixos/` 8.has: module (update) This PR changes an existing module in `nixos/` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 1-10 10.rebuild-darwin: 1 10.rebuild-linux: 1-10 11.by: package-maintainer This PR was created by the maintainer of the package it changes
Projects
None yet
Development

Successfully merging this pull request may close these issues.

8 participants