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

オープン
#1,471 コメント 1 件 リアクション 0 件 担当者 0 名 GitHub で見る

まだ誰も着手していません。

評価

難易度
4/5
見積もり時間
3〜5日
初心者へのやさしさ
35/100
issue の種類
バグ
明瞭さ
おおむね明確
活発さ
停滞
技術スタック
haskell
領域
backend

調査の方向性

まず Distribution.Server.Framework.ServerEnv.requireUserContent を読み、commit 4231f36 の報告されたコマンドを再現します。required-base-host-header と user-content-uri の両方が localhost:1024 を使用する場合に、これらがどのように相互作用するかを追跡します。信頼できるローカルインスタンスを不合理なオプション値なしで実行でき、ユーザーコンテンツへのリクエストが無限の 301 リダイレクトに入らなくなれば完了です。

索引モデルが issue の本文から書いたものです。

説明

  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.

主要言語
Haskell
スター
471
フォーク
228
平均マージ
5日 6時間
マージ済み PR(30日)
3

環境構築

  • Dockerfile または Docker Compose ファイルあり
  • プルリクエストのテンプレートなし
  • コントリビューションガイドなし

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

haskell/hackage-server のほかの issue

haskell/hackage-server の issue をすべて見る

似ている issue

Haskell の issue をもっと見る

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。