6855 Commits

Author SHA1 Message Date
James Valleroy
ff0dc01023
samba: Use systemd sandboxing for smbd/nmbd
Test: Samba functional tests passed.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 13:52:54 -08:00
James Valleroy
4bb0f81643
avahi: Use systemd sandboxing
Sandbox coverage is 35%.

Tests:
- Functional tests passed.
- Diagnostics passed.
- FreedomBox services are visible in Avahi Zeroconf Browser.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 13:28:42 -08:00
James Valleroy
10ece80a56
tests: functional: Add diagnostics delay parameter
Time to delay after app is enabled, before checking
diagnosics. Default value is 0 (no delay).

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:55:31 -08:00
James Valleroy
520feedaca
tor: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:55:28 -08:00
James Valleroy
7b90787be3
tahoe: Use BaseAppTests for functional tests
Not tested: App is not currently available.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:55:24 -08:00
James Valleroy
b94833e44d
transmission: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:55:21 -08:00
James Valleroy
452f8b825b
shadowsocks, syncthing: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:55:06 -08:00
James Valleroy
a27333c0b3
samba: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:36 -08:00
James Valleroy
7e84eba614
radicale: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:33 -08:00
James Valleroy
8033ec8368
pagekite: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:30 -08:00
James Valleroy
9b58f4f031
openvpn: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:26 -08:00
James Valleroy
8210935e49
mldonkey: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:23 -08:00
James Valleroy
723546502e
mediawiki: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:20 -08:00
James Valleroy
1b1d81e787
ikiwiki: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:17 -08:00
James Valleroy
55fd53a18c
gitweb: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:14 -08:00
James Valleroy
05ae605cf9
ejabberd: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:11 -08:00
James Valleroy
e148316c25
deluge: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:07 -08:00
James Valleroy
025de63ac2
calibre: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Rename the backup/restore test to override base class]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:51:04 -08:00
James Valleroy
d70dd81e21
bind: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Rename backup/restore test to override base class test]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:50:36 -08:00
James Valleroy
56a756fd99
bepasty: Use BaseAppTests for functional tests
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:47:24 -08:00
James Valleroy
3043574eb0
tests: Use background fixture for each test
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-11-08 11:05:09 -08:00
Michael Breidenbach
84ab4b3b3c
Translated using Weblate (Swedish)
Currently translated at 100.0% (1518 of 1518 strings)
2021-11-04 03:39:11 +01:00
Sunil Mohan Adapa
d6a9392704
email_server: Use rollback journal for aliases sqlite DB
WAL journaling mode is causing problems with postfix unable to open the database
despite ownership and permission changes. Default is the DELETE rollback journal
mode. The former gives more performance but in our case, writes are very rare
and the DB is used mostly just for reads.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:44:48 -04:00
Sunil Mohan Adapa
8d7bac70c9
email_server: Setup /var/mail, drop home setup view
Creating home directories is no longer necessary. We store all mail in /var/mail
and don't allow use of direct access to mail folder.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:40:55 -04:00
Sunil Mohan Adapa
88e372b8f8
email_server: dovecot: Don't deliver mail to home directory
Delivering mail to home directory is only needed when users are expected to
login via terminal and use command line tools for accessing their email. In
FreedomBox, we expect users to use GUI tools such as Thunderbird and K-9 Mail to
access their mail. So, POP3 and IMAP access sufficient.

Not trying to compatible with command line mail tools means that high
performance mailbox storage formats can be chosen. This is important to ensure
that accessing mail via IMAP is fast. In future, we can consider enabling full
text search using Apache Solr.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:40:47 -04:00
Sunil Mohan Adapa
afc958a884
email_server: dovecot: Authenticate using PAM instead of LDAP
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:40:38 -04:00
Sunil Mohan Adapa
cb8c23c28d
email_server: Lookup LDAP local recipients via PAM
Most modern setups simply use to PAM to lookup local recipients instead of
integrating directly with LDAP. libnss-ldapd package that we install and
configure connects the password database with LDAP. Anyone then using PAM need
not be aware of LDAP integration. This reduces extra configuration and many
problems that come along with it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:40:30 -04:00
Sunil Mohan Adapa
d0cf01fb29
email_server: Don't use user IDs when performing lookups
- Typical mail systems are configured to work on usernames or virtual usernames.
UIDs/GIDs are only needed at the final moment when delivering mails to user
inboxes that need to have proper UID/GID set.

- This makes it easy for dovecot to simply use PAM authentication instead of
having to use LDAP.

