3079 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
38ece87c6c
*: Utilize newer 3.10 syntax for type hints
Tests:

- mypy does not show any errors.

- Installing ejabberd app works. Privileged actions run fine.

- Unit tests work.

- No additional testing was done as type annotations don't have any effect at
runtime.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:03:34 -04:00
Sunil Mohan Adapa
2dd00a8f08
*: Fix all typing hint related errors
- Try to mark class variables in component classes.

- Leave typing hints generic, such as 'list' and 'dict' where content is usually
not filled, too complex, or context is unimportant.

- backups: Handle failure for tarfile extraction so that methods are not called
on potentially None valued variables.

- backups: Prevent potentially passing a keyword argument twice.

- dynamicdns: Deal properly with outcome of urlparsing.

- ejabberd: Deal with failed regex match

- email: Fix a mypy compliant when iterating a filtered list.

- tor: Don't reuse variables for different typed values.

- tor: Don't reuse variables for different typed values.

- operation: Return None explicitly.

- operation: Ensure that keyword argument is not repeated.

Tests:

- Where only typing hints were modified and no syntax error came up, additional
testing was not done.

- `mypy --ignore-missing-imports .` run successfully.

- Generate developer documentation.

- Service runs without errors upon start up.

- backups: Listing and restoring specific apps from a backup works.

- backups: Mounting a remote backup repository works.

- NOT TESTED: dynamicdns: Migrating from old style configuration works.

- ejabberd: Verify that setting coturn configuration works.

- email: Test that showing configuration from postfix works.

- tor: Orport value is properly shown.

- transmission: Configuration values are properly set.

- users: Running unit tests as root works.

- operation: Operation status messages are show properly during app install.

- ./setup.py install runs

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:03:24 -04:00
Sunil Mohan Adapa
ac84258f05
upgrades: Fix detecting apt over tor during upgrade
- This was missed during the split of tor/torproxy apps.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 20:03:16 -04:00
Sunil Mohan Adapa
995749a975
wordpress: Use absolute path in service file
This is the recommended approach. On Debian, php is usually resolved to
/usr/bin/php.

Tests:

- Tests with absolute path in service file were performed as part of testing
done in https://salsa.debian.org/freedombox-team/freedombox/-/issues/2373 . No
separate testing was done.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-09-25 17:41:11 -04:00
rsquared
a6165c997a
ikiwiki: Disable discussion pages by default for new wiki/blog
Closes: #2102.

- Wiki: Unchanged behavior is to have discussion pages enabled. To post users
must login.

- Blog: Earlier behavior is to allow anonymous users to post comments. They go
into the moderation queue when posted. This could lead to a lot of spam comments
to moderate. New behavior is to allow posting comments only when logged in.

- Blog: discussion => 0 does not effect comments. It is meant for discussion
page on the blog's home page (and possibly other pages). Discussion on those
pages is disabled by default.

- The changes only apply to defaults. Everything can be changed from Setup page.

Testing:

- Test the above described behavior in Debian testing.

- Debian stable testing was not done as the version of ikiwiki is that same as
testing.

[sunil: Drop removal of discussion from wiki pages]
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-09-25 12:58:04 -07:00
Sunil Mohan Adapa
fa58633e81
openpvn: Renew server/client certificates
- Set renewal period to 3 years before expiry so that users not inconvenienced
too much.

- Renew server certificate if possible.

- There are openvpn server setups where the expiry of the server certificate has
been set to 2 years due to a bug in our code. Triggering a setup call will renew
these certificates without effecting any clients. Even during the bug, CA certs
were still be valid for 10 years. So, they are unaffected.

- When downloading profile, if client certificate is renewable, renew
before providing profile for download. Old certificates will still be valid
until their expiry.

Tests:

- Without the patches, install openvpn app. Server certificate will be created
with a validity of 2 years. Download the client profile. Apply patches, setup
will be rerun. OpenVPN will be restarted. Server certificate will be renewed and
show 10 years expiry. Old client profile will continue to connect successfully.
It will have expiry of 2 years. Download the client profile again. It will an
expiry of 10 years and will successfully to the server.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 16:53:17 -04:00
Sunil Mohan Adapa
251e2b4064
openvpn: Ensure that re-running setup works as expected
- Don't overwrite the entire PKI directory or CA certificates.

- Don't re-enable app during setup.

Tests:

- Install app with patches. Rerun setup. It succeeds. Server certificate is not
changed.

- Disable app. Re-run setup. App is not re-enabled. OpenVPN is not running.

