#!@GUILE@ \ --no-auto-compile -e main -s !# ;;;; Copyright (C) 2020 Julien Lepiller ;;;; Copyright (C) 2024 Evgeny Pisemsky ;;;; ;;;; 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 (ice-9 match) (fibers web server) (git settings) (gitile config) (gitile handler)) (define* (main #:optional (args (command-line))) (let ((config (match args ((_ "-c" file) (let ((content (call-with-input-file file read))) (match content (('config ('port port) ('host host) ('database database) ('repositories repositories) ('base-git-url git-base-url) ('index-title index-title) ('intro intro) ('footer footer)) (make-config port host database repositories git-base-url index-title intro footer))))) (_ (format #t "Usage: ~a -c config-file~%" (car args)) (exit))))) (set-owner-validation! #f) (set-parameters-from-config! config) (run-server (gitile-handler config) #:port (config-port config)))) ;; Local Variables: ;; mode: scheme ;; End: