6578 Commits

Author SHA1 Message Date
James Valleroy
c660cada6d
Release v21.8 to unstable
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-30 20:02:12 -04:00
James Valleroy
2774f06bdb
doc: Fetch latest manual
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-30 20:01:13 -04:00
James Valleroy
1345ad5f66
locale: Update translation strings
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-30 19:38:29 -04:00
James Valleroy
4b51396860
security: Remove display of past vulnerabilities
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-08-26 14:22:07 -07:00
Sunil Mohan Adapa
efa615201b
wordpress: New app to manage a WordPress site/blog
- Use php-fpm instead of using mod-php.

- Create database and setup permissions manually. Tables and initial data are
created during the initial setup process done by WordPress. Database upgrades
are handled by WordPress. Minor versions are upgraded automatically and major
version need user intervention.

- Backup/restore functionality including database.

- Install recommended extensions for performance.

- Setup and run cron jobs to ensure that scheduled publications are
completed (among other things). Service has systemd security features. Timer is
set to run every 10 minutes.

- Functional tests for adding/removing posts and backup/restore.

- Increase file upload size limit to 128MiB.

- A private mode (default) for keeping the setup process secure. Should be
disabled after first setup is completed. This uses a new approach using
file-based flag for different Apache configurations.

TODO:

- Find a nice way to allow WordPress to upload plugins/themes. Currently this
operation files and users are expected to manually scp the files to
/var/lib/wordpress/wp-content/{plugins,themes} directory.

Tests:

- Functional tests.

- Schedule publishing of a post. Notice that post got published.

- Test uploading a file larger than 2MiB.

- Test enabling permalinks. This leads to nicer looking URLs.

- Test adding images to posts/pages.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-25 08:20:01 -04:00
Sunil Mohan Adapa
5340cf3119
tests: functional: Add a convenience method to logout
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-25 08:19:57 -04:00
Sunil Mohan Adapa
28030933dc
d/control: Drop wireless-tools as recommends
Closes: #2100.

- wireless-tools package is being orphaned. https://bugs.debian.org/963896 .

- We use Network Manager to manage network and don't use iw* tools from
wireless-tools package. Network Manager itself does not need wireless-tools
package to configure and manage Wi-Fi connections. This is seen on typical
desktops.

- FreedomBox service uses NM D-Bus API to scan for available networks.

- Code does not refer to the tools iwconfig, iwevent, iwgetid, iwlist, iwpriv or
iwspy. These are the binaries provided by the wireless-tools package.

Tests:

- After removal of the wireless-tools package, wireless scan functionality does
not result in an error.

- Not tested: Attaching actual Wi-Fi hardware and seeing the list of available
Wi-Fi networks.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-21 18:00:44 -04:00
Sunil Mohan Adapa
7aca9d9299
d/lintian-overrides: Allow all systemd services paths
- Temporary workaround for https://bugs.debian.org/992465

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-21 16:12:08 -04:00
fliu
f400eb9439
email: implemented service alert
- Better error handling
- You may retroactively diagnose and fix problems
- Shows the most important issues first

audit.models.Diagnosis
  - Added JSON serialization (needed for IPC)
  - Replaced ambiguous vocabulary
  - Provided a sorting key

audit, diagnosis
  - Support title translation
2021-08-20 19:24:21 -07:00
Andrij Mizyk
74bf8dc4a8
Translated using Weblate (Ukrainian)
Currently translated at 69.0% (1005 of 1456 strings)
2021-08-20 23:20:39 +02:00
Andrij Mizyk
396e14b572
Translated using Weblate (Ukrainian)
Currently translated at 61.9% (902 of 1456 strings)
2021-08-19 15:51:11 +02:00
Petter Reinholdtsen
930f39dc8e
Translated using Weblate (Norwegian Bokmål)
Currently translated at 82.2% (1198 of 1456 strings)
2021-08-19 15:51:09 +02:00
Sunil Mohan Adapa
02ea2106bc
container: Use keyserver.ubuntu.com as the default keyserver
Closes: #2091.

