Add file upload functionality

Adds an :allow_uploads wiki option, an --allow-uploads flag to
bin/gollum, an "Upload" button with a file upload dialog, and a
handler to commit uploaded files into the repository.

:allow_uploads defaults to false, to prevent unauthenticated users
from uploading arbitrary files into the repository (albeit only in
the uploads directory).

This code is based on the patch from @l3iggs at
https://github.com/gollum/gollum/issues/694, but the handling on the
backend is completely rewritten to use the Committer infrastructure.
This commit is contained in:
Abhijit Menon-Sen
2013-07-15 16:38:47 +05:30
parent 4627a39165
commit 183840b793
6 changed files with 108 additions and 2 deletions
+4
View File
@@ -39,6 +39,10 @@ module Precious
@editable
end
def allow_uploads
@allow_uploads
end
def has_header
@header = (@page.header || false) if @header.nil?
!!@header