1
0
Fork 0
Commit graph

77 commits

Author SHA1 Message Date
Ramakrishnan Muthukrishnan
1692732222 get username from the password file instead of using `cuserid'.
* tekuti/util.scm (expanduser): Use the user id to fetch the
  username from the /etc/passwd file, so that the username is
  not chopped at eight characters.
2010-11-18 11:15:48 +01:00
Ramakrishnan Muthukrishnan
b8b1f47d65 Change wordpress import to use the newer wordpress database layout.
* wordpress_to_dir.py (all_posts): select only published posts.
  (post_categories): get the post category based on the new set
  of tables wp_terms, wp_term_relationships and wp_term_taxonomy.
2010-11-15 22:05:15 +01:00
Andy Wingo
befda5cb02 big change to use new (web server) infrastructure
Change to use (web server) instead of our own loop. This also means that
requests are request objects from (web request), and responses are from
(web response).

* tekuti/boot.scm (boot): Run the main loop from (tekuti web).

* tekuti/config.scm (*port*, *backlog*, *public-url-base*)
  (*private-url-base*): Remove extraneous config vars.

* tekuti/mod-lisp.scm: Rewrite to be a (web server) server-impl. Not
  tested very well.

* tekuti/page-helpers.scm (respond): New procedure, now the primary way
  to respond to a request.
  (relurl, rellink): Take path components as a list, and encode the
  parts when making the resulting URL. All callers changed.

* tekuti/page.scm: Change all handlers to take an additional `body'
  argument, to respond using `respond', and to use the new `relurl' /
  `rellink' protocol.

* tekuti/request.scm: Eviscerate, leaving only pieces that deal in
  request objects from `(web request)'.

* tekuti/web.scm: Update to use (weeb server).
2010-11-13 19:26:47 +01:00
Andy Wingo
1152ccf68a (tekuti tags) uses (web uri)
* tekuti/tags.scm (tag-link): Use (web uri).
2010-11-13 19:09:35 +01:00
Andy Wingo
0d4fc4e501 templatize uses (web uri)
* tekuti/template.scm (templatize): Use define* and keyword args instead
  of taking a "request" object. Use (web uri) for URI work.
2010-11-13 19:08:59 +01:00
Andy Wingo
820b449cbc updates to (tekuti config)
* tekuti/config.scm (*private-url-base*, *public-url-base*): Change to
  "/", so that we can serve HTTP directly without having a fetch to
  e.g. "/foo.css" cause an error. A silly reason, I know.
  (*public-path-base*, *private-path-base*): New vars, containing lists
  of path components corresponding to their "url" variants above. We are
  switching to this, as future commits will show.
  (*server-impl*, *server-impl-args*): New vars, will be used by the new
  (web server) main loop.
2010-11-13 19:02:47 +01:00
Andy Wingo
5d85d1b7fe remove with-backtrace definition; add date->timestamp
* tekuti/util.scm: Remove with-backtrace definition. Add date->timestamp
  definition.
2010-11-13 18:58:36 +01:00
Andy Wingo
a8c28da20b remove a couple uses of with-backtrace
* tekuti/index.scm (reindex): Don't use with-backtrace, that's not how I
  want to roll, debugging-wise.

* tekuti/post.scm (post-sxml-content): Same
2010-11-13 18:55:25 +01:00
Andy Wingo
31a2d6ebbc fix various (tekuti git) errors
* tekuti/git.scm (git-update-ref, patch-blob, munge-tree1-recursive):
  Fix various errors caught by the compiler.
