The `https-port-number' configuration is meaningless, removed and
replaced with `use-https' which defaults to #t. If the web server is disabled, run a tiny "server" that spits out a message -- to avoid students complaining that something is broken. Configuration files with `https-port-number' will throw an error, and should be upgraded. svn: r17450
This commit is contained in:
parent
e423ae7e71
commit
d5f1f59d77
|
@ -70,7 +70,7 @@
|
|||
[(active-dirs) (values '() path-list )]
|
||||
[(inactive-dirs) (values '() path-list )]
|
||||
[(port-number) (values 7979 id )]
|
||||
[(https-port-number) (values #f id )]
|
||||
[(use-https) (values #t id )]
|
||||
[(hook-file) (values #f path/false )]
|
||||
[(session-timeout) (values 300 id )]
|
||||
[(session-memory-limit) (values 40000000 id )]
|
||||
|
|
|
@ -26,8 +26,7 @@
|
|||
@item{Make a @filepath{test} subdirectory in your new directory.}
|
||||
|
||||
@item{Create a file @filepath{config.ss} with the following content:
|
||||
@schemeblock[((active-dirs ("test"))
|
||||
(https-port-number 7980))]}
|
||||
@schemeblock[((active-dirs ("test")))]}
|
||||
|
||||
@item{In your new directory, run @commandline{mred-text -l handin-server}}
|
||||
|
||||
|
@ -50,10 +49,9 @@
|
|||
The submitted file will be @filepath{.../test/tester/handin.scm}.}
|
||||
|
||||
@item{Check the status of your submission by pointing a web browser at
|
||||
@tt{https://localhost:7980/}. Note the ``s'' in ``https''. Use the
|
||||
``@tt{tester}'' username and ``@tt{pw}'' password, as before.
|
||||
@tt{https://localhost:7979/}. Note the ``s'' in ``@tt{https}''. Use
|
||||
the ``@tt{tester}'' username and ``@tt{pw}'' password, as before.
|
||||
|
||||
NOTE: The @scheme[https-port-number] line in the
|
||||
@filepath{config.ss} file enables the embedded secure server. You
|
||||
can remove it if you don't want it.}
|
||||
NOTE: The embedded web server can be disabled in the configuration
|
||||
file if you don't want to use it.}
|
||||
]
|
||||
|
|
|
@ -41,9 +41,9 @@ This directory contains the following files and sub-directories:
|
|||
@item{@indexed-scheme[port-number] --- the port for the main handin
|
||||
server; the default is 7979.}
|
||||
|
||||
@item{@indexed-scheme[https-port-number] --- the port number for the
|
||||
handin-status HTTPS server; the default is @scheme[#f] which
|
||||
indicates that no HTTPS server is started.}
|
||||
@item{@indexed-scheme[use-https] --- determines whether to start an
|
||||
embedded web server for handin status reports; the default is
|
||||
@scheme[#t].}
|
||||
|
||||
@item{@indexed-scheme[session-timeout] --- number of seconds before
|
||||
the session times-out. The client is given this many seconds for
|
||||
|
@ -470,9 +470,9 @@ the correct assignment in the handin dialog.
|
|||
|
||||
A student can download his/her own submissions through the handin
|
||||
dialog. This can also be done through a web server that runs
|
||||
concurrently with the handin server if you use the
|
||||
@scheme[https-port-number] option in the configuration file. The
|
||||
starting URL is
|
||||
concurrently with the handin server (on the same port) if you set the
|
||||
@scheme[use-https] option in the configuration file to @scheme[#t] (the
|
||||
default). The starting URL is
|
||||
|
||||
@commandline{https://SERVER:PORT/}
|
||||
|
||||
|
|
|
@ -254,16 +254,27 @@
|
|||
|
||||
(provide run)
|
||||
(define (run)
|
||||
(cond [(get-conf 'https-port-number)
|
||||
=> (lambda (p)
|
||||
(begin0 (parameterize ([error-print-context-length 0])
|
||||
(run-servlet
|
||||
dispatcher
|
||||
#:namespace '(handin-server/private/md5
|
||||
handin-server/private/logger
|
||||
handin-server/private/config
|
||||
handin-server/private/hooker
|
||||
handin-server/private/reloadable)
|
||||
#:log-file (get-conf 'web-log-file)))
|
||||
(log-line "*** embedded web server started")))]
|
||||
[else void]))
|
||||
(if (get-conf 'use-https)
|
||||
(begin0 (parameterize ([error-print-context-length 0])
|
||||
(run-servlet
|
||||
dispatcher
|
||||
#:namespace '(handin-server/private/md5
|
||||
handin-server/private/logger
|
||||
handin-server/private/config
|
||||
handin-server/private/hooker
|
||||
handin-server/private/reloadable)
|
||||
#:log-file (get-conf 'web-log-file)))
|
||||
(log-line "*** embedded web server started"))
|
||||
;; simple "server" so it's known that there is no server
|
||||
(lambda (msg . args)
|
||||
(when (eq? 'connect msg)
|
||||
(for-each (lambda (x) (display x (cadr args)))
|
||||
'(#"HTTP/1.0 200 OK\r\n"
|
||||
#"Content-Type: text/html\r\n"
|
||||
#"\r\n"
|
||||
#"<html><body><h1>"
|
||||
#"Please use the handin plugin"
|
||||
#"</h1></body></html>"))
|
||||
(close-input-port (car args))
|
||||
(close-output-port (cadr args))
|
||||
(semaphore-post (caddr args))))))
|
||||
|
|
Loading…
Reference in New Issue
Block a user