To avoid current issues with keys.gnupg.net.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-08-18 22:41:14 -04:00
fliu
3ff823e837
email: Sender spoofing patch 1/2: domain rewriting
A sender canonical map deletes the domain part from sender addresses.
Postfix will append @$myhostname after the rewriting.
2021-08-17 19:44:24 -07:00
fliu
1e712f6bc4
email: setup: Configure Roundcube 2021-08-17 19:44:21 -07:00
fliu
5a9c7e5077
email: Documentation, code cleanup
- Audit: finalize MainCfDiagnosis API
- Doc: document Diagnosis models
- Doc: remove hacky imports and replace them with autodoc mock imports
- Views: add `email_` prefix to email server templates
- Apache: delete unnecessary directives (robots tag, cookie header etc.)
2021-08-17 19:44:17 -07:00
fliu
ea8150d9dd
email: setup: Find Let's Encrypt certificates 2021-08-17 19:44:14 -07:00
fliu
9a98ddadd4
email: postfix: dovecot: Set strong security parameters
Other changes:
- Fix linter error
- Postfix port 25: do not trust localhost IP addresses
2021-08-17 19:44:11 -07:00
fliu
b172b0b1cd
email: Local delivery: use full email address
If the domain part was not provided, $myhostname will be used.
In case $myhostname is not in $mydestinations, the email will be relayed.
In case $myhostname is invalid, the email will be bounced.

The next hop should always be LMTP (local: transport)
and hence the `@localhost`
2021-08-17 19:44:08 -07:00
fliu
2f77d99899
email: Code cleanup, address reviews
- View: security.html -> email_security.html
- Setup: will not install Redis
- Setup: put clamav packages on hold
- Crash recovery: opening firewall ports becomes the last post action
- Crash recovery: group postconf.set_many into small transactions
- Crash recovery: safer postconf.set_master_cf_options
2021-08-17 19:44:05 -07:00
fliu
240b67c49e
email: Reload postfix in domain view 2021-08-17 19:44:02 -07:00
fliu
27387d4a9c
email: Implement outbound mail filtering
- Make extensive use of the milter protocol
- Milter: add X-Fbx- headers to emails
- All submitted mails go to smtp:localhost:10025 for filtering
- Header privacy for submitted mails
- Rspamd: be able to inject and replace FreedomBox-managed config
- Reserve special addresses for future use

Known issue: internal emails do not go through spam filtering
2021-08-17 19:43:58 -07:00
fliu
85c6b91fbc
email: Code cleanup
- Move render_tabs into plinth.views
- Move admin_tabs and user_tabs into the class
- New interproc module contains inter-process functions
- New helper methods in TabMixin
2021-08-17 19:43:55 -07:00
fliu
e454e8ac1b
email: LMTP: remove the recipient's UID number from email headers 2021-08-17 19:43:52 -07:00
fliu
cdfef82bf6
email: Implement auto-discovery 2021-08-17 19:43:49 -07:00
fliu
355cc84a1b
email: apache: X-Robots-Tag header, full URL match 2021-08-17 19:43:46 -07:00
fliu
c31a896e81
email: Implement spam sorting with sieve
- Sieve script detects spam headers used by Rspamd and SpamAssassin
- Autosubscribe to Archive, Drafts, Junk, Sent, Trash
- Autoexpunge Trash and Junk folders
- INBOX.Junk -> Junk, INBOX.Trash -> Trash, Sent Messages -> Sent
2021-08-17 19:43:42 -07:00
fliu
41f0461ac7
email: postfix: Install LDAP map support 2021-08-17 19:43:39 -07:00
fliu
a234407b97
email: Implement view for setting up domains 2021-08-17 19:43:36 -07:00
fliu
502cfa4953
email: Add templates for TLS and domains 2021-08-17 19:43:33 -07:00
fliu
62c501e9c7
email: Add UI for creating the home directory
email_server:
- `-i` option passes all remaining arguments to action
- delete unused "touch file" option

Views:
- delete broken links
- add tabs to every page
- separate admin tabs from user tabs
2021-08-17 19:43:30 -07:00
fliu
2bd1ad4533
email: aliases: Use bootstrap styles
Other changes:

- Added license identifiers
- Fixed linter warnings
- Deleted excessive parameters in rendering code
2021-08-17 19:43:26 -07:00
fliu
4375828703
email: Implement alias management
- Separate alias database from system
- Block mail to system users, without backscatter
- Alias management UI for non-admin users
- Enabling/Disabling aliases (mails to /dev/null)