2010-11-13 18:48:18 +01:00
Andy Wingo
f34e3b1c78 src/tekuti uses -s, not -l
* src/tekuti: Change to use an implicit `-s', so a control-c causes an
  exit rather than dropping us into a repl.
2010-11-13 18:48:18 +01:00
Andy Wingo
da85967b42 use compile warnings
* Makefile.am (GUILE_WARNINGS): Use compile warnings when compiling
  tekuti.
2010-11-13 18:48:18 +01:00
Andy Wingo
5b81c576a5 fix a number of syncase porting bugs
* tekuti/git.scm (with-output-to-blob, with-input-from-blob): Use
  hygienic macros.

* tekuti/match-bind.scm (match-bind): Add a check that the pattern is a
  literal string.

* tekuti/util.scm (match-lines): Fix port from defmacro.
2010-11-13 18:48:18 +01:00
Andy Wingo
4f62c95bde autotoolize, and compile the scheme files
* .gitignore:
* AUTHORS:
* COPYING:
* ChangeLog:
* Makefile.am:
* NEWS:
* README:
* acinclude.m4:
* configure.ac:
* env.in: All the needed bits.
2010-11-13 18:48:18 +01:00
Andy Wingo
10095abd48 move up let-request definition
* tekuti/request.scm (let-request): Move definition up.
2010-11-13 18:48:18 +01:00
Andy Wingo
29f45c45bb (tekuti util) fixen
* tekuti/util.scm (unwind-protect): Move definition up.
  (with-backtrace*): Update to backtrace in the throw handler.
2010-11-13 18:47:03 +01:00
Andy Wingo
69f7a83449 change uses of define/kwargs to define*
* tekuti/git.scm (git*):
* tekuti/request.scm (rref):
* tekuti/util.scm (date-increment): Use define* instead of
  define/kwargs. Remove (scheme kwargs) import.

* tekuti/page-helpers.scm (tekuti):
* tekuti/page.scm (tekuti): Remove needless (scheme kwargs) imports.
2010-11-13 18:47:03 +01:00
Andy Wingo
974bdce47d update to use (tekuti match-bind)
* tekuti/comment.scm:
* tekuti/filters.scm:
* tekuti/git.scm:
* tekuti/post.scm:
* tekuti/request.scm:
* tekuti/util.scm: Update to use (tekuti match-bind).
2010-11-13 18:47:03 +01:00
Andy Wingo
35873a522a import match-bind from guile-lib
* tekuti/match-bind.scm: Import from guile-lib.
2010-11-13 18:47:03 +01:00
Andy Wingo
1a0ff53dfc use a properly exported interface to define parsed entities
* tekuti/config.scm: Use the new define-parsed-entity! to define the
  character entities.
2010-11-13 18:47:03 +01:00
Andy Wingo
73bd5c3a3e call setlocale
* tekuti/boot.scm (boot): Call (setlocale LC_ALL) to pull in locale
  settings from the environment.
2010-11-13 18:47:03 +01:00
Andy Wingo
b9b78f3b8a updates to (tekuti boot)
* tekuti/boot.scm (*option-grammar*): Remove repl and gds args, replaced
  by `listen'.
  (parse-options): `listen' causes tekuti to spawn a repl server.
  (boot): No more repl option; we always sit down into the event-loop.
2010-11-13 18:47:03 +01:00
Andy Wingo
d3cf39b5c0 base64 efficiency hacks
* tekuti/base64.scm (bytevector-map-n-to-m): Use multiple values.
  (base64-encode): Inline the map-3-to-4 definition, and use multiple
  values.
  (base64-decode): Likewise, with map-4-to-3.
2010-11-13 18:47:03 +01:00
Andy Wingo
1b9e370805 port (tekuti base64) to use (rnrs bytevectors)
* tekuti/base64.scm: Port to (rnrs bytevectors). All the real work was
  done by Andreas Rottmann.

* tekuti/request.scm (request-authenticated?): Run the decoded user name
  and password bytevector through utf8->string.
2010-11-13 18:47:03 +01:00
Andreas Rottmann
97a49f0801 Revert last, misguided commit
This reverts commit 8a8e0fadae.
2010-11-06 22:55:14 +01:00
Andreas Rottmann
8a8e0fadae post: make post-comments' and post-n-comments' work with current git
Apparently, at least git 1.7.2.3 ls-files does not understand the
SHA1:filename syntax anymore.
2010-11-05 22:27:15 +01:00
Andreas Rottmann
146a68731f Remove two unnecessary instances of quasisyntax 2010-11-04 22:02:22 +01:00
Andreas Rottmann
2649cadc43 Replace several define-macro' uses with syntax-rules' and `syntax-case' 2010-10-13 22:22:38 +02:00
Andreas Rottmann
1c0d0f2a85 Don't crash generating the atom feed when there are no posts yet 2009-07-03 18:08:47 +02:00
Andreas Rottmann
eac799afc3 Convert the mod-lisp headers to lowercase
HTTP headers are expected to be treated case-insensitively.
2009-07-02 19:47:30 +02:00
Andy Wingo
d52865f037 dewingoize
* tekuti/boot.scm (boot): Add config option, a file evaluated inside
  (tekuti config).

