2681 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
4e5835f92a
wordpress: tests: Fix writing title for new post in newer versions
Newer versions of wordpress after Bullseye seem to have a different HTML
structure for the title element. Make the functional tests work for the new
structure as well as the old one.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-06 12:17:25 -07:00
James Valleroy
90cef6e95c
wordpress: tests: Continue past language selection screen
Tests: Functional tests for wordpress pass on stable container.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Make language selection presence optional]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-06 11:16:47 -07:00
Kolja Gorter
561ba00f18
Add function to change root chanel name of mumble server
Show the current name of the root channel

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[james: Use augeas for config file operations]
[james: Pass channel name on command line]
[james: Add functional test for change root channel name]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-06-03 10:03:51 -04:00
Sunil Mohan Adapa
411f42edb2
wordpress: Allow installing/updating plugins and themes
Based on work by Benedek Nagy at:
https://salsa.debian.org/freedombox-team/freedombox/-/merge_requests/2198

Tests:

- Install WordPress without this patch. Then switch to code with this patch.
Restart FreedomBox. WordPress setup should get executed and the setup version
should get incremented to 2. The configuration file should contain the include
line for freedombox-static.php. freedombox-static.php should be installed and
should contain the line for setting FS_METHOD to 'direct'.

- Uninstall WordPress and wipe everything. Install WordPress freshly using this
patch. The line to include freedombox-static.php should be present in the
default configuration file. freedombox-static.php should be installed and should
contain the line for setting FS_METHOD to 'direct'.

- Installing a new theme using a URL and setting the default theme to the new
theme should work.

- Installing a plugin and enabling it should work.

- Installing an older version of a plugin and then updating it should work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-06-01 10:26:56 -04:00
Benedek Nagy
b6d3e21608
transmission: Add redirects to avoid 409 conflict
Tests:

- Inside container, run 'curl http://localhost/transmission/' and 'curl
http://localhost/transmission/web'. Notice that '409 Conflict' errors are
thrown.

- Apply the patch, run ./setup.py install and restart apache. Run the curl
commands again and this time, they lead to 302 redirects instead.

[sunil]: Update comment and make the redirect temporary.
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-05-25 15:46:55 -07:00
Sunil Mohan Adapa
52d55efe35
tor: Show port forwarding information in consistent way
Closes: #2187

Tests:

- Visit the Tor app page after installing. Port forwarding information is
shown like in all other apps. Protocol column lists 'TCP'.

- Information about SOCKS port is shown in the description.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-23 19:47:15 -04:00
Sunil Mohan Adapa
ca13b7bd93
firewall: Show service name in port forwarding info table
- Also add CSS class for the table to aide functional tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-23 19:47:11 -04:00
Sunil Mohan Adapa
74a6042ed8
*: Show Learn More... links in frontpage with description
Closes: #1797.

Tests:

- For each affected app, install the app, visit frontpage. Select the shortcut.
Notice that Learn More... link is shown and clicking on the link takes us to the
manual page of the app.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-22 05:44:22 -04:00
Sunil Mohan Adapa
48457dd0d0
mediawiki: Fix URL diagnostics with redirects involved
Upon access of MediaWiki URL, it redirects to the main page with the URL
configured. This new URL could only be accessed on IPv4 or IPv6 only. When curl
is invoked with the IP address version of a different kind, this fails. Tell the
diagnostics methods not the restrict to a particular address type.

Tests:

- All MediaWiki diagnostic tests pass. URL tests show that they haven't been
performed on particular address type but rather generically.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-21 19:55:18 -04:00
Sunil Mohan Adapa
436060fecb
apache: Allow URL diagnostics to work with redirects
Upon access of an app URL, it may redirect to another URL that is configured in
app settings. This new URL could only be accessed on IPv4 or IPv6 only. When
curl is invoked with the IP address version of a different kind, the access
fails. In such cases, tell the diagnostics methods not the restrict to a
particular address type.

Tests:

- Unit tests pass.

- All of transmission's diagnostics tests pass. The URL tests show that they
have been performed on a particular IP address type.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-21 19:55:05 -04:00
Benedek Nagy
5da1ebf00c
ssh, bind: Show 'Learn More...' links
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-05-11 10:11:58 -07:00
Benedek Nagy
10fb0cae74
tt-rss: Fix description about user access
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-05-10 14:02:51 -07:00
Benedek Nagy
1dcfa06dd8
mediawiki: Serve hidden service over http for .onion domains
[sunil: rename the form field variable]
[sunil: rename the parater to get/set_server_url functions]
[sunil: remove unused PrependWidget, can be added back later]
[sunil: update functional tests]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-05-10 12:43:43 -07:00
Benedek Nagy
b3d5d68448
mediawiki: Add stricter sandbox rules for jobrunner service
Tests:

