22 Commits

Author SHA1 Message Date
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
25d32d245a
tor: Also use Aptsources822 augeas lens
This will handle sources files with Deb822 format.

Closes: #214.

Tests:

- Enable package download through Tor. "tor+" is prepended to sources
  URL.

- Disable package download through Tor. "tor+" is removed from sources
  URL.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-01-27 15:15:31 -08:00
James Valleroy
3fac4f55fe
tor: Remove workaround for old Augeas bug
The upstream issue was fixed in 2015:
https://github.com/hercules-team/augeas/pull/295

Tests:

- In stable container, add options like [arch=amd64] to apt
  sources.list.

- Enable package download through Tor. "tor+" is prepended to sources
  URL.

- Disable package download through Tor. "tor+" is removed from sources
  URL.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2023-01-27 14:56:03 -08:00
Sunil Mohan Adapa
a78480c033
tor: Use privileged decorator for actions
- Fixed issue with restarting start when apt transport is updated

Tests:

- Functional tests work
- Initial setup works
  - 'plinth' instance is created
- Enabling works
  - Firewall ports are updated.
- Disabling works
  - Apt transport over Tor is disabled
- Diagnostics work
  - Shows all ports for Tor
- Updating configuration works
  - Correct value is set in configuration file
  - App page shows correct status
  - Setting/unsetting each of relay, bridge relay, bridges, hidden service, apt
    transport all work.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:53:24 -04:00
Sunil Mohan Adapa
900c0d30b9
*: Drop module level app property
module.app property usage is greatly reduced because setup() and force_upgrade()
method are now part of App class instead of at the module level. Remove the
remaining minor cases of usage and drop the property altogether.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-08-15 10:36:29 -04:00
Joseph Nuthalapati
d92ca09e19
framework: Remove module init() functions
Fixes #1906

Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2020-08-03 18:06:48 -04:00
Sunil Mohan Adapa
9368504da5
*.py: Use SPDX license identifier
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-02-19 14:38:55 +02:00
Alice Kile
eb83e00011
fix formatting issues
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-12-07 13:08:35 -05:00
Sunil Mohan Adapa
ba4afd2a09
names: Use new API in all apps
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-08-11 18:39:56 -04:00
Sunil Mohan Adapa
e4351b6b97
Introduce daemon component to handle systemd units
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:18:02 -04:00
Sunil Mohan Adapa
2565737f38
tor: Make a utility method public
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-02-05 14:58:48 -08:00
Sunil Mohan Adapa
dea4af17fb
Rename Plinth to FreedomBox in license headers
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2018-02-16 20:10:09 -05:00
Sunil Mohan Adapa
527aa66494
tor: Ensure that is-enabled status is show properly
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2018-01-30 17:00:47 +05:30
James Valleroy
09b58a8b99
tor: Add option to use upstream bridges 2017-01-29 11:17:41 +05:30
mridulnagpal
fdac901181
tor: Run tor-instance-create during setup 2017-01-08 14:55:37 -05:00
mridulnagpal
49106fe8ee
tor: Update setup to use plinth instance 2017-01-08 14:55:35 -05:00
Sunil Mohan Adapa
038fec97a6
tor: Ability to run regular relays
- Allow users to run regular relays.  In addition to that users will be
  able to turn them into bridge relays.  Like before, by default,
  relaying is enabled and the relay type bridge relay.

- Show obfs3/4 transport ports as needing firewall port forwarding only
  if bridge relay is enabled.

- Remove pluggable transports configuration from configuration when
  bridge rely is disabled.

- Improve description message for relays and bridge relays.
2016-07-16 13:43:29 -04:00
Sunil Mohan Adapa
70001c841f
tor: Minor improvements
- Minimize loading of Augeas since it takes time.

- Make some methods private

- PEP8 fixes
2016-07-16 13:43:23 -04:00
James Valleroy
38382ec09c
tor: Add option to toggle bridge relay 2016-07-08 23:19:16 +05:30
James Valleroy
1c98d1272f
tor: Use single command to get status
Merge get_ports and get_hs into get_status.
2016-07-08 23:19:09 +05:30
fonfon
bc2cba0cbf
tor: remove circular import 2016-05-11 18:19:49 -04:00
fonfon
f419c28596
Services: Explicitly use ServiceForm and ServiceView
- adapted all modules to not use views.ConfigurationView anymore
- removed templates that are not needed anymore
- no more implicit 'enabled' and 'get_status' functions in __init__.py files
- (more coherent/explicit use of Django functionality)
2016-05-11 18:19:31 -04:00