Add git owner verification option
gitile/config.scm
| 26 | 26 | config-host | |
| 27 | 27 | config-database | |
| 28 | 28 | config-repositories | |
| 29 | + | config-git-owner-validation? | |
| 29 | 30 | config-base-git-url | |
| 30 | 31 | config-index-title | |
| 31 | 32 | config-intro | |
… | |||
| 36 | 37 | set-parameters-from-config!)) | |
| 37 | 38 | ||
| 38 | 39 | (define-record-type <config> | |
| 39 | - | (make-config port host database repositories base-git-url index-title intro footer) | |
| 40 | + | (make-config port host database repositories git-owner-validation? | |
| 41 | + | base-git-url index-title intro footer) | |
| 40 | 42 | config? | |
| 41 | 43 | (port config-port) | |
| 42 | 44 | (host config-host) | |
| 43 | 45 | (database config-database) | |
| 44 | 46 | (repositories config-repositories) | |
| 47 | + | (git-owner-validation? config-git-owner-validation?) | |
| 45 | 48 | (base-git-url config-base-git-url) | |
| 46 | 49 | (index-title config-index-title) | |
| 47 | 50 | (intro config-intro) | |
gitile/handler.scm
| 20 | 20 | (define-module (gitile handler) | |
| 21 | 21 | #:use-module (fibers web server) | |
| 22 | 22 | #:use-module (git) | |
| 23 | + | #:use-module (git settings) | |
| 23 | 24 | #:use-module (gitile config) | |
| 24 | 25 | #:use-module (gitile pages) | |
| 25 | 26 | #:use-module (gitile repo) | |
… | |||
| 198 | 199 | (list))) | |
| 199 | 200 | ||
| 200 | 201 | (match config | |
| 201 | - | (($ <config> port host database repositories base-git-url index-title intro | |
| 202 | - | footer) | |
| 202 | + | (($ <config> port host database repositories owner-validation? base-git-url | |
| 203 | + | index-title intro footer) | |
| 204 | + | (set-owner-validation! owner-validation?) | |
| 203 | 205 | (lambda (request body) | |
| 204 | 206 | (pk 'request request) | |
| 205 | 207 | (pk 'body (if body (utf8->string body) body)) | |
scripts/gitile.in
| 23 | 23 | ||
| 24 | 24 | (use-modules (ice-9 match) | |
| 25 | 25 | (fibers web server) | |
| 26 | - | (git settings) | |
| 27 | 26 | (gitile config) | |
| 28 | 27 | (gitile handler)) | |
| 29 | 28 | ||
… | |||
| 37 | 36 | ('host host) | |
| 38 | 37 | ('database database) | |
| 39 | 38 | ('repositories repositories) | |
| 39 | + | ('git-owner-validation? validation?) | |
| 40 | 40 | ('base-git-url git-base-url) | |
| 41 | 41 | ('index-title index-title) | |
| 42 | 42 | ('intro intro) | |
| 43 | 43 | ('footer footer)) | |
| 44 | - | (make-config port host database repositories | |
| 44 | + | (make-config port host database repositories validation? | |
| 45 | 45 | git-base-url index-title intro footer))))) | |
| 46 | 46 | (_ (format #t "Usage: ~a -c config-file~%" (car args)) | |
| 47 | 47 | (exit))))) | |
| 48 | - | (set-owner-validation! #f) | |
| 49 | 48 | (set-parameters-from-config! config) | |
| 50 | 49 | (run-server (gitile-handler config) #:port (config-port config)))) | |
| 51 | 50 | ||