Skip to content

Fix symlink path resolution, add Makefile for streamlined global installation, and optimize trailing slash normalization #56

Description

@R0X4R

Issue Description

Problem

  1. Symlink Asset Resolution Breakdowns: When executing the compiled nomore403 binary via a symbolic link, the tool fails to locate the default payloads/ directory. This happens because the runtime context evaluates relative to the symlink file path rather than the underlying binary destination.
  2. Global Installation Configuration Gaps: Users who install the tool via go install or run it globally have to manually move or pass the -f flag to point to the payloads directory, leading to a clunky user experience for a system-wide CLI utility.
  3. Redundant Code Patterns: The initialization checks for trailing slashes on target URIs use multi-line conditional statements that can be simplified into a more idiomatic Go pattern.

Proposed Solution

  1. Implement filepath.EvalSymlinks: Update the path resolution inside cmd/root.go to follow symbolic links to their absolute source before attaching the fallback /payloads directory string.
  2. Introduce a Configuration Makefile: * Add a make build target that compiles the binary locally while deploying default payloads to a persistent global directory (~/.nomore403/payloads).
  • Add a make install target that handles dynamic GOBIN/GOPATH extraction via go env for a robust, zero-download installation footprint.
  • Include an automated -h verification step on successful compilation.
  1. Refactor Code Noise: Replace the conditional slash checks inside runAutocalibrate with an unconditional strings.TrimSuffix(options.uri, "/") + "/" statement and remove any verified dead code wrappers.

I have implemented these fixes locally across cmd/root.go and a new root-level Makefile and can submit a Pull Request if the maintainers are open to these improvements.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions