Switch to SSL.
This commit is contained in:
parent
0893583334
commit
d3e0a061d9
2
.gitignore
vendored
2
.gitignore
vendored
|
@ -6,3 +6,5 @@ run-prelude
|
|||
*~
|
||||
compiled/
|
||||
*.[0-9]*
|
||||
server-cert.pem
|
||||
private-key.pem
|
||||
|
|
17
Makefile
17
Makefile
|
@ -19,3 +19,20 @@ clean:
|
|||
find . -depth -type d -iname compiled -exec rm -rf {} \;
|
||||
|
||||
.PHONY: run bounce
|
||||
|
||||
###########################################################################
|
||||
|
||||
keys: private-key.pem server-cert.pem
|
||||
|
||||
private-key.pem:
|
||||
openssl genrsa -des3 -passout pass:a -out $@ 1024
|
||||
openssl rsa -passin pass:a -in $@ -out $@
|
||||
|
||||
server-cert.pem: private-key.pem
|
||||
openssl req -new -x509 -nodes -sha1 -days 365 \
|
||||
-subj /CN=beta.package.database.site \
|
||||
-passin pass:a \
|
||||
-key private-key.pem > $@
|
||||
|
||||
clean-keys:
|
||||
rm -f private-key.pem server-cert.pem
|
||||
|
|
|
@ -5,7 +5,8 @@
|
|||
(require web-server/servlet-env)
|
||||
(require "signals.rkt")
|
||||
|
||||
(define (start-service #:port [port 8000]
|
||||
(define (start-service #:port [port 8443]
|
||||
#:ssl? [ssl? #t]
|
||||
request-handler-function)
|
||||
(start-restart-signal-watcher)
|
||||
(serve/servlet request-handler-function
|
||||
|
@ -15,4 +16,7 @@
|
|||
#:port port
|
||||
#:extra-files-paths (list (build-path (current-directory)
|
||||
"../static"))
|
||||
#:ssl? ssl?
|
||||
#:ssl-cert (and ssl? (build-path (current-directory) "../server-cert.pem"))
|
||||
#:ssl-key (and ssl? (build-path (current-directory) "../private-key.pem"))
|
||||
#:servlet-regexp #rx""))
|
||||
|
|
|
@ -21,7 +21,7 @@
|
|||
(bootstrap-project-name
|
||||
`(a ((class "four columns logo")
|
||||
(href "http://www.racket-lang.org/"))
|
||||
(img ((src "http://pkgs.racket-lang.org/logo-and-text.png")
|
||||
(img ((src "/logo-and-text.png")
|
||||
(height "50")
|
||||
(alt "Racket Package Index")))))
|
||||
|
||||
|
@ -96,8 +96,7 @@
|
|||
(bootstrap-cookies
|
||||
(if session
|
||||
(list (make-cookie COOKIE session-key
|
||||
;; TODO #:secure? #t
|
||||
))
|
||||
#:secure? #t))
|
||||
(list (make-cookie COOKIE ""
|
||||
#:expires "Thu, 01 Jan 1970 00:00:00 GMT")))))
|
||||
(body))))))
|
||||
|
|
BIN
static/logo-and-text.png
Normal file
BIN
static/logo-and-text.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 18 KiB |
|
@ -1,6 +1,6 @@
|
|||
@charset "UTF-8";
|
||||
@import url(http://fonts.googleapis.com/css?family=Open+Sans:500,400,300,600,700);
|
||||
@import url(http://fonts.googleapis.com/css?family=Inconsolata);
|
||||
@import url(https://fonts.googleapis.com/css?family=Open+Sans:500,400,300,600,700);
|
||||
@import url(https://fonts.googleapis.com/css?family=Inconsolata);
|
||||
|
||||
body {
|
||||
padding-top: 50px;
|
||||
|
|
Loading…
Reference in New Issue
Block a user