* tekuti/config.scm: Add *css-file*, *navbar-links*, *navbar-infix*.
  Change default admin pass.

* tekuti/template.scm (templatize): Make the default template less
  wingo-specific.
2008-04-23 14:02:07 +02:00
Andy Wingo
3a7ddef467 fix starting from scratch
* tekuti/git.scm (ensure-git-repo): Actually create a master ref. Fixes
  startup when ~/blog.git doesn't exist.
2008-04-22 11:29:18 +02:00
Andy Wingo
29bc9314dd fix search with no results on deployed tekuti
* tekuti/page-helpers.scm: Be patient with git errors. Dunno why they
  happen, though.
2008-04-13 00:05:51 +02:00
Andy Wingo
8e19b46ec8 whoops, fix search
* tekuti/page.scm (page-search): 
* tekuti/web.scm (choose-handler): fix search
2008-04-12 22:10:52 +02:00
Andy Wingo
88c136e775 add search capabilities
* tekuti/page-helpers.scm (main-sidebar): Add search box.
  (find-posts-matching): New function, does a search using git-grep.

* tekuti/page.scm (page-search): New page for showing search results.

* tekuti/util.scm (match-lines): Capture the match-bind binding.

* tekuti/web.scm (choose-handler): Add the search page.
2008-04-12 19:15:55 +02:00
Andy Wingo
cbfce24dc1 add related-tags clouds to tag/foo pages
* tekuti/page-helpers.scm (related-tag-cloud): New function, shows a
  tag-relative tag cloud.

* tekuti/page.scm (page-show-tag): Add a cloud of related tags.

* tekuti/tags.scm (compute-related-tags): New proc to show related tags.
2008-04-12 18:33:34 +02:00
Andy Wingo
2f7780b552 better error messages for invalid xhtml
* tekuti/filters.scm (bad-user-submitted-xhtml?): Add a more informative
  error message.
2008-04-11 13:24:57 +02:00
Andy Wingo
e1e44eb8f0 add main tag cloud page
* tekuti/page-helpers.scm: Export top-tags.

* tekuti/page.scm (page-show-tags): Implement the main tag cloud page.
  Yay!
2008-04-11 13:15:19 +02:00
Andy Wingo
df96b1f07e add "related posts" foo
* tekuti/page-helpers.scm (post-sidebar): New function, pops up a sidebar
  for related posts.

* tekuti/page.scm (page-show-post): Show the post sidebar.

* tekuti/tags.scm (compute-related-posts): New function, computes the set
  of related posts based on the number of tags which they share in
  common.
2008-04-11 12:59:47 +02:00
Andy Wingo
062e0f109a tweak tag cloud code
* tekuti/page-helpers.scm (top-tags, tag-cloud, main-sidebar): Make the
  tag cloud code a bit more modular. Up the number of tags shown to 30.

* tekuti/util.scm: Allow # in the path part of a URL. Yick.
2008-04-11 12:05:24 +02:00
Andy Wingo
11eed1fbc8 spam spam spam
* tekuti/comment.scm (bad-number?, *new-comment-spec*):
* tekuti/page-helpers.scm (comment-form): Lame spam obfuscation.

* tekuti/util.scm (emailish?): Allow _ in the before-@ part of the url.
  (urlish?): Don't require a slash after the host.
2008-03-11 23:58:12 +01:00
Andy Wingo
4ebd686868 don't say I'm not lenient
* tekuti/post.scm (post-sxml-content): Don't throw an exception if a post
  fails to format.
2008-03-11 23:43:20 +01:00
Andy Wingo
f1ef3f80cf fix comment openage
* tekuti/page-helpers.scm (post-editing-form): 
* tekuti/post.scm (munge-post, parse-post-data): Add foo to allow
  comments to be opened or closed. Fix date setting.
