| Version 9 (modified by zenzike, 20 months ago) |
|---|
Quickstart hacking guide
This page describes the new Hackage server.
Installing
To build the latest Hackage code:
darcs get http://code.haskell.org/hackage-server/ cd hackage-server cabal install --only-dependencies [--dry-run] cabal configure -O0 cabal build
Running
The following commands run the server in the current build tree:
dist/build/hackage-server/hackage-server init --static-dir=static/ dist/build/hackage-server/hackage-server run --static-dir=static/
By default the server runs on port 8080 with the following settings:
URL: http://localhost:8080/ username: admin password: admin
To specify something different, see hackage-server init --help for details.
The server can be killed by using:
Control-C
This will save the current state and shutdown cleanly. Running again will resume with the same state.
Resetting
To reset everything, kill the server and delete the server state:
rm -rf state/
Note that the static/ and state/ directories differ: static is for static html and other files. The state directory holds information about the database, using acid-state.
Creating users & uploading packages
List of registered users:
http://localhost:8080/users/
Register new users:
http://localhost:8080/users/register
Currently there is no restriction on registering, but only an admin user can grant privileges to registered users e.g. by adding them to other groups. In particular there are groups:
- admins http://localhost:8080/users/admins/ -- administrators can do things with user accounts like disabling, deleting, changing other groups etc.
- trustees http://localhost:8080/packages/trustees/ -- trustees can do janitorial work on all packages
- mirrors http://localhost:8080/packages/mirrorers/ -- for special mirroring clients that are trusted to upload packages
- per-package maintainer groups http://localhost:8080/package/foo/maintainers -- users allowed to upload packages
Currently any registered user can upload new packages i.e. new names (we may want to review this), but only people in the package maintainer group can upload new versions of existing packages.
Mirroring
There is a program included in the hackage-server package called hackage-mirror. This is still work in progress. Duncan is working on that. It's intended to enable syncing all the packages from one server to another, e.g. getting all the packages from the old hackage and uploading them to a local instance of a hackage-server. The mirror client mostly works, the current issue is making the server agree with the client about how to manage package uploads.
Current TODOs
- Sort out the mess with basic vs digest authentication (ask Duncan).
Duncan is working on: cleaning up the error handling style and getting mirroring working.
- HackageDB and HackageToDo
- HackageDB/2.0/OldURIs - the documents and scripts in hackage-scripts' directory tree
- HackageDB/2.0/URIs - the planned new URIs and how to interact with them
- HackageDB/2.0/Architecture - ideas and implementations for internal code organization
- HackageDB/2.0/CommandLine - how to use the command line interface
- HackageDB/2.0/Switchover - Roadmap for hackage-server and the eventual switch to it.
Bigger projects
- Work on new html theme. See djahandarie's mockup here: picture of the intended design, current html
- convert to acid-state
- convert to modular use of type-safe URLs
People to ask
Ask Duncan (dcoutts on irc) and Matt (Gracenotes on irc). Duncan knows the general design ideas and strategy. Matt did his GSoC project last year on improving the server.
