Soks 0.0.7 → 1.0.0

Sign up to get free protection for your applications and to get access to all the features.
Files changed (109) hide show
  1. data/LICENSE.txt +2 -0
  2. data/README.txt +3 -2
  3. data/TODO.txt +31 -0
  4. data/bin/soks-create-wiki.rb +0 -1
  5. data/lib/authenticators.rb +30 -4
  6. data/lib/helpers/counter-helpers.rb +132 -0
  7. data/lib/helpers/default-helpers.rb +170 -169
  8. data/lib/helpers/mail2wiki-helper.rb +18 -22
  9. data/lib/helpers/maintenance-helpers.rb +149 -0
  10. data/lib/helpers/rss2wiki-helper.rb +7 -8
  11. data/lib/soks-model.rb +82 -54
  12. data/lib/soks-servlet.rb +126 -108
  13. data/lib/soks-storage.rb +74 -11
  14. data/lib/soks-utils.rb +77 -3
  15. data/lib/soks-view.rb +169 -103
  16. data/lib/soks.rb +5 -23
  17. data/templates/default/attachment/newpage.js +4 -13
  18. data/templates/default/attachment/print_stylesheet.css +2 -7
  19. data/templates/default/caches/readme.txt +1 -0
  20. data/templates/default/content/Api%20for%20classes%20to%20modify%20the%20wiki.textile +2 -0
  21. data/templates/default/content/Author.textile +4 -1
  22. data/templates/default/content/Automatic%20Summaries.textile +16 -53
  23. data/templates/default/content/Automatic%20linking%20between%20pages.textile +3 -3
  24. data/templates/default/content/{bug%3A%20competing%20edits.textile → Bug%3A%20Competing%20edits.textile} +9 -0
  25. data/templates/default/content/Bug%3A%20Does%20not%20make%20use%20of%20if%2Dmodified%2Dsince%20r.textile +2 -0
  26. data/templates/default/content/Bug%3A%20E%2Dmail%20addresses%20with%20hyphens%20not%20recognised.textile +17 -0
  27. data/templates/default/content/Bug%3A%20Email%20adresses%20in%20page%20titles%20cause%20incorrec.textile +3 -0
  28. data/templates/default/content/Bug%3A%20GEM%20limits%20title%20lengths.textile +3 -1
  29. data/templates/default/content/Bug%3A%20Memory%20leak.textile +13 -0
  30. data/templates/default/content/Bug%3A%20Pages%20that%20link%20here%20may%20not%20appear%20on%20r.textile +13 -0
  31. data/templates/default/content/Bug%3A%20Textile%20mishandles%20paragraphs.textile +4 -0
  32. data/templates/default/content/Bug%3A%20Unanticipated%20Rollbacks.textile +2 -0
  33. data/templates/default/content/Bug%3A%20notextile%20does%20not%20prevent%20page%20inserts.textile +2 -0
  34. data/templates/default/content/Home%20Page.textile +3 -1
  35. data/templates/default/content/How%20to%20administrate%20this%20wiki.textile +23 -13
  36. data/templates/default/content/How%20to%20change%20the%20way%20this%20wiki%20looks.textile +3 -1
  37. data/templates/default/content/How%20to%20export%20a%20site%20from%20this%20wiki.textile +22 -0
  38. data/templates/default/content/How%20to%20get%20the%20latest%20Soks%20from%20cvs.textile +2 -0
  39. data/templates/default/content/How%20to%20hack%20soks.textile +2 -0
  40. data/templates/default/content/How%20to%20import%20a%20site%20from%20instiki.textile +2 -0
  41. data/templates/default/content/{How%20to%20import%20data%20to%20this%20wiki.textile → How%20to%20import%20data.textile} +3 -7
  42. data/templates/default/content/How%20to%20install%20Soks.textile +2 -0
  43. data/templates/default/content/How%20to%20password%20protect%20your%20wiki.textile +21 -11
  44. data/templates/default/content/How%20to%20report%20a%20bug.textile +2 -1
  45. data/templates/default/content/How%20to%20upgrade%20soks.textile +22 -0
  46. data/templates/default/content/How%20to%20use%20the%20keyboard%20shortcuts.textile +2 -2
  47. data/templates/default/content/How%20to%20use%20this%20wiki.textile +3 -1
  48. data/templates/default/content/List%20of%20changes.textile +84 -118
  49. data/templates/default/content/News%3A%20Version%201%2D0%2D0%20released.textile +19 -0
  50. data/templates/default/content/Pages%20to%20include%20in%20the%20distribution.textile +51 -0
  51. data/templates/default/content/Per%20Wiki%20Templates.textile +2 -0
  52. data/templates/default/content/Planned%20Features.textile +30 -9
  53. data/templates/default/content/README.textile +3 -2
  54. data/templates/default/content/RSS%20feed.textile +1 -1
  55. data/templates/default/content/Recent%20changes%20to%20this%20site.textile +283 -0
  56. data/templates/default/content/SOKS%20features.textile +3 -0
  57. data/templates/default/content/Site%20Index.textile +202 -0
  58. data/templates/default/content/Soks%20Licence.textile +2 -0
  59. data/templates/default/content/Tag%3A%20Include%20this%20page%20in%20the%20distribution.textile +6 -0
  60. data/templates/default/start.rb +67 -123
  61. data/templates/default/version.txt +1 -1
  62. data/templates/default/views/Page_edit.rhtml +7 -7
  63. data/templates/default/views/{Page_search_results.rhtml → Page_find.rhtml} +9 -3
  64. data/templates/default/views/Page_linksfromrss.rhtml +24 -0
  65. data/templates/default/views/Page_listrss.rhtml +46 -0
  66. data/templates/default/views/Page_meta.rhtml +1 -1
  67. data/templates/default/views/Page_revision.rhtml +39 -0
  68. data/templates/default/views/Page_revisions.rhtml +13 -5
  69. data/templates/default/views/Page_rss.rhtml +8 -8
  70. data/templates/default/views/Page_view.rhtml +3 -3
  71. data/templates/default/views/UploadPage_edit.rhtml +8 -8
  72. data/templates/default/views/frame.rhtml +8 -8
  73. data/templates/default/views/messages.yaml +1 -0
  74. data/test/html/2006Mar.html +66 -0
  75. data/test/html/poignant.html +36 -0
  76. data/test/html/poignant.textile +36 -0
  77. data/test/mock-objects.rb +69 -0
  78. data/test/stress_url_calls.rb +33 -0
  79. data/test/stress_urls.txt +68 -0
  80. data/test/test_counter-helper.rb +158 -0
  81. data/test/test_soks-helper-maintenance.rb +106 -0
  82. data/test/test_soks-helpers.rb +104 -0
  83. data/test/test_soks-model.rb +144 -0
  84. data/test/test_soks-servlet.rb +231 -0
  85. data/test/test_soks-storage.rb +70 -31
  86. data/test/test_soks-utils.rb +112 -13
  87. data/test/test_soks-view.rb +141 -3
  88. metadata +38 -27
  89. data/templates/default/content/A%20page%20with%20an%20umlaut%20%F6%20in%20its%20title.textile +0 -1
  90. data/templates/default/content/All%20News.textile +0 -26
  91. data/templates/default/content/Bil%20Kleb.textile +0 -1
  92. data/templates/default/content/Bil.textile +0 -1
  93. data/templates/default/content/Bill%20Wood.textile +0 -3
  94. data/templates/default/content/Bug%3A%20RSS%20feed%20does%20not%20validate.textile +0 -10
  95. data/templates/default/content/Bug%3A%20Type%20a%20title%20here.textile +0 -31
  96. data/templates/default/content/Instructions%20and%20Howtos.textile +0 -21
  97. data/templates/default/content/Latest%20News.textile +0 -26
  98. data/templates/default/content/New%20Recent%20Changes%20class.textile +0 -68
  99. data/templates/default/content/New%20page%20templates%20or%20categories%20code.textile +0 -68
  100. data/templates/default/content/News%3A%20Version%200%2E0%2E6%20Released.textile +0 -13
  101. data/templates/default/content/Recent%20Blog%20Entries.textile +0 -5
  102. data/templates/default/content/Recent%20Changes%20to%20This%20Site.textile +0 -286
  103. data/templates/default/content/Ruby.textile +0 -9
  104. data/templates/default/content/Skorgu.textile +0 -3
  105. data/templates/default/content/ctrl%2Dn.textile +0 -1
  106. data/templates/default/content/let%20me%20know.textile +0 -1
  107. data/templates/default/content/sandbox.textile +0 -20
  108. data/templates/default/content/tamc.textile +0 -1
  109. data/templates/default/content/tamc2.textile +0 -1
