998 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
c6b69b2f41
package: Run installation operation using app_id instead of module
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:10 -04:00
Sunil Mohan Adapa
20081ee5d1
roundcube: Use privileged to simplify actions
Tests:

- Functional tests pass

- Same tests as previous patch for setting logging to syslog.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-17 17:23:18 -04:00
Sunil Mohan Adapa
253ddb0c18
roundcube: Configure to log to journald
Tests:

- On a fresh container, install roundcube. log_driver is set to syslog in
freedombox-config.conf.

- Install roundcube without the changes. Enable local only. Apply the changes
and restart service. roundcube setup is run. log_driver is set to syslog in
freedombox-config.conf. Setting is still local-only.

- Install roundcube without the changes. Disable local only. Apply the changes
and restart service. roundcube setup is run. log_driver is set to syslog in
freedombox-config.conf. Setting is still not local-only.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-17 17:22:30 -04:00
Sunil Mohan Adapa
bf1ed7d064
apache: Redirect all logs to systemd journal
- Redirect with separate identifiers so that they can retrieved separately.

- Enable virtual host log format that include name of the domain accessed so
that that information is preserved.

- There is no need to increment the apache app's version number as it has been
incremented earlier in the patch series (for this release).

Tests:

- In a fresh container, setup succeeds. Default apache sites 000-default.conf
and default-ssl.conf are disabled. freedombox-default.conf is enabled. Apache
access logs and error logs are sent to systemd journal.

- Without the patch applied, create a container. Run setup and access Plinth
interface. Apply the patches. Apache setup is run. a2query -s default and
a2query -s 000-default show that sites are not enabled. a2query -s
freedombox-default shows that site is enabled. Apache access logs and error logs
are sent to systemd journal.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-17 12:07:55 -04:00
Sunil Mohan Adapa
f8f7dd22b5
apache: Merge old configuration files into a better location
- It is simpler to keep all the configuration in a single file. Any overrides
are expected to be done by writing additional configuration files with higher
priority.

- /etc/apache2/site-available/ is typically reserved for virtual host
configurations. Redirections and proxying for all virtual hosts rather belongs
in /etc/apache2/conf-available/.

- This looses the option of disabling plinth-ssl.conf when needed. In the
initial days of enabling TLS, there was a need felt to keep the option of easily
disabling redirection to TLS in case there is a need for it. However, TLS
certificate setup is mature and the limitations are well understood. There is no
longer a need for it. It still may be possible to avoid the redirection with an
additional configuration.

Tests:

- In a fresh container, setup succeeds. Redirecting to https:// for /plinth
works. FreedomBox web interface is available.

- Without the patch applied created a container. Run setup and access Plinth
interface. Apply the patches. Apache setup is run. a2query -s plinth and a2query
-s plinth-ssl show that sites are not enabled. Redirecting to https:// for
/plinth works. FreedomBox web interface is available.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-17 12:07:55 -04:00
Veiko Aasa
545b35c0aa
gitweb: Switch default branch name to main for new repositories
I tested additionally that if the root user has already configured
default branch other than main, it is not changed by the gitweb app
setup process.

Signed-off-by: Veiko Aasa <veiko17@disroot.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-15 20:54:32 -04:00
Sunil Mohan Adapa
99d8be9d2a
cockpit: Use decorator for privileged actions
Tests:

- Login to Cockpit on a freshly setup container.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-15 20:37:13 -04:00
Sunil Mohan Adapa
c163601b6c
cockpit: Reconfigure to allow any origin
When Cockpit is not configured any origins, it uses the host and protocol of the
incoming request to set the allowed origin for WebSocket connections. By
ensuring that the original host/protocol is passed on to Cockpit from the
browser, we can eliminate the need for configuring a pre-determined list of
origins. Passing the host and protocol from the browser is done by setting
ProxyPreserveHost and using https:// for proxying.

