Skip to content

Easier config to mirror Hackage #5870

@brandonchinn178

Description

@brandonchinn178

Our company has an Artifactory instance that we've set up to mirror/cache Hackage urls; i.e. https://artifactory.example.com/hackage/foo/bar will mirror and cache https://hackage.haskell.org/foo/bar.

Currently it's annoying to configure Stack to use this mirror; currently we have to manually create ~/.stack/config.yaml containing

package-indices:
- download-prefix: https://artifactory.example.com/hackage/
  hackage-security:
    keyids:
    - ...
    key-threshold: 3
    ignore-expiry: true

Since the mirror is basically the same thing as Hackage, there's no point in duplicating all the keyids and whatnot; presumably this is all information already bundled in the Stack executable anyway.

It would be nice to have a way to just specify a URL and have it configured with the default configuration, e.g.:

# environment variable
export STACK_HACKAGE_URL=https://artifactory.example.com/hackage/

# helper command
stack config set hackage-url https://artifactory.example.com/hackage/

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