- Enable app. Re-run setup. OpenVPN is restarted.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 16:53:10 -04:00
Sunil Mohan Adapa
0176d706b9
openvpn: Use config file instead of env vars for easy-rsa
- A configuration file seems to be the preferred approach for invoke easy-rsa
since version 3.

- Drop unused configuration keys KEY_CONFIG, KEY_DIR and EASYRSA_REQ_NAME. These
are no longer referred to in the easy-rsa script.

- Remove configuration key EASYRSA_OPENSSL as the value 'openssl' is already the
default.

- Use pathlib.Path to simplify some code.

Tests:

- Re-run setup and notice the ca.cert file has not changed.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 16:53:06 -04:00
Sunil Mohan Adapa
95f65b5c4b
openvpn: Minor refactoring in setting up easy-rsa
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 16:53:04 -04:00
Sunil Mohan Adapa
0e91261446
openvpn: Correctly set expiry of server/client certs to 10 years
- After moving to easy-rsa 3.x, the expiry configuration key changed and
original intention of setting the expiry to 10 years was not working. Update the
key to set the expiry properly.

Tests:

- Install the app freshly and verify the server and client have 'Valid Not
After' date set 10 years in future.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 16:53:01 -04:00
Sunil Mohan Adapa
ec89d11494
openvpn: Fix app not installing Debian testing
Closes: #2370.

- In Debian testing (trixie), easy-rsa version is 3.1.5 (up from 3.1.0). In this
version trying to sign a certificate request when the final certificate is
already present leads to an error which fails openvpn app installation.

- In versions 3.1.0 (Debian bookworm/stable) and above, build-server-full also
generates a signing request and then signs the request. So, there is no need to
run them separately.

Tests:

- Uninstall openvpn test that /etc/openvpn directory has been removed. Install
openvpn download client profile and connect using 'sudo openvpn --config
tester.ovpn'. The connection will be successful.

- Files /etc/openvpn/freedombox-keys/pki/issues/{server,tester}.ovpn show
signature values.

- Repeat test for Debian testing and stable/bookworm.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-28 16:52:57 -04:00
Sunil Mohan Adapa
c4f087ea4a
networks, samba: tests: functional: Fix setting firewall zone
Without the changes, the form submission for setting firewall zone fails with
error similar to "element can't be scrolled to view".

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-23 21:47:51 -04:00
Sunil Mohan Adapa
770974c8ce
sso: Switch to django-axes >= 5.0
- Add explicit dependency on django-ipware >=3. django-axes >= 6 adds
only and optional dependency on django-ipware. Adding explicit dependency make
the behavior safer.

- Depend on django-axes >= 5 where the authentication backend and other features
are available. The new code won't work with older versions. The new approach
uses and authentication backend to deny access to the login form on lockout and
a middleware to redirect user to locked out form when limit of attempts have
been reached.

- Drop old code used for compatibility with django-axes 3.x.

- Suppress verbose and debug messages as django-axes is too chatty.

- Re-implment the CAPTCHA form entirely. In the old style, we have a login form
with CAPTCHA field. That would not work with the new django-axes authentication
middle. On submission of the form, auth.authenticate() will be called. This
call invokes various authentication backends include django-axes authentication
backend. This backend's behavior is to reject all authentication attempts when
the IP is listed in locked table. The new approach is to provide a simple
CAPTCHA form with just the CAPTCHA field. If the form is successfully
validated (correct CAPTCHA is provided), then the lock on the IP address is
reset. The user is then free to perform 3 more attempts to login.

- Update firstboot form to send the request parameter when using
auth.authenticate() method. This needed by Django axes' authentication method
which will be triggered.

Tests:

- Run tests on Debian Bookworm and Debian testing.

- Axes verbose messages and debug messages are not printed on the console when
running FreedomBox in debug mode.

- Only three invalid attempts are allowed at the login page. After the final
incorrect attempt, user is redirected to CAPTCHA page. Visiting the login page
using the URL works but entering the correct credentials still takes the user to
CAPTCHA page.

- CAPTCHA form appears as expected. Clicking the CAPTCHA images downloads the
audio file corresponding to the image. Incorrect CAPTCHA shows an error. Correct
CAPTCHA takes the user to login form where they are able to login with correct
credentials. Entering incorrect credentials 3 times will take the user again to
CAPTCHA page.

- Creating user account during firstboot works.

