2637 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
6cfa0589a7
email: Drop atomic writing to a file
Not very critical. Reduce complexity. Re-implement later at framework level.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:42 -05:00
Sunil Mohan Adapa
48f17c4eeb
email: Drop postfix and dovecot LDAP packages
They are unused. postfix-ldap is needed for LDAP based maps. In dovecot,
authentication happens using PAM.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:40 -05:00
Sunil Mohan Adapa
e08988507e
email: Name module ldap to postfix
There is nothing related to LDAP in the module. It actually configures postfix.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:38 -05:00
Sunil Mohan Adapa
59e51faf2e
email: Drop unused utility method for logging
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:36 -05:00
Sunil Mohan Adapa
8a53957b1e
email: Simplify and rename postfix configuration module
- Remove unnecessary complex crash handler needed due to setting the service
configuration in two steps. Merge the two step into one after which crash
handler is not needed.

- Drop '_unsafe' API and verify all keys and values for sanity.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:33 -05:00
Sunil Mohan Adapa
5bc5191ea7
email: Drop use of mutex for postfix configuration operations
This is not critically needed in FreedomBox. Implementation is complex. This may
be recreated at framework level to benefit all applications.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:30 -05:00
Sunil Mohan Adapa
1b5e99c56e
email: Rename audit module to privileged
The module does not interact with kernel audit system or is not related to
security logging. The 'privileged' makes us pay more attension.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:28 -05:00
Sunil Mohan Adapa
37b28e05d7
email: Drop mentions of clamav as it is too memory intensive
A fresh install of clamav-daemon takes up about 1GiB or RAM. Most of this is the
virus signature database and is used regularly for a scan. This makes ClamAV
unsuitable for FreedomBox running on many single board computers. Drop ClamAV
until we start recommending/requiring at least 2GiB of RAM.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:26 -05:00
Sunil Mohan Adapa
ad702e1a91
email: Add shortcut for non-admin users to manage their aliases
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:24 -05:00
Sunil Mohan Adapa
9d0d7e586c
email: aliases: Drop ability to enable/disable aliases
- There is no use case for keeping an alias disabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:22 -05:00
Sunil Mohan Adapa
60822f7198
email: Enable as an advanced app
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:19 -05:00
Sunil Mohan Adapa
bc5de46eb2
email: dns: Show table for desired DNS entries
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:17 -05:00
Sunil Mohan Adapa
1af9a6b114
email: dkim: Implement setting up DKIM signing keys
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:15 -05:00
Sunil Mohan Adapa
10606bfc69
email: Set an icon from Tango project
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:13 -05:00
Sunil Mohan Adapa
1bc576387e
email: Minor indentation and docstring changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:10 -05:00
Sunil Mohan Adapa
11b4b8fa93
email: Drop unused diagnosis module
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:08 -05:00
Sunil Mohan Adapa
c8d1f614da
email: Simplify setting up postfix
- Reduce complexity by removing the diagnosis approach.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:05 -05:00
Sunil Mohan Adapa
bbd0b629f3
email: Add backup/restore component
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:03 -05:00
Sunil Mohan Adapa
851644574d
email: Add basic functional tests
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:01 -05:00
Sunil Mohan Adapa
96c587c13c
email: Setup rspamd configuration to include FreedomBox config
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:58 -05:00
Sunil Mohan Adapa
60d137a537
email: Remove override for local addresses
- The default, which is to trust local LAN IPs is good enough for FreedomBox use
case.

- This allows skipping some checks like DKIM for mails originating from local
networks which are not expected to have proper signatures.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:56 -05:00
Sunil Mohan Adapa
0d5366a356
email: Drop special handling for outbound filtering
- Reduces a lot of complexity and avoids running a couple of more postfix
daemons (one on 10025 port and other on socket fbxcleanup).

- Cleaning outbound headers for privacy can be done in a simpler way. This may
be re-implemented later.

- Masquerading domains is not very important for FreedomBox use case. Users are
expected to send all mail using MUA using properly configured email addresses.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:53 -05:00
Sunil Mohan Adapa
84f7b60bc5
email: Drop special handling for reserved TLDs
There is no special reason to handle them separately instead of letting DNS
resolution to them fail. No documentation on what caret addresses are or what
.fm.localhost TLD is.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:50 -05:00
Sunil Mohan Adapa
4b741e9192
email: Simplify setting milter configuration and running sievec
- Drop diagnosis.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:48 -05:00
Sunil Mohan Adapa
75ec7c5a5a
email: Add more special-use IMAP folders, set autoexpunge to 60days
A mail client should not create these special folders if they see existing
folders with the special-use flag set on them. However, if a mail clients does
create a folder and does not set special-use folder, the server will set the
flag so that all other mail clients can see the flag.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:45 -05:00
Sunil Mohan Adapa
9710369949
email: Narrowly match just rspamd's spam header
There is no need to match generically for flags that are possibly generated by
other spam software. Allow other rules to run after filing into Junk folder.
Allow other sieve filter to be present in the FreedomBox configuration directory.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:42 -05:00
Sunil Mohan Adapa
d47d39a8dd
email: Open firewall port for managesieve protocol
- managesieve plugin is already enabled due to installation of
dovecot-managesieve.