@@ -1,7 +1,2 @@
1
- #Menu {
2
- display: none;
3
- }
4
-
5
- #command {
6
- display: none;
7
- }
1
+ /* Thanks to Pavel Sykora for fixing this */
2
+ #menu, .command { display:none !important; }
@@ -0,0 +1 @@
1
+ This folder contains various caches for the wiki, to speed up restarts. If you are having problems, try deleting everything in here before starting soks again.
@@ -22,3 +22,5 @@ Examples of helpers that use this api:
22
22
  * rss2wiki
23
23
  * mail2wiki
24
24
  * wiki2html
25
+
26
+ Tag: Include this page in the distribution
@@ -4,9 +4,12 @@ Soks was written by Tom Counsell. He can be reached at tamc@rubyforge.org.
4
4
 
5
5
  h2. Thanks to
6
6
 
7
- * Bil Kleb for new page categories, meta page improvements and other suggestsions.
7
+ * Pavel Sykora for a fix to the print stylesheet.
8
+ * Bil Kleb for new page categories, meta page improvements and many other suggestsions.
8
9
  * Sebastien Clediere for a patch to fix uploads on windows and other bugfixes
9
10
  * Giovanni Ferro for a patch to allow soks to be used from a memory stick
10
11
  * _why for the RedCloth library
