haskell / haskell/hackage-server

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

Open
#1,471 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Haskell
Stars
467
Forks
225
PR merge metrics
No merged PRs in 30d

Description

0. 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. 
1. However, the flags `required-base-host-header` and `user-content-uri` are required.
2. 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:

``` sh
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.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.