2008-03-09 23:07:34 +01:00
Andy Wingo
c0f32d5484 comment deletion, post editing.
* tekuti/comment.scm (make-new-comment): Refactor to decouple comment.scm
  from post.scm.

* tekuti/git.scm (run): Generalize so it can run any executable.
  (git-ls-tree, git-ls-subdirs): Check for a #f treeish, return directly
  in that case, avoiding tracebacks in the forked kid.
  (git-mktree): Return #f if the tree is empty.
  (git-rev-list): New command, something like git log.
  (patch-blob): New function; unused, though. Perhaps I should just
  delete it.
  (git-commit-reverse-operations): New function, constructs munge-tree
  operations to revert a commit.
  (git-revert): New operator, reverts a commit. Can't use git's revert
  because it requires a working tree.
  (munge-tree): Rewrite to unify the various commands, and process the
  commands in order. Makes a bit more garbage, but is much more
  understandable.

* tekuti/page-helpers.scm (post-editing-form): Add a preview.
  (admin-post-url): New helper.
  (redirect): New helper.
  (admin-post-redirect): New helper.

* tekuti/page.scm (page-admin): Show recent changes in the sidebar.
  (page-admin-new-post): Redirect to the new post.
  (page-new-comment): Rework for make-new-comment changes, and redirect
  to the post. Would be nice to redirect to the comment though.
  (page-admin-changes): New page, lists recent changes.
  (page-admin-change): New page, shows a change, allowing it to be
  undone.
  (page-admin-revert-change): New page, actually reverts a change. Thus
  we have comment deletion.

* tekuti/post.scm (munge-post): New helper, factored out of
  make-new-post.
  (parse-post-data): Another new helper. Needs to do more validation,
  though.
  (modify-post): Post editing, yay!

* tekuti/request.scm (parse-www-form-urlencoded): Factored out of
  request-form-data.
  (*request-initializers*): Initialize 'query to have the parsed query
  string data.

* tekuti/url.scm (url:path-part, url:query-part): New somewhat hacky
  functions. url.scm needs some love.
  (url:path-split): Split on only the "path part" of the URL.

* tekuti/util.scm (foldn): New export. Probably a bad idea.
  (match-case): New macro, not used though.
  (string-split/trimming): New util.

* tekuti/web.scm (choose-handler): Update the set of pages.
2008-03-07 13:09:47 +01:00
Andy Wingo
579a5d7ae4 various fixes, new post support
* tekuti/comment.scm (make-new-comment): Better commit log for comments.

* tekuti/git.scm (munge-tree): Fix when creating multiple files in a new
  directory.

* tekuti/page-helpers.scm (with-authentication): Resurrect, this got lost
  somehow, in that past time place.
  (post-editing-form): Frobate a bit.
  (admin-post-link): Fix.

* tekuti/page.scm (page-admin): Frobate.
  (page-admin-post): Fix for recent change in post-from-key.
  (page-admin-new-post): Sortof works, needs some fixage.

* tekuti/post.scm (make-new-post): Implement, yay

* tekuti/util.scm (timestamp->date): New function

* tekuti/web.scm (*status-names*): add 303
2008-03-04 23:15:38 +01:00
Andy Wingo
ea420f3680 only index tags of published posts
* tekuti/tags.scm (reindex-tags): Only index published posts.
2008-03-02 17:14:20 +01:00
Andy Wingo
1ec5fb27eb implement tags/foo
* tekuti/page.scm (page-show-tag): Implement, in a basic way.
2008-03-02 16:49:11 +01:00
Andy Wingo
c08973ca92 intern some character entities
* tekuti/config.scm: Define some character entities to intern here. Not
  ideal by any means, but it works for me.
2008-03-02 15:21:50 +01:00
Andy Wingo
e9849a19cc fix up the atom feed
* tekuti/page-helpers.scm (atom-header): Set the xml:base to the root
  url.
  (atom-entry): Actually include a link to the post.
2008-03-02 00:09:22 +01:00
Andy Wingo
c2446d0f7f more cleanups 2008-02-29 13:38:07 +01:00
Andy Wingo
a9141efbe6 add missing files 2008-02-29 00:37:38 +01:00