Pacman DB Viewer
A web view for Pacman package databases.
Setup
This setup uses Quicklisp, bower, systemd, GNU Screen, SBCL and Lighttpd to get things running. This is not the only way to do it, but it is the way I've set it up.
- Clone pacman-db-viewer into your quicklisp local-projects
directory and install the bower dependencies.
cd ~/quicklisp/local-projects git clone git://github.com/ryuslash/pacman-db-viewer.git cd pacman-db-viewer bower install
- Create a file
~/start-pacman-db-viewer.lispand put the following contents in it:(ql:quickload "pacman-db-viewer") (use-package :clack.app.urlmap) (setf pacman-db-viewer-config:*database-file* #P"/path/to/pacman.db.tar.gz") (defparameter *urlmap* (make-instance '<clack-app-urlmap>)) (mount *urlmap* "/packages/" (pacman-db-viewer:get-app)) (defvar *handler* (clack:clackup *urlmap* :port 8028))
The
/packages/path and8028port are both just suggestions. You can use whichever values you like.If you have any other clack-based applications you can easily add them by adding more
mountcalls. - Create a service file in
~/.config/systemd/user/namedpacman-db-viewer.service. Put the following contents in it:[Unit] Description=Pacman DB Viewer [Service] Type=simple ExecStart=/usr/bin/screen -D -m /usr/bin/sbcl --load /path/to/start-pacman-db-viewer.lisp [Install] WantedBy=default.target
- Start and enable the service:
systemctl --user start pacman-db-viewer systemctl --user enable pacman-db-viewer
It can take a while to start if you install the dependencies for the first time or if you've just updated your quicklisp dists.
Note: Just in case you don't already have that, be sure to enable user lingering for whichever user you use to run this service:
sudo loginctl enable-linger username
Where
usernameshould be replaced with whichever username you use to run pacman-db-viewer. - Setup a reverse proxy in
lighttpd.conf:server.modules += ( "mod_proxy" ) $HTTP["host"] =~ "^(www\.)?example\.com" { $HTTP["url"] =~ "^/packages/?" { proxy.server = ( "" => (( "host" => "127.0.0.1", "port" => 2028 )) ) } }
Where you'd replace
example.comwith your own domain (which you probably already have setup),packageswith whichever path you specified instart-pacman-db-viewer.lisp, and the port you specified there as well.