root/swish_website/README

Revision 1909, 17.9 kB (checked in by moseley, 1 year ago)

Add redirect for swish-e.com

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
Line 
1 Mon Jan 17 07:32:40 PST 2005
2 Updated for new site Fri Feb  2 12:57:49 PST 2007
3
4 Swish-e site.
5
6 This site is maintained in CVS.  Pages should not be modified directly.
7 Check out the site from cvs, and modify the pages locally.  Rebuild locally
8 to review and then check in.
9
10 Prerequisites
11 -------------
12
13 The one thing I hate about Perl:
14
15     HTML-Parser-3.56
16     HTML-Tree-3.23
17     HTML-FillInForm-1.06
18     hypermail-2.1.8
19     Pod-POM-0.17
20     swish-e-2.4.5
21     Template-Toolkit-2.15
22     TimeDate-1.16 (for Date::Parse)
23     DateTime-0.36 (let's see how much code can be brought in for simple usage)
24         Params-Validate-0.87
25         DateTime-Locale-0.33
26         DateTime-TimeZone-0.59
27             Module-Build-0.2806
28             Class-Singleton-1.03
29
30
31
32
33 There are likely other dependencies, depending on your systems base
34 configuration.
35
36 Note, the versions were the current CPAN versions and don't necessarily reflect
37 dependencies.
38
39
40 Overview
41 --------
42
43 The website generation has a few dependencies.  There are scripts to generate
44 the various parts.  Here's an overview of what's needed before the site can be
45 generated.
46
47     - swish-e current release source
48         Used to build the swish-e docs.
49
50     - swish-e cvs checkout
51         Used to build the nightly build, and the docs from that.
52
53     - archive (hypermail)
54         Not actually required to build the site, as the site just
55         points to the hypermail archive.  But, might in the future
56         use a single script to display the archive then it would be
57         a true dependency.
58
59         currently, procmail feeds new posts to hypermail to
60         add new posts to the archive.  The posts are also archived
61         in the "mbox" directory by month in mbox format.
62
63     - indexes
64         When the archive is updated a flag is set and then cron
65         can re-index the hypermail archive.  Also, the index of
66         the site is needed, but first need the site...
67
68     - swish-daily
69         This is where daily tarballs are placed.  The website
70         creates an index page from the list of files
71
72     - swish-release
73         Similar to the swish-daily directory, but for releases
74
75
76
77 Directory Structure
78 -------------------
79
80     A "top level dir" contains a number of directories.  This top level
81     directory will be called $ROOT below.
82
83     $ROOT/
84
85         swish_daily_build/          - where the daily builds are created
86         swish-daily/                - daily tarballs
87
88         swish_release_build/        - where the release is build (for the docs)
89         distribution/               - releases (tarballs, .exe, old stuff)
90             old/                    - this is needed.
91
92         mbox/                       - mailbox archives by month
93         archive/                    - hypermail archive
94
95         indexes/                    - indexes for the archive and website
96
97         pubilc_html                 - bulk of generated website.
98
99
100     Of those directories, public_html is the site's Document Root,
101     and "archive", "distribution", and "swish-daily" are aliased
102     in the Apache configuration.
103
104     The names of the directors do not have to be as shown above and don't
105     even need to all be under the same directory.  But, if the names above
106     are used then the site build script can be invoked with simpler arguments.
107
108
109
110
111 Notes on building the HTML docs
112 -------------------------------
113
114     There's somewhat of a circular dependency.  Before the website can be
115     built the swish-daily needs to be generated.  This makes the pod docs
116     available for generating the documentation.
117
118     But, to build a daily tarball that include the HTML docs the website code
119     needs to be installed.
120
121     So, the swish_website needs to be checked out from subversion first.
122
123     The swish-e configure script looks for the program "build-swish-docs" in the
124     path.  This is typically a symlink to the swish_website/bin/build program.
125     This program is used to build the HTML documentation that is placed in the tarball
126     generated by the swish-daily.pl program.
127
128
129
130 Creating the above directories
131 ------------------------------
132
133     The following examples use $ROOT as the top-level directory above.
134     This might be /opt/swish, for example.
135
136
137     swish_website
138     -------------
139         The website isn't generated yet, but the code is needed before
140         building the daily tarballs.
141
142         This example places swish_website below $ROOT.  This is not a requirement,
143         but is nice if you want to keep everything in one place.
144
145             cvn co http://svn.swish-e.org/swish_website/ $ROOT/swish_website
146             ln -s $ROOT/swish_website/bin/build /usr/local/bin/build-swish-docs
147
148         The actual site will be built later.
149
150
151
152
153     swish-daily_build / swish-daily
154     -------------------------------
155
156         Use the swish-daily.pl script to create the daily builds.
157         The script uses the cwd for the default "topdir" if not specified,
158         and also has the command to check out from trunk by default.
159
160         But, it's probably more explicit to pass in the build directory
161         by specifying "topdir".
162
163             $ROOT/swish_website/bin/swish-daily.pl \
164                 --topdir=$ROOT/swish_daily_build \
165                 --tardir=$ROOT/swish-daily \
166                 || echo "Problem building swish-daily"
167
168
169         The script will exit non-zero if there's a problem and any errors
170         should be in the log files.  This should be run nightly.
171
172         swish_daily_build will be created if doesn't exist,
173         but the tardir directory must exist.
174
175             mkdir $ROOT/swish-daily
176
177
178         This does a fresh checkout.  Obviously, doing a svn update would
179         be much faster, but better to test a fresh checkout.
180
181         After all that there's also a script Make_Daily.sh
182         that does the above.
183
184
185
186     swish_release_build / distribution
187     ----------------------------------
188
189         This is only run when a new release is created.
190         But the current release source needs to be available
191         so the documentation can be generated on the website.
192
193         This is similar to the above, but the source is not fetched
194         via svn, rather from the current release tarball.
195         Also, assuming the tarball is already in the releases directory
196         there's no need to write it to the tardir.
197
198
199             $ROOT/swish_website/bin/swish-daily.pl \
200                 --fetchtarurl=http://swish-e.org/distribution/latest.tar.gz \
201                 --topdir=$ROOT/swish_release_build \
202                 --notimestamp \
203                 --noremove \
204                 --tardir=$ROOT/distribution \
205                 || echo "Problem building release"
206
207         There's also a Make_Release.sh script.  Review it before use.
208
209         Running --help will show available options.
210
211
212         Note that this can be used to generate an actual release (by fetching
213         from svn instead), but it's better to generate the release separately
214         and test it.  In that case REMOVE the --tardir option above.
215
216
217
218
219     mbox / archive
220     --------------
221
222         Copy the existing mbox directory from where ever they currently are
223         located.
224
225         Generate the hypermail archive.  This needs to be done from the hypermail
226         directory since that's where the templates are located.
227
228         This step is only needed to create the initial archive.  The archive
229         is added to as new messages arrive (e.g. via procmail).
230
231             cd $ROOT/swish_website/hypermail
232             gzip -dc $ROOT/mbox/*.gz \
233                 | hypermail \
234                     -i \
235                     -c hypermailrc \
236                     -d $ROOT/archive.new \
237             && mv $ROOT/archive $ROOT/archive.old \
238             && mv $ROOT/archive.new $ROOT/archive
239
240
241         Note, would really be good dynamically display the archive
242         so that the headers and footers can be shared.
243
244
245
246     public_html
247     -----------
248         Now the website can be created.  The bin/build script is used
249         to generate the website.  The script will detect when files
250         need to be generated, or passing --all will tell it to generate
251         the complete site.
252
253         There are a lot of options, and running build --help will list them.
254         The same build script is used when building from cvs to generate the
255         html docs for the tarball.
256
257         If the directories above are all in $ROOT and use the same names as
258         above, then the script can be called like this:
259
260             $ROOT/swish_website/bin/build --root $ROOT --all
261
262         (The --all is optional)
263
264         This is the same as calling the script and explicitly setting
265         all the directories:
266
267
268             $ROOT/swish_website/bin/build \
269                 --dest      $ROOT/public_html \
270                 --indexes   $ROOT/indexes \
271                 --swishsrc  $ROOT/swish_release_build/latest_swish_build/source \
272                 --develsrc  $ROOT/swish_daily_build/latest_swish_build/source \
273                 --download  $ROOT/distribution \
274                 --daily     $ROOT/swish-daily \
275                 --all
276
277
278
279         httpd.conf
280         ----------
281
282             Setting up Apache is just a matter of pointing
283             Apache at public_html, and creating aliases
284             for the distribution, swish-daily, and the archive directories.
285
286             The same bin/build script can be used to generate an httpd.conf file.
287
288                 $ROOT/swish_website/bin/build --root $ROOT --apache > httpd.conf
289
290             You will likely need to specify the full path to the modules (-module_dir)
291             unless you first cd to the ServerRoot directory and "modules" is a
292             subdirectory.
293
294             You may notice a few warnings:
295
296             Warning: module '/usr/lib/apache2/modules/mod_access.so' was not found
297             Warning: module '/usr/lib/apache2/modules/mod_auth.so' was not found
298             Warning: module '/usr/lib/apache2/modules/mod_log_config.so' was not found
299
300             This is normal on Apache 2.2 since those modules were renamed.  The script
301             will try the new names for those modules.
302
303             For debugging locally, say just the web site
304
305                 mkdir $ROOT/indexes
306
307
308                 $ROOT/swish_website/bin/build \
309                     --root      $ROOT \
310                     --apache    \
311                     --port      8080 \
312                     --ipaddr    `hostname` \
313                     --domain    `hostname` \
314                     --user      `whoami` \
315                     --group     `whoami` \
316                     --nodev_site \
317                     --nolists_site \
318                     --nosvn_site \
319                     --module_dir /usr/lib/apache2/modules \
320                 > httpd.test
321
322             The only reason to disable sites might be if you don't have
323             the modules installed locally.
324
325
326             Another example, for the p3 machine:
327
328                 $ROOT/swish_website/bin/build \
329                     --root      $ROOT \
330                     --apache    \
331                     --port      8080 \
332                     --ipaddr    70.42.42.162 \
333                     --domain    p3.swish-e.org \
334                     --user      `whoami` \
335                     --group     `whoami` \
336                     --module_dir /usr/lib/httpd/modules \
337                 > httpd.test
338
339             mkdir logs run
340             /usr/sbin/httpd -d $(pwd) -f httpd.test
341
342
343     indexes
344     -------
345
346         This directory contains two indexes.  One for the archive and
347         another for the website.
348
349
350         This create the index of the archive
351
352             mkdir $ROOT/indexes
353
354             $ROOT/swish_website/bin/index_hypermail.pl $ROOT/archive \
355                 | swish-e \
356                     -S prog \
357                     -i stdin \
358                     -c $ROOT/swish_website/etc/archive.conf \
359                     -f $ROOT/indexes/archive.swish-e \
360                     -v0
361
362         This should be a cron task.  Normally set a flag when
363         the archive is updated (new message arrives).
364
365
366         This creates the index of the website.  The site is spidered,
367         so Apache must be running.
368
369         This uses the spider installed with swish-e -- and runs the spider
370         via the swish config (instead of piping the spider's output to swish).
371         Therefore, must cd to the website directory:
372
373         # Note the SWISH_SITE if testing on a different host
374
375
376             cd $ROOT/swish_website && \
377             SWISH_SITE=http://p3.swish-e.org \
378             SPIDER_QUIET=1 \
379             swish-e \
380                 -c etc/swish.config \
381                 -f $ROOT/indexes/index.swish-e \
382                 -S prog \
383                 -v0
384
385
386
387
388
389
390 Crontab
391 -------
392
393 TODO
394     Cron is used for a number of tasks.  The user running cron needs to
395     have write access to the $ROOT directory.
396
397     Cron is used for:
398
399         1) create the daily builds
400         2) cvs update the website and rebuild if necessary (including reindexing)
401         3) cvs update an rebuild the website nightly using --all, just for good measure
402         4) reindex when new archives messages have been added
403
404         See etc/crontab
405
406
407 Procmail
408 --------
409
410
411     Procmail is used to look for email messages from the swish-e list.
412     A message is saved to the mbox directory and piped to hypermail
413     to be included in the html archive.  A flag is set to let cron
414     know that the archive needs to be re-indexed.
415
416     See etc/procmailrc
417
418     ln -s $ROOT/etc/procmailrc .procmailrc
419
420
421 ============================= NOTE ====================================================
422
423 Note: Sat Feb  3 20:36:10 PST 2007
424         Some of the content below has not be reviewed
425         and may be inaccurate.
426
427
428
429 swish_website layout
430 --------------------
431
432     Here's an overview of the files that are used to build the website.
433
434     ./
435         -> src              - web source docs.
436         -> bin              - bin/build script and other utilities
437         -> lib/config       - site config templates.
438         -> lib/config/site  - contains swish-e current version (see TODO)
439         -> lib/config/map   - defines layout of site and site's menu
440         -> lib/page         - templates that define the look of each page
441         -> lib/pod_toc      - top-level index for pod docs
442
443
444
445     Note: if speedy (speedyCGI) is installed and in the path at build time the
446     the search script will run that instead of perl.
447
448
449 Download and swish-daily directories
450 ------------------------------------
451
452 These directory listings are *static* pages.  If a new file is added
453 to one of these directories you need to touch the source file or rebuild
454 all pages:
455
456     $ touch src/download/index.html && bin/build -v
457 or
458     $ bin/build -all -v
459
460
461
462 Building the html docs for distribution
463 ---------------------------------------
464
465     Specify the pod destination directory:
466
467         bin/build -all -swishsrc=$HOME/swish-e -poddest=$HOME/swish-e/html
468
469     This adjusts the links so that every non-pod link points to the swish-e.org
470     site; pod links are local.
471
472
473 Content Creation
474 ----------------
475
476 Links:
477     All internal pages can (and probably should) be defined in the
478     config/map file.  This is mostly for defining the menu, but entries
479     can be marked "hidden".  Even off-site links can be entered (look for link to CVS)
480
481     Entries in the config/map file can then be linked
482     to using a macro:
483
484      Check out the [% link_to_page('readme#Key features', 'full list of features') %].
485
486     That will find the (first) menu item that has "readme" for an id
487     and create a complete <a>..</a> tag.  notice that it's possible to use
488     fragments.
489
490     The macro has at least three parameters:
491         1) the menu id to search for
492         2) optional text to use for the link -- otherwise the menu text is used
493         3) flag to say just return the href part of the link
494
495
496     TODO:
497         add MACROS for page sections and the abilty to create a TOC at the top of the
498         page.
499
500
501
502 Indexing the site for searches
503 ------------------------------
504
505 To index the site run from the top level directory:
506
507     $ SWISH_SITE=http://swish-e.org swish-e -c etc/swish.config -S prog
508
509 SWISH_SITE is the top level URL.
510 START_FILE is the starting file.  Default is index.html
511 (SWISH_SITE=http://swish-e.org/docs START_FILE=readme.html to index just one file)
512
513 That writes the index to public_html/search/
514
515 Or to run it quiet:
516
517 $ SPIDER_QUIET=1 SWISH_SITE=http://localhost/apache/public_html \
518     swish-e -c etc/swish.config -S prog -v0
519
520 Capture output (for debugging) like this:
521
522   $ SWISH_SITE=http://localhost/apache/public_html \
523         /usr/local/lib/swish-e/spider.pl etc/spider.config > out
524
525
526
527 todo: add metaname selection and create build script that is built from
528
529
530 TODO
531 ----
532
533 - add 404 and 500 pages (should they be cgi scripts to show the probled
534 path, or can people figure that out on their own?
535
536 - Have title be part of the layout (instead of added on each page)?
537
538
539 - [done] Fetch version from -swishsrc/configure instead of hard-coded in config/site
540
541 - Split out some of the lib/page templates into smaller components that can be
542 overridden separately.
543
544 - add to META on each page [author = '$Author$'] and maybe also $Date$, although
545 lastmod is probably fine.  Waiting until can think of a better way to do the same
546 for the pod files.
547
548 - [done] test speedycgi and install on sunsite
549
550 - [done - not really needed under speedy ] enable template caching for the search script
551
552 - [done] Probably should filter all hrefs= and name= through |uri|html.  Plus some
553 are very large.  Maybe shorten or md5 them?  If so, then need to adjust link_to_page().
554 [Well, partially done.  Pod::POM prevents access to the #fragment so there's spaces in hrefs
555 which is ok, I suppose but other chars could mess things up.]
556
557 - [done - just rebuld, doesn't take any time]
558   Try (again) to find a way to detect when a cvs update doesn't really update any files.
559
560 - [done - see above]Add disk cache for table of contents for each POD page so index.html can be
561 regenerated without having to parse all pods.  Not that parsing a small handfull of
562 pods is a big deal....
563
564 - [done] add timezone to dates and make UTC.
565
566 - Set fixed pitch font for timestamp on file listings.  Currently ugly.
Note: See TracBrowser for help on using the browser.