Skip to content

Running without a separate user content instance requires abuse of command line options. #1471

Description

@kindaro
  1. I wish to run a local instance of a Hackage server. This is a trusted environment, so I see no need for a separate user content instance. 
  2. However, the flags required-base-host-header and user-content-uri are required.
  3. Moreover, when they are set all to the same value, say localhost:1024, any request to user content will result in an infinite 301 redirect due to the logic of the function Distribution.Server.Framework.ServerEnv.requireUserContent.

This problem can be overcome by setting required-base-host-header to a nonsensical value. Any string other than the true base host header would do.

I think this should be re-designed. Either the problematic options should be made optional, or an equality check should be added to the problematic logic.

This is the exact command I am running:

hackage-server run --static-dir datafiles --user-content-uri 'http://localhost:1024' --base-uri 'http://localhost:1024' --required-base-host-header 'localhost:1024' --port 1024

The executable file is built from the commit 4231f36.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions