Commit Graph

2604 Commits (8ce1bea634a3e8cef7c12b76377ae5cdbb6eb4ea)

Author SHA1 Message Date
Joey Hess b6f7906da6 fix child process error propigation
$? holds the full exit status
2010-07-08 14:14:59 -04:00
Joey Hess d4c11466ba fork a child to run dumpsetup 2010-07-08 13:55:30 -04:00
Joey Hess c23cb312b4 revert bugfix
Not needed; lastupdate will be 0 for new feeds.
2010-07-06 16:02:41 -04:00
Joey Hess 45a5e8e972 bugfix 2010-07-06 15:59:08 -04:00
Joey Hess 2dd0c177a6 aggregate: Write timestamp next aggregation can happen to .ikiwiki/aggregatetime, to allow for more sophisticated cron jobs. 2010-07-06 13:57:17 -04:00
Joey Hess 7e3fb8b8a2 comments: Added commentmoderation directive for easy linking to the comment moderation queue. 2010-07-05 20:19:31 -04:00
Joey Hess f6db10df21 img: Add a margin around images displayed by this directive.
Particularly important for floating images, which could before be placed
uncomfortably close to text.
2010-07-05 14:04:49 -04:00
Joey Hess 7fdf1f1d00 move nickname sanitization out
Probably best to store it unsanitized and sanitize as needed on use.
And it already was for comments, leaving only the need to sanitize the
nickname when git committing, to ensure the email address is legal.
2010-07-04 16:44:38 -04:00
Joey Hess e72ef3b070 comment: Fix problem moderating comments of certian pages with utf-8 in their name. 2010-07-04 16:19:22 -04:00
Joey Hess acde957512 further sanitize nickname characters 2010-07-04 16:12:50 -04:00
intrigeri cd03bd0b80 po: added support for html pagetype
... after having audited the po4a Xml and Xhtml modules for security issues.

Signed-off-by: intrigeri <intrigeri@boum.org>
(cherry picked from commit a128c256a5)
2010-07-04 15:27:02 -04:00
intrigeri a6e629e5cf po: s/utf-8/UTF-8, to solve part of the double commit bug.
(cherry picked from commit 4f44534d72)
2010-07-04 15:25:07 -04:00
Joey Hess 8a8914151c review of needstranslation() pagespec
Minor wording fix; changelog; etc.
2010-07-04 14:22:19 -04:00
intrigeri be49679fe9 po: added a needstranslation() pagespec
(cherry picked from commit b225fdc44d)
2010-07-04 14:20:12 -04:00
Joey Hess 0eabe6f794 git: Added git_wrapper_background_command option. Can be used to eg, make the git wrapper push to github in the background after ikiwiki runs. 2010-07-01 16:57:20 -04:00
Joey Hess bb5193fde1 hnb: Fixed broken use of mkstemp that had caused dangling temp files, and prevented actually rendering hnb files. 2010-06-27 13:49:51 -04:00
Joey Hess d8d057c356 chdir to srcdir in rcs_getctime 2010-06-23 21:29:47 -04:00
Joey Hess 38bf2f6388 bugfix 2010-06-23 20:26:09 -04:00
Joey Hess 9a32451986 finializing openid nickname support
Renamed usershort => nickname.

Note that this means existing user login sessions will not have the nickname
recorded, and so it won't be used for those.
2010-06-23 20:16:01 -04:00
Joey Hess a4f381ace8 git: Record the username from openid in the git author email. (This avoids display of ugly google openids.) 2010-06-23 19:44:41 -04:00
Joey Hess b38b9327a8 take username from email address as fallback 2010-06-23 19:36:23 -04:00
Joey Hess d8e4b51a41 rcs_getctime and rcs_getmtime take relative filenames
There was some confusion about whether the filename was
relative to srcdir or not. Some test cases, and the bzr
plugin assumed it was relative to the srcdir. Most everything else
assumed it was absolute.

Changed it to relative, for consistency with the rest
of the rcs_ functions.
2010-06-23 19:32:53 -04:00
Joey Hess ecdfd1b864 rcs_commit and rcs_commit_staged api changes
Using named parameters for these is overdue. Passing the session in a
parameter instead of passing username and IP separately will later allow
storing other session info, like username or part of the email.

