Procházet zdrojové kódy

Update the readme for image based builds

Bob Mottram před 9 roky
rodič
revize
e145423a9f
1 změnil soubory, kde provedl 129 přidání a 61 odebrání
  1. 129
    61
      README.md

+ 129
- 61
README.md Zobrazit soubor

16
 
16
 
17
 Freedombone is, and shall remain, 100% free software. Non-free repositories are removed automatically upon installation.
17
 Freedombone is, and shall remain, 100% free software. Non-free repositories are removed automatically upon installation.
18
 
18
 
19
-Preparation for the Beaglebone Black
20
-====================================
21
-This section is specific to the Beaglebone Black hardware. If you're not using that hardware then just skip to the next section.
19
+Building an image for an SBC or Virtual Machine
20
+===============================================
21
+You don't have to trust images downloaded from random internet locations signed with untrusted keys. You can build one from scratch yourself, and this is the recommended procedure for maximum security. For guidance on how to build images see the manpage for the **freedombone-image** command.
22
 
22
 
23
-To get started you will need:
23
+Install the freedombone commands onto your laptop/desktop:
24
 
24
 
25
- - A Beaglebone Black
26
- - A MicroSD card
27
- - Ethernet cable
28
- - Optionally a 5V 2A power supply for the Beaglebone Black
29
- - Access to the internet via a router with ethernet sockets
30
- - USB thumb drive (for backups or storing media)
31
- - One or more domains available via a dynamic DNS provider, such as https://freedns.afraid.org
32
- - A purchased domain name and SSL certificate (only needed for Hubzilla)
33
- - A laptop or desktop machine with the ability to write to a microSD card (might need an adaptor)
34
-
35
-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).
36
-
37
-You can either install from a debian package or manually as follows:
38
-
39
-    sudo apt-get update
40
-    sudo apt-get install git dialog build-essential
25
+    sudo apt-get install git build-essential dialog
41
     git clone https://github.com/bashrc/freedombone
26
     git clone https://github.com/bashrc/freedombone
42
     cd freedombone
27
     cd freedombone
43
     sudo make install
28
     sudo make install
44
 
29
 
45
-Plug the microSD card into your laptop/desktop and then run the *freedombone-prep* command. For example:
30
+Then install packages needed for building images:
31
+
32
+    sudo apt-get -y install python-docutils mktorrent vmdebootstrap
33
+    sudo apt-get -y install dosfstools btrfs-tools extlinux python-distro-info mbr
34
+    sudo apt-get -y install qemu-user-static binfmt-support u-boot-tools qemu
35
+
36
+A typical use case to build an 8GB image for a Beaglebone Black is as follows. You can change the size depending upon the capacity of your microSD card.
37
+
38
+    freedombone-image -t beaglebone -s 8G
39
+
40
+If you prefer an advanced installation with all of the options available then use:
46
 
41
 
47
-    freedombone-prep -d /dev/sdX --ip freedombone_IP_address --iprouter router_IP_address
42
+    freedombone-image -t beaglebone -s 8G --minimal no
48
 
43
 
49
-where /dev/sdX is the device name for the microSD card. Often it's /dev/sdb or /dev/sdc, 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.
44
+To build a 64bit Virtualbox image:
50
 
45
 
51
-When the initial setup is done follow the instructions on screen to run the main freedombone command.
46
+    freedombone-image -t virtualbox-amd64 -s 8G
47
+
48
+To build a 64bit Qemu image:
49
+
50
+    freedombone-image -t qemu-x86_64 -s 8G
51
+
52
+Other supported boards are cubieboard2, cubietruck and olinuxino-lime2.
52
 
53
 
53
 Checklist
54
 Checklist
54
 =========
55
 =========
55
-Before running the freedombone command you will need a few things.
56
+Before installing Freedombone you will need a few things.
56
 
57
 
57
   * Have some domains, or subdomains, registered with a dynamic DNS service
58
   * Have some domains, or subdomains, registered with a dynamic DNS service
58
-  * System with a new installation of Debian Jessie
59
-  * Ethernet connection to an internet router
60
-  * It is possible to forward ports from the internet router to the system
61
-  * If you want to set up a social network or microblog then you will need SSL certificates corresponding to those domains
62
-  * Have ssh access to the system
59
+  * System with a new installation of Debian Jessie or a downloaded/prepared disk image
60
+  * Ethernet connection between the system and your internet router
61
+  * That it is possible to forward ports from the internet router to the system, typically via firewall settings
62
+  * Have ssh access to the system, typically via fbone@freedombone.local on port 2222
63
 