11
12
  * Austin Ziegler for the Diff:LCS library
12
13
  * Matz and ruby-core for the ruby language
14
+
15
+ Tag: Include this page in the distribution
@@ -1,77 +1,40 @@
1
1
  h1. Automatic Summaries
2
2
 
3
- In lib/helpers/default-helpers.rb you will find an AutomaticSummary class. This uses the [[api => api for classes to modify the wiki ]] to watch for changes to the wiki, and if the page that is changed matches a given regexp, adds it to a summary page.
3
+ In lib/helpers/default-helpers.rb you will find an AutomaticSummary class, and its subclasses AutomaticList and AutomaticDetailedList. This uses the [[api => api for classes to modify the wiki ]] to watch for changes to the wiki, and if the page that is changed matches a given regexp, adds it to a summary page.
4
4
 
5
- You can use it by creating a line in your soks-wiki/start.rb file of the form @AutomaticSummary.new( wiki, settings )@ where settings can be (defaults shown):
5
+ You can use it by creating a line in your soks-wiki/start.rb file of the form @AutomaticSummary.new( wiki, settings ) { |page| page.name =~ /Something you are interested in/ }@ where settings can be (defaults shown):
6
6
 
7
7
  <pre>
8
8
  <code>
9
9
  DEFAULT_SETTINGS = {
10
- :regexp_for_title => /.*/, # These three regexps act as an AND
11
- :regexp_for_author => nil,
12
- :regexp_for_content => nil,
13
10
  :max_pages_to_show => nil,
14
- :pagename => 'Summary',
11
+ :description => 'This summary was created automatically',
15
12
  :author => 'AutomaticSummary',
16
- :lines_to_include => nil, # If nil then justs puts a link, otherwise includes X number of lines from the page in the summary
17
- :only_new_pages => false, # Otherwise includes changes
13
+ :lines_to_include => 10,
18
14
  :sort_pages_by => :created_on, # Could be :revised_on or :score or :name or :name_for_index, or :author
19
15
  :reverse_sort => false,
20
- :include_metadata => false, # If true includes author and time in summary
21
- :summarise_revisions => false, # If true, then can contain several revisions for same page
16
+ :event => :page_created, # Only summarises new pages. :page_revised would summarise changed pages
22
17
  :remove_deleted_pages => true, # If false will keep references to deleted pages
18
+ :summarise_revisions => false, # If true will list revisions rather than pages
19
+ :merge_revisions_within => false, # If set to a number, repeats with the same author within that many seconds will be merged
23
20
  }
24
21
  </code>
25
22
  </pre>
26
23
 
27
24
  h2. Examples
28
25
 
29
- Two examples of its use, included in the default-helpers.rb file, are the Site Index and the Recent Changes page:
26
+ Four examples of its use, included in the default start.rb file are:
30
27
 
31
28
  <pre>
32
29
  <code>
