About Download Docs Changes

REMOTE_USER from Basic Auth as Author

On the Install-page under "Private wiki" it says:

"You can simply configure your web server to require a password when accessing the wiki. Hatta will even fill in the user name in the editor automatically from that information!"

But I could not make that work, I would get either get the Author filled in from a cookie or it would be my IP adress.

Applying this patch made it work as I expected:

--- a/hatta.py
+++ b/hatta.py
@@ -862,6 +862,8 @@ class WikiRequest(werkzeug.BaseRequest, werkzeug.ETagRequestMixin):
     def get_author(self):
         author = (self.form.get("author")
                   or werkzeug.url_unquote(self.cookies.get("author", ""))
+                  or (self.environ.has_key('REMOTE_USER')
+                      and self.environ['REMOTE_USER'])
                   or self.remote_addr)
         return author

(As you probably can tell, I have no experience with Python; I don't know the right idiom for "get a value from a dictionary if the key exists" :-).)


You are right, somehow I have missed that – it was intended to be there. Fixed in the current development version. – Radomir Dopieralski


Are the double dots in that commit intentional? environ..get? – asjo


No, I didn;t test before commit, my mistake, it should be ok in this version now. Sorry.


No problem, I am very impressed by your prompt changes/fixes/comments/answers/etc. - so thank you – asjo


Fixed Bugs