#!@GUILE@ \ --no-auto-compile -e main -s !# ;;;; Copyright (C) 2020 Julien Lepiller ;;;; ;;;; SPDX-License-Identifier: AGPL-3.0-or-later ;;;; ;;;; This program is free software: you can redistribute it and/or modify ;;;; it under the terms of the GNU Affero General Public License as published by ;;;; the Free Software Foundation, either version 3 of the License, or ;;;; (at your option) any later version. ;;;; ;;;; This program 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 Affero General Public License for more details. ;;;; ;;;; You should have received a copy of the GNU Affero General Public License ;;;; along with this program. If not, see . ;;;; (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))))