Misc. changes

- Daemon management
- Backup information
- Postconf diagnostics interface
2021-08-17 19:43:23 -07:00
fliu
a9ac51eb7b
email: views: Implement tab rendering 2021-08-17 19:43:20 -07:00
fliu
8c740e08da
email: diagnostics: Fix sudo permission problem 2021-08-17 19:43:17 -07:00
fliu
0acbe5dd6b
email: Support UID number lookup in Dovecot 2021-08-17 19:43:14 -07:00
fliu
91c907f657
email: Open lock file as plinth user 2021-08-17 19:43:11 -07:00
fliu
e2535bad49
email: audit: improve the speed of post-installation setup
- New class: `MainCfDiagnosis`
  - "Advise and repair" mechanism reduces the number of postconf calls

- File locking: lock acquisition moved into audit module
  - Enables finer-grained control
2021-08-17 19:43:07 -07:00
fliu
573287cf28
email: postconf: Handle postconf returning an empty key
However, if /sbin/postconf complained, a KeyError will be raised
2021-08-17 19:43:04 -07:00
fliu
aab3fe9c02
email, plinth.log: Write more information to syslog
sudo journalctl -b -o short-monotonic --no-pager -f
2021-08-17 19:43:01 -07:00
fliu
7397326d57
email: mutex: create lock file as plinth user 2021-08-17 19:42:58 -07:00
fliu
df14e74972
email: Parse command arguments with a mutually exclusive group 2021-08-17 19:42:55 -07:00
fliu
7166e63b02
email: Install rspamd; proxy its web interface 2021-08-17 19:42:51 -07:00
fliu
758c8791f1
email: Address some code review comments
- __init__.py: Changed email server description
- audit module: Added module docstring
- email_server action:
  - Used argparse
  - Replaced "wrapper functions" with a getattr based lookup method
2021-08-17 19:42:48 -07:00
fliu
81c9632f5a
email: dovecot: Support user lookup by UID number
Dovecot refuses to open the root user's mail box
Need (!(uidNumber=0)) to correctly return status code
2021-08-17 19:42:45 -07:00
fliu
f20929c23f
email: Fix enabling SMTPS; check return value
- master.cf: Enable SMTPS
- lock.Mutex: check the return value of lock.acquire
- Write debug logs
2021-08-17 19:42:42 -07:00
fliu
10c3a667b6
email: Code quality fixes
- flake8: Delete unused imports
- lock.Mutex: Set file mode (rw-rw----) and ownership (plinth:plinth)
2021-08-17 19:42:39 -07:00
fliu
ba179a860e
email: Set up local delivery (no spam filtering)
Hosts file:

192.168.56.101 host1.test.example virtualbox
10.42.0.101    host2.test.example freedombox

Container setup (run commands in container)

1. Install the email server module
2. Create a FreedomBox account for `fred`
3.
$ sudo postconf myhostname=host2.test.example
$ echo "contactfred: fred" | sudo tee -a /etc/aliases
$ sudo newaliases
$ sudo systemctl reload postfix

Test IMAP (run on host1.test.example)

$ swaks --to=contactfred@host2.test.example --from=spam@host1.test.example
$ mutt -f imaps://fred@host2.test.example

Test mail submission (run in container):

$ swaks --to=spam@host1.test.example --from=contactfred@host2.test.example \
        --server host2.test.example:587 --tlso --auth-user=fred
2021-08-17 19:42:36 -07:00
fliu
fdc6f23908
email: Implement email_server ipc set_sasl and set_submission
- Rewrote action script to eliminate stdin communication
- Changed return type of audit.*.get()
  - An audit can return multiple lines of diagnostics
- Move recommended endpoint URLs into function docstrings
2021-08-17 19:42:32 -07:00
fliu
cde0b47064
email: Enable LDAP by calling postconf in a thread-safe way
- Implemented `email_server ipc postconf_set_many_v1`
- Implemented `lock.Mutex` (fcntl.lockf and threading.Lock based mutex)
  - FIXME: Lock file permissions
- Implemented `postconf` (thread-safe postconf operations)
- Started using service orientation
2021-08-17 19:42:29 -07:00