- Blocked IP address the IP of the client such as 10.42.0.1 and not the local IP
address 127.0.0.1 according the django-axes log messages. While one client IP
address is blocked, another IP is able to login to the same user account that
was attempted by the blocked client.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-23 21:47:39 -04:00
Sunil Mohan Adapa
cf6c604cec
sso: Use POST method for logout
- This prevents CSRF attacks that allow adversarial websites from logging out
users from FreedomBox. Django itself has made this change in 4.x releases.

Tests:

- Logout works with the menu item in drop-down when Javascript is enabled. The
menu item appears similar to other drop-down menu items.

- Logout works with the menu item when JavaScript is disabled on the page. The
menu item appears similar to other menu items.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-23 21:47:36 -04:00
Sunil Mohan Adapa
dc9e86d918
users, networks: Use the autofocus HTML attribute sparingly
Using autofocus too much hurts accessibility[1] as screen readers jump to the
autofocused field. Specifically, it should used only when it increases UX
significantly, when the form is the only thing on the page and there is nothing
to read before the field is filled.

- Networks: There is not much improvement to UX by focusing on a radio select.

- Update User Form: there is a statement to be read before the first element is
filled up. Username is changed rarely but it being focused on.

- First boot user account: There is content to be read before filling the form
and this will be skipped by the screen reader.

Links:

1) https://www.boia.org/blog/accessibility-tips-be-cautious-when-using-autofocus

Tests:

- networks: Add new connection form works. The connection type is not
autofocused.

- users: Update user form works. Username is not autofocused.

- users: First boot form works. Username is not autofocused.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-23 21:47:31 -04:00
Sunil Mohan Adapa
ebf2dd5c80
backups: Remove use of length_is template function
- It has been deprecated in Django 4.2

Tests:

- Add a remote backup location with valid SSH hostname and notice that the list
of SSH host keys are shown properly.

- Add a remote backup location with invalid SSH hostname and notice that the
error "Could not reach SSH host..." is shown.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-08-23 21:47:28 -04:00
Sunil Mohan Adapa
dc0b9bed82
zoph: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:47:13 -04:00
Sunil Mohan Adapa
2c6faf7014
wireguard: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:47:11 -04:00
Sunil Mohan Adapa
a1217b36be
ttrss: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:47:09 -04:00
Sunil Mohan Adapa
629c476767
sharing: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:47:06 -04:00
Sunil Mohan Adapa
a6a7de70e6
shaarli: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:47:04 -04:00
Sunil Mohan Adapa
9f51fd6a9c
rssbridge: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:47:01 -04:00
Sunil Mohan Adapa
8d723daec3
radicale: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:59 -04:00
Sunil Mohan Adapa
100592c1d4
quassel: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:52 -04:00
Sunil Mohan Adapa
9fa1e1f563
privoxy: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:50 -04:00
Sunil Mohan Adapa
4444f15c60
performance: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:47 -04:00
Sunil Mohan Adapa
62aa247c8d
openvpn: Don't enable app when setup is rerun
Tests:

- Could not test: rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:45 -04:00
Sunil Mohan Adapa
de5d0ce6b0
minetest: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:42 -04:00
Sunil Mohan Adapa
ec7560b798
mediawiki: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:40 -04:00
Sunil Mohan Adapa
9f78d444a4
jsxc: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:37 -04:00
Sunil Mohan Adapa
ab4fb9238e
janus: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:33 -04:00
Sunil Mohan Adapa
3172c6a7b4
infinoted: Don't enable app when setup is rerun
Tests:

- When app is freshly installed, app is enabled.

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:29 -04:00
Sunil Mohan Adapa
e6b88a48b9
ikiwiki: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:24 -04:00
Sunil Mohan Adapa
b90ddd514d
gitweb: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:22 -04:00
Sunil Mohan Adapa
69c4aca429
ejabberd: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:19 -04:00
Sunil Mohan Adapa
02192266c2
deluge: Don't enable app when setup is rerun
Tests:

- Could not test: rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:16 -04:00
Sunil Mohan Adapa
f0e1a1ebc9
bind: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:12 -04:00
Sunil Mohan Adapa
099e021024
bepasty: Don't enable app when setup is rerun
Tests:

- Rerun setup after disabling the app. App is not enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-31 19:46:08 -04:00
James Valleroy
49fa9a0599
upgrades: Use n= for unattended-upgrades origin pattern
In the Debian bookworm-backports repository, the Suite has changed to
"stable-backports". The Codename is the more specific "bookworm-backports".

Tests:

