-
Notifications
You must be signed in to change notification settings - Fork 61
/
config.rb.example
72 lines (64 loc) · 2 KB
/
config.rb.example
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
# Example gollum config with omnigollum authentication
# gollum ../wiki --config config.rb
#
# or run from source with
#
# bundle exec bin/gollum ../wiki/ --config config.rb
# Remove const to avoid
# warning: already initialized constant FORMAT_NAMES
#
# only remove if it's defined.
# constant Gollum::Page::FORMAT_NAMES not defined (NameError)
Gollum::Page.send :remove_const, :FORMAT_NAMES if defined? Gollum::Page::FORMAT_NAMES
# limit to one format
Gollum::Page::FORMAT_NAMES = { :markdown => "Markdown" }
=begin
Valid formats are:
{ :markdown => "Markdown",
:textile => "Textile",
:rdoc => "RDoc",
:org => "Org-mode",
:creole => "Creole",
:rest => "reStructuredText",
:asciidoc => "AsciiDoc",
:mediawiki => "MediaWiki",
:pod => "Pod" }
=end
# Specify the path to the Wiki.
gollum_path = '/home/gollum/wiki'
Precious::App.set(:gollum_path, gollum_path)
# Specify the wiki options.
wiki_options = {
:live_preview => false,
:allow_uploads => true,
:allow_editing => true
}
Precious::App.set(:wiki_options, wiki_options)
# Set as Sinatra environment as production (no stack traces)
Precious::App.set(:environment, :production)
# Setup Omniauth via Omnigollum.
require 'omnigollum'
require 'omniauth-ldap'
options = {
# OmniAuth::Builder block is passed as a proc
:providers => Proc.new do
provider :ldap,
:host => '127.0.0.1',
:port => 389,
:method => :plain,
:base => 'dc=example,dc=com',
:uid => 'uid',
:bind_dn => 'cn=manager,dc=example,dc=com',
:password => 'password'
end,
:dummy_auth => false,
# Make the entire wiki private
:protected_routes => ['/*'],
# Specify committer name as just the user name
:author_format => Proc.new { |user| user.name },
# Specify committer e-mail as just the user e-mail
:author_email => Proc.new { |user| user.email }
}
# :omnigollum options *must* be set before the Omnigollum extension is registered
Precious::App.set(:omnigollum, options)
Precious::App.register Omnigollum::Sinatra