-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathREADME
594 lines (265 loc) · 12.5 KB
/
README
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
WikiTeX 1.1 BETA 3 README
Peter Danenberg <pcd at wikitex dot org>
ABSTRACT
THIS PRODUCT IS IN BETA, AND AS SUCH SHOULD
NOT BE DEPLOYED IN A PRODUCTION ENVIRONMENT.
Covers installation and expansion of the
WikiTeX system.
NOTICE: Failure to implement all security
measures in section 3.2 may expose your system to
loss or mischief.
19 February 2006
WikiTeX 1.1 BETA 3 README
Peter Danenberg <pcd at wikitex dot org>
Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . 1
2. Acquisition . . . . . . . . . . . . . . . . . . . . . 1
2.1 CVS . . . . . . . . . . . . . . . . . . . . . . 1
2.2 FTP . . . . . . . . . . . . . . . . . . . . . . 2
2.3 HTTP . . . . . . . . . . . . . . . . . . . . . 2
2.4 Subversion . . . . . . . . . . . . . . . . . . 2
3. Installation . . . . . . . . . . . . . . . . . . . . 2
3.1. Prerequisites . . . . . . . . . . . . . . . . 2
3.2. Security . . . . . . . . . . . . . . . . . . . 3
3.2.1. Makefile . . . . . . . . . . . . . . . 3
3.2.2. Unprivileged User . . . . . . . . . . . 3
3.2.3. Disk Quota . . . . . . . . . . . . . . 3
3.2.4. Cron . . . . . . . . . . . . . . . . . 4
3.2.5. Sudo . . . . . . . . . . . . . . . . . 4
3.2.6. Per Package . . . . . . . . . . . . . . 4
3.2.6.1. LaTeX . . . . . . . . . . . . . 5
3.2.7. Audit . . . . . . . . . . . . . . . . . 5
3.3. Installation . . . . . . . . . . . . . . . . . 5
4. Hacking . . . . . . . . . . . . . . . . . . . . . . . 6
4.1. Getting Started . . . . . . . . . . . . . . . 6
4.2. Extending WikiTeX . . . . . . . . . . . . . . 6
5. Help . . . . . . . . . . . . . . . . . . . . . . . . 6
6. Colophon . . . . . . . . . . . . . . . . . . . . . . 7
7. Copyright . . . . . . . . . . . . . . . . . . . . . . 8
1. Introduction
WikiTeX extends MediaWiki by allowing authors to
manipulate graphical objects directly in their arti-
cles; support so far includes: math, music, chess,
chemistry, go, plotting, relational diagrams and
schematic capture.
Visit http://wikitex.org to learn more; or to see
WikiTeX in action:
http://wikisophia.org
2. Acquisition
2.1. CVS
WikiTeX can be CVSed from MediaWiki's facil-
19 February 2006
-2-
ity at SourceForge:*
cvs -d:pserver:[email protected]:/cvsroot/wikipedia \
co wikitex
2.2. FTP
The latest stable releases can be downloaded
from:
ftp://wikitex.org
2.3. HTTP
The latest releases can be browsed and down-
loaded from:
http://wikitex.org/wikitex
2.4. Subversion
Use your Subversion client (http://subversion
.tigris.org) to get the latest development snap-
shot:
svn co http://svn.wikitex.org/wikitex/branches/1.1 \
wikitex
or visit http://wikitex.org/viewcvs/wikitex to
browse the codebase via web.
3. Installation
3.1. Prerequisites
In a nutshell, WikiTeX requires a successful
installation of:
o PHP 5.1.0+ (php.net)
o MediaWiki 1.6alpha1+ (wikipedia.sf.net)
o LaTeX (latex-project.org)
o ImageMagick (imagemagick.org)
o dvipng (dvipng.sf.net)
As of writing, WikiTeX requires the CVS ver-
sion of MediaWiki; to get it, issue:
-----------
* For actual development snapshots see Subver-
sion below.
19 February 2006
-3-
cvs -z3 -d:pserver:[email protected]:/cvsroot/wikipedia\
co -P phase3
Lilypond (lilypond.org), Gnuplot (gnu-
plot.info), and Graphviz (graphviz.org) are
required for music, plot, and graph; and as many
of the packages under 3.3.5 (see below) whose
classes you would like to support.
3.2. Security
WikiTeX requires preparation to mitigate
risk; failure to prepare in whole or in part may
expose your system to loss and mischief.
3.2.1. Makefile
We've gathered all the editable parame-
ters into one place; edit `Makefile' and run:
make
every time you've made changes.
3.2.2. Unprivileged User
WikiTeX runs as the unprivileged user
`wikitex' to restrict access to the local
file-system. You must protect sensitive
world-writable and -readable resources, how-
ever.
Create the user wikitex:
useradd -M -s /sbin/nologin wikitex
3.2.3. Disk Quota
To prevent runaway scripts or DoS
attacks from usurping storage, institute disk
quotas. See:
http://www.tldp.org/HOWTO/Quota.html
for details.
1. Edit /etc/fstab and, next to "defaults,"
add "usrquota" for the partition on
which WikiTeX runs (hereafter /part);
e.g.:
/part /home reiserfs defaults,usrquota 1 1
19 February 2006
-4-
2. Remount /part:
mount -o remount /part
3. Update quota data:
quotacheck -vguma
4. Turn on quotas:
quotaon -av
5. Implement quotas for user wikitex:
edquota -u wikitex
The following values will give WikiTeX
one hundred megabytes and ten thousand
files to play with (edit the values with
asterisks):
Filesystem blocks soft hard* inodes soft hard*
/part 186 0 100000 30 0 10000
3.2.4. Cron
To prevent legitimate files from exceed-
ing the disk quota, set up a crontab to purge
unused files.
Determine your webserver's user (consult
`httpd.conf' for Apache), and execute:
crontab -u <apache-user> wikitex.cron
from extensions/wikitex.
3.2.5. Sudo
You will need sudo version 1.6.8 or
above (verify by `sudo -V'), with support for
NOEXEC compiled in. Remove any WikiTeX cruft
from /etc/sudoers, and issue:
cat wikitex.sudoers >> /etc/sudoers
and then:
visudo -c
If there are parse errors, run `visudo' and
correct any mistakes.
19 February 2006
-5-
3.2.6. Per Package
Following are package-specific security
measures.
3.2.6.1. LaTeX
Edit `texmf.cnf', modifying the
following variables:
shell_escape = f
openout_any = p
openin_any = p
3.2.7. Audit
`wikitex-audit.sh' has been provided to
assess the integrity of an installation; as
root, run:
./wikitex-audit.sh
until you satisfy it.
3.3. Installation
NOTE: DON'T CONTINUE UNTIL wikitex-audit.sh
EXECUTES SANS FATAL ERRORS.
Fulfill the security guidelines per 3.2, and
install MediaWiki (see 3.1); then, working from
MediaWiki's base directory, perform the following:
1. Create /extensions/wikitex and copy thither
the distribution.
2. Add the following line to /LocalSettings.php
before the terminal `?>':
include './extensions/wikitex/Wikitex.php';
3. Render /extensions/wikitex/tmp scribable to
the web server:*
chown nobody:nobody /extensions/wikitex/tmp
4. Disable PHP in /extensions/wikitex/tmp by
issuing:
php_flag engine off
-----------
* Consult your server config for the appropriate
user and group id.
19 February 2006
-6-
from .htaccess in the same directory; disable
CGI, if necessary.
5. Install as many of the following packages
whose classes you would like to support, or
add your own (see Expanding WikiTeX):
Class Package Author URL
--------------------------------------------------------
amsmath AMS-LaTeX Amer. Math. Soc. ams.org
chem XyMTeX Shinsaku Fujita kit.ac.jp
chess Skak Torben Hoffmann ctan.org
feyn FenyMF Thorsten Ohl ctan.org
go Go Daniel Bump stanford.edu
graph Graphviz Emden Gansner research.att.com
greek Ibycus Pierre MacKay tug.org
music Lilypond Han-Wen Nienhuys lilypond.org
plot Gnuplot Nikos Drakos gnuplot.info
svg SVG lite ImageMagick imagemagick.org
teng Tengwar Ivan Derzhanski quettar.org
ipa TIPA Rei Fukui ctan.org
6. (Optional) If you would like your users to be
able to source uploaded files, specify the
following in LocalSettings.php:
$wgStrictFileExtensions = false;
4. Hacking WikiTeX
4.1. Getting Started
Join the WikiTeX-l mailing list, where you
can communicate with other users and developers:
http://lists.wikitex.org/listinfo/wikitex-l
and familiarize yourself with Subversion
(http://subversion.tigris.org), our collaborative
development tool.
4.2. Extending WikiTeX
Adding novel packages to WikiTeX can be
achieved in several discrete steps; after you have
downloaded and installed the package:
1. Devise a class name for the package, and add
a template to /extensions/wikitex/template in
this form:
<classname>.<ext>
19 February 2006
-7-
The template should expose said package to
the renderer; see the current templates for
examples.
2. If the class requires non-standard (extra-
LaTeX) processing, add a new function in
wikitex.sh under <class>.
Consult wikitex.sh for examples.
3. Lastly, add a hook to `wikitex.php' and an
element->hook mapping to `wikitex.inc.php'.
5. Getting Help
A great way to meet users and developers is by
joining WikiTeX-l (see 4.1 above); alternatively,
visit:
http://archives.wikitex.org/wikitex-l
to browse the archives.
6. Colophon
This document was prepared in GNU troff using the
ms macro package; preprocessed with tbl, the table for-
matter; and lastly filtered through col to remove
reverse line feeds and tabs:
groff -ms -t -Tascii SOURCE | col -bx > OUT
19 February 2006
-8-
WikiTeX: expansible LaTeX module for MediaWiki
Copyright (C) 2004-6 Peter Danenberg
WikiTeX is licensed under the Artistic License 2.0; to
view a copy of this license, see COPYING or visit:
http://dev.perl.org/perl6/rfc/346.html
19 February 2006