installation.html 14KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  3. "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
  4. <html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
  5. <head>
  6. <title></title>
  7. <!-- 2014-10-26 Sun 22:02 -->
  8. <meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
  9. <meta name="generator" content="Org-mode" />
  10. <meta name="author" content="Bob Mottram" />
  11. <meta name="description" content="Turn the Beaglebone Black into a personal communications server"
  12. />
  13. <meta name="keywords" content="freedombox, debian, beaglebone, red matrix, email, web server, home server, internet, censorship, surveillance, social network, irc, jabber" />
  14. <style type="text/css">
  15. <!--/*--><![CDATA[/*><!--*/
  16. .title { text-align: center; }
  17. .todo { font-family: monospace; color: red; }
  18. .done { color: green; }
  19. .tag { background-color: #eee; font-family: monospace;
  20. padding: 2px; font-size: 80%; font-weight: normal; }
  21. .timestamp { color: #bebebe; }
  22. .timestamp-kwd { color: #5f9ea0; }
  23. .right { margin-left: auto; margin-right: 0px; text-align: right; }
  24. .left { margin-left: 0px; margin-right: auto; text-align: left; }
  25. .center { margin-left: auto; margin-right: auto; text-align: center; }
  26. .underline { text-decoration: underline; }
  27. #postamble p, #preamble p { font-size: 90%; margin: .2em; }
  28. p.verse { margin-left: 3%; }
  29. pre {
  30. border: 1px solid #ccc;
  31. box-shadow: 3px 3px 3px #eee;
  32. padding: 8pt;
  33. font-family: monospace;
  34. overflow: auto;
  35. margin: 1.2em;
  36. }
  37. pre.src {
  38. position: relative;
  39. overflow: visible;
  40. padding-top: 1.2em;
  41. }
  42. pre.src:before {
  43. display: none;
  44. position: absolute;
  45. background-color: white;
  46. top: -10px;
  47. right: 10px;
  48. padding: 3px;
  49. border: 1px solid black;
  50. }
  51. pre.src:hover:before { display: inline;}
  52. pre.src-sh:before { content: 'sh'; }
  53. pre.src-bash:before { content: 'sh'; }
  54. pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
  55. pre.src-R:before { content: 'R'; }
  56. pre.src-perl:before { content: 'Perl'; }
  57. pre.src-java:before { content: 'Java'; }
  58. pre.src-sql:before { content: 'SQL'; }
  59. table { border-collapse:collapse; }
  60. caption.t-above { caption-side: top; }
  61. caption.t-bottom { caption-side: bottom; }
  62. td, th { vertical-align:top; }
  63. th.right { text-align: center; }
  64. th.left { text-align: center; }
  65. th.center { text-align: center; }
  66. td.right { text-align: right; }
  67. td.left { text-align: left; }
  68. td.center { text-align: center; }
  69. dt { font-weight: bold; }
  70. .footpara:nth-child(2) { display: inline; }
  71. .footpara { display: block; }
  72. .footdef { margin-bottom: 1em; }
  73. .figure { padding: 1em; }
  74. .figure p { text-align: center; }
  75. .inlinetask {
  76. padding: 10px;
  77. border: 2px solid gray;
  78. margin: 10px;
  79. background: #ffffcc;
  80. }
  81. #org-div-home-and-up
  82. { text-align: right; font-size: 70%; white-space: nowrap; }
  83. textarea { overflow-x: auto; }
  84. .linenr { font-size: smaller }
  85. .code-highlighted { background-color: #ffff00; }
  86. .org-info-js_info-navigation { border-style: none; }
  87. #org-info-js_console-label
  88. { font-size: 10px; font-weight: bold; white-space: nowrap; }
  89. .org-info-js_search-highlight
  90. { background-color: #ffff00; color: #000000; font-weight: bold; }
  91. /*]]>*/-->
  92. </style>
  93. <link rel="stylesheet" type="text/css"
  94. href="http://sachachua.com/blog/wp-content/themes/sacha-v3/foundation/css/foundation.min.css"></link>
  95. <link rel="stylesheet" type="text/css" href="http://sachachua.com/org-export.css"></link>
  96. <link rel="stylesheet" type="text/css" href="http://sachachua.com/blog/wp-content/themes/sacha-v3/style.css"></link>
  97. <script type="text/javascript">
  98. /*
  99. @licstart The following is the entire license notice for the
  100. JavaScript code in this tag.
  101. Copyright (C) 2012-2013 Free Software Foundation, Inc.
  102. The JavaScript code in this tag is free software: you can
  103. redistribute it and/or modify it under the terms of the GNU
  104. General Public License (GNU GPL) as published by the Free Software
  105. Foundation, either version 3 of the License, or (at your option)
  106. any later version. The code is distributed WITHOUT ANY WARRANTY;
  107. without even the implied warranty of MERCHANTABILITY or FITNESS
  108. FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
  109. As additional permission under GNU GPL version 3 section 7, you
  110. may distribute non-source (e.g., minimized or compacted) forms of
  111. that code without the copy of the GNU GPL normally required by
  112. section 4, provided you include this license notice and a URL
  113. through which recipients can access the Corresponding Source.
  114. @licend The above is the entire license notice
  115. for the JavaScript code in this tag.
  116. */
  117. <!--/*--><![CDATA[/*><!--*/
  118. function CodeHighlightOn(elem, id)
  119. {
  120. var target = document.getElementById(id);
  121. if(null != target) {
  122. elem.cacheClassElem = elem.className;
  123. elem.cacheClassTarget = target.className;
  124. target.className = "code-highlighted";
  125. elem.className = "code-highlighted";
  126. }
  127. }
  128. function CodeHighlightOff(elem, id)
  129. {
  130. var target = document.getElementById(id);
  131. if(elem.cacheClassElem)
  132. elem.className = elem.cacheClassElem;
  133. if(elem.cacheClassTarget)
  134. target.className = elem.cacheClassTarget;
  135. }
  136. /*]]>*///-->
  137. </script>
  138. </head>
  139. <body>
  140. <div id="preamble" class="status">
  141. <a name="top" id="top"></a>
  142. </div>
  143. <div id="content">
  144. <h1 class="title"></h1>
  145. <div class="center">
  146. <div class="figure">
  147. <p><img src="./images/logo.png" alt="logo.png" />
  148. </p>
  149. </div>
  150. </div>
  151. <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  152. <colgroup>
  153. <col class="left" />
  154. <col class="left" />
  155. <col class="left" />
  156. <col class="left" />
  157. <col class="left" />
  158. </colgroup>
  159. <tbody>
  160. <tr>
  161. <td class="left"><a href="index.html">Home</a></td>
  162. <td class="left"><a href="#unnumbered-1">Download the code</a></td>
  163. <td class="left"><a href="#unnumbered-2">On a Beaglebone Black</a></td>
  164. <td class="left"><a href="#unnumbered-3">On other hardware</a></td>
  165. <td class="left"><a href="#unnumbered-4">Internet Router</a></td>
  166. </tr>
  167. </tbody>
  168. </table>
  169. <div id="outline-container-unnumbered-1" class="outline-2">
  170. <h2 id="unnumbered-1">Download the code</h2>
  171. <div class="outline-text-2" id="text-unnumbered-1">
  172. <p>
  173. Firstly you'll need to download the code as follows:
  174. </p>
  175. <div class="org-src-container">
  176. <pre class="src src-bash">sudo apt-get install git
  177. git clone https://github.com/bashrc/freedombone
  178. <span class="org-builtin">cd</span> freedombone
  179. </pre>
  180. </div>
  181. </div>
  182. </div>
  183. <div id="outline-container-unnumbered-2" class="outline-2">
  184. <h2 id="unnumbered-2">On a Beaglebone Black</h2>
  185. <div class="outline-text-2" id="text-unnumbered-2">
  186. <p>
  187. To get started you will need:
  188. </p>
  189. <ul class="org-ul">
  190. <li>A Beaglebone Black
  191. </li>
  192. <li>A MicroSD card
  193. </li>
  194. <li>Ethernet cable
  195. </li>
  196. <li>Optionally a 5V 2A power supply for the Beaglebone Black
  197. </li>
  198. <li>Access to the internet via a router with ethernet sockets
  199. </li>
  200. <li>USB thumb drive (for backups or storing media)
  201. </li>
  202. <li>One or more subdomains created on <a href="https://freedns.afraid.org/">https://freedns.afraid.org/</a>
  203. </li>
  204. <li>A purchased domain name and SSL certificate (only needed for Red Matrix)
  205. </li>
  206. <li>A laptop or desktop machine with the ability to write to a microSD card (might need an adaptor)
  207. </li>
  208. </ul>
  209. <p>
  210. You will also need to know, or find out, the IP address of your internet router and have a suitable static IP address for the Beaglebone on your local network. The router should allow you to forward ports to the Beaglebone (often this is under firewall or "advanced" settings).
  211. </p>
  212. <p>
  213. Check that within <b>initial_setup.sh</b> the router IP address and static IP for the Beaglebone are set correctly.
  214. </p>
  215. <p>
  216. Plug the microSD card into your laptop/desktop and then run the <b>initial_setup.sh</b> script. For example:
  217. </p>
  218. <div class="org-src-container">
  219. <pre class="src src-bash">./initial_setup.sh /dev/sdX
  220. </pre>
  221. </div>
  222. <p>
  223. where <b>/dev/sdX</b> is the device name for the microSD card. Often it's <b>/dev/sdb</b> or <b>/dev/sdc</b>, depending upon how many drives there are on your system. The script will download the Debian installer and update the microSD card. It can take a while, so be patient.
  224. </p>
  225. <p>
  226. When the initial setup is done follow the instructions on screen to run the main Freedombone script. You can either edit the variables within the <b>install-freedombone.sh</b> script directly, or create a separate configuration file called <b>freedombone.cfg</b> which contains those variables. Variables which you might want to put into a <b>freedombone.cfg</b> file are:
  227. </p>
  228. <div class="org-src-container">
  229. <pre class="src src-bash"><span class="org-variable-name">MY_EMAIL_ADDRESS</span>=
  230. <span class="org-variable-name">MY_NAME</span>=
  231. <span class="org-variable-name">MY_BLOG_TITLE</span>=
  232. <span class="org-variable-name">MY_BLOG_SUBTITLE</span>=
  233. <span class="org-variable-name">SSH_PORT</span>=
  234. <span class="org-variable-name">FULLBLOG_DOMAIN_NAME</span>=
  235. <span class="org-variable-name">FULLBLOG_FREEDNS_SUBDOMAIN_CODE</span>=
  236. <span class="org-variable-name">MICROBLOG_DOMAIN_NAME</span>=
  237. <span class="org-variable-name">MICROBLOG_FREEDNS_SUBDOMAIN_CODE</span>=
  238. <span class="org-variable-name">REDMATRIX_DOMAIN_NAME</span>=
  239. <span class="org-variable-name">OWNCLOUD_DOMAIN_NAME</span>=
  240. <span class="org-variable-name">OWNCLOUD_FREEDNS_SUBDOMAIN_CODE</span>=
  241. <span class="org-variable-name">WIKI_TITLE</span>=
  242. <span class="org-variable-name">WIKI_DOMAIN_NAME</span>=
  243. <span class="org-variable-name">WIKI_FREEDNS_SUBDOMAIN_CODE</span>=
  244. <span class="org-variable-name">MY_GPG_PUBLIC_KEY</span>=
  245. <span class="org-variable-name">MY_GPG_PRIVATE_KEY</span>=
  246. <span class="org-variable-name">PUBLIC_MAILING_LIST</span>=
  247. <span class="org-variable-name">ROUTE_THROUGH_TOR</span>=no
  248. <span class="org-variable-name">LOCAL_NETWORK_STATIC_IP_ADDRESS</span>=192.168.1.60
  249. </pre>
  250. </div>
  251. <p>
  252. The GPG public/private key variables are for the filenames of exported GPG keys, and if a private key filename is given then it will be automatically shredded after import.
  253. </p>
  254. <p>
  255. The FreeDNS subdomain codes can be found under "Dynamic DNS" and "quick cron example". On the last line it will be the string located between the '?' and the '==' characters.
  256. </p>
  257. <p>
  258. The syntax of the <b>install-freedombone.sh</b> script is:
  259. </p>
  260. <div class="org-src-container">
  261. <pre class="src src-bash">./install-freedombone.sh [domain name] [username] [FreeDNS subdomain code] [optional variant type]
  262. </pre>
  263. </div>
  264. <p>
  265. If you don't specify a variant type with the final option then everything will be installed. If you have a <b>freedombone.cfg</b> file then it should be in the same directory as <b>install-freedombone.sh</b>.
  266. </p>
  267. <p>
  268. Installation is not quick, and depends upon which variant you choose and your internet bandwidth. Allow about three hours for a full installation on the Beaglebone Black. On the Beaglebone installation is in two parts, since a reboot is needed to enable the hardware random number generator and zram.
  269. </p>
  270. <p>
  271. When done you can ssh into the Freedombone with:
  272. </p>
  273. <div class="org-src-container">
  274. <pre class="src src-bash">ssh username@domain -p 2222
  275. </pre>
  276. </div>
  277. <p>
  278. Any manual post-installation setup instructions or passwords can be found in <b>/home/username/README</b>. You should remove any passwords from that file and store them within a password manager such as KeepassX.
  279. </p>
  280. </div>
  281. </div>
  282. <div id="outline-container-unnumbered-3" class="outline-2">
  283. <h2 id="unnumbered-3">On other hardware</h2>
  284. <div class="outline-text-2" id="text-unnumbered-3">
  285. <p>
  286. It's also possible to install Freedombone onto other hardware, such as an old laptop or other type of single board computer. Any system with a fresh installation of Debian Jessie will do. Just make sure that you change the variable INSTALLING_ON_BBB to "no" within <b>freedombone.cfg</b> or the <b>install-freedombone.sh</b> script. Obviously, you don't need to run the <b>initial_setup.sh</b> script on non-Beaglebone systems.
  287. </p>
  288. </div>
  289. </div>
  290. <div id="outline-container-unnumbered-4" class="outline-2">
  291. <h2 id="unnumbered-4">Internet Router</h2>
  292. <div class="outline-text-2" id="text-unnumbered-4">
  293. <p>
  294. On your internet router, typically under firewall settings, open the following ports and forward them to the Freedombone.
  295. </p>
  296. <table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
  297. <colgroup>
  298. <col class="left" />
  299. <col class="right" />
  300. </colgroup>
  301. <thead>
  302. <tr>
  303. <th scope="col" class="left">Service</th>
  304. <th scope="col" class="right">Ports</th>
  305. </tr>
  306. </thead>
  307. <tbody>
  308. <tr>
  309. <td class="left">HTTP</td>
  310. <td class="right">80</td>
  311. </tr>
  312. <tr>
  313. <td class="left">HTTPS</td>
  314. <td class="right">443</td>
  315. </tr>
  316. <tr>
  317. <td class="left">SSH</td>
  318. <td class="right">2222</td>
  319. </tr>
  320. <tr>
  321. <td class="left">DLNA</td>
  322. <td class="right">1900</td>
  323. </tr>
  324. <tr>
  325. <td class="left">DLNA</td>
  326. <td class="right">8200</td>
  327. </tr>
  328. <tr>
  329. <td class="left">XMPP</td>
  330. <td class="right">5222..5223</td>
  331. </tr>
  332. <tr>
  333. <td class="left">XMPP</td>
  334. <td class="right">5269</td>
  335. </tr>
  336. <tr>
  337. <td class="left">XMPP</td>
  338. <td class="right">5280..5281</td>
  339. </tr>
  340. <tr>
  341. <td class="left">IRC</td>
  342. <td class="right">6697</td>
  343. </tr>
  344. <tr>
  345. <td class="left">IRC</td>
  346. <td class="right">9999</td>
  347. </tr>
  348. <tr>
  349. <td class="left">Git</td>
  350. <td class="right">9418</td>
  351. </tr>
  352. <tr>
  353. <td class="left">Email</td>
  354. <td class="right">25</td>
  355. </tr>
  356. <tr>
  357. <td class="left">Email</td>
  358. <td class="right">587</td>
  359. </tr>
  360. <tr>
  361. <td class="left">Email</td>
  362. <td class="right">465</td>
  363. </tr>
  364. <tr>
  365. <td class="left">Email</td>
  366. <td class="right">993</td>
  367. </tr>
  368. </tbody>
  369. </table>
  370. </div>
  371. </div>
  372. </div>
  373. <div id="postamble" class="status">
  374. <style type="text/css">
  375. .back-to-top {
  376. position: fixed;
  377. bottom: 2em;
  378. right: 0px;
  379. text-decoration: none;
  380. color: #000000;
  381. background-color: rgba(235, 235, 235, 0.80);
  382. font-size: 12px;
  383. padding: 1em;
  384. display: none;
  385. }
  386. .back-to-top:hover {
  387. background-color: rgba(135, 135, 135, 0.50);
  388. }
  389. </style>
  390. <div class="back-to-top">
  391. <a href="#top">Back to top</a> | <a href="mailto:bob@robotics.uk.to">E-mail me</a>
  392. </div>
  393. <script type="text/javascript">
  394. var offset = 220;
  395. var duration = 500;
  396. jQuery(window).scroll(function() {
  397. if (jQuery(this).scrollTop() > offset) {
  398. jQuery('.back-to-top').fadeIn(duration);
  399. } else {
  400. jQuery('.back-to-top').fadeOut(duration);
  401. }
  402. });
  403. </script>
  404. </div>
  405. </body>
  406. </html>