33
- AutomaticSummary.new( wiki, {
34
- :regexp_for_title => /.*/ # Match all pages
35
- :pagename => 'Site Index',
36
- :author => 'Automatic Site Indexer',
37
- :only_new_pages => true,
38
- :sort_pages_by => :name_for_index,
39
- } )
30
+ AutomaticDetailedList.new( wiki, 'Known bugs' ) do |page|
31
+ page.name =~ /^Bug:/i && page.name !~ /^Bug: Type a title here/i
32
+ end
33
+
34
+ AutomaticList.new( wiki, 'Instructions and Howtos' ) { |page| page.name =~ /^How to /i }
35
+ AutomaticSummary.new( wiki, 'Latest News', :max_pages_to_show => 1, :reverse_sort => true) { |page| page.name =~ /^News:/i }
36
+ AutomaticSummary.new( wiki, 'All News', :reverse_sort => true) { |page| page.name =~ /^News:/i }
40
37
  </code>
41
38
  </pre>
42
39
 
43
- <pre>
44
- <code>
45
- AutomaticSummary.new( wiki, {
46
- :regexp_for_title => /.*/ # Match all pages
47
- :pagename => 'Recent Changes',
48
- :author => 'Automatic Recent Changes',
49
- :only_new_pages => false,
50
- :sort_pages_by => :revised_on,
51
- :include_metadata => true,
52
- :summarise_revisions => true,
53
- :reverse_sort => true,
54
- :remove_deleted_pages => false,
55
- })
56
- </code>
57
- </pre>
58
-
59
- You might also use it to construct a basic blog class:
60
-
61
- <pre>
62
- <code>
63
- AutomaticSummary.new( wiki, {
64
- :regexp_for_title => /^Blog:.*/ # Match all pages starting with blog
65
- :pagename => 'Recent Blog Entries',
66
- :author => 'Automatic Blog Watcher',
67
- :max_pages_to_show => 10 # Only show the ten most recent blogs
68
- :lines_to_include => 20 # Show the first 20 lines of each blog entry
69
- :only_new_pages =>true,
70
- :sort_pages_by => :created_on,
71
- :include_metadata => true,
72
- :reverse_sort => true,
73
- })
74
- </code>
75
- </pre>
76
-
77
- If you have any other ideas or examples, please add them here
40
+ Tag: Include this page in the distribution
@@ -1,7 +1,7 @@
1
1
  h1. Automatic linking between pages
2
2
 
3
- Any reference to the title of another page in the wiki will be automatically linked. e.g. home page is linked to the home page.
4
-
5
- The links are made left to right, top to bottom, with the longest possible link made at any given time.
3
+ Any reference to the title of another page in the wiki will be automatically linked. e.g. home page is linked to the home page. The longest possible links are made first.
6
4
 
7
5
  The easiest way to create a new page (if your browser supports it - I can only positively say that Safari does) is to highlight the text you want to link from and press ctrl-n.
6
+
7
+ Tag: Include this page in the distribution
@@ -1,9 +1,16 @@
1
+ h1. Bug competing edits
2
+
1
3
  I had a case today where I was evidently editing a page at the same time someone else was. He won and my edits were trashed upon save. (Or at least this is what I surmise happened.)
2
4
 
3
5
  Is this possible? --Bil
4
6
 
5
7
  Umm, trashed on save? I hope not. I hope that if you look at the 'show all changes' for the page it will show both edits in the history? I *seriously* want to know if they are not.
6
8
 