- Using ManageSieve protocol, clients like Thunderbird (with managesieve addon)
will be able to edit mail filters on the server. The server will perform the
filtering enabling all clients to share the benefits.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:39 -05:00
Sunil Mohan Adapa
ae8dd4ec7f
email: Depend on and run redis server
Many modules in rspamd including the bayes built-in module depend on
redis-server. Install, run and configure redis-server.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:36 -05:00
Sunil Mohan Adapa
fd9e1927e5
email: Simplify modifying headers proxied to rspamd web UI
There is no need to remove many headers explicitly after doing ProxyAddHeaders
off. If those headers are set by the client, that will merely result in an
unnecessary password dialog.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:34 -05:00
Sunil Mohan Adapa
b3a04ebce9
email: Drop unused Apache include freedombox-robots.conf
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:31 -05:00
Sunil Mohan Adapa
6421090a41
email: Tweak client auto-configuration file
- Allow STARTTLS as it is safe to do so.

- Allow POP service in the event user wants to keep the mails on the server.

- Add documentation link (this is currently unused and for documenting the code
only).

- Allow translation of display name and short name.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:26 -05:00
Sunil Mohan Adapa
6e2c24c9e4
email: rspamd: Simplify installing configuration
Existing implementation expects configuration files installed by FreedomBox to
be edited at the top and the bottom. When re-installing, it tries to keep the
edited parts while reinstalling the FreedomBox managed section in the middle to
be overwritten with (new) FreedomBox defaults.

Instead, simply ship the two files to rspamd configuration directories. These
can be easily overridden by the user if they desire due to flexible
configuration file priorities by rspamd.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:37:01 -05:00
Sunil Mohan Adapa
3b5091cbc3
email: Backup/restore aliases and mailboxes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:55 -05:00
Sunil Mohan Adapa
2c044db25c
email: Drop X-Robots-Tag on the auto-configuration URL
Seems unnecessary. Nothing to followup on.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:47 -05:00
Sunil Mohan Adapa
32737a16ed
email: Rename app from email_server to email
For simplicity and consistency. Eliminate '_' in the name.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:40 -05:00
Sunil Mohan Adapa
d35ec339d1
email_server: Add front page shortcut, update name and description
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:36 -05:00
Sunil Mohan Adapa
3dc53046f4
email_server: Update short description
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:31 -05:00
Sunil Mohan Adapa
41dd78f432
email_server: Update donation URL to rspamd donation URL
These URLs are meant for supporting the upstream development of apps rather than
for FreedomBox (which has its own page). postfix, dovecot and clamav don't seem
have a donation mechanism. So, add rspamd's donation URL.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:20 -05:00
Sunil Mohan Adapa
5ce9f58bb4
email_server: List all listening ports of the daemons
This allows diagnosis of listening on all ports instead just the ports exposed
to outside.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:36:07 -05:00
Benedek Nagy
74b0a94917
samba: add iOS VLC client
Source code: https://code.videolan.org/videolan/vlc-ios

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-26 12:14:08 -05:00
Benedek Nagy
1c99330282
minidlna: add iOS VLC client
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-26 11:45:06 -05:00
Benedek Nagy
1f83c92802
tt-rss: Restrict access to feed-reader group in "/tt-rss-app"
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-14 18:03:02 -05:00
Sunil Mohan Adapa
09d177755d
minetest: Reduce the number of configuration update messages
Reduces translation burden, more consistency with other apps and allows generic
implementation in framework in the future.

Tests:

- Install and update configuration for minetest. See message 'Configuration
updated'. If configuration is not updated, 'Settings unchanged' message is
shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-12 17:01:23 -05:00
Sunil Mohan Adapa
3cbd8f604b
users: Fix typo in description
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reported-by: Besnik_b
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-12 17:01:14 -05:00
Sunil Mohan Adapa
7e0156adbe
dynamicdns: Rewrite configuration handling and update using URL
- Drop all the bash code.

- Run the update URL code with same logic as before. Don't need to use action
code for it.

- Completely new way to handle configuration: using key/value store. Import old
configuration once and delete it.

- Use a glib scheduler instead of creating a cron job.

- Store and show status from key/value store.

- Handle multiple domains when getting/setting configuration and status. The UI
still shows a single configuration form. To be improved later.

- Catch and report all errors during the update process.