63
 
64
-GPG Keys
65
-========
66
-If you have existing GPG keys then copy the .gnupg directory onto the system.
64
+Installation
65
+============
66
+There are three install options: Laptop/Desktop/Netbook, SBC and Virtual Machine.
67
 
67
 
68
-    scp -r ~/.gnupg username@freedombone_IP_address:/home/username
68
+**On a Laptop, Netbook or Desktop machine**
69
 
69
 
70
-Interactive Setup
71
-=================
72
-The interactive server configuration setup is recommended for most users. On the system where freedombone is to be installed create a configuration file.
70
+If you have an existing system, such as an old laptop or netbook which you can leave running as a server, then install a new version of Debian Jessie onto it. During the Debian install you won't need the print server or the desktop environment, and unchecking those will reduce the attack surface. Once Debian enter the following commands:
73
 
71
 
74
-    ssh username@freedombone_IP_address
75
     su
72
     su
76
     apt-get update
73
     apt-get update
77
-    apt-get install git dialog
74
+    apt-get -y install git dialog build-essential
78
     git clone https://github.com/bashrc/freedombone
75
     git clone https://github.com/bashrc/freedombone
79
     cd freedombone
76
     cd freedombone
80
     make install
77
     make install
78
+    freedombone menuconfig
81
 
79
 
82
-Now the easiest way to install the system is via the interactive setup.
80
+**On a single board computer (SBC)**
83
 
81
 
84
-    freedombone menuconfig
82
+Currently the following boards are supported:
83
+
84
+    Beaglebone Black
85
+    Cubieboard 2
86
+    Cubietruck (Cubieboard 3)
87
+    olinuxino Lime2
88
+
89
+If there is no existing image available then you can build one from scratch. See the section above on how to do that. If an existing image is available then you can download it and check the signature with:
90
+
91
+    gpg --verify filename.img.asc
92
+
93
+And the hash with:
94
+
95
+    sha256sum filename.img
96
+
97
+If the image is compressed then decompress it with:
98
+
99
+    tar -xjvf filename.tar.bz2
100
+
101
+Then copy it to a microSD card. Depending on your system you may need an adaptor to be able to do that.
102
+
103
+    sudo dd bs=1M if=filename.img of=/dev/sdX conv=fdatasync
104
+
105
+Where **sdX** is the microSD drive. You can check which drive is the microSD drive using:
106
+
107
+    ls /dev/sd*
108
+
109
+With the drive removed and inserted. Copying to the microSD will take a while, so go and do something less boring instead. When it's complete remove it from your system and insert it into the SBC. Connect an ethernet cable between the SBC and your internet router, then connect the power cable. On the Beaglebone Black you will see some flashing LEDs, but on other SBCs there may not be any visual indication that anything is booting.
110
+
111
+With the board connected and running you can ssh into the system with:
85
 
112
 
86
-You can select which variant you wish to install and then enter the details as requested.
113
+    ssh fbone@freedombone.local -p 2222
87
 
114
 
88
-Other types of setup
89
-====================
90
-See the manpage for details on other kinds of non-interactive setup.
115
+Using the password 'freedombone'. Take a note of the new login password and then you can proceed through the installation.
91
 
116
 
92
-    man freedombone
117
+**As a Virtual Machine**
93
 
118
 
94
-Post-Setup
95
-==========
96
-Setup of the server and installation of all the relevant packages 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.
119
+Virtualbox and Qemu are supported. You can run a 64 bit Qemu image with:
97
 
120
 
98
-When done you can ssh into the Freedombone with:
121
+    qemu-system-x86_64 filename.img
99
 
122
 
100
-    ssh username@domain -p 2222
123
+If you are using Virtualbox then add a new VM and select the Freedombone **vdi** image.
101
 
124
 