Note that these functions are not part of the exported API,
and the prototype change will catch (most) skew, so I am not changing
API versions. Any third-party plugins that call them will need updated
though.
2010-06-23 19:04:36 -04:00
Joey Hess caf7bcdda3 update for new rcs_commit_staged API
In the process, lost the commits from special usernames
when committing changed po files. Instead of trying to dummy up a session
object for the special username, I just don't pass one, and the commit will
appear to be from whatever user ikiwiki runs as.
2010-06-23 16:56:50 -04:00
Joey Hess 4292802ee5 stop using REMOTE_ADDR
Everywhere that REMOTE_ADDR was used, a session object is available, so
instead use its remote_addr method.

In IkiWiki::Receive, stop setting a dummy REMOTE_ADDR.

Note that it's possible for a session cookie to be obtained using one IP
address, and then used from another IP. In this case, the first IP will now
be used. I think that should be ok.
2010-06-23 16:35:51 -04:00
Joey Hess b4a43406f6 API: rcs_commit and rcs_commit_staged are passed a new parameter
that may contain the username component of the email address of
the user making the commit.
2010-06-23 16:05:49 -04:00
Joey Hess c46bcb425a Add new optional field usershort to rcs_recentchanges.
Now the git plugin supports commits with author fields that look like:
Author: http://my.openid/ <me@web>

Then in recentchanges, the short username will be displayed, linking
to the openid.

