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

goshs: init at 1.0.1 #366872

Draft
wants to merge 2 commits into
base: master
Choose a base branch
from
Draft

goshs: init at 1.0.1 #366872

wants to merge 2 commits into from

Conversation

SEIAROTg
Copy link
Contributor

Adds package goshs, the simple, yet feature-rich web server.

See:

Things done

  • Built on platform(s)
    • x86_64-linux
    • aarch64-linux
    • x86_64-darwin
    • aarch64-darwin
  • For non-Linux: Is sandboxing enabled in nix.conf? (See Nix manual)
    • sandbox = relaxed
    • sandbox = true
  • 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/)
  • 25.05 Release Notes (or backporting 24.11 and 25.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.

Add a 👍 reaction to pull requests you find important.

@ofborg ofborg bot added 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 10.rebuild-darwin: 1 10.rebuild-linux: 1 labels Dec 21, 2024
pkgs/by-name/go/goshs/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/go/goshs/package.nix Outdated Show resolved Hide resolved
pkgs/by-name/go/goshs/package.nix Outdated Show resolved Hide resolved
@lucasew
Copy link
Contributor

lucasew commented Dec 21, 2024

Just for curiosity sake, what this does that rclone doesn't do?

Rclone has rclone serve http and rclone serve webdav that does basically the same thing.

@SEIAROTg
Copy link
Contributor Author

@lucasew

Just for curiosity sake, what this does that rclone doesn't do?

I was really looking for a really simple file upload portal but it turns out surprisingly hard.

  • filestash, projectsend: too heavy.
  • rclone serve, simple-http-server, etc.: no web ui for upload.
  • jirafeau, privatebin, most pastebin-alikes: can't upload multiple files.
  • psitransfer: files have to expire.
  • linx-server: modifies file name (underscore, case).

This is the only thing works for me so far (except it doesn't handle file timestamp but nor does most alternatives I've seen so far).

"-s"
"-w"
];

Copy link
Contributor

Choose a reason for hiding this comment

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

passthru.updateScript = gitUpdater { rev-prefix = "v"; };


vendorHash = "sha256-6UaKh2UUyGqOriAaMhiEFr20R4W/ZWxQXtXnm/BVHOc=";

ldflags = [
Copy link
Contributor

Choose a reason for hiding this comment

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

Why these ldflags?

Copy link
Contributor

Choose a reason for hiding this comment

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

These two flags disable symbol generation and DWARF generation respectively and are AFAICT fairly standard for release-build Go packages. No need to strip them out later if we never generate them to begin with

# --- FAIL: TestGetIPv4Addr (0.00s)
# utils_test.go:62: route ip+net: no such network interface
badPlatforms = lib.platforms.darwin;
maintainers = with lib.maintainers; [ seiarotg ];
Copy link
Contributor

Choose a reason for hiding this comment

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

maintainers = [ lib.maintainers.seiarotg ];

@lucasew
Copy link
Contributor

lucasew commented Dec 22, 2024

@ofborg eval

@lucasew
Copy link
Contributor

lucasew commented Dec 22, 2024

Weird

description = "Simple, yet feature-rich web server written in Go";
homepage = "https://goshs.de";
license = lib.licenses.mit;
platforms = lib.platforms.all;
Copy link
Contributor

@pluiedev pluiedev Dec 25, 2024

Choose a reason for hiding this comment

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

I seriously doubt this (I don't think Go compiles for all platforms Nixpkgs supports). If this is supposed to work for all platforms Go supports, then just leave it blank as buildGoModule will provide a sensible default

platforms = lib.platforms.all;
# --- FAIL: TestGetIPv4Addr (0.00s)
# utils_test.go:62: route ip+net: no such network interface
badPlatforms = lib.platforms.darwin;
Copy link
Contributor

Choose a reason for hiding this comment

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

Hnnrgh, feels weird to mark all Darwin builds as broken when only one test is failing. Should we just disable that test on Darwin? (Also, just a hunch, but given this is about networking and only happens on Darwin, try setting __darwinAllowLocalNetworking to true)

"-s"
"-w"
];

Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
nativeInstallCheckInputs = [ versionCheckHook ];
doInstallCheck = true;


meta = {
description = "Simple, yet feature-rich web server written in Go";
homepage = "https://goshs.de";
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
homepage = "https://goshs.de";
homepage = "https://goshs.de";
changelog = "https://github.com/patrickhener/goshs/releases/tag/v${version}";

@donovanglover donovanglover marked this pull request as draft February 1, 2025 12:10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
8.has: maintainer-list (update) This PR changes `maintainers/maintainer-list.nix` 8.has: package (new) This PR adds a new package 10.rebuild-darwin: 0 This PR does not cause any packages to rebuild on Darwin 10.rebuild-linux: 1-10 10.rebuild-linux: 1 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.

5 participants