For a cross-site request, Origin: and Host: entries won't match and '403
Forbidden' is thrown. So, this approach is still safe.

Tests:

- Without the patch, access Cockpit using IP address and it fails. Apply the
patch. Cockpit setup should run. Origins= directive in the configuration file
/etc/cockpit/cockpit.conf should get removed. Accessing with IP address and
logging in succeeds.

- Freshly setup a container with the patch and access Cockpit using IP address.
This works and login succeeds.

- Test on stable and testing containers.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-15 20:37:04 -04:00
Sunil Mohan Adapa
372ecdcda9
privoxy: Use privileged decorator for actions
Tests:

- App installation works. Proxying works when configured with Firefox.
listen-address and permit-access directives are set as expected in the
configuration file.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-07-13 19:41:45 -07:00
nbenedek
de2c246dbd
privoxy: Restrict to private IPs, prevent access over the internet
- Make sure a user might not run Privoxy as an open proxy, potentially giving
unwanted access to local resources. Only private IP classes are allowed to
connect.

Tests:

- Freshly install privoxy app. permit-access directives are set in the
configuration. Proxy works when tested with a private IP address with Firefox.

- Install privoxy app without the changes. Apply the changes, privoxy setup
should run. permit-access directives are set in the configuration. Proxy works
when tested with a private IP address with Firefox.

- Privoxy works when accessed with IPv4 address (such as 10.42.0.x) and IPv6
address (such as fe80:y:z%ve-fbx-testing).

[sunil: Use Spacevars augeus lens to edit the configuration file]
[sunil: Update IP ranges with auto-configuration, IPv6 addresses, etc.]
[sunil: Update description to mention that only local IPs are allowed]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-07-13 19:41:42 -07:00
Sunil Mohan Adapa
c73f88b925
*: pylint: Suppress unused argument warnings
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-04 19:46:06 -04:00
Sunil Mohan Adapa
3c7bc4a192
*: pylint: Explicitly specify encoding when open a file
This is recommended by PEP-0597: https://peps.python.org/pep-0597/

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-04 19:45:57 -04:00
James Valleroy
892deefdca
upgrades: Hold packages one at a time
`apt-mark hold PACKAGES` accepts a list of packages. But if one of the
package is missing from the apt repository, then it will fail to hold
any of the listed packages. So it is necessary to try to hold each
package by itself.

Test:
- Run dist-upgrade from bullseye to bookworm. mumble-server package is
currently missing from bookworm, but it should not cause an error in
dist-upgrade.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-07-01 10:22:42 -04:00
James Valleroy
c70006d03a
upgrades: Re-add workaround for grub
For dist-upgrade from buster to bullseye, we had a workaround to avoid
grub error during upgrade. The workaround is still needed for
dist-upgrade from bullseye to bookworm.

Helps #2057.

Test:
1. Build freedombox package for bullseye-backports with this fix
included.
2. Install package in bullseye vagrant box.
3. Enable automatic updates, and start dist upgrade from action.
4. Check journal to see if there is an error from grub.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-07-01 09:30:40 -04:00
Guillermo Lopez Alejos
d7a1ea03a3
backups: Add options to keep sshfs shares responsive
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-30 15:31:13 -07:00
nbenedek
35b50a2c71
users: create home directories for newly created users
Test I made: Created a few users, then appied the changes
and rebooted FreedomBox. After reboot I created another user
whose home directory could now be listed.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-30 09:07:52 -07:00
nbenedek
9ca56c728e
mediawiki: Remove Buster specific code not needed in Bullseye
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-29 09:29:09 -07:00
Sunil Mohan Adapa
7470821dc7
mumble: Use privileged decorator for superuser actions
- Don't use command line argument for sending the join password for security.

- murmurd can switch to mumble-server UID before performing database operations.
Remove code to switch to mumble-server user.

- murmurd seems to return correct response code of 0 upon successfully setting
the password. Simplify code accordingly.

