darcsden is a darcs repository hosting platform, providing a web application for browsing and managing repos, users, and issues, and a SSH server for push/pull and quick repository creation.
You will need:
- Redis (for storing web session data)
- CouchDB (for storing user/repo/repository data)
Both should be running on their default port, or just edit DarcsDen/State/Util.hs to point to different ones.
You should have a "darcsden" user account (for running the app and owning the files), with a ssh key:
adduser --system --home /home/darcsden --shell /bin/bash --group --gecos DarcsDen darcsden sudo -u darcsden ssh-keygen
Configure, build and install darcsden:
(edit src/DarcsDen/Settings.hs) cabal install
And configure the databases:
For a quick test, you can run:
and browse to port 8900 with your server.
This package provides separate executables for the web and SSH servers,
darcsden' anddarcsden-ssh', respectively. You could run them manually while logged in as user 'darcsden' via screen or dtach. Or, configure them as daemons. supervisord is one way, here are sample supervisord.conf entries.
[program:darcsden] command=sudo -Hu darcsden /path/to/darcsden --port 8900 directory=/home/darcsden priority=3 redirect_stderr=true autostart=true autorestart=true environment=LANG="en_US.UTF-8" [program:darcsden-ssh] command=sudo -Hu darcsden /path/to/darcsden-ssh 22 directory=/home/darcsden priority=3 redirect_stderr=true autostart=true autorestart=true environment=LANG="en_US.UTF-8"
Note that it's important to run as darcsden, with HOME set (sudo -Hu darcsden), to ensure proper darcs cache directory selection and proper file ownership. Otherwise you will get obscure errors when serving pages.
Also the directory where the web server starts should contain darcsden's public/ directory. Or you can run it behind a web server or something that'll handle /public requests by pointing to that directory.
Here's a sample apache vhost config:
<VirtualHost *:80> ServerName my.host.name RewriteEngine on ProxyPreserveHost On ProxyErrorOverride On RewriteRule ^/(.*) http://127.0.0.1:8900/$1 [P] </VirtualHost>