Particularly useful for the horrible google openids, of course.
2010-06-23 15:54:52 -04:00
Joey Hess 0580cbbf40 whitespace 2010-06-23 15:23:13 -04:00
Joey Hess 82789e39aa bugfix: record email-like links as page links
This way, an email-like link will be a mailto until a matching page
is created, then it will link to the page. And removing the page will
convert it back to a mailto.
2010-06-23 14:05:57 -04:00
Joey Hess 6e67219eff simplify anchor handling
At least two bugfixes in here. First, an old bug;
\[[foo#0]] was displayed as [[foo]], losing the anchor
as the anchor text was false. Secondly, a new bug;
an email like foo#bar@baz should not check bestlink("foo@baz").
2010-06-23 13:57:27 -04:00
Joey Hess 19dcd50c84 avoid needing full email regexp
Fully validating the email address is not necessary,
all that matters is not matching an url like http://foo@bar/
as an email address.
2010-06-23 13:40:10 -04:00
Bernd Zeimetz dd3274ce73 Enhance the link plugin to handle external links.
The following ways to create a link are supported now:
[[url]]
[[text|url]]
url can be one of the following:
- an internal wikilink: will be handled as before
- any other kind of URL, including mailto: proper links will be created:
  <a href="url">url</a>
  <a href="url">text</a>
- an email address:
  <a href="mailto:url">url</a>
  <a href="mailto:url">text</a>
2010-06-19 03:14:16 +02:00
Joey Hess 57e56828f5 store state to avoid needing to rebuild when changing theme 2010-06-18 16:40:47 -04:00
Joey Hess cfcc79ed4c needsbuild hook is passed an array ref 2010-06-18 16:15:57 -04:00
Joey Hess d5199424c5 avoid shelling 2010-06-18 12:50:31 -04:00
Joey Hess 2797a659db mercurial: Fix buggy getctime code.
The file passed to rcs_getctime is already absolute, and it was
trying to stick the srcdir on the front.

Also, eliminated potentially unsafe shelling.
2010-06-18 12:48:05 -04:00
Joey Hess cb4b999297 avoid dying if cannot chdir to an underlaydir 2010-06-17 16:54:03 -04:00
Joey Hess 184f68efa8 Merge branch 'themes' 2010-06-16 19:17:18 -04:00
Joey Hess eff5e233a2 force list context
run_or_die returns a status code in scalar context
2010-06-16 16:07:41 -04:00
Joey Hess 2f3f826b5b force rebuild for theme change
For now, a rebuild is the only way to ensure the changed theme is used.
Ikiwiki normally will not realize style.css has changed, since themes
tend to have the same timestamp for the file.
2010-06-16 15:44:21 -04:00
Joey Hess 062ed44f47 add theme plugin 2010-06-16 15:43:42 -04:00
Joey Hess a748f283ac Encode not used 2010-06-16 15:30:33 -04:00
Joey Hess 69c22fa1ea attachment: Support Windows paths when taking basename of client-supplied file name. 2010-06-16 13:23:32 -04:00
Joey Hess da2be6e85c git: Gix --gettime to properly support utf8 filenames.
In passing, fixed a bug where the srcdir was in a subdir of a repository
named "0".
2010-06-15 23:21:55 -04:00
Joey Hess 5f33532468 Make --gettime be honored after initial setup.
Bugfix in passing: New files not treated as such when no rcs is used.
2010-06-15 22:56:06 -04:00
Joey Hess a298959888 fix other cases of unicode mixing issue
and fix underlaydir override attack guard when srcdir is non-absolute
2010-06-15 17:41:26 -04:00
Joey Hess 86a43aefb4 Fix issues with combining unicode srcdirs and source files.
A short story:

  Once there was a unicode string, let's call him Srcdir.

  Along came a crufy old File::Find, who went through a tree and pasted each
  of the leaves in turn onto Srcdir. But this 90's relic didn't decode the
  leaves -- despite some of them using unicode! Poor Srcdir, with these
  leaves stuck on him, tainted them with his nice unicode-ness. They didn't
  look like leaves at all, but instead garbage.

(In other words, perl's unicode support sucks mightily, and drives
us all to drink and bad storytelling. But we knew that..)

So, srcdir is not normally flagged as unicode, because typically it's pure
ascii. And in that case, things work ok; File::Find finds filenames, which
are not yet decoded to unicode, and appends them to the srcdir, and then
decode_utf8 happily converts the whole thing.

But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml
setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of
*all* strings, even those containing only ascii. In either case, srcdir
has the unicode flag set; a non-decoded filename is appended, and the flag
remains set; and decode_utf8 sees the flag and does *nothing*. The result
is that the filename is not decoded, so looks valid and gets skipped.

File::Find only sticks the directory and filenames together in no_chdir
mode .. but we need that mode for security. In order to retain the
security, and avoid the problem, I made it not pass srcdir to File::Find.
Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem
is avoided.

Note that chdir srcdir is safe because we check for symlinks in the srcdir
path.

Note that it takes care to chdir back to the starting location. Because
the user may have specified relative paths and so staying in the srcdir
might break. A relative path could even be specifed for an underlay dir, so
it chdirs back after each.
2010-06-15 17:13:46 -04:00
Joey Hess 69383fb6b0 Fix issues with combining unicode srcdirs and source files.
A short story:

  Once there was a unicode string, let's call him Srcdir.

  Along came a crufy old File::Find, who went through a tree and pasted each
  of the leaves in turn onto Srcdir. But this 90's relic didn't decode the
  leaves -- despite some of them using unicode! Poor Srcdir, with these
  leaves stuck on him, tainted them with his nice unicode-ness. They didn't
  look like leaves at all, but instead garbage.

In other words, perl's unicode support sucks mightily, and drives
us all to drink and bad storytelling. But we knew that..

So, srcdir is not normally flagged as unicode, because typically it's pure
ascii. And in that case, things work ok; File::Find finds filenames, which
are not yet decoded to unicode, and appends them to the srcdir, and then
decode_utf8 happily converts the whole thing.

But, if the srcdir does contain utf8 characters, that breaks. Or, if a Yaml
setup file is used, Yaml::Syck's implicitunicode sets the unicode flag of
*all* strings, even those containing only ascii. In either case, srcdir
has the unicode flag set; a non-decoded filename is appended, and
decode_utf8 sees the flag and does *nothing*. The result is that the
filename is not decoded, so looks valid and gets skipped.

File::Find only sticks the directory and filenames together in no_chdir
mode .. but we need that mode for security. In order to retain the
security, and avoid the problem, I made it not pass srcdir to File::Find.
Instead, chdir to the srcdir, and pass ".". Since "." is ascii, the problem
is avoided.

Note that it takes care to chdir back to the starting location. Because
the user may have specified relative paths and so staying in the srcdir
might break. A relative path could even be specifed for an underlay dir, so
it chdirs back after each.
2010-06-15 16:40:37 -04:00
Joey Hess d541cc854a calendar: Tune archive_pagespec to only match pages, not other files. 2010-06-15 13:38:19 -04:00
Joey Hess c0bc2d0839 editpage, comments: Fix broken links in sidebar (due to forcebaseurl). (Thanks, privat) 2010-06-14 14:34:52 -04:00