- Drop all NAT detection code.

- Drop selfhost.bz. German only, no free account, no proper TLS on domain, no
easy to test. Existing accounts will continue to work with "other" as the
service type.

- For gnudip update code, add a timeout of 10 seconds, set a buffer size of two
powers and fix handling error messages from server.

Tests:

- GnuDIP:

  - Upon submission of the form, the IP is updated if app is enabled. IP is not
  updated if app is disabled.

  - Every 5 minutes, check is made again and IP is updated.

  - If IP lookup URL is available, update calls are not made if the DNS is
  already up-to-date.

  - If IP lookup URL is not available, update calls are made unconditionally
  every 5 minutes.

- For each of noip.com, freedns.afraid.org and other service:

  - Upon submission of the form, the IP is updated if app is enabled. IP is not
  updated if app is disabled.

  - Every 5 minutes, check is made again and IP is updated.

  - If IP lookup URL is available, update calls are not made if the DNS is
  already up-to-date.

  - If IP lookup URL is not available, update calls are made unconditionally
  every 5 minutes.

- Form validation:

  - Domain field is always mandatory.

  - When type is selected as gnudip, the fields server, username, and password
  are mandatory.

  - When type is selected other than gnudip, the field update URL is mandatory.
  The rest are optional.

  - When the update URL contains a field contains <User>, username is mandatory.
  For <Pass>, password is mandatory. For <Ip>, ip_lookup_url is mandatory.

  - When use HTTP basic auth is checked, the fields username and password are
  mandatory.

  - Password is optional only if a previous password exists. If configuration is
  deleted from kvstore, password is mandatory.

- Configuration import:

  Install dynamicdns without the patch. Add configuration with each of the
  service types. For GnuDIP service type, set two configurations with one with
  and without IP lookup URL. Update to code with the patch. Setup should run.

  - All fields in the configuration should be imported properly.

  - If the previous configuration is disabled, app should be disabled after
  import. Enabled otherwise.

  - Updating the IP address should work immediately after import.

- Enable/Disable: when enabled, IP URL should be enabled every 5 minutes.
When disabled, updates should not happen.

- Status:

  - When status is removed from the DB, it should show that no status is
  available yet.

  - When the form is updated or update happens via the timer, the status is
  shown. It should show success for a proper update. Proper external IP address
  should be shown.

  - Set the server to localhost and submit. Status should show 'Server refused
  connection' message. IP address should be '-'.

  - Set the server to an unknown domain. Status should show 'Could not find
  server' message. IP address should be '-'.

  - Set the server to a known domain. Status should show 'Connection timed out'
  message. IP address should be '-'.

  - Last update time should keep increasing as time passes.

- Backup/restore:

  - Functional tests.

- Javascript:

  - When GnuDIP is selected as the type, the fields server, username, password,
  domain, show password, and IP lookup URL should be shown while other fields
  should be hidden. Same on page load with GnuDIP as pre-selected type.

  - When GnuDIP is not selected as the type, the fields update URL, accept all
  SSL certificates, use basic HTTP auth, domain name, username, password, show
  password, IP lookup URL and use IPv6 fields should be shown and rest of the
  fields should be hidden. Same on page load with non-GnuDIP as pre-selected
  type.

  - When show password is checked, password should be shown and when it is
  unchecked, password is masked.

  - When other service types are selected, the update URL values changes to the
  respective service's URL.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-10 20:31:39 -05:00
Sunil Mohan Adapa
59c5e58549
backups: Implement backup/restore of key/value settings
- Implemented within the backup component. Scope for implementing database
backup/restore in similar way.

- Add new 'settings' key in the backup manifest to allow keys to backed up and
restored.

- Implement by dumping/loading settings from DB into the file.

Tests:

- Unit tests.

- Backup/restore tests for dynamicdns workss.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-10 20:31:36 -05:00
Sunil Mohan Adapa
f107e83534
dynamicdns: Drop NAT detection as it is no longer used
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-10 20:31:30 -05:00
Sunil Mohan Adapa
eac8f1f905
dynamicdns: Drop tabs and use single page
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-10 20:31:27 -05:00
Sunil Mohan Adapa
4705f1883f
dynamicdns: Drop about page and merge into description
Rename dynamicdns_configuration.html to dynamicdns.html.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-02-10 20:31:20 -05:00
James Valleroy
84a7323b42
dynamicdns: Replace ez-ipupdate
Add Python implementation of GnuDIP client.

Tests:

- In testing container, configure Dynamic DNS with a (previously
  offlined) freedombox.rocks account. FreedomBox interface shows that
  the address has been updated. GnuDIP server also shows the correct
  IP address.

- Running "gnudip update" and "dynamicdns update" actions produce the
  expected results.
2022-02-09 12:05:21 -08:00