Wiki2Go 1.16.1 → 1.17.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- data/lib/Web2Go/CGIRequest.rb +40 -8
- data/lib/Web2Go/MockRequest.rb +11 -2
- data/lib/Web2Go/WebrickRequest.rb +4 -0
- data/lib/Wiki2Go/DotGraphics.rb +1 -1
- data/lib/Wiki2Go/Install/config/chonqed_blacklist.txt +1537 -13
- data/lib/Wiki2Go/Install/config/mime.types.conf +49 -0
- data/lib/Wiki2Go/Install/config/passwords +1 -1
- data/lib/Wiki2Go/Install/make_repository.rb +3 -2
- data/lib/Wiki2Go/Install/make_site.rb +222 -19
- data/lib/Wiki2Go/Install/site/error.html +52 -52
- data/lib/Wiki2Go/Install/templates/admin_pages/commit_site.txt +5 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/edit.txt +8 -2
- data/lib/Wiki2Go/Install/templates/admin_pages/editfiles.txt +52 -7
- data/lib/Wiki2Go/Install/templates/admin_pages/greylist.txt +6 -3
- data/lib/Wiki2Go/Install/templates/admin_pages/passwords.txt +5 -2
- data/lib/Wiki2Go/Install/templates/admin_pages/regenerate.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/removespam.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/show_log.txt +5 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/update_blacklist.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/update_conflicts.txt +4 -1
- data/lib/Wiki2Go/Install/templates/admin_pages/update_site.txt +5 -1
- data/lib/Wiki2Go/Install/templates/full_footer.htm +2 -2
- data/lib/Wiki2Go/Install/templates/simple_footer.htm +1 -1
- data/lib/Wiki2Go/LineFormatter.rb +41 -31
- data/lib/Wiki2Go/Web.rb +1 -22
- data/lib/Wiki2Go/Wiki2GoServlet.rb +11 -4
- data/test/TestFormatter.rb +11 -11
- data/test/TestLineFormatter.rb +37 -37
- data/test/TestRepositoryMaker.rb +1 -1
- data/test/TestWeb.rb +3 -4
- data/test/TestWeb2Go.rb +5 -6
- data/test/TestWiki2GoServlet.rb +95 -74
- data/test/testdata/expected_edit.html +10 -10
- data/test/testdata/expected_out.html +22 -22
- data/test/testdata/expected_put.html +10 -10
- data/test/testdata/expected_save.html +11 -11
- data/test/testdata/expected_savehtml.html +11 -11
- data/test/testdata/expected_search.html +8 -8
- data/test/testdata/expected_upload.html +11 -11
- data/test/testdata/expected_view.html +22 -22
- metadata +3 -2
@@ -0,0 +1,49 @@
|
|
1
|
+
mimetype.assign = (
|
2
|
+
|
3
|
+
".pdf" => "application/pdf",
|
4
|
+
".sig" => "application/pgp-signature",
|
5
|
+
".spl" => "application/futuresplash",
|
6
|
+
".class" => "application/octet-stream",
|
7
|
+
".ps" => "application/postscript",
|
8
|
+
".torrent" => "application/x-bittorrent",
|
9
|
+
".dvi" => "application/x-dvi",
|
10
|
+
".gz" => "application/x-gzip",
|
11
|
+
".pac" => "application/x-ns-proxy-autoconfig",
|
12
|
+
".swf" => "application/x-shockwave-flash",
|
13
|
+
".tar.gz" => "application/x-tgz",
|
14
|
+
".tgz" => "application/x-tgz",
|
15
|
+
".tar" => "application/x-tar",
|
16
|
+
".zip" => "application/zip",
|
17
|
+
".mp3" => "audio/mpeg",
|
18
|
+
".m3u" => "audio/x-mpegurl",
|
19
|
+
".wma" => "audio/x-ms-wma",
|
20
|
+
".wax" => "audio/x-ms-wax",
|
21
|
+
".ogg" => "audio/x-wav",
|
22
|
+
".wav" => "audio/x-wav",
|
23
|
+
".gif" => "image/gif",
|
24
|
+
".jpg" => "image/jpeg",
|
25
|
+
".jpeg" => "image/jpeg",
|
26
|
+
".png" => "image/png",
|
27
|
+
".xbm" => "image/x-xbitmap",
|
28
|
+
".xpm" => "image/x-xpixmap",
|
29
|
+
".xwd" => "image/x-xwindowdump",
|
30
|
+
".css" => "text/css",
|
31
|
+
".html" => "text/html",
|
32
|
+
".htm" => "text/html",
|
33
|
+
".js" => "text/javascript",
|
34
|
+
".asc" => "text/plain",
|
35
|
+
".c" => "text/plain",
|
36
|
+
".conf" => "text/plain",
|
37
|
+
".text" => "text/plain",
|
38
|
+
".txt" => "text/plain",
|
39
|
+
".dtd" => "text/xml",
|
40
|
+
".xml" => "text/xml",
|
41
|
+
".mpeg" => "video/mpeg",
|
42
|
+
".mpg" => "video/mpeg",
|
43
|
+
".mov" => "video/quicktime",
|
44
|
+
".qt" => "video/quicktime",
|
45
|
+
".avi" => "video/x-msvideo",
|
46
|
+
".asf" => "video/x-ms-asf",
|
47
|
+
".asx" => "video/x-ms-asf",
|
48
|
+
".wmv" => "video/x-ms-wmv"
|
49
|
+
)
|
@@ -1 +1 @@
|
|
1
|
-
admin:PtbdbFXq/1qM6
|
1
|
+
admin:PtbdbFXq/1qM6
|
@@ -303,7 +303,7 @@ module Wiki2Go
|
|
303
303
|
repository = RSCM::Cvs.new(@dir,modulename)
|
304
304
|
repository.checkout_dir = dir
|
305
305
|
|
306
|
-
repository.add subdir unless dir_in_repository?(File.join(dir,subdir))
|
306
|
+
repository.add('"' + subdir + '"') unless dir_in_repository?(File.join(dir,subdir))
|
307
307
|
end
|
308
308
|
|
309
309
|
def add_files(modulename,dir,files)
|
@@ -313,7 +313,8 @@ module Wiki2Go
|
|
313
313
|
if files.length > 0 then
|
314
314
|
repository = RSCM::Cvs.new(@dir,modulename)
|
315
315
|
repository.checkout_dir = dir
|
316
|
-
|
316
|
+
files_to_add = files.collect { |file| '"' + file + '"' }
|
317
|
+
repository.add files_to_add.join(' ')
|
317
318
|
added = files
|
318
319
|
end
|
319
320
|
end
|
@@ -6,7 +6,7 @@ require 'optparse'
|
|
6
6
|
require "uri"
|
7
7
|
|
8
8
|
require 'rubygems'
|
9
|
-
WIKI2GO_VERSION = '1.
|
9
|
+
WIKI2GO_VERSION = '1.17.0'
|
10
10
|
require_gem "Wiki2Go","~>#{WIKI2GO_VERSION}"
|
11
11
|
|
12
12
|
require 'Wiki2Go/PublicWikiConfig'
|
@@ -188,6 +188,7 @@ module Wiki2Go
|
|
188
188
|
do_make_wiki( configuration)
|
189
189
|
|
190
190
|
make_public_apache_config( configuration)
|
191
|
+
make_public_lighttpd_config( configuration)
|
191
192
|
end
|
192
193
|
|
193
194
|
def Install.do_make_readwrite_site( configuration)
|
@@ -199,6 +200,7 @@ module Wiki2Go
|
|
199
200
|
do_make_wiki( configuration)
|
200
201
|
|
201
202
|
make_readwrite_apache_config( configuration)
|
203
|
+
make_readwrite_lighttpd_config( configuration)
|
202
204
|
end
|
203
205
|
|
204
206
|
def Install.do_make_private_site(configuration)
|
@@ -211,6 +213,7 @@ module Wiki2Go
|
|
211
213
|
do_make_wiki( configuration)
|
212
214
|
|
213
215
|
make_apache_private_config( configuration)
|
216
|
+
make_private_lighttpd_config( configuration)
|
214
217
|
end
|
215
218
|
|
216
219
|
|
@@ -299,12 +302,16 @@ module Wiki2Go
|
|
299
302
|
if !owner.group.nil? then
|
300
303
|
group_id = Etc.getgrnam(owner.group).gid
|
301
304
|
end
|
302
|
-
mode = File.stat(dir).mode |
|
305
|
+
mode = File.stat(dir).mode | 0664
|
303
306
|
File.chmod(mode,dir)
|
304
307
|
File.chown(user_id,group_id,dir)
|
305
308
|
Dir.glob(File.join(dir,'**/*')).each do |file|
|
306
309
|
if file[0] != '.' then
|
307
|
-
|
310
|
+
if File.extname(file) == '.rb' then
|
311
|
+
mode = File.stat(file).mode | 0764
|
312
|
+
else
|
313
|
+
mode = File.stat(file).mode | 0664
|
314
|
+
end
|
308
315
|
File.chmod(mode,file)
|
309
316
|
File.chown(user_id,group_id,file)
|
310
317
|
end
|
@@ -453,6 +460,19 @@ TEMPLATE_END
|
|
453
460
|
copy_if_not_exists(source,config_dir)
|
454
461
|
end
|
455
462
|
|
463
|
+
def Install.write_lighttpd_config(config,contents)
|
464
|
+
config_dir = File.join(config.directory,'config')
|
465
|
+
mkdir_p(config_dir,{ :mode => 0775}) unless File.exists?(config_dir)
|
466
|
+
|
467
|
+
configfile = File.join(config_dir,'lighttpd.conf')
|
468
|
+
File.open(configfile,File::CREAT|File::TRUNC|File::RDWR,0664) do |f|
|
469
|
+
f.puts contents
|
470
|
+
end
|
471
|
+
|
472
|
+
source = File.join(config.source_dir,'config')
|
473
|
+
copy_if_not_exists(source,config_dir)
|
474
|
+
end
|
475
|
+
|
456
476
|
def Install.make_public_apache_config(config)
|
457
477
|
template = <<-END_TEMPLATE
|
458
478
|
<VirtualHost *#{config.dotted_port}>
|
@@ -460,11 +480,8 @@ ServerName #{config.server}
|
|
460
480
|
DocumentRoot #{config.directory}/site
|
461
481
|
RedirectMatch ^/$ http://#{File.join(config.server_url,config.default_wiki,'FrontPage.html')}
|
462
482
|
RedirectMatch ^$ http://#{File.join(config.server_url,config.default_wiki,'FrontPage.html')}
|
463
|
-
ScriptAlias /scripts #{config.directory}/site/scripts
|
464
483
|
ScriptAlias /scripts/secure #{config.directory}/site/scripts/secure
|
465
|
-
|
466
|
-
Options ExecCGI FollowSymLinks
|
467
|
-
</Directory>
|
484
|
+
ScriptAlias /scripts #{config.directory}/site/scripts
|
468
485
|
<Directory "#{config.directory}/site/scripts/secure">
|
469
486
|
AuthType Basic
|
470
487
|
AuthName "#{config.default_wiki} wiki site"
|
@@ -472,6 +489,9 @@ AuthUserFile #{config.directory}/config/passwords
|
|
472
489
|
require valid-user
|
473
490
|
Options ExecCGI FollowSymLinks
|
474
491
|
</Directory>
|
492
|
+
<Directory "#{config.directory}/site/scripts">
|
493
|
+
Options ExecCGI FollowSymLinks
|
494
|
+
</Directory>
|
475
495
|
ErrorLog #{config.directory}/logs/error.log
|
476
496
|
CustomLog #{config.directory}/logs/access.log.log combined
|
477
497
|
|
@@ -481,12 +501,9 @@ END_TEMPLATE
|
|
481
501
|
subsite_template = <<-END_TEMPLATE
|
482
502
|
RedirectMatch ^#{config.subsite}/$ http://#{File.join(config.server_url,config.subsite,config.default_wiki,'FrontPage.html')}
|
483
503
|
RedirectMatch ^#{config.subsite}$ http://#{File.join(config.server_url,config.subsite,config.default_wiki,'FrontPage.html')}
|
484
|
-
ScriptAlias #{config.subsite}/scripts #{config.directory}/site/scripts
|
485
504
|
ScriptAlias #{config.subsite}/scripts/secure #{config.directory}/site/scripts/secure
|
505
|
+
ScriptAlias #{config.subsite}/scripts #{config.directory}/site/scripts
|
486
506
|
Alias #{config.subsite} #{config.directory}/site
|
487
|
-
<Directory "#{config.directory}/site/scripts">
|
488
|
-
Options ExecCGI FollowSymLinks
|
489
|
-
</Directory>
|
490
507
|
<Directory "#{config.directory}/site/scripts/secure">
|
491
508
|
AuthType Basic
|
492
509
|
AuthName "#{config.default_wiki} wiki site"
|
@@ -494,10 +511,74 @@ AuthUserFile #{config.directory}/config/passwords
|
|
494
511
|
require valid-user
|
495
512
|
Options ExecCGI FollowSymLinks
|
496
513
|
</Directory>
|
514
|
+
<Directory "#{config.directory}/site/scripts">
|
515
|
+
Options ExecCGI FollowSymLinks
|
516
|
+
</Directory>
|
497
517
|
END_TEMPLATE
|
498
518
|
|
499
519
|
write_apache_config(config,(config.subsite.empty? ? template : subsite_template))
|
500
520
|
end
|
521
|
+
|
522
|
+
def Install.make_public_lighttpd_config( config)
|
523
|
+
template = <<-END_OF_TEMPLATE
|
524
|
+
# Configuration generated by Wiki2Go
|
525
|
+
|
526
|
+
# selecting modules
|
527
|
+
server.modules = ( "mod_rewrite",
|
528
|
+
"mod_redirect",
|
529
|
+
"mod_alias",
|
530
|
+
"mod_access",
|
531
|
+
"mod_auth",
|
532
|
+
"mod_status",
|
533
|
+
"mod_fastcgi",
|
534
|
+
"mod_cgi",
|
535
|
+
"mod_compress",
|
536
|
+
"mod_expire",
|
537
|
+
"mod_accesslog" )
|
538
|
+
|
539
|
+
server.port = #{config.port}
|
540
|
+
|
541
|
+
server.document-root = "#{config.directory}/site"
|
542
|
+
server.errorlog = "#{config.directory}/logs/lighttpd.error.log"
|
543
|
+
accesslog.filename = "#{config.directory}/logs/lighttpd.access.log"
|
544
|
+
|
545
|
+
server.follow-symlink= "enable"
|
546
|
+
debug.log-request-header= "enable"
|
547
|
+
debug.log-response-header= "enable"
|
548
|
+
debug.log-file-not-found= "enable"
|
549
|
+
|
550
|
+
server.indexfiles = ( "index.html", "FrontPage.html" )
|
551
|
+
|
552
|
+
# Execute .rb as Ruby
|
553
|
+
cgi.assign = ( ".rb" => "/usr/local/bin/ruby" )
|
554
|
+
|
555
|
+
# Redirect all scripts without extension to .rb equivalent
|
556
|
+
url.rewrite-once = (
|
557
|
+
"^/scripts/secure/([^\.\/]*)/(.*)$" => "/scripts/secure/$1.rb/$2",
|
558
|
+
"^/scripts/secure/([^\.\/]*)$" => "/scripts/secure/$1.rb" ,
|
559
|
+
"^/scripts/(?!secure)([^\.\/]*)/(.*)$" => "/scripts/$1.rb/$2" ,
|
560
|
+
"^/scripts/(?!secure)([^\.\/]*)$" => "/scripts/$1.rb"
|
561
|
+
)
|
562
|
+
|
563
|
+
auth.debug = 2
|
564
|
+
auth.backend = "htpasswd"
|
565
|
+
auth.backend.htpasswd.userfile = "#{config.directory}/config/passwords"
|
566
|
+
auth.require = (
|
567
|
+
"/scripts/secure/" =>
|
568
|
+
(
|
569
|
+
"method" => "basic",
|
570
|
+
"realm" => "lighty wiki",
|
571
|
+
"require" => "valid-user"
|
572
|
+
)
|
573
|
+
)
|
574
|
+
|
575
|
+
|
576
|
+
# Include standard mime types
|
577
|
+
include "mime.types.conf"
|
578
|
+
END_OF_TEMPLATE
|
579
|
+
|
580
|
+
write_lighttpd_config(config,template)
|
581
|
+
end
|
501
582
|
|
502
583
|
def Install.make_readwrite_apache_config(config)
|
503
584
|
template = <<-END_TEMPLATE
|
@@ -506,11 +587,8 @@ ServerName #{config.server}
|
|
506
587
|
DocumentRoot #{config.directory}/site
|
507
588
|
RedirectMatch ^/$ http://#{File.join(config.server_url,config.default_wiki,'FrontPage.html')}
|
508
589
|
RedirectMatch ^$ http://#{File.join(config.server_url,config.default_wiki,'FrontPage.html')}
|
509
|
-
ScriptAlias /scripts #{config.directory}/site/scripts
|
510
590
|
ScriptAlias /scripts/secure #{config.directory}/site/scripts/secure
|
511
|
-
|
512
|
-
Options ExecCGI FollowSymLinks
|
513
|
-
</Directory>
|
591
|
+
ScriptAlias /scripts #{config.directory}/site/scripts
|
514
592
|
<Directory "#{config.directory}/site/scripts/secure">
|
515
593
|
AuthType Basic
|
516
594
|
AuthName "#{config.default_wiki} wiki site"
|
@@ -518,6 +596,9 @@ AuthUserFile #{config.directory}/config/passwords
|
|
518
596
|
require valid-user
|
519
597
|
Options ExecCGI FollowSymLinks
|
520
598
|
</Directory>
|
599
|
+
<Directory "#{config.directory}/site/scripts">
|
600
|
+
Options ExecCGI FollowSymLinks
|
601
|
+
</Directory>
|
521
602
|
ErrorLog #{config.directory}/logs/error.log
|
522
603
|
CustomLog #{config.directory}/logs/access.log.log combined
|
523
604
|
|
@@ -527,12 +608,9 @@ END_TEMPLATE
|
|
527
608
|
subsite_template = <<-END_TEMPLATE
|
528
609
|
RedirectMatch ^#{config.subsite}/$ http://#{File.join(config.server_url,config.subsite,config.default_wiki,'FrontPage.html')}
|
529
610
|
RedirectMatch ^#{config.subsite}$ http://#{File.join(config.server_url,config.subsite,config.default_wiki,'FrontPage.html')}
|
530
|
-
ScriptAlias #{config.subsite}/scripts #{config.directory}/site/scripts
|
531
611
|
ScriptAlias #{config.subsite}/scripts/secure #{config.directory}/site/scripts/secure
|
612
|
+
ScriptAlias #{config.subsite}/scripts #{config.directory}/site/scripts
|
532
613
|
Alias #{config.subsite} #{config.directory}/site
|
533
|
-
<Directory "#{config.directory}/site/scripts">
|
534
|
-
Options ExecCGI FollowSymLinks
|
535
|
-
</Directory>
|
536
614
|
<Directory "#{config.directory}/site/scripts/secure">
|
537
615
|
AuthType Basic
|
538
616
|
AuthName "#{config.default_wiki} wiki site"
|
@@ -540,10 +618,74 @@ AuthUserFile #{config.directory}/config/passwords
|
|
540
618
|
require valid-user
|
541
619
|
Options ExecCGI FollowSymLinks
|
542
620
|
</Directory>
|
621
|
+
<Directory "#{config.directory}/site/scripts">
|
622
|
+
Options ExecCGI FollowSymLinks
|
623
|
+
</Directory>
|
543
624
|
END_TEMPLATE
|
544
625
|
|
545
626
|
write_apache_config(config,(config.subsite.empty? ? template : subsite_template))
|
546
627
|
end
|
628
|
+
|
629
|
+
def Install.make_readwrite_lighttpd_config( config)
|
630
|
+
template = <<-END_OF_TEMPLATE
|
631
|
+
# Configuration generated by Wiki2Go
|
632
|
+
|
633
|
+
# selecting modules
|
634
|
+
server.modules = ( "mod_rewrite",
|
635
|
+
"mod_redirect",
|
636
|
+
"mod_alias",
|
637
|
+
"mod_access",
|
638
|
+
"mod_auth",
|
639
|
+
"mod_status",
|
640
|
+
"mod_fastcgi",
|
641
|
+
"mod_cgi",
|
642
|
+
"mod_compress",
|
643
|
+
"mod_expire",
|
644
|
+
"mod_accesslog" )
|
645
|
+
|
646
|
+
server.port = #{config.port}
|
647
|
+
|
648
|
+
server.document-root = "#{config.directory}/site"
|
649
|
+
server.errorlog = "#{config.directory}/logs/lighttpd.error.log"
|
650
|
+
accesslog.filename = "#{config.directory}/logs/lighttpd.access.log"
|
651
|
+
|
652
|
+
server.follow-symlink= "enable"
|
653
|
+
debug.log-request-header= "enable"
|
654
|
+
debug.log-response-header= "enable"
|
655
|
+
debug.log-file-not-found= "enable"
|
656
|
+
|
657
|
+
server.indexfiles = ( "index.html", "FrontPage.html" )
|
658
|
+
|
659
|
+
# Execute .rb as Ruby
|
660
|
+
cgi.assign = ( ".rb" => "/usr/local/bin/ruby" )
|
661
|
+
|
662
|
+
# Redirect all scripts without extension to .rb equivalent
|
663
|
+
url.rewrite-once = (
|
664
|
+
"^/scripts/secure/([^\.\/]*)/(.*)$" => "/scripts/secure/$1.rb/$2",
|
665
|
+
"^/scripts/secure/([^\.\/]*)$" => "/scripts/secure/$1.rb" ,
|
666
|
+
"^/scripts/(?!secure)([^\.\/]*)/(.*)$" => "/scripts/$1.rb/$2" ,
|
667
|
+
"^/scripts/(?!secure)([^\.\/]*)$" => "/scripts/$1.rb"
|
668
|
+
)
|
669
|
+
|
670
|
+
auth.debug = 2
|
671
|
+
auth.backend = "htpasswd"
|
672
|
+
auth.backend.htpasswd.userfile = "#{config.directory}/config/passwords"
|
673
|
+
auth.require = (
|
674
|
+
"/scripts/secure/" =>
|
675
|
+
(
|
676
|
+
"method" => "basic",
|
677
|
+
"realm" => "lighty wiki",
|
678
|
+
"require" => "valid-user"
|
679
|
+
)
|
680
|
+
)
|
681
|
+
|
682
|
+
|
683
|
+
# Include standard mime types
|
684
|
+
include "mime.types.conf"
|
685
|
+
END_OF_TEMPLATE
|
686
|
+
|
687
|
+
write_lighttpd_config(config,template)
|
688
|
+
end
|
547
689
|
|
548
690
|
def Install.make_apache_private_config(config)
|
549
691
|
template = <<-END_TEMPLATE
|
@@ -589,6 +731,67 @@ END_TEMPLATE
|
|
589
731
|
|
590
732
|
write_apache_config(config,(config.subsite.empty? ? template : subsite_template))
|
591
733
|
end
|
734
|
+
|
735
|
+
def Install.make_private_lighttpd_config( config)
|
736
|
+
template = <<-END_OF_TEMPLATE
|
737
|
+
# Configuration generated by Wiki2Go
|
738
|
+
|
739
|
+
# selecting modules
|
740
|
+
server.modules = ( "mod_rewrite",
|
741
|
+
"mod_redirect",
|
742
|
+
"mod_alias",
|
743
|
+
"mod_access",
|
744
|
+
"mod_auth",
|
745
|
+
"mod_status",
|
746
|
+
"mod_fastcgi",
|
747
|
+
"mod_cgi",
|
748
|
+
"mod_compress",
|
749
|
+
"mod_expire",
|
750
|
+
"mod_accesslog" )
|
751
|
+
|
752
|
+
server.port = #{config.port}
|
753
|
+
|
754
|
+
server.document-root = "#{config.directory}/site"
|
755
|
+
server.errorlog = "#{config.directory}/logs/lighttpd.error.log"
|
756
|
+
accesslog.filename = "#{config.directory}/logs/lighttpd.access.log"
|
757
|
+
|
758
|
+
server.follow-symlink= "enable"
|
759
|
+
debug.log-request-header= "enable"
|
760
|
+
debug.log-response-header= "enable"
|
761
|
+
debug.log-file-not-found= "enable"
|
762
|
+
|
763
|
+
server.indexfiles = ( "index.html", "FrontPage.html" )
|
764
|
+
|
765
|
+
# Execute .rb as Ruby
|
766
|
+
cgi.assign = ( ".rb" => "/usr/local/bin/ruby" )
|
767
|
+
|
768
|
+
# Redirect all scripts without extension to .rb equivalent
|
769
|
+
url.rewrite-once = (
|
770
|
+
"^/scripts/secure/([^\.\/]*)/(.*)$" => "/scripts/secure/$1.rb/$2",
|
771
|
+
"^/scripts/secure/([^\.\/]*)$" => "/scripts/secure/$1.rb" ,
|
772
|
+
"^/scripts/(?!secure)([^\.\/]*)/(.*)$" => "/scripts/$1.rb/$2" ,
|
773
|
+
"^/scripts/(?!secure)([^\.\/]*)$" => "/scripts/$1.rb"
|
774
|
+
)
|
775
|
+
|
776
|
+
auth.debug = 2
|
777
|
+
auth.backend = "htpasswd"
|
778
|
+
auth.backend.htpasswd.userfile = "#{config.directory}/config/passwords"
|
779
|
+
auth.require = (
|
780
|
+
"/" =>
|
781
|
+
(
|
782
|
+
"method" => "basic",
|
783
|
+
"realm" => "lighty wiki",
|
784
|
+
"require" => "valid-user"
|
785
|
+
)
|
786
|
+
)
|
787
|
+
|
788
|
+
|
789
|
+
# Include standard mime types
|
790
|
+
include "mime.types.conf"
|
791
|
+
END_OF_TEMPLATE
|
792
|
+
|
793
|
+
write_lighttpd_config(config,template)
|
794
|
+
end
|
592
795
|
|
593
796
|
def Install.make_static_homepage(configuration)
|
594
797
|
case configuration.type
|
@@ -1,47 +1,47 @@
|
|
1
1
|
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
|
2
2
|
<HTML>
|
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
|
-
|
3
|
+
<HEAD>
|
4
|
+
<META http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
|
5
|
+
<META http-equiv="Pragma" content="no-cache">
|
6
|
+
<META name="Author" content="Pascal Van Cauwenberghe">
|
7
|
+
<META name="Keywords" content="ruby,wiki">
|
8
|
+
<LINK rel="stylesheet" href="/style.css" type="text/css">
|
9
|
+
<TITLE>An error has ocurred</TITLE>
|
10
|
+
</HEAD>
|
11
|
+
<BODY>
|
12
|
+
<div id="container">
|
13
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%">
|
14
|
+
<TR>
|
15
|
+
<TD>
|
16
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Header">
|
17
|
+
<TR>
|
18
|
+
<TD><h1>Error</h1>
|
19
|
+
</TD>
|
20
|
+
<td align="right"><a href="/">Home</a></td>
|
21
|
+
</TR>
|
22
|
+
</TABLE>
|
23
|
+
<TABLE border="0" cellpadding="8" cellspacing="0" width="100%" class="Body">
|
24
|
+
<TR>
|
25
|
+
<TD width="100%">
|
26
|
+
<p>An error has ocurred in this wiki.</p>
|
27
|
+
<p>Please contact the owner of this site or go to <a href="http://wiki2go.nayima.be" target="_blank">the Wiki2Go site</a> to report the problem.</p>
|
28
|
+
<p>Sorry.</p>
|
29
|
+
</TD>
|
30
|
+
</TR>
|
31
|
+
</TABLE>
|
32
|
+
<TABLE border="0" cellpadding="0" cellspacing="0" width="100%" class="Footer">
|
33
|
+
<TR>
|
34
|
+
<TD width="50%"> </TD>
|
35
|
+
<TD width="50%"> </TD>
|
36
|
+
</TR>
|
37
|
+
<TR>
|
38
|
+
<TD width="50%"> </TD>
|
39
|
+
<TD width="50%"> </TD>
|
40
|
+
</TR>
|
41
|
+
<TR><TD colspan="2"></TD></TR>
|
42
|
+
<TR>
|
43
|
+
<td> </td>
|
44
|
+
<TD align="right">
|
45
45
|
<script type="text/javascript">
|
46
46
|
//<![CDATA[
|
47
47
|
function hiveware_enkoder(){var i,j,x,y,x=
|
@@ -64,14 +64,14 @@ function hiveware_enkoder(){var i,j,x,y,x=
|
|
64
64
|
while(x=eval(x));}hiveware_enkoder();
|
65
65
|
//]]>
|
66
66
|
</script>
|
67
|
-
|
68
|
-
|
69
|
-
|
70
|
-
|
71
|
-
|
72
|
-
|
73
|
-
|
74
|
-
|
75
|
-
|
76
|
-
|
67
|
+
<a target="_blank" href="http://validator.w3.org/check?uri=<%= current.format.absolute_url %>">
|
68
|
+
<img border="0" src="http://www.w3.org/Icons/valid-html401" alt="Verify if layout is correct!" height="31" width="88"></a>
|
69
|
+
</TD>
|
70
|
+
</TR>
|
71
|
+
</TABLE>
|
72
|
+
</TD>
|
73
|
+
</TR>
|
74
|
+
</TABLE>
|
75
|
+
</div>
|
76
|
+
</BODY>
|
77
77
|
</HTML>
|
@@ -1,4 +1,8 @@
|
|
1
1
|
<%
|
2
|
+
require 'Wiki2Go/WikiFormatter'
|
3
|
+
|
4
|
+
formatter = Wiki2Go::Formatter.new(@web,@config.storage,@config,true,@config.editable?(@web))
|
5
|
+
|
2
6
|
output = ''
|
3
7
|
|
4
8
|
doit = @request.parameter('update',nil)
|
@@ -12,7 +16,7 @@
|
|
12
16
|
%>
|
13
17
|
|
14
18
|
<h3>Commit Site</h3>
|
15
|
-
<form action="<%=
|
19
|
+
<form action="<%= formatter.make_verb_url('admin','commit_site')%>" method="get">
|
16
20
|
Comment: <input name="comment" value="">
|
17
21
|
<button type="submit" name="update" value="update">
|
18
22
|
Commit site changes to repository
|
@@ -1,5 +1,9 @@
|
|
1
1
|
<%
|
2
|
+
require 'Wiki2Go/WikiFormatter'
|
3
|
+
|
4
|
+
formatter = Wiki2Go::Formatter.new(@web,@config.storage,@config,true,@config.editable?(@web))
|
2
5
|
|
6
|
+
message = ''
|
3
7
|
file = @request.parameter('file',nil)
|
4
8
|
|
5
9
|
content = 'EMPTY'
|
@@ -13,16 +17,18 @@
|
|
13
17
|
if !doit.nil? then
|
14
18
|
content = @request.parameter('text',nil)
|
15
19
|
if !content.nil? then
|
16
|
-
File::open(filename,File::CREAT|File::WRONLY) do |f|
|
20
|
+
File::open(filename,File::CREAT|File::WRONLY|File::TRUNC) do |f|
|
17
21
|
f.puts content
|
18
22
|
end
|
23
|
+
message = 'File saved'
|
19
24
|
end
|
20
25
|
end
|
21
26
|
end
|
22
27
|
|
23
28
|
%>
|
24
29
|
<h3>Edit File</h3>
|
25
|
-
|
30
|
+
<%= message %>
|
31
|
+
<form action="<%= formatter.make_verb_url('admin','edit')%>" method="post">
|
26
32
|
<input type="hidden" name="file" value="<%= file %>">
|
27
33
|
<textarea name="text" rows="35" cols="96"><%= content %></textarea><br>
|
28
34
|
<button type="submit" name="update" value="update">
|