Permalink
Browse files

Removed bknr.datastore and used file storage for persistence instead.

  • Loading branch information...
vsedach committed Apr 15, 2012
1 parent 1e3b63f commit 15565355f700d69b7eb71558ea47c1b6ae730c80
View
4 TODO
@@ -1 +1,3 @@
-* make sure email works
+* test account password recovery
+* lisp captchas for creating accounts and anonymous edits
+* reorder divs to make site more accessible to screen readers
View
@@ -1,5 +1,6 @@
(asdf:defsystem :cliki-convert
- :components ((:module "cliki-convert"
- :components ((:file "package")
- (:file "cliki-convert" :depends-on ("package")))))
- :depends-on (#:cliki2 #:cl-fad #:external-program #:local-time))
+ :components
+ ((:module "cliki-convert"
+ :components ((:file "package")
+ (:file "cliki-convert" :depends-on ("package")))))
+ :depends-on (#:cliki2 #:iterate #:cl-fad #:external-program #:local-time))
@@ -4,7 +4,7 @@
(in-package #:cliki2.converter)
-(defun convert-article-revision (content)
+(defun convert-content (content)
(flet ((fixup-tag (regex str fixup)
(ppcre:regex-replace-all regex str
(lambda (match register)
@@ -58,7 +58,7 @@
(search "*(delete this page)" content :test #'char-equal)))
(defun make-revision (article revision-path authorship summary all-revisions)
- (let ((content (convert-article-revision
+ (let ((content (convert-content
(alexandria:read-file-into-string
revision-path :external-format :latin1))))
(or (when (delete-article? revision-path content all-revisions)
@@ -95,16 +95,6 @@
hunchentoot::+latin-1+)))
(defun load-old-articles (old-article-dir)
- "WARNING: This WILL blow away your old store."
- (close-store)
-
- (iter (for item in '("articles/" "store/"))
- (for path = (merge-pathnames item cliki2::*datadir*))
- (cl-fad:delete-directory-and-files path :if-does-not-exist :ignore)
- (ensure-directories-exist path))
-
- (open-store (merge-pathnames "store/" cliki2::*datadir*))
-
(let ((old-articles (make-hash-table :test 'equalp)) ;; case insensitive
(all-edits (load-edits old-article-dir)))
(dolist (file (remove-if #'cl-fad:directory-pathname-p
@@ -133,9 +123,6 @@
(match-edits-to-files article-title
(edits-for-article article-title all-edits)
revision-paths)
- revision-paths))))
-
- (cliki2::init-recent-revisions)
- (snapshot))
+ revision-paths)))))
;; (cliki2.converter::load-old-articles #P"/home/viper/tmp/cliki-virgin/")
@@ -1,4 +1,4 @@
(in-package #:cl)
(defpackage #:cliki2.converter
- (:use #:cl #:iter #:bknr.datastore))
+ (:use #:cl #:iter))
View
@@ -5,10 +5,8 @@
:license "AGPLv3"
:version "2.0"
:depends-on (#:alexandria
- #:iterate
#:hunchentoot
#:bordeaux-threads
- #:bknr.datastore
#:ironclad
#:colorize
#:sanitize
@@ -18,8 +16,11 @@
#:flexi-streams
#:cl-ppcre
#:cl-smtp
+ #:cl-fad
#:anaphora
- #:stem)
+ #:stem
+ #:osicat ;; only used to exit
+ )
:components
((:module "src"
:serial t
@@ -29,14 +30,14 @@
(:file "acceptor")
(:file "http-resource")
(:file "html-rendering")
+ (:file "wiki")
(:file "authentication")
(:file "accounts")
(:file "article")
(:file "markup")
(:file "diff")
- (:file "search")
+ (:file "indexes")
(:file "recent-changes")
- (:file "deleted-articles")
(:file "history")
(:file "tools")
(:file "dispatcher")
View
@@ -1,16 +1,17 @@
(in-package #:cliki2)
+(defvar *wiki*)
+
(defclass cliki2-acceptor (easy-acceptor)
- ((dispatch-table :reader dispatch-table :initarg :dispatch-table)
- ;; config slots
- (wiki-home :reader wiki-home :initarg :wiki-home)
- (wiki-name :reader wiki-name :initarg :wiki-name)
- (wiki-description :reader wiki-description :initarg :wiki-description)
- (reminder-email :reader password-reminder-email-address
- :initarg :password-reminder-email-address)))
+ ((dispatch-table :reader dispatch-table :initarg :dispatch-table)
+ (wikis :reader wikis :initarg :wikis)))
(defmethod acceptor-dispatch-request ((acceptor cliki2-acceptor) request)
- (loop for dispatcher in (dispatch-table acceptor)
- for action = (funcall dispatcher request)
- when action return (funcall action)
- finally (call-next-method)))
+ (let* ((host (subseq (host) 0 (or (position #\: (host)) (length (host)))))
+ (*wiki* (cadr (assoc host (wikis acceptor) :test #'string=))))
+ (if *wiki*
+ (loop for dispatcher in (dispatch-table acceptor)
+ for action = (funcall dispatcher request)
+ when action return (funcall action)
+ finally (call-next-method))
+ (call-next-method))))
Oops, something went wrong.

0 comments on commit 1556535

Please sign in to comment.