- Use subprocess.run() instead of subprocess.Popen for convenience.

Tests:

- Run functional and unit tests on Debian stable.

- Perform a fresh installation.

- Verify that setting super user password works.

- Verify that setting root channel names works.

- Verify that setting join password works.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-06-24 08:41:23 -04:00
Sunil Mohan Adapa
a55e63b7f4
matrixsynapse: Allow new dependency to be installed from backports
Closes: #2230.

- matrix-synapse >= 1.59.1-1 requires python3-unpaddedbase64 >= 2.1.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-06-24 08:18:27 -04:00
Sunil Mohan Adapa
15038ae24c
transmission: Simplify actions using the privileged decorator
Tests:

- Get and set the storage path.

- Functional tests pass.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-06-20 18:17:18 -04:00
Sunil Mohan Adapa
4fed6921d6
actions: Add a decorator for marking superuser actions
Any privileged action (a method) can be marked as such with the new decorator. A
call to the method will be serialized into a sudo call (or later into a D-Bus
call). The method arguments are turned to JSON and method is called as
superuser. Arguments are de-serialized and are verified for type before the
actual call as superuser. Return values are serialized and returned where they
are de-serialized. Exceptions are also serialized and de-serialized.

The method must have be strictly typed and should not have keyword-only
arguments. Currently supported types are int, float, str, dict/Dict, list/List
and Optional.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-06-20 18:16:47 -04:00
nbenedek
3ec086411b
mediawiki: Add option to change the site name
[sunil: Update the form description for styling]
[sunil: Show the default site name when nothing is set]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-20 14:13:28 -07:00
James Valleroy
1a39212313
ejabberd: Add multi-select form for domains
Choices includes all of the available domain names in the system, as
well as any domains that are in ejabberd configuration.

Tests:

- Disable a domain. It is removed from ejabberd config.

- Enable a domain. It is added to ejabberd config.

- Enable all name services. Run ejabberd functional tests and observe
  that they pass.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-20 11:09:31 -07:00
schiriki
7028e3d022
Add char field to set a password that is required to join the server
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
[james: Apply yapf formatting]
[james: Minor adjustment to help text]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-06-18 10:26:51 -04:00
James Valleroy
b7a1d4bf8f
janus: Add new app for lightweight WebRTC server
- Add basic video room based on demo.

- Set port range to use for RTP.

- coturn: Add component for time-limited TURN configuration.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
[sunil: Don't error out when coturn is not installed/configured]
[sunil: Prepend data- to custom attribute in HTML]
[sunil: Convert SVG with embedded bitmap to vector graphics]
[sunil: Hide Javascript license information in footer]
[sunil: Minor changes to comments for styling]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2022-06-06 17:42:41 -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
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
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
James Valleroy
f1bbfa73c7
upgrades: Split Explanation line
Avoids a flake8 error.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-04-11 19:50:54 -04: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
45820fbdfa
package: Use package expressions in Packages component
- managed_packages() finds all possible packages that could be
  installed. This is used for the check in the action script.

- resolve() finds actual packages to be installed. This is used in
  setup, diagnose, and has_unavailable_packages.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2022-04-10 08:29:34 -04: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
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
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
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
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
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
Sunil Mohan Adapa
affffddf36
roundcube: Add setting for local connection only
When this option is enabled, it would make the interface easy to work with. This
is likely what most users would want. Don't break things for users who have
already installed roundcube and ensure that local only is disable for them.

Tests:

- Install roundcube without the patch. Disable the app. Apply patch. Restart
service. Notice that roundcube is not re-enabled.

- Install roundcube without the patch. Apply patch. Restart service. Notice that
roundcube configuration /etc/roundcube/config.inc.php file has been updated and
include_once() at the end has been added. The file
/etc/roundcube/freedombox-config.php has been added. Local only option is
disabled.

- Install roundcube freshly with the patch. Local only option is enabled. Open
interface. Notice that server option is not presented.

- Disable local only option and notice that server field is shown in the
interface.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Fix comment]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-31 18:46:01 -05:00
Sunil Mohan Adapa
78d78d84a7
coturn: Use wildcard listening address to fix startup issues
Fixes: #2069.

