[bknr-cvs] hans changed deployed/quickhoney/projects/quickhoney/

BKNR Commits bknr at bknr.net
Mon Aug 16 10:46:23 UTC 2010


Revision: 4578
Author: hans
URL: http://bknr.net/trac/changeset/4578

save changes from old production system
U   deployed/quickhoney/projects/quickhoney/src/handlers.lisp
U   deployed/quickhoney/projects/quickhoney/src/init.lisp
U   deployed/quickhoney/projects/quickhoney/src/load.lisp
U   deployed/quickhoney/projects/quickhoney/src/quickhoney.asd
A   deployed/quickhoney/projects/quickhoney/src/run.sh
U   deployed/quickhoney/projects/quickhoney/website/static/index.css
U   deployed/quickhoney/projects/quickhoney/website/static/javascript.js
U   deployed/quickhoney/projects/quickhoney/website/templates/index.xml

Modified: deployed/quickhoney/projects/quickhoney/src/handlers.lisp
===================================================================
--- deployed/quickhoney/projects/quickhoney/src/handlers.lisp	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/src/handlers.lisp	2010-08-16 10:46:22 UTC (rev 4578)
@@ -334,13 +334,6 @@
                                                                 :spider-keywords spider-keywords))))
 		  (with-http-response ()
 		    (with-http-body ()
-                      (let ((tinyurl (drakma:http-request
-                                      (format nil "http://tinyurl.com/api-create.php?url=~A"
-                                              (hunchentoot:url-encode (format nil "http://quickhoney.com~A/~A"
-                                                                              (handler-path handler) image-name))))))
-                        (twitter:update-status (bknr-session-user)
-                                               (format nil "Uploaded new image ~A: ~A"
-                                                       image-name tinyurl)))
 		      (html (:html
 			     (:head
 			      (:title "Upload successful")
@@ -405,8 +398,6 @@
                              (apply #'make-store-image :image uploaded-image args)
                              (apply #'import-image (upload-pathname uploaded-file) args))))
               (declare (ignore item))   ; for now
-              (twitter:update-status (bknr-session-user)
-                                     (format nil "Posted news item: http://quickhoney.com/news/~A" name))
               (with-http-response ()
                 (with-http-body ()
                   (html (:html
@@ -596,6 +587,10 @@
 (defclass shutdown-handler (admin-only-handler page-handler)
   ())
 
+(defvar *acceptor* nil)
+
 (defmethod handle ((handler shutdown-handler))
-  (hunchentoot:stop-server hunchentoot:*server*)
+  (when *acceptor*
+    (hunchentoot:stop *acceptor*)
+    (setf *acceptor* nil))
   "Shutting down HTTP server")

Modified: deployed/quickhoney/projects/quickhoney/src/init.lisp
===================================================================
--- deployed/quickhoney/projects/quickhoney/src/init.lisp	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/src/init.lisp	2010-08-16 10:46:22 UTC (rev 4578)
@@ -36,8 +36,10 @@
     (format t "; loading site configuration file~%")
     (let ((*package* (find-package :quickhoney.config)))
       (load "site-config.lisp")))
-  (bt:make-thread (curry #'hunchentoot:start-server
-                         :port *webserver-port*
-                         :threaded nil
-                         :persistent-connections-p nil)
+  (setf *acceptor* (make-instance 'hunchentoot:acceptor
+                                  :port *webserver-port*
+                                  :taskmaster (make-instance 'hunchentoot:single-threaded-taskmaster)
+                                  :persistent-connections-p nil
+                                  :request-dispatcher 'bknr.web:bknr-dispatch))
+  (bt:make-thread (curry #'hunchentoot:start *acceptor*)
                   :name (format nil "HTTP server on port ~A" *webserver-port*)))

Modified: deployed/quickhoney/projects/quickhoney/src/load.lisp
===================================================================
--- deployed/quickhoney/projects/quickhoney/src/load.lisp	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/src/load.lisp	2010-08-16 10:46:22 UTC (rev 4578)
@@ -1,3 +1,20 @@
+;; -*- Lisp -*-
+
+(require 'asdf)
+
+(defun setup-registry (directory-path)
+  (format t "; adding components under ~A to asdf registry~%" directory-path)
+  (mapc (lambda (asd-pathname)
+	  (pushnew (make-pathname :name nil
+				  :type nil
+				  :version nil 
+				  :defaults asd-pathname)
+		   asdf:*central-registry*
+		   :test #'equal))
+	(directory (merge-pathnames #p"**/*.asd" directory-path))))
+
+(setup-registry #P"../../../")
+
 (push :cl-gd-gif *features*)
 
 (asdf:oos 'asdf:load-op :quickhoney)

Modified: deployed/quickhoney/projects/quickhoney/src/quickhoney.asd
===================================================================
--- deployed/quickhoney/projects/quickhoney/src/quickhoney.asd	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/src/quickhoney.asd	2010-08-16 10:46:22 UTC (rev 4578)
@@ -27,7 +27,7 @@
 	       :cl-gd
                :unit-test
                :yason
-               :cl-pdf)
+               #+(or) :cl-pdf)
 
   :components ((:file "packages")
 	       (:file "config" :depends-on ("packages"))
@@ -41,8 +41,8 @@
 	       (:file "webserver" :depends-on ("handlers"))
 	       (:file "daily" :depends-on ("config"))
 
-               (:file "turtle" :depends-on ("packages"))
-               (:file "pixel-pdf" :depends-on ("turtle"))
+               #+(or) (:file "turtle" :depends-on ("packages"))
+               #+(or) (:file "pixel-pdf" :depends-on ("turtle"))
 
                (:file "money" :depends-on ("packages"))
                (:file "shop" :depends-on ("money"))

Added: deployed/quickhoney/projects/quickhoney/src/run.sh
===================================================================
--- deployed/quickhoney/projects/quickhoney/src/run.sh	                        (rev 0)
+++ deployed/quickhoney/projects/quickhoney/src/run.sh	2010-08-16 10:46:22 UTC (rev 4578)
@@ -0,0 +1,8 @@
+#!/bin/sh
+
+while true
+do
+	sbcl --dynamic-space-size 800 --no-userinit --load load.lisp --eval '(quickhoney::startup)'
+	ps axw | mail -s 'quickhoney crashed' hans.huebner at gmail.com
+	sleep 10
+done


Property changes on: deployed/quickhoney/projects/quickhoney/src/run.sh
___________________________________________________________________
Added: svn:executable
   + *

Modified: deployed/quickhoney/projects/quickhoney/website/static/index.css
===================================================================
--- deployed/quickhoney/projects/quickhoney/website/static/index.css	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/website/static/index.css	2010-08-16 10:46:22 UTC (rev 4578)
@@ -120,20 +120,20 @@
 #menu.contact a#m_contact img.unselected { visibility: hidden }
 
 #m_home { top: 30px; left: 36px; }
+/*
 #m_pixel { top: 36px; left: 247px; }
 #m_vector { top: 36px; left: 317px; }
 #m_pen { top: 36px; left: 398px; }
 #m_news { top: 36px; left: 450px; }
 #m_shop { top: 36px; left: 523px; }
 #m_contact { top: 36px; left: 586px; }
+*/
 
-/*
 #m_pixel { top: 36px; left: 259px; }
 #m_vector { top: 36px; left: 340px; }
 #m_pen { top: 36px; left: 435px; } 
 #m_news { top: 36px; left: 500px; } 
 #m_contact { top: 36px; left: 586px; }
-*/
 
 #menu img.selected {
 	visibility: hidden;

Modified: deployed/quickhoney/projects/quickhoney/website/static/javascript.js
===================================================================
--- deployed/quickhoney/projects/quickhoney/website/static/javascript.js	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/website/static/javascript.js	2010-08-16 10:46:22 UTC (rev 4578)
@@ -653,8 +653,8 @@
 
     /* workaround for IE, which does not display the overlapping menu items expectedly */
     map(function (keyword) {
-        $('m_' + keyword).style.zIndex = (keyword == pagename) ? 101 : 100;
-    }, ['pixel', 'vector', 'pen', 'news', 'shop', 'contact']); /* , 'shop' disabled */
+            $('m_' + keyword).style.zIndex = (keyword == pagename) ? 101 : 100;
+        }, ['pixel', 'vector', 'pen', 'news', 'contact']); /* , 'shop' disabled */
 
     // Activate the menu by coloring the menu choices correctly
     $('menu').className = pagename;

Modified: deployed/quickhoney/projects/quickhoney/website/templates/index.xml
===================================================================
--- deployed/quickhoney/projects/quickhoney/website/templates/index.xml	2010-08-05 19:51:03 UTC (rev 4577)
+++ deployed/quickhoney/projects/quickhoney/website/templates/index.xml	2010-08-16 10:46:22 UTC (rev 4578)
@@ -40,10 +40,12 @@
         <img alt="" class="unselected" src="/image/news-unselected" />
         <img alt="" class="selected" src="/image/news-selected" />
       </a>
+      <!--
       <a onclick="show_directory_buttons('shop')" href="#shop" id="m_shop">
         <img alt="" class="unselected" src="/image/shop-unselected" />
         <img alt="" class="selected" src="/image/shop-selected" />
       </a>
+      -->
       <a href="#contact" id="m_contact">
         <img alt="" class="unselected" src="/image/contact-unselected" />
         <img alt="" class="selected" src="/image/contact-selected" />
@@ -184,9 +186,11 @@
             Keywords:<br />
             <input type="text" id="upload_keywords" name="spider-keywords" value="" size="60" /><br />
             <input type="checkbox" id="explicit" name="explicit" value="1" /> Explicit<br/>
+            <!-- shop disabled for now
             <input type="checkbox" name="buy-file" value="1"/> Sell as file<br/>
             <input type="checkbox" name="buy-print" value="1"/> Sell as print<br/>
             <input type="checkbox" name="buy-t-shirt" value="1"/> Sell as t-shirt<br/>
+            -->
           </p>
           <p class="cms">
             <input type="submit" name="upload" value="upload" />
@@ -253,9 +257,11 @@
             Keywords:<br />
             <input type="text" id="edit_keywords" name="spider-keywords" value="" size="60" /><br />
             <input type="checkbox" id="edit_explicit" name="explicit" value="1" /> Explicit<br/>
+            <!-- shop disabled for now
             <input type="checkbox" id="edit_buy-file" name="buy-file" value="1"/> Sell as file<br/>
             <input type="checkbox" id="edit_buy-print" name="buy-print" value="1"/> Sell as print<br/>
             <input type="checkbox" id="edit_buy-t-shirt" name="buy-t-shirt" value="1"/> Sell as t-shirt<br/>
+            -->
           </p>
           <p class="cms">
             <button type="submit" onclick="do_edit();">edit</button>





More information about the Bknr-cvs mailing list