42 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
d6c0b98375
i2p: Use app.html instead of app-subsubmenu.html
- Gain ability to show internal zone warning for I2P proxies.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-05 13:26:13 -04:00
Sunil Mohan Adapa
86da6a894a
Minor changes to flake8 related updates
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-07-25 11:46:14 -07:00
Nikolas Nyby
5439084c84
Add flake8 to gitlib-ci - closes #58
And fix the rest of the flake8 errors.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-07-25 11:07:06 -07:00
Nikolas Nyby
f81b1751ce
Fix typos in module init docs
Intialize -> Initialize

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-07-24 14:55:22 -07: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
46f162d093
app: Add unique ID to each app class
Also maintain a global list of apps

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:59 -04:00
Sunil Mohan Adapa
4100d36381
Introduce webserver component for managing Apache configuration
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:49 -04:00
Sunil Mohan Adapa
ca2c7dbeb0
Introduce firewall component for opening/closing ports
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-06-13 20:17:45 -04:00
Sunil Mohan Adapa
75c57d3e00
Turn frontpage shortcut into an app component
- Turn frontpage shortcut into an App component. Add tests and full
  documentation.

- Overridden implementations for tahoe, diaspora, mediawiki shortcuts to handle
  special cases. Special handling for ikiwiki.

- Extend App API for removing and retrieving a component.

- Add clients information into shortcuts to avoid hacks when presenting
  shortcuts to Mobile devices via API.

- Fixed unnecessary stripping and adding of '/' when setting home page redirect
  URLs. This fixes problem with setting Cockpit as home page.

- Replaced the use of term 'app' in favor of 'shortcut' as the term when setting
  frontpage shortcuts as home page.

- JSXC shortcut does not require login.

- Don't show shadowsocks for anonymous users.

- Simplify showing selected shortcut details.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:08 -07:00
Sunil Mohan Adapa
b96d901071
Introduce component architecture and menu component
- Introduce base class for all apps that will contain components. With
  unittests.

- Introduce base classes for components. With unittests.

- Turn Menu class into an app component.

  - Further cleanup Menu class.

  - Update tests.

  - Maintain a global list of menu items and look them up easily. Generalize
    such that subsubmenus can later be merged into Menu class.

  - Cleanup scope of main menu initialization.

  - Use None instead of empty strings for various values. Ensure that
    printing short_description does not show 'None' in output.

  - Use enable/disable instead of promote/demote.

- Use menu component in all apps.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-06-07 11:48:04 -07:00
Sunil Mohan Adapa
4bfb1accfb
i2p: Show port forwarding information
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-05-13 15:54:24 -07:00
Sunil Mohan Adapa
532a450ef7
i2p: Rename test fixtures to avoid a minor warning
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Joseph Nuthalapati <njoseph@thoughtworks.com>
2019-05-12 17:17:01 +05:30
James Valleroy
893bd2b4d6
apps: Separate enabled and disabled apps
- Add 'secondary' flag to menu items.

- Mark apps as 'secondary' when disabled.

- Extend TemplateView for apps index.

- Add card-container for disabled apps.

Closes #1309

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-05-07 16:57:55 -07:00
Sunil Mohan Adapa
56d511368d
i2p: Convert router configuration tests to pytest style
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:51:58 -07:00
Sunil Mohan Adapa
97ed7fe144
i2p: Minor flake8 and yapf fixes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:51:54 -07:00
Sunil Mohan Adapa
dca91da571
i2p: Update license headers for consistent formatting
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:51:51 -07:00
LoveIsGrief
f7d9c9eff5
i2p: Include default favorites after installation
The default favorites might change and we might have to update the list but for
now they were extracted from a clean router.config saved by the i2p daemon.

1528 - augeas for router.config

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:51:19 -07:00
LoveIsGrief
1c9ad9f953
i2p: Use augeas for editing the router.config
It's cleaner and less hacky, however we still overwrite the default favs because
they aren't written to the file by i2p until a change is made manually in the
frontend.

We still need to recreate the list of default and add them manually.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 16:50:40 -07:00
Sunil Mohan Adapa
c13e9a4227
i2p: Don't enable proxies on external zone
- Only web interface (protected by sign-on) should be available on external
  interfaces.

- Proxies should only be available on internal interfaces. Otherwise, they will
  become open proxies on the Internet which might have implications for the
  FreedomBox user.

- Update description to convey that we are not opening SOCKS proxy but only
  HTTP, HTTPS and IRC proxies.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:38:43 -07:00
Sunil Mohan Adapa
8267c1156b
i2p: Disable the daemon before editing configuration
- This is likely to yield better consistency as the daemon also edits the
  configuration files.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:02:30 -07:00
