freedombone/website/installation.html

544 lines
19 KiB
HTML

<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title></title>
<!-- 2014-12-26 Fri 15:11 -->
<meta http-equiv="Content-Type" content="text/html;charset=utf-8" />
<meta name="generator" content="Org-mode" />
<meta name="author" content="Bob Mottram" />
<meta name="description" content="Turn the Beaglebone Black into a personal communications server"
/>
<meta name="keywords" content="freedombox, debian, beaglebone, red matrix, email, web server, home server, internet, censorship, surveillance, social network, irc, jabber" />
<style type="text/css">
<!--/*--><![CDATA[/*><!--*/
.title { text-align: center; }
.todo { font-family: monospace; color: red; }
.done { color: green; }
.tag { background-color: #eee; font-family: monospace;
padding: 2px; font-size: 80%; font-weight: normal; }
.timestamp { color: #bebebe; }
.timestamp-kwd { color: #5f9ea0; }
.right { margin-left: auto; margin-right: 0px; text-align: right; }
.left { margin-left: 0px; margin-right: auto; text-align: left; }
.center { margin-left: auto; margin-right: auto; text-align: center; }
.underline { text-decoration: underline; }
#postamble p, #preamble p { font-size: 90%; margin: .2em; }
p.verse { margin-left: 3%; }
pre {
border: 1px solid #ccc;
box-shadow: 3px 3px 3px #eee;
padding: 8pt;
font-family: monospace;
overflow: auto;
margin: 1.2em;
}
pre.src {
position: relative;
overflow: visible;
padding-top: 1.2em;
}
pre.src:before {
display: none;
position: absolute;
background-color: white;
top: -10px;
right: 10px;
padding: 3px;
border: 1px solid black;
}
pre.src:hover:before { display: inline;}
pre.src-sh:before { content: 'sh'; }
pre.src-bash:before { content: 'sh'; }
pre.src-emacs-lisp:before { content: 'Emacs Lisp'; }
pre.src-R:before { content: 'R'; }
pre.src-perl:before { content: 'Perl'; }
pre.src-java:before { content: 'Java'; }
pre.src-sql:before { content: 'SQL'; }
table { border-collapse:collapse; }
caption.t-above { caption-side: top; }
caption.t-bottom { caption-side: bottom; }
td, th { vertical-align:top; }
th.right { text-align: center; }
th.left { text-align: center; }
th.center { text-align: center; }
td.right { text-align: right; }
td.left { text-align: left; }
td.center { text-align: center; }
dt { font-weight: bold; }
.footpara:nth-child(2) { display: inline; }
.footpara { display: block; }
.footdef { margin-bottom: 1em; }
.figure { padding: 1em; }
.figure p { text-align: center; }
.inlinetask {
padding: 10px;
border: 2px solid gray;
margin: 10px;
background: #ffffcc;
}
#org-div-home-and-up
{ text-align: right; font-size: 70%; white-space: nowrap; }
textarea { overflow-x: auto; }
.linenr { font-size: smaller }
.code-highlighted { background-color: #ffff00; }
.org-info-js_info-navigation { border-style: none; }
#org-info-js_console-label
{ font-size: 10px; font-weight: bold; white-space: nowrap; }
.org-info-js_search-highlight
{ background-color: #ffff00; color: #000000; font-weight: bold; }
/*]]>*/-->
</style>
<link rel="stylesheet" type="text/css"
href="http://sachachua.com/blog/wp-content/themes/sacha-v3/foundation/css/foundation.min.css"></link>
<link rel="stylesheet" type="text/css" href="http://sachachua.com/org-export.css"></link>
<link rel="stylesheet" type="text/css" href="http://sachachua.com/blog/wp-content/themes/sacha-v3/style.css"></link>
<script type="text/javascript">
/*
@licstart The following is the entire license notice for the
JavaScript code in this tag.
Copyright (C) 2012-2013 Free Software Foundation, Inc.
The JavaScript code in this tag is free software: you can
redistribute it and/or modify it under the terms of the GNU
General Public License (GNU GPL) as published by the Free Software
Foundation, either version 3 of the License, or (at your option)
any later version. The code is distributed WITHOUT ANY WARRANTY;
without even the implied warranty of MERCHANTABILITY or FITNESS
FOR A PARTICULAR PURPOSE. See the GNU GPL for more details.
As additional permission under GNU GPL version 3 section 7, you
may distribute non-source (e.g., minimized or compacted) forms of
that code without the copy of the GNU GPL normally required by
section 4, provided you include this license notice and a URL
through which recipients can access the Corresponding Source.
@licend The above is the entire license notice
for the JavaScript code in this tag.
*/
<!--/*--><![CDATA[/*><!--*/
function CodeHighlightOn(elem, id)
{
var target = document.getElementById(id);
if(null != target) {
elem.cacheClassElem = elem.className;
elem.cacheClassTarget = target.className;
target.className = "code-highlighted";
elem.className = "code-highlighted";
}
}
function CodeHighlightOff(elem, id)
{
var target = document.getElementById(id);
if(elem.cacheClassElem)
elem.className = elem.cacheClassElem;
if(elem.cacheClassTarget)
target.className = elem.cacheClassTarget;
}
/*]]>*///-->
</script>
</head>
<body>
<div id="preamble" class="status">
<a name="top" id="top"></a>
</div>
<div id="content">
<h1 class="title"></h1>
<div class="center">
<div class="figure">
<p><img src="./images/logo.png" alt="logo.png" />
</p>
</div>
</div>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="left" />
<col class="left" />
<col class="left" />
<col class="left" />
<col class="left" />
</colgroup>
<tbody>
<tr>
<td class="left"><a href="index.html">Home</a></td>
<td class="left"><a href="#unnumbered-1">Download the code</a></td>
<td class="left"><a href="#unnumbered-2">On a Beaglebone Black</a></td>
<td class="left"><a href="#unnumbered-3">On a laptop/PC/netbook</a></td>
<td class="left"><a href="#unnumbered-4">Internet Router</a></td>
</tr>
</tbody>
</table>
<div id="outline-container-unnumbered-1" class="outline-2">
<h2 id="unnumbered-1">Download the code</h2>
<div class="outline-text-2" id="text-unnumbered-1">
<p>
Firstly you'll need to download the code as follows:
</p>
<div class="org-src-container">
<pre class="src src-bash">sudo apt-get install git
git clone https://github.com/bashrc/freedombone
<span class="org-builtin">cd</span> freedombone
</pre>
</div>
</div>
</div>
<div id="outline-container-unnumbered-2" class="outline-2">
<h2 id="unnumbered-2">On a Beaglebone Black</h2>
<div class="outline-text-2" id="text-unnumbered-2">
<p>
To get started you will need:
</p>
<ul class="org-ul">
<li>A Beaglebone Black
</li>
<li>A MicroSD card
</li>
<li>Ethernet cable
</li>
<li>Optionally a 5V 2A power supply for the Beaglebone Black
</li>
<li>Access to the internet via a router with ethernet sockets
</li>
<li>USB thumb drive (for backups or storing media)
</li>
<li>One or more subdomains created on <a href="https://freedns.afraid.org/">https://freedns.afraid.org/</a>
</li>
<li>A purchased domain name and SSL certificate (only needed for Red Matrix)
</li>
<li>A laptop or desktop machine with the ability to write to a microSD card (might need an adaptor)
</li>
</ul>
<p>
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).
</p>
<p>
Check that within <b>initial_setup.sh</b> the router IP address and static IP for the Beaglebone are set correctly.
</p>
<p>
Plug the microSD card into your laptop/desktop and then run the <b>initial_setup.sh</b> script. For example:
</p>
<div class="org-src-container">
<pre class="src src-bash">./initial_setup.sh /dev/sdX
</pre>
</div>
<p>
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.
</p>
<p>
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:
</p>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-variable-name">MY_EMAIL_ADDRESS</span>=&lt;your email address&gt;
<span class="org-variable-name">MY_NAME</span>=&lt;your name/nick/pseudonym&gt;
<span class="org-variable-name">MY_BLOG_TITLE</span>=&lt;title of your blog&gt;
<span class="org-variable-name">MY_BLOG_SUBTITLE</span>=&lt;subtitle of your blog&gt;
<span class="org-variable-name">SSH_PORT</span>=2222
<span class="org-variable-name">FULLBLOG_DOMAIN_NAME</span>=&lt;freedns subdomain for your blog&gt;
<span class="org-variable-name">FULLBLOG_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your blog&gt;
<span class="org-variable-name">MICROBLOG_DOMAIN_NAME</span>=&lt;domain name for your microblog&gt;
<span class="org-variable-name">MICROBLOG_FREEDNS_SUBDOMAIN_CODE</span>=1234
<span class="org-variable-name">REDMATRIX_DOMAIN_NAME</span>=&lt;domain name for your Red Matrix site&gt;
<span class="org-variable-name">OWNCLOUD_DOMAIN_NAME</span>=&lt;freedns subdomain for your Owncloud site&gt;
<span class="org-variable-name">OWNCLOUD_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your Owncloud site&gt;
<span class="org-variable-name">WIKI_TITLE</span>=&lt;title of your wiki&gt;
<span class="org-variable-name">WIKI_DOMAIN_NAME</span>=&lt;freedns subdomain for your wiki&gt;
<span class="org-variable-name">WIKI_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your wiki&gt;
<span class="org-variable-name">MY_GPG_PUBLIC_KEY</span>=&lt;exported public key filename&gt;
<span class="org-variable-name">MY_GPG_PRIVATE_KE</span>=&lt;exported private key filename&gt;
<span class="org-variable-name">PUBLIC_MAILING_LIST</span>=&lt;name of your mailing list&gt;
<span class="org-variable-name">LOCAL_NETWORK_STATIC_IP_ADDRESS</span>=192.168.1.60
<span class="org-variable-name">ROUTER_IP_ADDRESS</span>=192.168.1.254
</pre>
</div>
<p>
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.
</p>
<p>
The <a href="https://freedns.afraid.org/">FreeDNS</a> 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.
</p>
<p>
The syntax of the <b>install-freedombone.sh</b> script is:
</p>
<div class="org-src-container">
<pre class="src src-bash">./install-freedombone.sh &lt;your wiki domain name&gt; &lt;your username&gt; &lt;your wiki FreeDNS domain code&gt; [optional variant type]
</pre>
</div>
<p>
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>.
</p>
<p>
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.
</p>
<p>
When done you can ssh into the Freedombone with:
</p>
<div class="org-src-container">
<pre class="src src-bash">ssh username@domain -p 2222
</pre>
</div>
<p>
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.
</p>
</div>
</div>
<div id="outline-container-unnumbered-3" class="outline-2">
<h2 id="unnumbered-3">On a laptop/PC/netbook</h2>
<div class="outline-text-2" id="text-unnumbered-3">
<p>
It's also possible to install Freedombone onto other hardware, including other types 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.
</p>
<ul class="org-ul">
<li>Download the <a href="https://www.debian.org/devel/debian-installer">Debian Jessie "netinst" installer</a>
</li>
<li>Use <a href="https://apps.ubuntu.com/cat/applications/usb-creator-gtk/">Startup Disk Creator</a> or <a href="https://en.wikipedia.org/wiki/UNetbootin">Unetbootin</a> to copy the netinst image to a USB thumb drive
</li>
<li>Connect the machine to your internet router using an ethernet patch lead. Freedombone is a fully free (as in freedom) system and so wifi drivers may not work. A wired network connection will give better performance anyway.
</li>
<li>On the target machine boot from the USB drive and go through the installation. It's a good idea to use LVM and disk encryption together with a long passphrase which will be hard to crack by brute force methods. Keep a note of the passphrase in your password manager.
</li>
<li>Within the installer unselect the <b>print server</b> and select the <b>ssh server</b>
</li>
<li>After installation use ssh to access the machine and become the root user
</li>
</ul>
<div class="org-src-container">
<pre class="src src-bash">ssh username@192.168.1.60
su
</pre>
</div>
<ul class="org-ul">
<li>If you have GPG keys you may wish to transfer them to the <b>/home/usernname</b> directory. If the machine has a second USB socket or an SD card slot then that may be the most secure way to do it.
</li>
<li>Run the following commands:
</li>
</ul>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-builtin">cd</span> /home/&lt;username&gt;
apt-get install git
git clone https://github.com/bashrc/freedombone
<span class="org-builtin">cd</span> freedombone
nano freedombone.cfg
</pre>
</div>
<ul class="org-ul">
<li>Now create a configuration file, such as the following, filling in the details for your <a href="https://freedns.afraid.org/">FreeDNS subdomains</a>.
</li>
</ul>
<div class="org-src-container">
<pre class="src src-bash"><span class="org-variable-name">INSTALLING_ON_BBB</span>=no
<span class="org-variable-name">MY_EMAIL_ADDRESS</span>=&lt;your email address&gt;
<span class="org-variable-name">MY_NAME</span>=&lt;your name/nick/pseudonym&gt;
<span class="org-variable-name">MY_BLOG_TITLE</span>=&lt;title of your blog&gt;
<span class="org-variable-name">MY_BLOG_SUBTITLE</span>=&lt;subtitle of your blog&gt;
<span class="org-variable-name">SSH_PORT</span>=2222
<span class="org-variable-name">FULLBLOG_DOMAIN_NAME</span>=&lt;freedns subdomain for your blog&gt;
<span class="org-variable-name">FULLBLOG_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your blog&gt;
<span class="org-variable-name">MICROBLOG_DOMAIN_NAME</span>=&lt;domain name for your microblog&gt;
<span class="org-variable-name">MICROBLOG_FREEDNS_SUBDOMAIN_CODE</span>=1234
<span class="org-variable-name">REDMATRIX_DOMAIN_NAME</span>=&lt;domain name for your Red Matrix site&gt;
<span class="org-variable-name">OWNCLOUD_DOMAIN_NAME</span>=&lt;freedns subdomain for your Owncloud site&gt;
<span class="org-variable-name">OWNCLOUD_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your Owncloud site&gt;
<span class="org-variable-name">WIKI_TITLE</span>=&lt;title of your wiki&gt;
<span class="org-variable-name">WIKI_DOMAIN_NAME</span>=&lt;freedns subdomain for your wiki&gt;
<span class="org-variable-name">WIKI_FREEDNS_SUBDOMAIN_CODE</span>=&lt;freedns subdomain code for your wiki&gt;
<span class="org-variable-name">MY_GPG_PUBLIC_KEY</span>=&lt;exported public key filename&gt;
<span class="org-variable-name">MY_GPG_PRIVATE_KE</span>=&lt;exported private key filename&gt;
<span class="org-variable-name">PUBLIC_MAILING_LIST</span>=&lt;name of your mailing list&gt;
<span class="org-variable-name">LOCAL_NETWORK_STATIC_IP_ADDRESS</span>=192.168.1.60
<span class="org-variable-name">ROUTER_IP_ADDRESS</span>=192.168.1.254
</pre>
</div>
<ul class="org-ul">
<li>Save and exit, then run:
</li>
</ul>
<div class="org-src-container">
<pre class="src src-bash">./install-freedombone.sh &lt;your wiki domain name&gt; &lt;your username&gt; &lt;your wiki FreeDNS domain code&gt;
</pre>
</div>
</div>
</div>
<div id="outline-container-unnumbered-4" class="outline-2">
<h2 id="unnumbered-4">Internet Router</h2>
<div class="outline-text-2" id="text-unnumbered-4">
<p>
On your internet router, typically under firewall settings, open the following ports and forward them to the Freedombone.
</p>
<table border="2" cellspacing="0" cellpadding="6" rules="groups" frame="hsides">
<colgroup>
<col class="left" />
<col class="right" />
</colgroup>
<thead>
<tr>
<th scope="col" class="left">Service</th>
<th scope="col" class="right">Ports</th>
</tr>
</thead>
<tbody>
<tr>
<td class="left">HTTP</td>
<td class="right">80</td>
</tr>
<tr>
<td class="left">HTTPS</td>
<td class="right">443</td>
</tr>
<tr>
<td class="left">SSH</td>
<td class="right">2222</td>
</tr>
<tr>
<td class="left">DLNA</td>
<td class="right">1900</td>
</tr>
<tr>
<td class="left">DLNA</td>
<td class="right">8200</td>
</tr>
<tr>
<td class="left">XMPP</td>
<td class="right">5222..5223</td>
</tr>
<tr>
<td class="left">XMPP</td>
<td class="right">5269</td>
</tr>
<tr>
<td class="left">XMPP</td>
<td class="right">5280..5281</td>
</tr>
<tr>
<td class="left">IRC</td>
<td class="right">6697</td>
</tr>
<tr>
<td class="left">IRC</td>
<td class="right">9999</td>
</tr>
<tr>
<td class="left">Git</td>
<td class="right">9418</td>
</tr>
<tr>
<td class="left">Email</td>
<td class="right">25</td>
</tr>
<tr>
<td class="left">Email</td>
<td class="right">587</td>
</tr>
<tr>
<td class="left">Email</td>
<td class="right">465</td>
</tr>
<tr>
<td class="left">Email</td>
<td class="right">993</td>
</tr>
</tbody>
</table>
</div>
</div>
</div>
<div id="postamble" class="status">
<style type="text/css">
.back-to-top {
position: fixed;
bottom: 2em;
right: 0px;
text-decoration: none;
color: #000000;
background-color: rgba(235, 235, 235, 0.80);
font-size: 12px;
padding: 1em;
display: none;
}
.back-to-top:hover {
background-color: rgba(135, 135, 135, 0.50);
}
</style>
<div class="back-to-top">
<a href="#top">Back to top</a> | <a href="mailto:bob@robotics.uk.to">E-mail me</a>
</div>
<script type="text/javascript">
var offset = 220;
var duration = 500;
jQuery(window).scroll(function() {
if (jQuery(this).scrollTop() > offset) {
jQuery('.back-to-top').fadeIn(duration);
} else {
jQuery('.back-to-top').fadeOut(duration);
}
});
</script>
</div>
</body>
</html>