complete last paragraph
[ikiwiki] / doc / bugs / Anon_edit_caused_lock_out_on_entire_site_.mdwn
1 Probably caused by something misconfigured about the [[plugins/comments]] plugin.
2
3 ---
4
5 ## Config
6
7 My setup file:
8
9     # comments plugin
10     # PageSpec of pages where comments are allowed
11     comments_pagespec: forum/* or blog/posts/* or tarefa/*
12     # PageSpec of pages where posting new comments is not allowed
13     comments_closed_pagespec: ''
14     # Base name for comments, e.g. "comment_" for pages like "sandbox/comment_12"
15     comments_pagename: comment_
16     # Interpret directives in comments?
17     #comments_allowdirectives: 0
18     # Allow anonymous commenters to set an author name?
19     comments_allowauthor: 1
20     # commit comments to the VCS
21     comments_commit: 1
22     # Restrict formats for comments to (no restriction if empty)
23     comments_allowformats: mdwn txt
24
25 The `moderatedcomments` plugins is **not** enabled
26
27 The `anonok` plugin is **not** enabled
28
29 > What are your complete `add_plugins` and `disable_plugins` options?
30 > Which version of ikiwiki are you running? Are you using any third-party
31 > plugins or patches? --[[smcv]]
32
33 >> Pasted [[here|addplugins]]
34
35 >>> I asked three questions and you gave one answer. Please answer the
36 >>> other two questions. --[[smcv]]
37
38 ---
39
40 ## Steps
41
42 I've tried to place a comment clicking in the obvious [Add a comment](https://dev.iikb.org/ikiwiki.cgi?do=comment&page=forum%2FTema_bootstrap) in a [forum post](https://dev.iikb.org/forum/Tema_bootstrap/).
43
44 I've not signed in because the *sign in* page didn't come up, instead a simple `(You might want to Signin first?)` showed up, which I've haven't read and commented away.
45
46 ---
47
48 ## Results
49
50 As a consequence of that, the user '' - that's a null character, have somehow logged in and it seems that there is no way to [log it out](https://dev.iikb.org/ikiwiki.cgi?do=prefs).
51
52 None of this phantom user edits are being commited - this [blog post](https://dev.iikb.org/blog/posts/Bug_severo_neste_site/) was made with that user logged in via web.
53
54 It seems I can't log out from nowhere. I've rebuild the wiki from the command line and restarted the nginx server, the phantom user remains logged in and open to anyone willing to edit away the wiki.
55
56 > I wonder whether this might be caused by the combination of the `httpauth` plugin
57 > with the nginx web server. `httpauth` is known to work correctly with Apache,
58 > but you might be the first to use it with nginx.
59 >
60 > Specifically, I wonder whether `$cgi->remote_user()` might be returning the
61 > empty string. Looking at the code, we expect it to be either a non-empty
62 > username, or `undef`.
63 >
64 > Please try installing this CGI script on your nginx server, making it
65 > executable and accessing its URL without carrying out any special HTTP
66 > authentication (you can delete the script immediately afterwards if
67 > you want). If my theory is right, you will see a line `REMOTE_USER=` in
68 > the output. Post the output somewhere, or mail it to `smcv` at
69 > `debian.org` if you don't want to make it public.
70 >
71 > ```
72 > #!/bin/sh
73 > printf 'Content-type: text/plain\r\n\r\n'
74 > env | LC_ALL=C sort
75 > ```
76 >
77 > If you do not intend to use
78 > [HTTP basic authentication](https://en.wikipedia.org/wiki/Basic_access_authentication),
79 > please do not enable the `httpauth` plugin. That plugin is intended to be used
80 > in conjunction with a web server configured to require HTTP basic authentication
81 > with one of a limited set of authorized usernames.
82 >
83 > --[[smcv]]
84
85 ---
86
87 ## Conclusion
88
89 If I wanted to do a totally anonnymous wiki, this would be the best setup ever.
90
91 For [this particular installation](https://dev.iikb.org), that's not the case.
92
93 ---
94
95 ## Question
96
97 Is there a session file or something to logout this phantom user?
98
99 > See [[tips/inside_dot_ikiwiki]]. `.ikiwiki/userdb` is a Perl Storable file;
100 > there are instructions for inspecting it on that page. `.ikiwiki/sessions.db`
101 > is most likely a Berkeley DB file.
102 >
103 > I would be interested to see the contents of these two files and the complete
104 > `.setup` file. I would also be interested to see a tarball of the entire
105 > wiki source directory, if it isn't excessively large. If you'd be willing to
106 > share them, please contact <mailto:smcv@debian.org>. --[[smcv]]
107
108 >> I think I've sent right away when you asked, anyway I still have the tarball hanging around. The last *iikb* domains will expire next month though, the wiki will only be accessible by mirror <https://notabug.org/iikb/dev.iikb.org>.
109
110 >>> I see from the tarball that you have a lot of uncommitted changes. This is
111 >>> probably because whatever is causing the anonymous accesses to succeed is
112 >>> breaking other code paths by giving them an empty username: in particular
113 >>> it seems reasonably likely that the `git` plugin will refuse to commit
114 >>> changes in that situation.
115 >>>
116 >>> I would expect that you should be getting error messages on the ikiwiki
117 >>> CGI script's `stderr` in this situation. In Apache they would normally
118 >>> end up in `error.log`; I don't know how nginx does logging, but it is
119 >>> probably something similar. Please check that log for relevant-looking
120 >>> error messages. --[[smcv]]