Sunil Mohan Adapa
1e8a39e690
i2p: Update firewalld service descriptions
- HTTP/HTTPS proxies are not SOCKS proxies. SOCKS proxies are not recommended by
  the project. https://geti2p.net/en/docs/api/socks

- Write more detailed description in firewalld style.

- Rename the files for firewalld styling and removing 'socks'.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:02:27 -07:00
Sunil Mohan Adapa
ce9eacb751
i2p: Convert unit tests to pytest style
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:02:24 -07:00
Sunil Mohan Adapa
a73f002ed6
i2p: flake8 and yapf fixes
- Run isort and yapf.

- Better docstrings.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:02:20 -07:00
LoveIsGrief
66b161b986
i2p: Enable application
Closes: #1528 (i2p: Improve and enable the application)

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:02:03 -07:00
LoveIsGrief
f40ecaa155
i2p: Add HTTP(S) and IRC ports to firewall
Enable or disable the ports with the firewalld.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:01:59 -07:00
LoveIsGrief
5c26c28f96
i2p: Open HTTP(S) and IRC ports on all interfaces on install
I2P has to be restarted in order for the changes to take effect.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 15:01:50 -07:00
LoveIsGrief
eb28f47053
i2p: Add helper to modify the tunnel config
We will want to set the 'interface' property of certain tunnels to 0.0.0.0 and
the handle the rest with the firewall. This is just prep to do so.

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-29 14:58:38 -07:00
Sunil Mohan Adapa
7a89474cb6
i2p: Disable app until further fixes are done
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:34:01 -07:00
Sunil Mohan Adapa
fe03b4f34f
i2p: Review and update views
- Update the description of the app. Remove link to web interface at it is now
  in clients list.

- Add showing running status of the service.

- Use the new style for showing subsubmenus under the description of the
  application.

- Don't use frames to show the interface. Let users launch that interface in a
  new window instead.

- Use class based views for I2P service views.

- Update description of the I2P service views.

- Minor styling updates.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:58 -07:00
Sunil Mohan Adapa
6e5a45a9b3
i2p: Review and cleanup action script
- Remove unneeded actions: start, stop, restart, is-running and is-enabled.

- Remove short form parameter passing for add-favorite action. Mostly for
  consistency and avoid confusion. Actions are not expected to be used by
  regular users.

- Rename Apache configuration from: i2p-plinth.conf to i2p-freedombox.conf

- Fix issue with adding favorites when none already present. This eliminates
  failure during first time installation for I2P.

- Fix issue with incorrect new lines while editing favorites.

- Minor fixes in Apache configuration.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:55 -07:00
Sunil Mohan Adapa
9ceec9c8d8
i2p: Add main web interface to list of clients
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:51 -07:00
Sunil Mohan Adapa
c98f44f5ae
i2p: Add diagnostic test for web interface port
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:48 -07:00
Sunil Mohan Adapa
ba4d73ae60
i2p: Minor styling changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:45 -07:00
Sunil Mohan Adapa
14b581c96d
i2p: Backup/restore the correct state folder
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:42 -07:00
Sunil Mohan Adapa
eb35629a8c
i2p: Move data files into the app's data folder
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:29 -07:00
LoveIsGrief
3d211d26eb
i2p: torrents: Link to the list of trackers
There are already a few listed, so no need to rewrite the list

freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:22 -07:00
LoveIsGrief
0b2922749b
i2p: setup: Enrich I2P favorites
3 search engines and a torrent tracker added to the favorites

freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:12 -07:00
LoveIsGrief
4e7fc70192
i2p: django: Add i2p homepage to description
freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:09 -07:00
LoveIsGrief
23b4d33b3b
i2p: django: Add description for the configuration shortcuts
Tunnels have a better description now.

I2P snark will need a better description and introduction

freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:33:06 -07:00
LoveIsGrief
ad9712b54f
i2p: django: Additional information about /i2p location
The first visit will start a configuration process

freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:32:50 -07:00
LoveIsGrief
5e5e0119d2
i2p: django: Add shortcuts to /i2p/... URLs
This should help the user reach pages of the configuration more quickly

freedombox-team/plinth#1428 Request: I2P support

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:32:47 -07:00
LoveIsGrief
25d3f76434
i2p: Add new application
- installs i2p from apt
 - accessible under /i2p/
 - needed to modify diagnostics url to include numbers

TODO:

 - fix CSS at /i2p/ : firefox NS_ERROR_INVALID_CONTENT_ENCODING ???
 - all green diagnostics
 - functional tests
 - autoconfiguration in setup form
 - configuration of SOCKS5 proxy for network interfaces

Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-04-01 17:32:37 -07:00