gollum-bibanon 1.4.3 → 1.4.4
Sign up to get free protection for your applications and to get access to all the features.
- data/HISTORY.md +20 -0
- data/README.md +34 -0
- data/{gollum-bibanon.gemspec → gollum.gemspec} +7 -7
- data/lib/gollum.rb +1 -1
- data/lib/gollum/frontend/app.rb +20 -6
- data/lib/gollum/sanitization.rb +1 -1
- data/test/test_app.rb +38 -0
- metadata +7 -7
data/HISTORY.md
CHANGED
@@ -7,6 +7,26 @@
|
|
7
7
|
* Include the language of the code snippet when making a uniquely
|
8
8
|
identifiable sha of a code snippet while rendering a page.
|
9
9
|
|
10
|
+
# 1.4.1 (Bibanon mod) / 2012-02-05
|
11
|
+
|
12
|
+
* Major Enhancements
|
13
|
+
* reversing mediawiki_compat
|
14
|
+
* Minor Enhancements
|
15
|
+
* Fixed incorrect redirect in new versions of sinatra
|
16
|
+
* Bug Fixes
|
17
|
+
* fixed sanitization bug
|
18
|
+
|
19
|
+
# 1.4.0 (Bibanon mod) / 2012-02-04
|
20
|
+
|
21
|
+
* Major Enhancements
|
22
|
+
* Removed Mathjax support
|
23
|
+
* Minor Enhancements
|
24
|
+
* Underscore support in wikipages (for Mediawiki)
|
25
|
+
* Adds OmniAuth username to commit message.
|
26
|
+
* Magnet, IRC, and FTP links now allowed.
|
27
|
+
* Bug Fixes
|
28
|
+
* Some mods to make OmniAuth work better with Gollum (using OmniGollum)
|
29
|
+
|
10
30
|
# 1.3.1 / 2011-07-21
|
11
31
|
|
12
32
|
* Major Enhancements
|
data/README.md
CHANGED
@@ -16,6 +16,40 @@ number of ways depending on your needs. You can edit your wiki locally:
|
|
16
16
|
Gollum follows the rules of [Semantic Versioning](http://semver.org/) and uses
|
17
17
|
[TomDoc](http://tomdoc.org/) for inline documentation.
|
18
18
|
|
19
|
+
### Bibanon
|
20
|
+
|
21
|
+
This is a fork of Gollum used by the Bibliotheca Anonoma. It adds some extra functionality:
|
22
|
+
|
23
|
+
* [OmniAuth integration](https://github.com/github/gollum/pull/181) - Adds support for OmniGollum.
|
24
|
+
* [OmniAuth User Commit Message](https://github.com/treeofsephiroth/gollum/commit/8400ad0749288f658f735625b7c39550134f7586) Adds the username from OmniAuth to a commit message.
|
25
|
+
* [Gollum Pull Request](https://github.com/github/gollum/pull/166)
|
26
|
+
* [Fix `undefined method 'new' for Redcarpet:Module`](https://github.com/github/gollum/pull/271) - Forces the gem to use a working copy of redcarpet, rather than the new one.
|
27
|
+
* [Fix spaces in filenames breaking redirect](https://github.com/github/gollum/pull/249) - New edition of Sinatra uses + signs instead of dashes, breaking redirects.
|
28
|
+
* Magnet links - Now allowed.
|
29
|
+
|
30
|
+
### Wishlist
|
31
|
+
|
32
|
+
Functionalities we hope to implement in the future.
|
33
|
+
|
34
|
+
* Custom CSS - Instead of modding the CSS stylesheet bundled with Gollum, it would be nice to work like Ikiwiki and use a "local.css" file in the git repo, if it exists. It would also be cool if we made a tag that specified custom CSS for a single page.
|
35
|
+
* [Ikiwiki CSS extension](http://ikiwiki.info/css/)
|
36
|
+
|
37
|
+
* Extensions - Would make it possible to safely add extra functionality to wikilink tags, similar to that of Mediawiki Templates or ikiwiki plugins.
|
38
|
+
* [Basic support for extensions on Gollum](https://github.com/github/gollum/pull/58)
|
39
|
+
* [Gists embed implementation](https://github.com/github/gollum/issues/208)
|
40
|
+
|
41
|
+
* Shift JIS extension - Tag to tell gollum to use [monafont](http://monafont.sourceforge.net/index-e.html) on selected text. Should probably use @font-face.
|
42
|
+
* [Font Face Guide](http://sixrevisions.com/css/font-face-guide/)
|
43
|
+
* [Mozilla Font Face Guide](https://developer.mozilla.org/en/CSS/@font-face)
|
44
|
+
* It might help to see how [Google Webfont](https://www.google.com/webfonts) works and implement it in Gollum's CSS
|
45
|
+
|
46
|
+
* Page Locking - Would add ability to lock certain pages to editing. An example would be ikiwiki's page locking mechanism.
|
47
|
+
* [Ikiwiki Lockedit plugin](http://ikiwiki.info/plugins/lockedit/)
|
48
|
+
* File Uploading - Would add the ability to upload some files through the web interface, and implement restrictions to allow only certain extensions of a certain size.
|
49
|
+
* [Ikiwiki Attachments](http://ikiwiki.info/plugins/attachment/)
|
50
|
+
* [Ikiwiki File Checking](http://ikiwiki.info/plugins/filecheck/)
|
51
|
+
* Untrusted Git Push - Yes, this would be perfectly safe. Ikiwiki has the ability to accept commits from anyone in the world. What makes this safe is Ikiwiki's pre-commit checks, which check page locks and upload restrictions to block any change that cannot be done with the web interface.
|
52
|
+
* [Ikiwiki Implementation](http://ikiwiki.info/tips/untrusted_git_push/)
|
19
53
|
|
20
54
|
## INSTALLATION
|
21
55
|
|
@@ -1,15 +1,15 @@
|
|
1
1
|
Gem::Specification.new do |s|
|
2
2
|
s.specification_version = 2 if s.respond_to? :specification_version=
|
3
3
|
s.required_rubygems_version = Gem::Requirement.new(">= 0") if s.respond_to? :required_rubygems_version=
|
4
|
-
s.rubygems_version = '1.
|
4
|
+
s.rubygems_version = '1.3.5'
|
5
5
|
|
6
6
|
s.name = 'gollum-bibanon'
|
7
|
-
s.version = '1.4.
|
7
|
+
s.version = '1.4.4'
|
8
8
|
s.date = '2012-03-22'
|
9
|
-
s.rubyforge_project = 'gollum
|
9
|
+
s.rubyforge_project = 'gollum'
|
10
10
|
|
11
11
|
s.summary = "A simple, Git-powered wiki, with Bibanon mods."
|
12
|
-
s.description = "A simple, Git-powered wiki with a sweet API and local frontend, modded for the Bibliotheca Anonoma. Uses the latest edition of Gollum."
|
12
|
+
s.description = "A simple, Git-powered wiki with a sweet API and local frontend, modded for the Bibliotheca Anonoma. Uses the latest edition of Gollum, adds OmniGollum support, and other cool stuff."
|
13
13
|
|
14
14
|
s.authors = ["Tom Preston-Werner", "Rick Olson", "Tenshi Hinanawi"]
|
15
15
|
s.email = 'cockmomgler@gmail.com'
|
@@ -27,10 +27,10 @@ Gem::Specification.new do |s|
|
|
27
27
|
s.add_dependency('pygments.rb', "~> 0.2.0")
|
28
28
|
s.add_dependency('posix-spawn', "~> 0.3.0")
|
29
29
|
s.add_dependency('sinatra', "~> 1.0")
|
30
|
-
s.add_dependency('mustache', [">= 0.11.2", "< 1.0.0"])
|
30
|
+
s.add_dependency('mustache-bibanon', [">= 0.11.2", "< 1.0.0"])
|
31
31
|
s.add_dependency('sanitize', "~> 2.0.0")
|
32
32
|
s.add_dependency('nokogiri', "~> 1.4")
|
33
|
-
s.add_dependency('redcarpet')
|
33
|
+
s.add_dependency('redcarpet', "~> 1.17.2")
|
34
34
|
|
35
35
|
s.add_development_dependency('RedCloth')
|
36
36
|
s.add_development_dependency('mocha')
|
@@ -50,7 +50,7 @@ Gem::Specification.new do |s|
|
|
50
50
|
Rakefile
|
51
51
|
bin/gollum
|
52
52
|
docs/sanitization.md
|
53
|
-
gollum
|
53
|
+
gollum.gemspec
|
54
54
|
lib/gollum.rb
|
55
55
|
lib/gollum/blob_entry.rb
|
56
56
|
lib/gollum/committer.rb
|
data/lib/gollum.rb
CHANGED
data/lib/gollum/frontend/app.rb
CHANGED
@@ -49,7 +49,7 @@ module Precious
|
|
49
49
|
@content = page.raw_data
|
50
50
|
mustache :edit
|
51
51
|
else
|
52
|
-
|
52
|
+
redirect "/create/#{CGI.escape(@name)}"
|
53
53
|
end
|
54
54
|
end
|
55
55
|
|
@@ -68,7 +68,17 @@ module Precious
|
|
68
68
|
|
69
69
|
redirect "/#{CGI.escape(Gollum::Page.cname(name))}"
|
70
70
|
end
|
71
|
-
|
71
|
+
|
72
|
+
get '/create/*' do
|
73
|
+
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
74
|
+
@name = params[:splat].first
|
75
|
+
if wiki.page(@name)
|
76
|
+
redirect "/#{CGI.escape(@name)}"
|
77
|
+
else
|
78
|
+
mustache :create
|
79
|
+
end
|
80
|
+
end
|
81
|
+
|
72
82
|
post '/create' do
|
73
83
|
name = params[:page]
|
74
84
|
wiki = Gollum::Wiki.new(settings.gollum_path, settings.wiki_options)
|
@@ -77,7 +87,7 @@ module Precious
|
|
77
87
|
|
78
88
|
begin
|
79
89
|
wiki.write_page(name, format, params[:content], commit_message)
|
80
|
-
redirect "/#{CGI.escape(name)}"
|
90
|
+
redirect "/#{CGI.escape(Gollum::Page.cname(name))}"
|
81
91
|
rescue Gollum::DuplicatePageError => e
|
82
92
|
@message = "Duplicate page: #{e.message}"
|
83
93
|
mustache :error
|
@@ -199,8 +209,7 @@ module Precious
|
|
199
209
|
content_type file.mime_type
|
200
210
|
file.raw_data
|
201
211
|
else
|
202
|
-
|
203
|
-
mustache :create
|
212
|
+
redirect "/create/#{CGI.escape(name)}"
|
204
213
|
end
|
205
214
|
end
|
206
215
|
|
@@ -214,7 +223,12 @@ module Precious
|
|
214
223
|
end
|
215
224
|
|
216
225
|
def commit_message
|
217
|
-
|
226
|
+
if self.respond_to?('user_authed?') && user_authed?
|
227
|
+
user = get_user
|
228
|
+
return { :message => params[:message], :name => user.name, :email => user.email}
|
229
|
+
else
|
230
|
+
return { :message => params[:message]}
|
231
|
+
end
|
218
232
|
end
|
219
233
|
end
|
220
234
|
end
|
data/lib/gollum/sanitization.rb
CHANGED
@@ -43,7 +43,7 @@ module Gollum
|
|
43
43
|
|
44
44
|
# Default whitelisted protocols for URLs.
|
45
45
|
PROTOCOLS = {
|
46
|
-
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', :relative]},
|
46
|
+
'a' => {'href' => ['http', 'https', 'mailto', 'ftp', 'irc', 'magnet', :relative]},
|
47
47
|
'img' => {'src' => ['http', 'https', :relative]}
|
48
48
|
}.freeze
|
49
49
|
|
data/test/test_app.rb
CHANGED
@@ -85,6 +85,44 @@ context "Frontend" do
|
|
85
85
|
assert_equal 'def', page.version.message
|
86
86
|
end
|
87
87
|
|
88
|
+
test "redirects to create on non-existant page" do
|
89
|
+
name = "E"
|
90
|
+
get "/#{name}"
|
91
|
+
follow_redirect!
|
92
|
+
assert_equal "/create/#{name}", last_request.fullpath
|
93
|
+
assert last_response.ok?
|
94
|
+
end
|
95
|
+
|
96
|
+
test "edit redirects to create on non-existant page" do
|
97
|
+
name = "E"
|
98
|
+
get "/edit/#{name}"
|
99
|
+
follow_redirect!
|
100
|
+
assert_equal "/create/#{name}", last_request.fullpath
|
101
|
+
assert last_response.ok?
|
102
|
+
end
|
103
|
+
|
104
|
+
test "create redirects to page if already exists" do
|
105
|
+
name = "A"
|
106
|
+
get "/create/#{name}"
|
107
|
+
follow_redirect!
|
108
|
+
assert_equal "/#{name}", last_request.fullpath
|
109
|
+
assert last_response.ok?
|
110
|
+
end
|
111
|
+
|
112
|
+
test "creates pages with escaped characters in title" do
|
113
|
+
post "/create", :content => 'abc', :page => 'Title with spaces',
|
114
|
+
:format => 'markdown', :message => 'foo'
|
115
|
+
assert_equal 'http://example.org/Title-with-spaces', last_response.headers['Location']
|
116
|
+
get "/Title-with-spaces"
|
117
|
+
assert_match /abc/, last_response.body
|
118
|
+
|
119
|
+
post "/create", :content => 'ghi', :page => 'Title/with/slashes',
|
120
|
+
:format => 'markdown', :message => 'bar'
|
121
|
+
assert_equal 'http://example.org/Title-with-slashes', last_response.headers['Location']
|
122
|
+
get "/Title-with-slashes"
|
123
|
+
assert_match /ghi/, last_response.body
|
124
|
+
end
|
125
|
+
|
88
126
|
test "guards against creation of existing page" do
|
89
127
|
name = "A"
|
90
128
|
post "/create", :content => 'abc', :page => name,
|
metadata
CHANGED
@@ -2,7 +2,7 @@
|
|
2
2
|
name: gollum-bibanon
|
3
3
|
version: !ruby/object:Gem::Version
|
4
4
|
prerelease:
|
5
|
-
version: 1.4.
|
5
|
+
version: 1.4.4
|
6
6
|
platform: ruby
|
7
7
|
authors:
|
8
8
|
- Tom Preston-Werner
|
@@ -73,7 +73,7 @@ dependencies:
|
|
73
73
|
type: :runtime
|
74
74
|
version_requirements: *id005
|
75
75
|
- !ruby/object:Gem::Dependency
|
76
|
-
name: mustache
|
76
|
+
name: mustache-bibanon
|
77
77
|
prerelease: false
|
78
78
|
requirement: &id006 !ruby/object:Gem::Requirement
|
79
79
|
none: false
|
@@ -114,9 +114,9 @@ dependencies:
|
|
114
114
|
requirement: &id009 !ruby/object:Gem::Requirement
|
115
115
|
none: false
|
116
116
|
requirements:
|
117
|
-
- -
|
117
|
+
- - ~>
|
118
118
|
- !ruby/object:Gem::Version
|
119
|
-
version:
|
119
|
+
version: 1.17.2
|
120
120
|
type: :runtime
|
121
121
|
version_requirements: *id009
|
122
122
|
- !ruby/object:Gem::Dependency
|
@@ -196,7 +196,7 @@ dependencies:
|
|
196
196
|
version: 0.9.2
|
197
197
|
type: :development
|
198
198
|
version_requirements: *id016
|
199
|
-
description: A simple, Git-powered wiki with a sweet API and local frontend, modded for the Bibliotheca Anonoma. Uses the latest edition of Gollum.
|
199
|
+
description: A simple, Git-powered wiki with a sweet API and local frontend, modded for the Bibliotheca Anonoma. Uses the latest edition of Gollum, adds OmniGollum support, and other cool stuff.
|
200
200
|
email: cockmomgler@gmail.com
|
201
201
|
executables:
|
202
202
|
- gollum
|
@@ -214,7 +214,7 @@ files:
|
|
214
214
|
- Rakefile
|
215
215
|
- bin/gollum
|
216
216
|
- docs/sanitization.md
|
217
|
-
- gollum
|
217
|
+
- gollum.gemspec
|
218
218
|
- lib/gollum.rb
|
219
219
|
- lib/gollum/blob_entry.rb
|
220
220
|
- lib/gollum/committer.rb
|
@@ -391,7 +391,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
391
391
|
version: "0"
|
392
392
|
requirements: []
|
393
393
|
|
394
|
-
rubyforge_project: gollum
|
394
|
+
rubyforge_project: gollum
|
395
395
|
rubygems_version: 1.8.21
|
396
396
|
signing_key:
|
397
397
|
specification_version: 2
|