Skip to content

Commit d25702d

Browse files
author
Andre Rodier
committed
Updated documentations
1 parent 157ccc9 commit d25702d

File tree

6 files changed

+73
-124
lines changed

6 files changed

+73
-124
lines changed

docs/index.md

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
1-
This is the home documentation for "Homebox", a set of Ansible scripts to deploy
2-
a fully functional _and_ secure mail server at home or online.
1+
This is the home documentation for "Homebox", a set of Ansible scripts to deploy a fully functional _and_ secure mail
2+
server at home or online.
33

44
The source code is on [GitHub](https://github.com/progmaticltd/homebox).
55

@@ -14,15 +14,15 @@ This project is for you if:
1414
## Philosophy
1515

1616
- You should be able to upgrade anything installed via the apt command. No git clone / wget / curl here, ever.
17-
- If you are using your own hardware, the disk will be fully encrypted using
18-
[LUKS](https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup). Nobody will be able to steal your hardware _and_ your
19-
information.
17+
- If you are using your own hardware, the disk can be fully encrypted using
18+
[LUKS](https://en.wikipedia.org/wiki/Linux_Unified_Key_Setup).
19+
Nobody will be able to steal your hardware _and_ your information.
2020
- AppArmor is activated on the first boot, and all the services are configured to support it. This makes your server
2121
very safe against remote intrusion, even when using 0-day vulnerabilities.
2222
- You can set up multiple backup destination, local and remote, all encrypted.
2323
- A lot of default choices made towards simplicity, [KISS principle](https://en.wikipedia.org/wiki/KISS_principle),
2424
and safety.
25-
- Attention to details, keep focused on the nitty-gritty features of self hosting, like full IPv6 support.
25+
- Attention to details, keep focused on the nitty-gritty features of self hosting, like full IPv6 support and DNSSEC.
2626

2727
## Main components
2828

@@ -36,7 +36,6 @@ This project is for you if:
3636
- Antivirus: ClamAV
3737
- Groupware: SOGo
3838
- Jabber: ejabberd
39-
- Remote administration: Cockpit
4039

4140
## Other projects to mention
4241

docs/installation.md

Lines changed: 19 additions & 37 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ Whatever you chose to host your system at home, or with a VPS, you need to speci
77
```sh
88
cd install/config
99
cp hosts-example.yml hosts.yml
10-
nano hosts.yml
10+
vi hosts.yml
1111
```
1212

1313
Here is an example on your LAN:
@@ -41,8 +41,7 @@ The system configuration file is a complete YAML configuration file containing a
4141
- User and group details, like email addresses and aliases.
4242
- Email parameters, like maximum attachment size, antivirus options, etc.
4343
- Some password policies, like minimum length and complexity.
44-
- Webmail settings (roundcube or SOGo).
45-
- Low level system settings, mainly used during the development phase.
44+
- SOGo settings if you want to install it.
4645
- Firewall policies, especially SSH access.
4746
- Security settings.
4847
- Backup strategies.
@@ -58,18 +57,7 @@ Once you have modified the file, you are ready to start the installation.
5857
!!! Warning
5958
You need to be careful with the indentation in your Yaml file, the number of spaces is significant.
6059

61-
## Step 3: Start the installation
62-
63-
You can choose a flavour to install, using a different playbook.
64-
65-
```sh
66-
cd install
67-
ansible-playbook -i ../config/hosts.yml install-mini.yml
68-
```
69-
70-
# Most important sections
71-
72-
## Network configuration
60+
## Step 3: Configure your system
7361

7462
### Domain name and host name
7563

@@ -105,7 +93,7 @@ network:
10593
!!! Tip
10694
If you do not have a backup IP address, use "~", which means "None" or Null in yaml.
10795
108-
## Users list
96+
### Users list
10997
11098
The file format should be self-explanatory. The other piece of information you need to fill first is the user list. In
11199
its simplest form, you will have something like this:
@@ -130,19 +118,11 @@ users:
130118
- jane@homebox.space
131119
```
132120
133-
The email aliases are the other email addresses that belong to the same user.
121+
You do not have to set the passwords for each user. A random password will be generated, using XKCD, and saved into
122+
_pass_, in the ldap sub directory.
134123
135-
You can also add more advanced features, like:
136124
137-
- [Import emails from other accounts](external-accounts.md).
138-
- [Define some users as administrators](security-configuration.md#defining-administrators)
139-
- [Grant remote access to certain users](security-configuration.md#grant-some-users-remote-access)
140-
141-
!!! Note
142-
You do not have to set the passwords for each user. A random password will be generated, usinx XKCD, and saved into
143-
_pass_, in the ldap sub directory.
144-
145-
## Email options
125+
### Email options
146126
147127
This is the second most important settings. Here is an example of the email options you can override:
148128
@@ -155,10 +135,10 @@ mail:
155135
default: 1G # Maximum allowed mailbox size for your users.
156136
```
157137
158-
All options are detailed on the [email configuration](email-configuration.md) page.
138+
Advanced options are detailed on the [email configuration](email-configuration.md) page.
159139
160140
161-
## Security options
141+
### Security options
162142
163143
Security options are detailed on the [security page](security-configuration.md).
164144
The default settings are:
@@ -170,15 +150,17 @@ The default settings are:
170150
171151
Other options are possible, see the security page for details.
172152
153+
## Step 4: Start the installation
173154
174-
## Backup configuration
155+
You can choose a flavour to install, using a different playbook. Four playbooks are included by default: mini, small,
156+
medium and large. Depending on the features and the capacity of your server.
175157
176-
It is possible to regularly backup your emails, for instance locally on a NAS drive, or on the internet, using various
177-
methods.
158+
For instance, the mini server:
178159
179-
By default, the whole home partition is backed up, but you can add or exclude more folders. The detailed instructions
180-
are on the [backup documentation](/backup-home/) page.
181-
182-
You can also use [OpenDNS servers](https://en.wikipedia.org/wiki/OpenDNS#Name_server_IP_addresses) for forward.
160+
```sh
161+
cd install
162+
ansible-playbook -i ../config/hosts.yml install-mini.yml
163+
```
183164

184-
Once your DNS set up is complete, you can monitor the [world wide propagation](/dns-propagation/).
165+
!!! Note
166+
The large version, including clamAV, requires at least 2GB of ram.

docs/jabber-configuration.md

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,10 @@
22

33
The default configuration for the Jabber server comes with the following options:
44

5-
- Installed by default
6-
- Server to server communication active and public by default
7-
- Socks proxy to transfer files
8-
- HTTP upload for offline file transfer
5+
- Installed by default.
6+
- Server to server communication active and public by default.
7+
- Socks proxy to transfer files.
8+
- HTTPs upload for offline file transfer.
99

1010
Default options for the Jabber server:
1111

@@ -41,11 +41,11 @@ ejabberd:
4141

4242
Two certificates are created to ensure proper communication with clients and other servers.
4343

44-
| Record | Type | Purpose | Example |
45-
| ----------- | ------ | --------- | --------- |
46-
| @ | A | Default certificate used by the server | homebox.space |
47-
| xmpp | A | Handle file transfer over https | xmpp.homebox.space |
48-
| conference | A | S2S conference public URL | conference.homebox.space |
44+
| Record | Type | Purpose | Example |
45+
|------------|------|----------------------------------------|--------------------------|
46+
| @ | A | Default certificate used by the server | homebox.space |
47+
| xmpp | A | Handle file transfer over https | xmpp.homebox.space |
48+
| conference | A | S2S conference public URL | conference.homebox.space |
4949

5050
## Fine tuning
5151

docs/maintenance.md

Lines changed: 22 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,8 @@ Then, run the dedicated playbook to update users:
4141
4242
```sh
4343
cd install
44-
ansible-playbook -v -i ../config/hosts.yml playbooks/update-users.yml
44+
export ROLE=ldap-openldap,user-setup
45+
ansible-playbook -v -i ../config/hosts.yml playbooks/install.yml
4546
```
4647

4748
The home playbook creates the home directories for this user.
@@ -69,55 +70,58 @@ This can be done through SSH, like you are doing on any Debian server.
6970

7071
## Adding or removing components
7172

72-
Most components can be added or removed individually, using the unit ansible playbook, for instance:
73+
Most components can be added or removed individually, using the unit playbook, for instance:
7374

7475
```sh
75-
ROLE=diagnostic ansible-playbook -l homebox -v install.yml
76+
ROLE=ejabberd ansible-playbook -l homebox install.yml
7677
```
7778

79+
This will install the ejabberd XMPP server.
80+
7881
or
7982

8083
```sh
81-
ROLE=diagnostic ansible-playbook -l homebox -v uninstall.yml
84+
ROLE=ejabberd ansible-playbook -l homebox uninstall.yml
8285
```
8386

87+
This will delete the ejabberd XMPP server.
8488

8589
### Removing ClamAV
8690

87-
Removing ClamAV can be done using the following command:
91+
Adding or removing ClamAV can be done using the following command:
8892

8993
```sh
90-
ROLE=clamav ansible-playbook -l homebox -v uninstall.yml
94+
ROLE=clamav ansible-playbook -l homebox install.yml
9195
```
9296

93-
### Removing rspamd
94-
95-
Removing Respamd can be done using the following command:
97+
Or to be removed:
9698

9799
```sh
98-
ROLE=clamav ansible-playbook -l homebox -v uninstall.yml
100+
ROLE=clamav ansible-playbook -l homebox uninstall.yml
99101
```
100102

101-
## Restarting the system
103+
104+
## Restarting the system when the drive is encrypted
102105

103106
If you have installed the system with the main drive encrypted using LUKS, you need to keep a way to decrypt your drive,
104-
locally or remotely
107+
locally or remotely.
105108

106-
### With physical access
109+
There is a role you can run, to install _dropbear_. When the system starts, a small SSH server is started, to allowing
110+
you to decrypt the drive remotely.
107111

108-
Plug a screen and a keyboard, and type your passphrase when the system boot.
112+
Here how to install it:
109113

110-
### Remotely over SSH
114+
```sh
115+
ROLE=luks-remote ansible-playbook -l homebox install.yml
116+
```
111117

112-
When the system starts, a small SSH server is started, which allows you to decrypt the drive remotely.
113118
Here is an example using a command line SSH client:
114119

115120
```sh
116-
andre@london:~ $ ssh root@rodier.me
121+
andre@london:~ $ ssh root@example.net
117122

118123
To unlock root partition, and maybe others like swap, run `cryptroot-unlock`
119124

120-
121125
BusyBox v1.22.1 (Debian 1:1.22.0-19+b3) built-in shell (ash)
122126
Enter 'help' for a list of built-in commands.
123127

docs/prerequisites.md

Lines changed: 16 additions & 49 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@ knowledge to achieve the above.
99
You still need some basic understanding though, like what is an IP address or a port, how to run Ansible in a console,
1010
how to edit Yaml files, etc.
1111

12+
1213
## Hosting emails at home
1314

1415
If you want to seriously host your emails at home, you will need the following:
@@ -25,69 +26,39 @@ Pros:
2526
Cons:
2627

2728
- Your internet connection and electric providers need to be stable.
28-
- Might be cumbersome when you are moving
29+
- Might be cumbersome when you are moving.
30+
- This is not _digital worker_ friendly.
31+
2932

3033
## Hosting emails online
3134

3235
Any serious hosting platform can provide a server, virtual or physical, with an externally accessible IP address. Some
3336
providers, however, are blocking the port 25 (e.g. Google cloud).
3437

35-
Be careful, using a VPS (Virtual Private Server) is no more secure than hosting at your home.
36-
3738
Pros:
3839

39-
- Does not rely on the reliability of your internet connection or your electricity provider
40-
- You can move to another address easily.
40+
- Does not rely on the reliability of your internet connection or your electricity provider.
41+
- Easier to manage remotely, especially for _digital workers_.
4142

4243
Cons:
4344

44-
- You may not have control on the kernel installed. This is less secure than Homebox, which is by default configured to
45-
run on AppArmor.
45+
- You may not have control on the kernel installed or the options available.
4646
- You may not be able to use Full Disk Encryption. Although there are some security measures in places, it is still
4747
perfectly possible to extract data from your disk without your knowledge or consent.
48-
- You will not have the choice on when and which security updates are applied. Most hosting providers have specific time
49-
windows to update the kernel images they use, which may not be as soon as you need, or even appropriate to you.
5048

5149

5250
# Pre-installation steps
5351

5452
## Set up your domain name
5553

56-
The first thing you need is a domain name and a DNS provider, there are many available. For instance, here is a
57-
[list of other DNS providers](https://github.com/AnalogJ/lexicon#providers) you can use.
58-
59-
The screenshots and examples in this tutorial are specific to [Gandi](https://www.gandi.net/), but the principles are
60-
the same.
61-
62-
Once you have chosen the domain name, it is necessary to configure the associated DNS servers, and the _glue records_.
63-
64-
For instance, on Gandi, you will have to set up the glue records first and then the DNS servers used for your domain:
65-
66-
### Glue records
67-
68-
Create at least one record that points to your static IP address.
54+
If you are not familiar with DNS, I recommend to use Gandi and to create an API key. The playbook will handle the DNS
55+
settings itself.
6956

70-
![Glue records](img/dns-setup/glue-records.png)
57+
Otherwise, here is a [list of other DNS providers](https://github.com/AnalogJ/lexicon#providers) you can use.
7158

72-
### DNS servers
59+
In this case, it is necessary to configure the associated DNS servers, and the _glue records_.
7360

74-
Add the DNS servers accordingly
75-
76-
![DNS servers](img/dns-setup/dns-servers.png)
77-
78-
## Choose the hardware
79-
80-
An old laptop should be enough to start, with the main advantage of being somewhat resilient to power failures. I also
81-
suggest you to have a look on this Debian page: [Cheap Serverbox Hardware](https://wiki.debian.org/FreedomBox/Hardware)
82-
of the project freedombox, another excellent project.
83-
84-
The preseed configuration (see next step) provides an option to use software RAID, so you can use this as well if you
85-
prefer.
86-
87-
!!! Warning
88-
You still need to regularly back up your data, even if you are using RAID.
89-
90-
## Set-up your home network
61+
## Home based: set-up your home network
9162

9263
This is necessary only if you choose to use a home device to host your emails. If you are using an online server, you
9364
can skip this section.
@@ -99,12 +70,11 @@ functionality if there is one. The other option is to redirect only the ports yo
9970

10071
Initially, the following TCP ports are required:
10172

102-
- To obtain your certificates from LetsEncrypt, the port 80 need to be exposed.
73+
- To obtain your certificates from LetsEncrypt, the port 53 in UDP and TCP mode.
10374
- To test sending and receiving emails, your system should be accessible on the port 25 as well.
104-
- To retrieve emails, your system should be accessible on ports 143, 993, 110, 995.
75+
- To retrieve emails, your system should be accessible on ports 993 and 995 if you are using POP3.
10576
- To send emails, your system should be accessible on ports 587 and/or 465.
106-
- For Thunderbird automatic configuration, your system should be accessible on port 80.
107-
- Once installed, SOGo and the webmail are accessible through https (port 443).
77+
- Once installed, SOGo is accessible through https (port 443).
10878

10979
The next step is to link your domain name (e.g homebox.me) to your static IP address that has been assigned to you by
11080
your ISP.
@@ -119,9 +89,6 @@ on Debian or Ubuntu:
11989
$ sudo apt install ansible rsync
12090
```
12191

122-
Another package to install is `python-netaddr`, which is part of Debian too. It is required to guess your public IP
123-
address during the installation phase. Once the playbook has been run, you can uninstall it.
124-
125-
If you already have a Debian server (Stretch) installed, and you prefer to use it, it's fine, you can skip the next
92+
If you already have a Debian server (Bullseye) installed, and you prefer to use it, it's fine, you can skip the next
12693
section and start the [installation](installation.md) directly. Otherwise, click on next to read the OS installation
12794
page.

docs/preseed.md

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ The file is self-explanatory. A content example is shown below:
3939
``` yaml
4040
system:
4141
hostname: mail
42-
passphrase: Correct horse battery stapple
42+
passphrase: Correct horse battery staple
4343
preseed: luks
4444
version: 11.1
4545
arch: amd64
@@ -82,9 +82,6 @@ root:
8282
debug: true
8383
```
8484
85-
!!! Tip
86-
If you do not have physical access to your box, don't worry, you will be able to enter the passphrase remotely over
87-
SSH.
8885
8986
## 3. Set up remote access
9087

0 commit comments

Comments
 (0)