- Build a freedombox package for bookworm-backports with a smaller version
  number than the package in bookworm-backports. Install it in bookworm vagrant
  box.

- Run a manual update. freedombox is upgraded to the version in
  bookworm-backports.

Closes: #2368.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-07-31 11:02:18 -07:00
James Valleroy
1b64394575
upgrades: Use codename= in apt preferences
In the Debian bookworm-backports repository, the Suite has changed to
"stable-backports". The Codename is the more specific "bookworm-backports".

Bump upgrades app version to rewrite the apt preferences file.

Helps: #2368.

Tests:

- `apt policy freedombox` shows priority 500 for package in bookworm-backports.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-07-31 11:02:09 -07:00
Sunil Mohan Adapa
655e4aff1b
tor, torproxy: Export settings from old to new app
Tests:

- Install old version of tor app, enable apt transport tor and bridges. Upgrade
to latest code. Notice that new torproxy app is installed, apt transport tor is
enabled and bridges are set. Remaining tor settings are unchanged.

- Install old version of tor app, disable apt transport tor and enable bridges.
Upgrade to latest code. Notice that new torproxy app is installed, apt transport
tor is disabled and bridges are set. Remaining tor settings are unchanged.

- Install old version of tor app, disable tor app and set bridges. Upgrade to
latest code. Notice that new torproxy app is not installed. Remaining tor
settings are unchanged.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
[jvalleroy: Minor update to comment and log message]
Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 22:03:51 -04:00
Sunil Mohan Adapa
e017e55a7b
torproxy: Drop irrelavant 'ExitPolicy' configuration directive
ExitPolicy is only used when relaying is enabled as per torrc manual page.

Tests:

- None

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:54 -04:00
Sunil Mohan Adapa
e8818179f7
tor: tests: Make functional test check for running service
Tor app does have a running daemon.

Tests:

- Functional tests pass.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:51 -04:00
Sunil Mohan Adapa
2412f3f051
tor, torproxy: Update description for info on services provided
- Explain SOCKS proxy, upstream bridges, relays and onion services.

Tests:

- Visiting the app pages shows expected description.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:48 -04:00
Sunil Mohan Adapa
e9056afe00
tor: Minor refactor to remove code the check for need to restart
- Any change to the remaining form fields now certainly requires restart of the
Tor daemon.

Tests:

- When no changes are done to the form, tor daemon is not restarted.

- When changes are done to the form, tor daemon is restarted. But only when app
is enabled.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:45 -04:00
Sunil Mohan Adapa
b7613d6e5a
torproxy: Add shortcut to home page for logged in users
Describing the SOCKS service provided by this instance of FreedomBox and
providing a convenient link to Manual.

Tests:

- The short cut shows as expected. Clicking on the shortcut shows description,
manual page link and configuration link.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:42 -04:00
Sunil Mohan Adapa
1409a6c493
torproxy: Remove unnecessary load tags in template file
Tests:

- Tor proxy template loads fine showing the app page.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:38 -04:00
Sunil Mohan Adapa
9a1e5a3eeb
torproxy: Rename icon from tor to torproxy
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-28 21:07:23 -04:00
James Valleroy
b0c75b7849
torproxy: Add separate app for Tor Proxy
- Includes SocksPort and "Download software packages over Tor" feature,
  as well as setting upstream bridges.

- "Download software packages over Tor" option is enabled by default.

- When upgrading, if Tor app was enabled and "Download software
  packages over Tor" was enabled, then Tor Proxy will be installed.

- The default tor instance is now called tor@default. The "tor" service
  is an multi-instance master that has Wants relation all instances.

Tests:

- Tests for Tor and Tor Proxy passed.

- Enable Tor, and run the tests for Tor Proxy. Afterwards, Tor is still
  enabled and running.

- Enable Tor Proxy, and run the tests for Tor. Afterwards, Tor Proxy is
  still enabled and running.

- Test setting upstream bridges for Tor and Tor Proxy.

- Install FreedomBox 23.11 in a VM and install Tor with default
  settings. Install new FreedomBox version with Tor Proxy. After
  install, both Tor and Tor Proxy apps are installed and running.
  /etc/tor/instances/{plinth,fbxproxy}/torrc both have expected content.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
2023-07-20 10:39:59 -07:00
James Valleroy
64d6356c2f
firewall: Add diagnostic check for passthroughs
Check that there are at least 12 direct passthroughs.

Tests:
- The diagnostic is passed.
- Manually remove a direct passthrough. The diagnostic is failed.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-07-20 10:39:20 -07:00