citadel.mdwn 13 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268
  1. Citadel FAQ, see admin section: <http://citadel.org/doku.php?id=faq:start>.
  2. Especially this item is important: <http://citadel.org/doku.php/faq:installation:apacheproxy#how.can.i.install.webcit.so.it.runs.alongside.apache.nginx.lighthttpd.on.port.80.443>
  3. Various guides for installing Citadel, try to follow them in parallel. Maybe
  4. start by making a summary containing all the points, to make it easier to follow
  5. and help me write my own guide.
  6. Also note times - more recent is probably more reliable.
  7. - <http://www.linuxjournal.com/article/9357>
  8. - <http://www.ducky-pond.com/posts/2012/Jul/installing-citadel-on-rpi/>
  9. - <https://library.linode.com/email/citadel/debian-6-squeeze>
  10. - <http://linuxaria.com/howto/how-to-install-citadel-collaboration-suite-on-debian-7>
  11. - <http://www.citadel.org/doku.php/installation:debian>
  12. Also, lighttpd seems to mostly use a forum rather than mailing list, but maybe
  13. if I register to the Redmine I can make e-mail updates work.
  14. <http://redmine.lighttpd.net/projects/lighttpd/boards/2>
  15. Translate WebCit to Hebrew: <http://citadel.org/doku.php/documentation:customize_webcit#wordingtranslating>
  16. # My Steps
  17. I currently have exim4-light installed, because some packages require an SMTP
  18. server and exim is the default. I think Debian's reportbug does. Maybe something
  19. else too. Anyway, installing Citadel uninstalls Exim.
  20. In addition to IMAP and SMTP I'm going to need a way to insert all the mail from
  21. the various providers into my server. I'm going to use a lightweight Fetchmail
  22. alternative for this.
  23. Let's start.
  24. ## 1 WebCit access in lighttpd
  25. Before I start, I'm going to assume WebCit, the web interface for Citadel users,
  26. will run *locally* on port 8081 and lighttpd will be a proxy for it. This allows
  27. it to be access on port 80 through lighttpd.
  28. However, lighttpd's mod_proxy cannot connect to SSL ports, which means that
  29. WebCit has to run on the same server lighttpd runs, or there will be no
  30. encryption. For now I run them on the same machine anyway, but WebCit will have
  31. its own subdomain. For now let's assume it's *mail*. Here's the example from the
  32. lighttpd section in the FAQ linked above:
  33. [[!format perl """
  34. $HTTP["host"] =~ "(^|\.)subdomain\.domain\.tld$" { # domain name regex for vhost
  35. # Use $HTTP["host"] == "subdomain.domain.tld" { if you don't want to use a regex.
  36. proxy.server = ( "" => ( ( # the "" means to forward all file extensions, it's kind of weird.
  37. # If you for some reason have multiple webcit hosts or local webcit processes, you can make more ( "host" => "", "port" => "" ) entries in here.
  38. "host" => "127.0.0.1", # citadel is likely running locally, note that mod_proxy forces an IP here and you cannot use a hostname.
  39. "port" => "8081" # port webcit is running on
  40. # Note that you must put the plain HTTP version of webcit here, mod_proxy cannot connect to ssl ports.
  41. # If your server has SSL engine enabled, you'll be able to connect over ssl, but the proxy will not be connecting over ssl.
  42. # If webcit is running on another server (and not on the same LAN),
  43. # this defeats the purpose of connecting over ssl as it wouldn't be encrypted past lighttpd.
  44. ) ) )
  45. }
  46. """]]
  47. See lighttpd.conf for my final setup (includes requiring SSL and mod_proxy
  48. enabled using `lighty-enable-mod`, i.e. linked in `conf.d`.).
  49. Basically it works like this:
  50. [[!format perl """
  51. $HTTP["host"] =~ "^(mail\.partager\.null|mail\.partager\.i2p)$" {
  52. proxy.server = ( "" => ( ( "host" => "127.0.0.1", "port" => "8081" ) ) )
  53. }
  54. """]]
  55. Now an I2P server tunnel can be created.
  56. Now an SSL cert for the new domain is needed.
  57. I think we're ready for installation. I'm choosing a tutorial to follow.
  58. # Hostname
  59. I have no idea whether this is needed or why. But I wrote 'partager.null' in
  60. /etc/hostname and ran `service hostname.sh start`. Don't ask me what it does.
  61. I also edited /etc/hosts but I'm not sure it's needed since regular DNS can be
  62. used for this. Anyway, the tutorial says. Maybe Citadel uses it, who knows.
  63. Installation: The tutorial's command installs spam assassin and amavisd but:
  64. 1. I need to read about spam fighting first
  65. 2. I don't need an anti virus, or at least I hope so
  66. I'm starting with `apt-get install citadel-suite citadel-doc`.
  67. It will ask questions. My answers:
  68. - Listen address – 0.0.0.0
  69. - Authentication method – Internal
  70. - Citadel administrator username – Not admin, for security use an alternate username (I used janitor)
  71. - Citadel Administrator Password – Something safe, usual rule to generate a safe password should be used
  72. - Integration with Apache webservers – Internal, since we'll use Lighttpd
  73. - Webcit HTTP port – 80 if you are not running another web server, 8080 otherwise (I use 8081)
  74. - Webcit HTTPS port – 443 if you are not running another web server, 4343 otherwise (I use 4343)
  75. - Limit Webcit’s login language selection  – User Defined (or just choose a language if your users are all from a specific language) (I made it user-defined, but there's no Hebrew - maybe I should help translate)
  76. You may see erros if you already have a Jabber server, because Citadel will want
  77. to use port 5222 which is already taken. In my case I have Prosody, so I'm going
  78. to disable Citadel's Jabber server (at least for now). It can be done in WebCit
  79. under "Admin->System Preferences->Network".
  80. Now edit `/etc/default/webcit` and update the port numbers - for some reason
  81. they aren't picked up from the debian configurator.
  82. Edit /etc/mailname to contain the fqdn (mine is partager.null, but again I still
  83. don't know when it is required - perhaps for auto-generated SSL cert or
  84. something).
  85. Now we need to take care of SSL. Rename the /etc/ssl/citadel folder into
  86. citadel-orig or something, and we'll make new cert and key with TinyCA. Looks
  87. like they need to be placed where the original ones were. Maybe there's a config
  88. for that but we'll see later. We need a key file and a cer file.
  89. Note that the CN needs to be the fqdn, partager.null. It means yet another one
  90. with this CN which is very confusing, so I'll use some pseudo-comment in one of
  91. the fields to make it clear this one is for citadel.
  92. Now let's customize the login banner in `/etc/citadel/messages/hello`. Original
  93. content is:
  94. Welcome to ^humannode!
  95. This logon banner resides in ^bbsdir/hello -- please customize it for your site.
  96. Maybe those ^ things are some way to insert variables, e.g. humannode is the
  97. human readable name of the Citadel node. Just guessing though. Anyway I'm
  98. leaving the first line as is, just removing the second line.
  99. Okay, time to restart Citadel to apply all the config we did:
  100. service citadel restart
  101. service webcit restart
  102. Again the first one brings error because of Prosody running. But now I should be
  103. able to go to WebCit and disable the Jabber component.
  104. Now go to the WebCit webpage and login. You can either use localhost:8081
  105. (or 4343) or the I2P tunnel. Using the clearnet with SSL is possible too of
  106. course, and is probably the best to do here, but I'm not sure about the
  107. subdomain name so the certificate validation will be broken. Let's try anyway,
  108. to make sure it's the only thing that doesn't work. Oh wait, I can't because I
  109. also need a DNS record for the subdomain... forget it, I'll use I2P for now. Of
  110. course JS is still needed.
  111. Problem: Both Midori and Epiphany fail to execute the login button JS. Trying
  112. Iceweasel too... oh, there it is. My first screenshot was incorrect. A popup
  113. is supposed to show up, like in the Linuxaria tutorial. I'm adding a task below
  114. to disable the login that uses OpenID, google, yahoo and aol. Disgusting. Maybe
  115. OpenID a bit less, but still centralized. I prefer to edit hardcoded HTML than
  116. let that stuff be there!
  117. Strange, I can't log in. It can't find user 'janitor'. Same error for 'admin'.
  118. Did debconf read *any* settings I gave it, at all?
  119. But wait. Before I re-run the configuration, let's turn off Prosody and see if
  120. it helps.
  121. Good news, another tutorial mentions the issue and explains how to solve.
  122. Great, problem solved with the Rpi tutorial. I managed to log in with WebCit.
  123. Now disabling the Jabber. Hmmm can't find it. Strange. How am I supposed to
  124. disable it then?
  125. Oops, I missed it somehow. Here it is.
  126. The full list of ports:
  127. <http://citadel.org/doku.php/faq:favoriteclient:general_configuring>. Right now
  128. I choose to open just these in the router:
  129. - Port 25 for local delivery of mail from outside to my users
  130. - Port 587 for users to send mail via StartTLS
  131. - Port 995 for POP via SSL
  132. - Port 143 for IMAP either unencrypted or StartTLS
  133. There's an issue with the mailing lists: It looks like new users get their fresh
  134. email address instead of just subscribing to "rooms". If there's no way to
  135. change that, the only solution is to turn off Citadel's mailing and make it just
  136. a BBS. Then I'll need Exim and Dovecot. I need to decide how useful those rooms
  137. really are - while they do provide a forum-like UI, can't the same be done with
  138. other software with more configurable UI and features?
  139. Anyway, adding MX record. Also looks like I need PTR to bypass spam filters, but
  140. reg.for.free doesn't offer it so I'm adding just to my own DNS. MX goes to both.
  141. Okay, done with that.
  142. I checked the BBS again, looks like it could be nicer to have a hackable
  143. solution that integrates with mailing lists. But wait a second, it actually
  144. seems now that I just missed some features. Look:
  145. <http://citadel.org/doku.php/faq:everydayuse:what_if_someone_wants_to_make_a_room_into_a_mailing_list_can_we_do_that#how.do.i.create.a.mailing.list.or.distribution.list>
  146. If this is fully functional mailing lists, it's okay. But I still want to try
  147. the following:
  148. 1. Use Syndie forums, try them again - because it's distributed
  149. 2. See if I can make ikiwiki easy for users to use as a forum with mail
  150. notifications support and mail replies (e.g. write scripts to implement that)
  151. 3. Read about forum and BBS software and mailing lists - e.g. looks like Sympa
  152. has integrated web view of the mailing list
  153. By the way, WebCit also relies on JS which I don't like. And the only other way
  154. is a console client most people won't handle.
  155. Now, last step - I need to feed my IMAP server with input from my existing mail
  156. accounts. A lightweight fetchmail alternative.
  157. I chose and installed mpop when I found this, which is integrated into Citadel:
  158. <http://www.citadel.org/doku.php/faq:favoriteclient:how_do_i_retrieve>. It means
  159. Citadel can download mail with POP3 from other mailboxes and insert it into any
  160. room I choose - in particular the Mail room. Let's try with fr33domlover at
  161. inventati.
  162. I also added an RSS feed there - nice bonus since then I get the feeds remotely
  163. from anywhere.
  164. POTENTIAL PROBLEM: I can't find an option to control use of SSL/TLS for this
  165. thing. mpop can handle it, but what does Citadel do? Guess the port? I don't
  166. like this. __TODO__. If I don't find a solution, I'll ask. If no good answer,
  167. I'll use mpop instead (but can still use the RSS feature, it's nice).
  168. One more thing, I want to ask a question on Citadel's own BBS - why not connect
  169. to them with my own Citadel? See how it's done exactly and safely. I want to
  170. avoid making a new account and using my own local user+pass to post there.
  171. Another issue, how do filtering rules work now? Can't share them between
  172. clients. On the other hand I'd depend on WebCit's JS for this... but fine.
  173. Another way is to keep them on single client (home). Just make sure it can
  174. properly edit the folder contents, and later other clients (work, mobile) get
  175. updated content. Procmail can't be a global solution, at least not from
  176. commandline, unless mail users get SSH access to the server for editing their
  177. procmail config. Actually, there it is - WebCit lets you configure server side
  178. mail filtering. But if it can be done from Claws, it's better.
  179. # Alias
  180. [[DONE|TODO/CLOSED]] consider whether akrasner should be alias of fr33domlover or a
  181. separate account. If I use filtering into IMAP folders, I'll either need to make
  182. is an alias or configure fr33domlover's folders to be shared with akrasner - see
  183. if possible. __DECISION__: I'll try to make them aliases. One account will
  184. receive the email and the other will be just for sending, i.e. configured with
  185. same password and with SMTP but without POP/IMAP at all (I can e.g. use POP and
  186. just leave the server empty and remove it from GetMail so it's never used).
  187. -------------------------
  188. I don't have any answers yet but I managed to connect with POP to mail new
  189. mailbox and the RSS aggregation works too. Unfortunately it's very
  190. unconfigurable, e.g. I can't choose how many messages to prefetch. But maybe it
  191. won't matter. For now it just works.
  192. In the mailing list config the URL for subscription is wrong in my case. The
  193. real one is <http://mail.partager.i2p/listsub> or the clearnet counterpart. This
  194. is what I should publish on the wiki.
  195. __TODO__:
  196. - Make the POP aggregation work with StartTLS or SSL by using mpop
  197. - Make the mail alias work, i.e. SMTP with akrasner - check again if works now
  198. - OUTGOING PORT 25 MAY BE FAILING - check it and maybe contact ISP to solve this