Without a listening port, coturn will try to enumerate the non-local IP
addresses and try to listen on them. If coturn is started before network is
fully setup, it finds no usable IP addresses and fails. Furthermore, if IPs are
added to the system, it does not automatically listen on them.

A better approach as advised by systemd NetworkTarget documentation is to listen
on a wildcard address. This does not require network to be online and works well
for IP addresses being added/removed from the system. coturn is itself unable to
make changes to its default listening behavior for backward compatibility.

Tests:

- Freshly install coturn. Observe that listening-ip is properly set in the
configuration file. coturn is listening on 3478, 3479, 5349, 5350. coturn is
listening on ::1 and * addresses instead of individual IP addresses.

- Install coturn without the patch. Apply the patch and restart FreedomBox.
coturn setup will run. listening-ips get added to the configuration file. The
static-auth-secret is not changed from earlier. coturn will be restarted. coturn
is listening on 3478, 3479, 5349, 5350. coturn is listening on ::1 and *
addresses instead of individual IP addresses.

- Install coturn without the patch. Disable coturn. Apply the patch and restart
FreedomBox. coturn setup will run. coturn will not be enabled. coturn will be
running after setup.

- Functional tests pass.

- All ports able to connect using netcat (nc command) with IPv4 (-4 option) and
IPv6 (-6 option).

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-31 13:48:15 -05:00
Sunil Mohan Adapa
668da20a02
mldonkey: Drop app not available in Debian Bullseye and Bookworm
Closes: #2157.

Original author of the app J. Carlos Romero <juancarlos.romero@gmail.com> has
been contacted to see if there is interest in continuing to maintain the app.
There has been no response.

Since the app is not available even in the current stable (Bullseye), few users
are presumably using it on a supported FreedomBox distribution. Any users are
advised to maintain the manually instead of relying on FreedomBox for it.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-22 11:55:34 -05:00
Sunil Mohan Adapa
01e2896724
upgrades: Allow matrix's new dependency to be installed
matrix-synapse 1.47.0-2 requires python3-frozendict 1.2-3 or higher. This is
only available in bullseye-backports, testing and unstable but not bullseye.

Allow python3-frozendict to be installed from buster-backports. Further there is
no longer any need to allow packages from buster-backports (on the master
branch). So, drop all those.

Tests:

- On stable/testing, without matrix-synapse and its dependencies installed, run
matrix-synapse functional tests.

- On stable, with older version of matrix-synapse and python3-frozendict, run
unattened-upgrade and notice that matrix-synapse upgrades to latest version.

- Without this patch, run service. Notice the contents of
/etc/apt/preferences.d/51freedombox.pref. When this patch is applied and service
is restarted, upgrades app is setup again and the files contents will change as
expected.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-01-17 11:00:09 -05:00
Joseph Nuthalapati
b0305746c8
tahoe-lafs: Drop app as it is not being used
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Add to configuration file removal in Debian package and setup.py]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 15:12:11 -08:00
Joseph Nuthalapati
621cb67527
diaspora: Drop app that was never finished.
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Add to configuration file removal in Debian package]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 15:11:29 -08:00
Joseph Nuthalapati
ce5274d9ee
monkeysphere: Drop app as it is not being used
Closes #2157.

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
[sunil: Split diaspora and tahoe-lafs into separate commits]
[sunil: Remove monkeysphere from help/tests/test_views.py]
[sunil: Add to configuration file removal in Debian package and setup.py]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 15:09:50 -08:00
James Valleroy
f72505d300
upgrades: Add type annotations to action
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2021-12-20 13:46:53 -08:00