125
+The default login will be username 'fbone' and password 'freedombone'. Take a note of the new login password then you can proceed through the installation.
126
+
127
+Social Key Management (aka "The Unforgettable Key")
128
+===================================================
129
+If you are using the interactive installer then you will be aked if you wish to import GPG keys. If you don't already possess GPG keys then just select "Ok" and they will be generated during the install. If you do already have GPG keys then there are a few possibilities
130
+
131
+**You have the gnupg keyring on an encrypted USB drive**
132
+
133
+If you previously made a master keydrive containing the full keyring (the .gnupg directory). This is the most straightforward case, but not as secure as splitting the key into fragments.
134
+
135
+**You have a number of key fragments on USB drives retrieved from friends**
136
+
137
+If you previously made some USB drives containing key fragments then retrieve them from your friends and plug them in one after the other. After the last drive has been read then remove it and just select "Ok". The system will then try to reconstruct the key. For this to work you will need to have previously made three or more **Keydrives**.
138
+
139
+**You can specify some ssh login details for friends servers containing key fragments**
140
+
141
+Enter three or more sets of login details and the installer will try to retrieve key fragments and then assemble them into the full key. This only works if you previously were using remote backups and had social key management enabled.
142
+
143
+Final Setup
144
+===========
102
 Any manual post-installation setup instructions or passwords can be found in /home/username/README. You should remove any passwords from that file and store them within a password manager such as KeepassX.
145
 Any manual post-installation setup instructions or passwords can be found in /home/username/README. You should remove any passwords from that file and store them within a password manager such as KeepassX.
103
 
146
 
104
 On your internet router, typically under firewall settings, open the following ports and forward them to your server.
147
 On your internet router, typically under firewall settings, open the following ports and forward them to your server.
121
     | Email   |        465 |
164
     | Email   |        465 |
122
     | Email   |        993 |
165
     | Email   |        993 |
123
     | VoIP    |      64738 |
166
     | VoIP    |      64738 |
124
-    | VoIP    |       5060 |
125
     | Tox     |      33445 |
167
     | Tox     |      33445 |
126
     | IPFS    |       4001 |
168
     | IPFS    |       4001 |
127
 
169
 
128
-On Client Machines
129
-==================
130
-You can configure laptops or desktop machines which connect to the Freedombone server in the following way. This alters encryption settings to improve overall security.
170
+Keydrives
171
+=========
172
+After installing for the first time it's a good idea to create some keydrives. These will store your gpg key so that if all else fails you will still be able to restore from backup. There are two ways to do this:
131
 
173
 
132
-    sudo apt-get update
133
-    sudo apt-get install git dialog
134
-    git clone https://github.com/bashrc/freedombone
135
-    cd freedombone
136
-    sudo make install
137
-    freedombone-client
174
+**Master Keydrive**
175
+
176
+This is the traditional security model in which you carry your full keyring on an encrypted USB drive. To make a master keydrive first format a USB drive as a LUKS encrypted drive. In Ubuntu this can be done from the *Disk Utility* application. Then plug it into the Freedombone system, then from your local machine run:
177
+
178
+    ssh myusername@mydomainname -p 2222
179
+    sudo control
180
+
181
+Select *Backup and Restore* then *Backup GPG key to USB (master keydrive)*.
182
+
183
+**Fragment keydrives**
184
+
185
+This breaks your GPG key into a number of fragments and randomly selects one to add to the USB drive. First format a USB drive as a LUKS encrypted drive. In Ubuntu this can be done from the *Disk Utility* application. Plug it into the Freedombone system then from your local machine run the following commands:
186
+
187
+    ssh myusername@mydomainname -p 2222
188
+    sudo control
189
+
190
+Select *Backup and Restore* then *Backup GPG key to USB (fragment keydrive)*.
191
+
192
+Fragments are randomly assigned and so you will need at least three or four keydrives to have enough fragments to reconstruct your original key in a worst case scenario. You can store fragments for different Freedombone systems on the same encrypted USB drive, so you can help to ensure that your friends can also recover their systems. This might be called *"the web of backups"* or *"the web of encryption"*. Since you can only write a single key fragment from your Freedombone system to a given USB drive each friend doesn't have enough information to decrypt your backups or steal your identity, even if they turn evil. This is based on the assumption that it may be difficult to get three or more friends to conspire against you all at once.
193
+
194
+Passwords
195
+=========
196
+Passwords for server applications are randomly generated and can be found within **/home/username/README** after the system has fully installed. You should move those passwords into a password manager, such as KeepassX.
197
+
198
+Administering the system
199
+========================
200
+To administer the system after installation log in via ssh, become the root user and then launch the control panel.
201
+
202
+    ssh fbone@freedombone.local -p 2222
203
+    sudo control
204
+
205
+From there you will be able to perform various tasks, such as backups, adding and removing users and so on. You can also do this via commands, which are typically installed as /usr/local/bin/freedombone* and the corresponding manpages.