- Trying to hide UID from email headers is no longer necessary. Received: header
is important for debugging mail delivery across the chain. Don't miss out.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:40:19 -04:00
Sunil Mohan Adapa
fb47f35e87
email_server: action: Add argument type checking for extra safety
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:11:06 -04:00
Sunil Mohan Adapa
ce3668d5e8
log, email_server: Don't use syslog instead of journald
- Syslog is not used on FreedomBox machines. Logging to syslog instead of
journald looses a lot of information fields that are otherwise available.

- Drop logging additional information. Most of the information is already
present in full journald records. Access using journalctl -o json.

- Use the same formatting for console as the primary daemon.

- When logging for actions, capture warnings too.

- Always log to stderr so that UI can capture the traceback and show UI error
messages. stderr is never used for returning data.

Tests:

- Run action script using command line with a error 'sudo actions/email_server
home mk a b'. See the traceback message printed on stderr (not stdout). Message
is printed with full field information in journalctl -o json.

- Main daemon writes to stderr and to journal with same formatting as before.

- Adding a warning in action code or main daemon results in printing of the
warning with desired formatting. import warnings; warnings.warn('Foo warning')

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:10:52 -04:00
Sunil Mohan Adapa
8cb100be79
email_server: yapf formatting
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:10:34 -04:00
Sunil Mohan Adapa
a2038e98d6
email_server: action: Refactor for simplicity
- Parse arguments in a readable way.

- Convert decorator into simple call.

- Make a simple call instead of looking for subcommand.

- Don't setup logging in global scope.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 19:10:17 -04:00
Sunil Mohan Adapa
220149e6e0
email_server: domains: Add validation to form
- Based on what is already done in domains.py at the time of setting the
configuration.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:44:55 -04:00
Sunil Mohan Adapa
e85001f01f
email_server: domains: Use Django forms and views
- Eliminate error-prone custom code and styling.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:44:41 -04:00
Sunil Mohan Adapa
b62dd2442c
email_server: Minor refactor of license statement in templates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:44:22 -04:00
Sunil Mohan Adapa
b3143ba201
email_server: homedir: Fix styling to not show everything as header
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:43:58 -04:00
Sunil Mohan Adapa
10c9156a29
email_server: Remove tabs from the interface
- All the views are reachable using buttons.

- Add title to the domains page as tabs are removed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:43:40 -04:00
Sunil Mohan Adapa
94a6a9b8aa
email_server: domains: Add button for domain management form
- It will dropped from tabs.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:43:25 -04:00
Sunil Mohan Adapa
bb82dbdaa5
email_server: rspamd: Turn spam management link to a button
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:43:06 -04:00
Sunil Mohan Adapa
77a0d54632
email_server: tls: Drop unimplemented TLS forms/view
- In FreedomBox we will obtain and manage certificates automatically. No need
for forms to manage TLS certificates

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-11-03 18:42:41 -04:00
Johannes Keyser
ee544622be
Translated using Weblate (German)
Currently translated at 100.0% (1518 of 1518 strings)
2021-11-02 14:36:01 +01:00
Sunil Mohan Adapa
31b438e5fd
email_server: aliases: Refactor for simpler organization
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:15:54 -04:00
Sunil Mohan Adapa
f2279ab58a
email_server: aliases: Fix showing empty alias list message
- Trim the button labels.

- Style the usual buttons as default buttons.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:15:51 -04:00
Sunil Mohan Adapa
db1df5ce6b
email_server: aliases: Minor refactor to list view
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:15:48 -04:00
Sunil Mohan Adapa
6eb5980f84
email_server: aliases: Minor refactoring to DB schema
- Use the IntergrityError exception instead of a complex query to ignore an
already existing alias.

- When retrieving existing aliases, use explicit list of columns instead of * so
that schema updates adding columns won't fail the code using the row results.

- Use terminology used by post fix. "name" for the name of the alias. "value"
for the mapping.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:15:44 -04:00
Sunil Mohan Adapa
778d22ac49
email_server: aliases: Minor refactoring
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:15:39 -04:00
Sunil Mohan Adapa
6e8b825d44
email_server: aliases: Drop hash DB and use sqlite3 directly
- Postfix has the ability to use sqlite3 databases directly. There is no need to
synchronize to a hash db and then use that.

- Store the aliases database in /var/lib/postfix/. This will make backup and
restore easier and remove dependence on FreedomBox and its data directory.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:15:26 -04:00
Sunil Mohan Adapa
91f18a0e52
email_server: yapf formatting
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 16:14:58 -04:00
Sunil Mohan Adapa
c742d18f3c
email_server: aliases: Drop unused regex
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 15:23:24 -04:00
Sunil Mohan Adapa
3e7037d0ea
email_server: aliases: Drop unused sanitizing method
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-10-30 15:23:21 -04:00