- Run ./setup.py install and check that 'systemctl daemon-reload; systemctl show
mediawiki-jobrunner.service' shows the required sandbox changes.

- Tested a few MediaWiki jobs. See:
https://salsa.debian.org/freedombox-team/freedombox/-/issues/299#note_306788

[sunil: Relax the restrictions on read/write paths and networking]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Tested-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-05-10 11:07:08 -07:00
Sunil Mohan Adapa
bf02dfb38c
matrixsynapse: Allow new dependencies to be installed from backports
Closes: #2215.

- matrix-synapse >= 1.55.0-2 requires python3-jinja2 >= 3.0~

- python3-jinja2 >= 3.0~ requires python3-markupsafe >= 2.0

Tests:

- On a stable container, matrixsynapse app is not installable.

- With the changes, start FreedomBox service, setup will run on the upgrades
module and /etc/apt/preferences.d/51freedombox-apps.conf will be changed to
include the two new entries. After this, matrix-synapse app is installable.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-09 21:49:26 -04:00
Sunil Mohan Adapa
8b7ca439ff
mediawiki: Handle password rejection from MediaWiki
Closes: #2063.

When admin password is being set in MediaWiki, if the password is found in the common
list of passwords, MediaWiki will fail instead of setting the password. Detect
this case and show an error instead of a hard server.

Tests:

- Setting the admin password to 'passwordpassword' fails due to check in common
passwords list. A message is shown that strong password is needed instead of a
500 error page.

- Set the password to 'passwordpassword' and update other settings. Settings are
updated with success message but password update fails with error message.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-09 21:44:37 -04:00
Benedek Nagy
8875bc32ae
mediawiki: Check if admin password is at least 10 characters long
Sunil: Current passwords policies as of MediaWiki 1.35.6 do not require capital
letter and numeral. Add comment that the password can't be common one.

Tests:

- Set the admin password to 'testingtesting'. Update should be successful.

[sunil: Fix typos]
[sunil: Drop checking for capital letter and numeral in password]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-09 21:44:32 -04:00
Sunil Mohan Adapa
7e761c91ea
email: Fix userdb lookups with LDAP
Without the base attribute set, LDAP search returns no results and because of
the lookup failure LMTP will not be able to deliver message even though postfix
has successfully received the messages.

Tests:

- On a fresh container, send a message to a local user using roundcube. The user
should receive the message successfully.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-05-09 21:06:56 -04:00
Benedek Nagy
3267a05963
transmission: Improve description
Closes: #952.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-04-29 09:38:12 -07:00
Veiko Aasa
78a2b26132
samba: Fix functional tests when user is not logged in at start
Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-04-26 11:19:29 -07:00
Sunil Mohan Adapa
59d7721682
sharing: Allow double quotes in path strings
Unix paths can contain double quotes. Allow entering paths with double quotes by
escaping them in c-style[1] and retrieve them back properly.

1) https://httpd.apache.org/docs/2.4/expr.html

Tests:

Run tests on with various paths:

- /var/a b

- /var/c"d

- /var/ef"

Run the following tests.

- Create a directory with the test path and create a sample file inside it.

- Add a share with the test path.

- Ensure that the share is accessible and the file can be downloaded.

- Ensure that the list of the shares shows the path correctly.

- Ensure that the share can be edited.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-04-25 15:21:55 -07:00
Benedek Nagy
0b2125aad6
sharing: put file path between quotation marks
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-04-25 15:21:45 -07:00
Aurélien Couderc
37d066e285
Fix description of the validation rule for calibre library names so it actually matches the pattern 2022-04-10 14:05:21 -07:00
James Valleroy
d21e33268d
upgrades: Use python3-typing-extensions from bullseye-backports
Fixes #2207.

Tests:

- /etc/apt/preferences.d/51freedombox-apps.pref has expected content.

- Matrix Synapse can be installed, functional tests pass.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-04-10 14:02:40 -07:00
Sunil Mohan Adapa
2752cf55d3
package: Update package expression API and fix regressions
- Make terminology more consistent managed vs. possible, resolve vs. actual.

- Fix regression in security report caused by comparing package expressions with
package names.

- Fix regression in package upgrades caused by comparing package expressions
with package names.

- Update API method names to improve readability and prevent accidental
mismatching of package names and package expressions. Update variable names for
same reason during usage.

Tests:

- minetest install successfully in testing.

- Security report shows non-zero value in the current vulnerabilities column.

- When an unavailable package is added to list of packages in an app, the app
can't be installed.

- When PackageOr expressions is added to an essential package, running
  --list-dependencies shows an expressions with '|' in it.

- Unit tests succeed.

- Find a package with conffile prompt and add that to list of a packages in an
app like bepasty and implement a stub force_upgrade() method in the app. Run
'apt update' and that triggers and analysis of packages with conf file prompts.
This should call force_upgrade() method in bepasty and with proper argument for
list of packages.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-04-10 09:51:13 -04:00
James Valleroy
93156fe8e7
minetest: Allow alternate name for 3d armor mod
In Bookworm, the minetest-mod-player-3d-armor package is renamed to
minetest-mod-3d-armor. Allow either package name to fulfill the
requirement, so that the app is installable in both Bullseye and
Bookworm.

Fixes #2164.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-04-10 08:29:34 -04:00
Jim Gregory
66e19ff56e
network: Fix showing wifi connection
Viewing a wifi connection will cause a 500 error.  To reproduce this
issue, go to plinth/sys/networks/.  If no wifi connections exist,
add one use the "Add Connection" button.  Then, click on the name of
the wifi connection to view it.  A 500 error is returned.

This commit fixes this error so the normal "show connection" is
returned.  It also fixes a bytestring conversion error
for the SSID and a blank value for "mode" on the page.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-03-28 15:19:48 -07:00
James Valleroy
5ea78f6e28
upgrades: Allow backports from src:freedombox
This allows any binary package in src:freedombox to be upgraded from
backports, so that packaged manuals are included.

Thanks for Frank Woodward for finding the root cause and solution.

Tests:

- Build a FreedomBox bullseye image with backports disabled.

- During setup, enable backports, and update packages. freedombox
  package from bullseye-backports is installed, but freedombox-doc-*
  packages are from bullseye.

- Install freedombox package with the fix, and update
  packages. freedombox-doc-* packages from bullseye-backports are
  installed.

Closes #2106.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-03-28 11:03:09 -07:00
Benedek Nagy
4ac789efd3
calibre: explain correct name format for new library
Closes: #2186.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[jvalleroy: Remove duplicate import]
[jvalleroy: Reword help text slightly]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-27 10:19:30 -04:00
Benedek Nagy
c5287a3893
ikiwiki: add packages that are neccesary for apt-get install
Closes: #2181.

Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-25 11:47:23 -04:00
Sunil Mohan Adapa
d77f812d11
dynamicdns: Fix adding null domain into configuration
When old configuration is not set and is exported with new code into newer
format, the result is a domain added with domain name 'null'. This causes issues
with UI not showing configuration and with null domain being added into
configurations of various daemons.

Tests:

- To reproduce the issue, switch to a revision with old dynamicdns code. Then
switch to a latest version without the fix. A 'null' domain is added to
configuration.

- To reproduce the issue, switch to a revision with old dynamicdns code. Then
switch to a latest version with the fix. A 'null' domain is not added to
configuration.

- With null domain in the configuration. Start FreedomBox with the fix. The null
domain should be removed and null domain should not be announced to other
daemons.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:13 -05:00
Sunil Mohan Adapa
354985f97c
email: Fix issue with certs not being available
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:10 -05:00
Sunil Mohan Adapa
9d4ae972e9
email: Revert to LDAP auth as pam does not allow non-admin users
Since FreedomBox does not allow any users but those belonging to 'admin' group
to login, using passwd driver for auth means that only admin can login to
postfix/dovecot. Fix this by reverting to using LDAP driver.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:08 -05:00
Sunil Mohan Adapa
56f95ddf97
email: rspamd: Log to journald via syslog
Unified querying, reduce random writes for SD cards, eliminate need for separate
log rotation.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:06 -05:00
Sunil Mohan Adapa
265534a6bf
email: postfix: use inline map for TLS SNI maps
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:04 -05:00
Sunil Mohan Adapa
64d0411d6b
email: Allow re-running setup
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:02 -05:00
Sunil Mohan Adapa
e52aae3acd
email: clients: Make Thunderbird URLs language independent
The site will then redirect to a language specific URL.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:39:00 -05:00
Sunil Mohan Adapa
a5a3500630
email: aliases: Minor refactoring to form validation
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:57 -05:00
Sunil Mohan Adapa
3d15ebd436
email: postfix: Fix priority for authentication directives
Otherwise, the default directives in 10-auth.conf take higher priority.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:55 -05:00
Sunil Mohan Adapa
828cc73320
email: Add various documentation links for future readability
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:53 -05:00
Sunil Mohan Adapa
6bdd62b643
email: Implement adding common aliases for first admin user
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:51 -05:00
Sunil Mohan Adapa
25da081ea2
email: Don't start disabled daemons when setup is re-run
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:48 -05:00
Sunil Mohan Adapa
ef6619d8d6
email: Use the term 'setup' rather than 'repair' for consistency
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:46 -05:00
Sunil Mohan Adapa
55bd428bd7
email: Update module docstrings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-03-02 07:38:44 -05:00
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