]> sipb.mit.edu Git - ikiwiki.git/blob - doc/tips/embedding_content.mdwn
move security to discussion
[ikiwiki.git] / doc / tips / embedding_content.mdwn
1 Content from sites such as YouTube can be embedded into a web page. Maybe
2 you want to do this. But you'll find that the [[plugins/htmlscrubber]]
3 doesn't let you. It blocks the tags used to embed such content, because
4 they can be abused in many evil ways.
5
6 Some plugins have been written to try to work around this problem, by
7 whitelisting the html needed to embed things from a few sites like Google
8 maps, calendar, videos, and YouTube. The problem with these plugins is that
9 they have to be kept up to date to add new sites, and follow changes to the
10 html such sites use for embedding.
11
12 (Digression: The real problem with the plugins is that they hide the
13 underlying trust relationship. If you decide to embed html from a site,
14 you'd better trust that site. And if ikiwiki lets you enter such html, it
15 needs to trust you.)
16
17 The [[plugins/htmlscrubber]] offers a different way around this problem.
18 You can configure it to skip scrubbing certian pages, so that content from
19 elsewhere can be embedded on those pages. Then use [[plugins/lockedit]]
20 to limit who can edit those unscrubbed pages.
21
22 For example, suppose your blog is all under `blog/*`, and you want
23 only yourself to be able to post there, and you'd like to be able to embed
24 youtube videos etc in your blog. Other users can edit some pages in the
25 wiki (Discussion pages, say), but not your blog posts. Then you could configure
26 ikiwiki as follows:
27
28         htmlscrubber_skip => 'blog/* and !*/Discussion',
29         locked_pages => '!*/Discussion',
30
31 More simply, you might want to allow yourself to embed content anywhere
32 on the wiki, but scrub content written on Discussion pages:
33         
34         htmlscrubber_skip => '!*/Discussion',
35         locked_pages => '!*/Discussion',