#!@GUILE@ \ --no-auto-compile -e main -s !# (use-modules (config) (config api) (config licenses) (config parser sexp) (ice-9 sandbox) (goblins) (starvat listener) (starvat handler)) (define %configuration (configuration (name 'starvat) (version @HVERSION@) (author @AUTHOR@) (copyright @COPYRIGHT@) (license @LICENSE@) (synopsis "A Gemini server based on Spritely's Goblins") (description "TODO") (keywords (list (setting (name 'resources) (default `(("localhost" . ,(string-append (getenv "HOME") "/gemini")))) (test list?) (handler eval-in-sandbox)))) (directory (list (path (given "/etc/starvat/") (eager? #f)) (in-home ".config/starvat"))) (parser simple-sexp-parser) (generate-cmdtree? #t))) (define (main args) (define options (getopt-config-auto args %configuration)) (define listener-vat (spawn-vat)) (define handler-vat (spawn-vat)) (define listener (with-vat listener-vat (spawn ^listener 1965 (string-append (getenv "HOME") "/localhost.crt") (string-append (getenv "HOME") "/localhost.key")))) (display options) (display (option-ref options 'resources)) (define handler (with-vat handler-vat (spawn ^handler options))) (with-vat listener-vat ($ listener 'init) ($ listener 'listen handler))) ;;; Local Variables: ;;; mode: scheme ;;; End: