1
0
Fork 0
Commit graph

192 commits

Author SHA1 Message Date
Andy Wingo
fc386dcb71 fix caching
* tekuti/cache.scm: Update with more structure. Use take-max, not
  list-head. Only cache cacheable request-response pairs.

* tekuti/index.scm: Add cache as index entry. Also return the index ref
  within the index itself, instead of at the head.

* tekuti/web.scm: Don't pass cache around, it's part of the index
  now. Adapt to new API.
2010-12-05 20:23:01 +01:00
Andy Wingo
aa86b62d79 simpler caching algorithm
* tekuti/cache.scm: Simpler LRU algorithm for the cache. Conses more,
  but throws away the cache less.
2010-12-04 20:08:16 +01:00
Andy Wingo
bc53abe0b6 mod-lisp sets client sockets to iso-8859-1
* tekuti/mod-lisp.scm (read-request/mod-lisp): Set port's encoding to
  latin-1, so that we reading one char reads one byte.
2010-12-04 13:15:47 +01:00
Andy Wingo
83a569885a use the simple cache
* tekuti/web.scm: Use the cache.
2010-12-03 19:59:45 +01:00
Andy Wingo
c099b9532c add a simple cache
* tekuti/cache.scm: Add a simple cache.
2010-12-03 19:59:32 +01:00
Andy Wingo
55617ccff2 tekuti git uses get-bytevector-all
* tekuti/git.scm (run): Use get-bytevector-all instead of
  read-delimited.
2010-12-03 19:59:15 +01:00
Andy Wingo
5900823c3e update mod-lisp web server impl
* tekuti/mod-lisp.scm: Update to use the poll set, do the right thing
  for SIGPIPE, etc, following http.scm. Maybe now it will actually be
  reliable.
2010-12-03 17:00:10 +01:00
Andy Wingo
a8ad41b06d src/tekuti is a shell script
* src/tekuti: Change to be a shell script.
2010-11-24 21:37:27 +01:00
Andy Wingo
507db16d48 fix locale setting
* src/tekuti: Use sh, not bash.

* tekuti/boot.scm (boot): Doh, actually set the locale.
2010-11-23 23:15:54 +01:00
Andy Wingo
16434bdf1d fix command-line parsing bugs
* src/tekuti: Fix bug processing command-line args.
2010-11-23 23:00:39 +01:00
Andy Wingo
6df26e1c72 fix mod-lisp bugs
* tekuti/mod-lisp.scm (url, read-request/mod-lisp)a
  (write-headers/mod-lisp, write-response/mod-lisp): Fix a number of
  mod-lisp bugs.
2010-11-23 21:48:43 +01:00
Andy Wingo
c2d3231e24 fix post content-type check
* tekuti/request.scm (request-form-data): Fix content-type check.
2010-11-22 23:50:48 +01:00
Andy Wingo
473bd070ae don't display doctype if unnecessary
* tekuti/page-helpers.scm (respond): Don't display a doctype if we
  aren't given one.
2010-11-22 23:42:10 +01:00
Andy Wingo
dda89fe5bf config refactor so that tekuti knows its public address
* tekuti/config.scm (*public-host*, *public-port*)
  (*private-host*, *private-port*): Use these instead of *host* and the
  recently removed *port*. A web app needs to know its public address,
  and the private ports are part of its config.
  (*server-impl-args*): Redefine as a thunk to delay the dereferencing
  of config parameters like *private-host*.

* tekuti/page-helpers.scm (ensure-public-uri): New helper, uses the new
  conf vars to ensure that a value is a URI.
  (build-headers): New helper, like the old acons* without consing a
  rest list.
  (respond): Use the two new helpers.
  (atom-header, atom-entry): No need for server-name arg, as we know how
  to make a public URI.

* tekuti/page.scm (page-feed-atom): Adapt to no need to guess at the
  server-name.

* tekuti/web.scm (main-loop): Allow *server-impl-args* to be a thunk.
2010-11-22 23:33:08 +01:00
Andy Wingo
3ece90674a expanduser tweaks
* tekuti/util.scm (expanduser): Use passwd:name accessor, and geteuid as
  cuserid did.
2010-11-18 11:16:50 +01:00
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