#!@GUILE@ \ --no-auto-compile -e main -s !# ;;;; Copyright (C) 2020 Julien Lepiller ;;;; ;;;; This library is free software; you can redistribute it and/or ;;;; modify it under the terms of the GNU Lesser General Public ;;;; License as published by the Free Software Foundation; either ;;;; version 3 of the License, or (at your option) any later version. ;;;; ;;;; This library is distributed in the hope that it will be useful, ;;;; but WITHOUT ANY WARRANTY; without even the implied warranty of ;;;; MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU ;;;; Lesser General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU Lesser General Public ;;;; License along with this library; if not, write to the Free Software ;;;; Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA ;;;; (use-modules (fibers web server)) (use-modules (ice-9 match)) (use-modules (gitile config) (gitile handler)) (define* (main #:optional (args (command-line))) (let ((config (match args ((_) (make-config 8080 "localhost" "/var/lib/gitile/gitile-db.sql" "/var/lib/gitolite/repositories")) ((_ "-c" file) (let ((content (call-with-input-file file read))) (match content (('config ('port port) ('host host) ('database database) ('repositories repositories)) (make-config port host database repositories))))) (_ (format #t "Usage: ~a [-c config-file]~%" (car args)))))) (run-server (gitile-handler config) #:port (config-port config))))