9
+ p(. I was paying more attention this time. Two of us were editing the same page.
10
+ I saved my changes, and they showed up on the page.
11
+ Next, he saved his changes, and my changes were removed (but still available
12
+ via the "show all changes"). --Bil
13
+
7
14
  As for a solution. There seem to be two routes:
8
15
  # Put a 'lock' on the page, so that only one person can see the edit view at once.
9
16
  # Try and merge competing edits.
@@ -11,3 +18,5 @@ As for a solution. There seem to be two routes:
11
18
  I would prefer to merge, but don't know how to implement...
12
19
 
13
20
  --tamc2
21
+
22
+ Tag: Include this page in the distribution
@@ -1 +1,3 @@
1
1
  Currently tells the browser to not cache any page. This is wasteful of bandwidth and increases server load. Should handle the if-modified-since request headers to return 'not modified' messages instead.
2
+
3
+ Tag: Include this page in the distribution
@@ -0,0 +1,17 @@
1
+ The email:
2
+
3
+ first-second@somewhere.com
4
+
5
+ results in the link
6
+
7
+ ==mailto:second@somewhere.com==
8
+
9
+ The workaround is to type
10
+
11
+ =="first-second@somewhere.com":mailto:first-second@somewhere.com==
12
+
13
+ like
14
+
15
+ "first-second@somewhere.com":mailto:first-second@somewhere.com
16
+
17
+ Tag: Include this page in the distribution
@@ -0,0 +1,3 @@
1
+ Seems like having an email adress in a page title causes problems with linking to that page.
2
+
3
+ Tag: Include this page in the distribution
@@ -1 +1,3 @@
1
- It seems that Ruby GEM limits filename lengths, which means there is a limit on title lengths. I am unclear what the limit for filename length is? and how this varies by platform?
1
+ It seems that Ruby GEM limits filename lengths, which means there is a limit on title lengths. It appears to be done so that the files work correctly on the windows platform.
2
+
3
+ Tag: Include this page in the distribution
@@ -0,0 +1,13 @@
1
+ There appears to be a memory leak.
2
+
3
+ Not sure what triggers it, and whether it occurs in any versions appart from the one in the CVS.
4
+
5
+ Spotted on this site (www.soks.org) where over a period of a couple of weeks, memory use grew from 47M to 102M. This is a problem for this site as only 64M of virtual memory is available, and so the larger size causes a slow down through swapping.
6
+
7
+ Will investiagate, and would appreciate other reports if anyone has a similar experience.
8
+
9
+ --tamc2
10
+
11
+ This hasn't repeated after that first time. It may have just ben a temporary blip. I'd appreciate any other reports --tamc2
12
+
13
+ Tag: Include this page in the distribution
@@ -0,0 +1,13 @@
1
+ The pages that link here sidebar may not appear if you:
2
+ # Run a soks wiki
3
+ # Shutdown the wiki gracefully so that it saves its caches
4
+ # Modify a wiki page off-line (everything is ok if you add a page)
5
+ # Restart the wiki and it succesfully reloads its caches
6
+
7
+ There are two workarounds:
8
+ # Either delete the caches before restarting in step 4 above
9
+ # Or edit any page in the wiki after restart. The pages that link here sidebar will then reappear.
10
+
11
+ Not sure yet as to the cause of this bug, but it doesn't seem to be a showstopper so I'm going to release v1-0-0 anyway. --tamc
12
+
13
+ Tag: Include this page in the distribution
@@ -31,3 +31,7 @@ A paragraph
31
31
  A paragraph not kept separate
32
32
 
33
33
  # Blah
34
+
35
+ This is possibly a bug with Redcloth rather than soks.
36
+
37
+ Tag: Include this page in the distribution
@@ -19,3 +19,5 @@ If it happens, could you let me know:
19
19
  Thanks
20
20
 
21
21
  tamc2
22
+
23
+ Tag: Include this page in the distribution
@@ -1 +1,3 @@
1
1
  Page inserts like @[ [insert other page]]@ should not insert another page if they are surrounded by notextile tags (or code, or pre?).
2
+
3
+ Tag: Include this page in the distribution
@@ -1,6 +1,6 @@
1
1
  h1. Congratulations, you have installed SOKS
2
2
 
3
- Welcome to Soks. It is yet another wiki, written in ruby. Please bear in mind that it is alpha, and therefore do not trust your mission critical sites to it. Please feel free to use and adapt, the soks licence is free and liberal (although if you feel like contributing towards a new mac for the author that would be apreciated).
3
+ Welcome to Soks. It is yet another wiki, written in ruby. Please bear in mind that it is beta. Feel free to use and adapt, the soks licence is free and liberal (although if you feel like contributing towards a new mac for the author that would be apreciated).
4
4
 
5
5
  p{background:yellow;padding:10px;}. A limited selection of help and bug reports are included here. For more information, and to share experiences, please visit http://www.soks.org. If you are upgrading, you may wish to look at the list of changes.
6
6
 
@@ -18,3 +18,5 @@ h2. Feedback
18
18
  * To keep track of developments, you may wish to subscribe to the mailing list at http://rubyforge.org/projects/soks.
19
19
 
20
20
  [[insert picture of a pair of soks]]
21
+
22
+ Tag: Include this page in the distribution
@@ -2,7 +2,7 @@ h1. Adjusting the settings
2
2
 
3
3
  Take a look at the start.rb file in your wiki folder. This can be used to change the settings such as port and url of this site, and to enable more advanced features such as calendars and automatic summaries.
4
4
 
5
- h2. To restart your wiki
5
+ h2. To start your wiki
6
6
 
7
7
  The soks-create-wiki.rb script will have created a folder in the directory in which you ran it (by default the folder is 'soks-wiki'). In that folder is a script 'start.rb' run it.
8
8
  <code>
@@ -10,16 +10,28 @@ cd soks-wiki
10
10
  ruby start.rb
11
11
  </code>
12
12
 
13
+ h2. To stop your wiki
14
+
15
+ If you've started the wiki as above, then hold down the ctrl key and press c.
16
+
17
+ If you have run the wiki as a daemon, or using nohup, then you will need to find the process id of the wiki. This can be found by @top@ or @ps -e | grep ruby@. In the first instance, try @kill -INT 123@ where 123 is the number found from top or ps. That will try and make the wiki gracefully shut down. If that doesn't work @kill -KILL 123@ will force the wiki to halt immediately.
18
+
13
19
  h2. To make your site accessible beyond localhost
14
20
 
15
- Open start.rb in your directory. Un-comment the lines
21
+ Open start.rb in your directory. Find the line:
16
22
 
17
23
  <code>
18
- # :url => 'http://localhost:8000',
19
- # :port => 8000,
24
+ view = View.new( wiki, "http://localhost:8000", "#{root_directory}/views" )
20
25
  </code>
21
26
 
22
- and replace them with the url and port you wish the wiki to run on.
27
+ and replace the url with the url and port you wish the wiki to run on.
28
+
29
+ Then replace
30
+ <code>
31
+ server = WEBrick::HTTPServer.new(:Port => 8000 )
32
+ </code>
33
+
34
+ with the port you wish the wiki to run on.
23
35
 
24
36
  h2. To password protect your wiki.
25
37
 
@@ -31,17 +43,15 @@ Edit template/start.rb in the directory where soks was installed.
31
43
 
32
44
  h2. To change how often the wiki checks the content directory for any changes.
33
45
 
34
- Open start.rb and add this to your CUSTOM_SETTINGS hash:
35
- <code>:check_files_every => 60, # Seconds</code>
36
-
37
- h2. To add a calendar and upcoming events page:
38
-
39
- Open start.rb and uncomment:
46
+ Open start.rb and change this line:
40
47
  <code>
41
- # calendar = AutomaticCalendar.new( wiki ) # Adds a series of calendar pages to the wiki
42
- # AutomaticUpcomingEvents.new( wiki, calendar ) # Creates a page with the next weeks events drawn from the calendar pages
48
+ wiki.check_files_every = :min
43
49
  </code>
44
50
 
51
+ Acceptable values are nil (never), :sec, :min, :hour, :day
52
+
45
53
  h2. To add a page that summarises other pages:
46
54
 
47
55
  See Automatic summaries
56
+
57
+ Tag: Include this page in the distribution
@@ -4,7 +4,7 @@ If you develop any improvements to the layout and style of this wiki, and are wi
4
4
 
5
5
  h2. Changing the logo on the right
6
6
 
7
- The logo can be changed by replacing logo.tif in the in the attachment folder of the wiki you have created ( soks-wiki/attachment/logo.tif by default)
7
+ The logo can be changed by replacing logo.jpg in the in the attachment folder of the wiki you have created ( soks-wiki/attachment/logo.tif by default)
8
8
 
9
9
  h2. Changing the color scheme
10
10
 
@@ -28,3 +28,5 @@ Note that you must restart soks for changes to the template to take effect.
28
28
  h2. Changing the default styles for NEW wikis
29
29
 
30
30
  To change the style and layout of new wikis created using the soks-create-wiki.rb command, then edit the 'template' directory of wherever you installed soks.
31
+
32
+ Tag: Include this page in the distribution
@@ -1,5 +1,25 @@
1
1
  h1. How to export a site from this wiki
2
2
 
3
+ h2. How to export as html
4
+
5
+ Modify your start.rb file to include:
6
+ <pre>
7
+ <code>
8
+ require 'helpers/wiki2html'
9
+ Wiki2Html.new( wiki, view,
10
+ :views_to_copy => ['view','meta','rss'],
11
+ :extension => '.html',
12
+ :destination_dir => '/Users/tamc2/Sites',
13
+ :destination_url => 'http://localhost/~tamc2')
14
+ </code>
15
+ </pre>
16
+
17
+ Where desitination_dir should be the directory you wish to export the html to, and destination_url should be the base_url you wish to use in the exported pages (could be just '/').
18
+
19
+ When you restart the wiki it will then maintain an html copy of the wiki in that directory.
20
+
21
+ h2. How to export the raw data
22
+
3
23
  The contents of this site are stored in flat files in the 'contents' folder of this wiki (soks-wiki/contents by default). They are the ones with the .textile ending. Should be pretty easy to transfer them to wherever you need.
4
24
 
5
25
  The authors, and change history of each page are stored in the same folder with a yaml extension. These are yaml'd files that contain many documents. Each document contains a single revision. Each revision is an array of [ revision number, changes, author, creation time ]. The changes is an array of change groups. Each change group is an array of changed lines. There may be several documents with the same revision number. The last document with a particular revision number is the 'definative' one.
@@ -58,3 +78,5 @@ Hello%20World.yaml might contain
58
78
  - What a beautiful world
59
79
  -
60
80
  </pre>
81
+
82
+ Tag: Include this page in the distribution
@@ -19,3 +19,5 @@ Steps:
19
19
  # @cvs -z3 -d:pserver:anonymous@rubyforge.org:/var/cvs/soks checkout soks@
20
20
  # Soks will now download...
21
21
  # @cd soks@ and play.
22
+
23
+ Tag: Include this page in the distribution
@@ -59,3 +59,5 @@ The WikiServlet deals with file uploads by separately writing the uploaded file
59
59
  h4. soks-helpers.rb
60
60
 
61
61
  These are a series of classes that may be optionally loaded by a wiki's start.rb script. They receive notifications of page changes from the View object and can use this information to update other pages in the wiki. See automatic summaries for a little more detail.
62
+
63
+ Tag: Include this page in the distribution
@@ -11,3 +11,5 @@ h1. How to import a site from instiki
11
11
  # Start the wiki <code>ruby soks-wiki/start.rb</code>
12
12
 
13
13
  Your instiki content should then appear. Note that all the links still work, but that all the pages have their WikiWord names.
14
+
15
+ Tag: Include this page in the distribution
@@ -1,6 +1,6 @@
1
- *The basic question:* How can I import data into Soks? (both pages and attachments)
1
+ h1. How to import data into a Soks wiki
2
2
 
3
- h2. Scenario
3
+ *The basic question:* How can I import data into Soks? (both pages and attachments)
4
4
 
5
5
  I have a table worth of information that I would like to load into my Soks wiki. Each row of the table will become a page and each row has a PDF file associated with it.
6
6
 
@@ -38,8 +38,4 @@ A third alternative would be to use DRb (e.g. write @require 'drb'@ @DRb.start_
38
38
 
39
39
  fn1. Changes detected by looking at the file's timestamp, not its content.
40
40
 
41
- ----
42
-
43
- Puzzled by Textile's non-rendering of the paragraph break between my signature above and Tom's "Yes. Comments:" --Bil
44
-
45
- I've had a little look and seems to be an interaction between the pre tag and the following list. Corrected here and noted at Bug: Textile mishandles paragraphs. I think it is Redcloth, so will report there.
41
+ Tag: Include this page in the distribution
@@ -29,3 +29,5 @@ ruby Soks-x.x.x/bin/soks-create-wiki.rb
29
29
  </pre>
30
30
 
31
31
  ...and then surf to http://localhost:8000
32
+
33
+ Tag: Include this page in the distribution
@@ -4,40 +4,50 @@ You can specify what authentication to be used based on a regular expression mat
4
4
 
5
5
  Open @start.rb@ in your wiki directory. Un-comment and edit the authenticators section and edit the array. The format is [ [ first regexp to match against title, authenticator to use ], [ second regexp to match against title, authenticator to use ] ... ]. For example:
6
6
 
7
- * The following matches against all the standard 'non editing commands' and doesn't ask for any authentication:
7
+ h2. No authentication
8
+
9
+ The following matches against all the standard 'non editing commands' and doesn't ask for any authentication:
8
10
 
9
11
  <code>[ %r{/(view|rss|print|find|meta)/.*}, WEBrick::HTTPAuth::NoAuthenticationRequired.new ]</code>
10
12
 
11
- * The following doesn't permit any file or picture uploads:
13
+ h2. No uploads
14
+
15
+ The following doesn't permit any file or picture uploads:
12
16
 
13
17
  <code>[ %r{/upload/.*}, WEBrick::HTTPAuth::NotPermitted.new ]</code>
14
18
 
15
- * The following asks for a site wide password to edit or save changes to the home page:
19
+ h2. Site wide password
20
+
21
+ The following asks for a site wide password to edit or save changes to the home page:
16
22
 
17
23
  <code>[ %r{/(edit|save)/home page}, WEBrick::HTTPAuth::SiteWidePassword.new('password','You need to enter the site wide password to edit the home page') ]</code>
18
24
 
19
- * The following uses the standard WEBrick authentication system on any page whose name starts with private. The standard WEBrick authentication uses a database of usernames and passwords. See [[ Gnome's Guide => http://shogo.homelinux.org/~ysantoso/webrickguide/html/html_webrick.html ]] for details.
25
+ h2. Per-user passwords
26
+
27
+ The following uses the standard WEBrick authentication system on any page whose name starts with private. The standard WEBrick authentication uses a database of usernames and passwords. See [[ Gnome's Guide => http://shogo.homelinux.org/~ysantoso/webrickguide/html/html_webrick.html ]] for details.
20
28
 
21
29
  <code>[ %r{/(view|edit|save)/private.*},WEBrick::HTTPAuth::BasicAuth.new( :UserDB => htpasswd, :Realm => realm ) ]</code>
22
30
 
23
- * The following is the default. For any page it just asks for a username, but the password can be left blank.
31
+ The following is the default. For any page it just asks for a username, but the password can be left blank.
24
32
 
25
33
  <code>[ %r{.*}, WEBrick::HTTPAuth::AskForUserName.new( 'No password, just enter a name') ]</code>
34
+ BasicAuth isn't very secure as it transfers passwords over plaintext. If you can cope with some incompatability with very old browsers, DigestAuth is more secure. To implement DigestAuth:
26
35
 
27
- * BasicAuth isn't very secure as it transfers passwords over plaintext. If you can cope with some incompatability with very old browsers, DigestAuth is more secure. To implement DigestAuth:
28
36
  # run this command: @htdigest -c /path/to/your/soks-wiki/htdigest "name of your realm" yourusername@ and enter your password. On gentoo, the full path is @/usr/sbin/htdigest2@
29
37
  # Add this line into start.rb, inside the authenticators= block: @[ %r{/(view|edit|save)/private.*},WEBrick::HTTPAuth::DigestAuth.new( :UserDB => WEBrick::HTTPAuth::Htdigest.new('/path/to/your/soks-wiki/htdigest'), :Realm => "name of your realm") ]@
30
- # Uncomment this line: @:authenticators => authenticators@
31
- -- Skorgu
32
38
 
33
- Note a big bug is that viewing attached images and files is NOT password protected. This will be fixed in version 0.0.6.
39
+ h2. Multiple authentication systems
40
+
41
+ To further-complicate your login woes, there is a nifty trick you can pull with the way Soks does its authentications. Because it creates a separate instance of the authenticator for each regexp, you can stack 'em :) Say you want to restrict viewing to those who have an account, but you don't want everyone to be able to edit. The first step is to create two htdigest files. One will have those who can read, the other those who can write. When you make these files, ensure that the realms are identical. Now assign the htdigest.write to the (edit|save) bits, and the htdigest.read to the (view|print|etc) bits. The annoying bit is that users who can edit need to be added to both files, but it makes up for it by users not having to login again when they want to edit.
34
42
 
35
43
  ----
36
44
 
37
- Is there any means to changing the authentication on the fly like how the editable "sidebar page" works? (Have a "master" page that is access controlled, on which one would put other page links that would then become access controlled.) --Bil
45
+ h2. Suggestions / The future
38
46
 
39
- ----
47
+ Is there any means to changing the authentication on the fly like how the editable "sidebar page" works? (Have a "master" page that is access controlled, on which one would put other page links that would then become access controlled.) --Bil
40
48
 
41
49
  Can someone point me to an example (or outline the steps) to having the user names checked for validity by an LDAP server ? (Note: I asked a similar question on the Webricken mailing list.) --Bil
42
50
 
43
51
  Not used LDAP myself, but the example at http://dataspill.org/posts/show/4 seems to show how one might communicate with the LDAP server to check valididty. This would need to be inserted into a WEBrick authenticator. If you just duplicate the code of an existing WEBrick authenticator (e.g. 1.8/webrick/httpauth/basicath.rb) you should be able to do a few tweaks to the authenticate method to get what you want. --tamc2
52
+
53
+ Tag: Include this page in the distribution