43 Commits

Author SHA1 Message Date
Sunil Mohan Adapa
e8ea6fff17
pagekite: Use privileged decorator for actions
Tests:

- Functional tests work
- Initial setup succeeds
- Configuration can be set and new configuration is properly reflected in app
  page and configuration files.
- A new service can be added and reflects in configuration files.
- Service can be deleted and reflects in configuration files.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-10-08 18:52:44 -04:00
Sunil Mohan Adapa
22a120d979
*: pylint: Avoid calling super() with arguments
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2022-07-04 19:46:23 -04:00
Sunil Mohan Adapa
74214c18ae
*: Use Django gettext functions instead of ugettext
- ugettext functions will be removed in Django 4.0. Each use emits a warning
when running with Django 3.2. Since we have warnings enabled in developer mode,
we see quite a few messages because of this.

- ugettext is already a simple alias of gettext. So, no regressions are
expected.

Tests:

- Accessing an affected app in UI with Django 3.2 and Django 2.2 works fine.

- Using Django 3.2 there are no warnings related to removal of ugettext
functions.

- Ran regular unit tests.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2021-09-20 16:50:16 -04:00
James Valleroy
48d7f68ed5
config, dynamicdns, pagekite: Remove incorrect use of str
This was used before to ensure the domain name was ASCII. However, str
does not convert to ASCII in Python 3.

Note that in config module, which sets the system domain name, the
domain is already restricted to alphanumerics, hyphen, and period.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-03-29 12:59:47 +03:00
James Valleroy
0b630037f9
pagekite: Convert entered kite name to lower case
Let's Encrypt certificate paths use lower-case kite name.

Test: Pagekite functional tests are passing.

Signed-off-by: James Valleroy <jvalleroy@mailbox.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2021-03-29 12:59:32 +03:00
Sunil Mohan Adapa
6fa0836847
pagekite: cosmetic: Minor yapf changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:31 +02:00
Sunil Mohan Adapa
546f112a88
pagekite: Drop unused subdomain widget
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-12-19 11:26:30 +02:00
Alice Kile
0b5b384651
app: Separate app enable/disable form from config form
- Introduce new API to mark an app that it can't be disabled.

- Mark jsxc, storage, config, upgrade and firewall apps as can't be disabled.

- Fixed functional tests

- Replaced AppForm with forms.Form in all modules' forms.py.

- Remove app.template.js.

- Remove unused styles.

- Remove app status checks in form_valid of Deluge, Diaspora, Matrix, Ejabberd,
MediaWiki, Storage, Transmission, Quassel

- Purge unused is_enabled context variables (Ikiwiki)

- ejabberd: Minor cleanup in template

- jsxc: Cleanup unneeded overrides

- tahoe: Cleanup unnecessary overrides

Tests performed:

- For all apps affected, test enable/disable button works and submitting
configuration form works: with changes updates message and without changes
'settings unchanged' message.
  - avahi
  - bind
  - cockpit
  - SKIP: coquelicot
  - datetime
  - deluge
  - SKIP: diaspora
  - ejabberd
  - gitweb
  - i2p
  - infinoted
  - ikiwiki
  - matrixsynapse
  - mediawiki
  - minetest
  - minidlna
  - mldonkey
  - mumble
  - pagekite
  - privoxy
  - quassel
  - radicale
  - roundcube
  - SKIP: samba
  - searx
  - SKIP: shaarli
  - shadowsocks
  - ssh
  - tahoe
  - transmission
  - FAIL: tt-rss (not installable)
  - wireguard
- Deluge test that configuration changes when app is disabled work
- Quassel test that setting the domain works when app is diabled
- Transmission test that setting the domain works when app is diabled
- Ikiwiki create form works properly
- Enable/disable button appears as expected when enabled and when disabled
- Enable/disable button works without Javascript
- Functional tests work for affected apps, Tor and OpenVPN
- AppForm is removed from developer documentation
  - Forms reference
  - Customizing tutorial
- Test all apps using directory select form
  - Transmission
  - Deluge
- Visit each template that overrides block configuration and ensure that it is
loaded properly and the display is as expected.
- All apps that use AppView that are not tested above should not have an
enable/disable button. That is JSXC, update, config, firewall, storage, users.

Signed-off-by: Alice Kile <buoyantair@protonmail.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-29 09:42:31 +03:00
Sunil Mohan Adapa
35732f6ca7
pagekite: Fix an error message in custom services form
There is no page called 'Standard Services' anymore.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-15 09:29:21 +02:00
Sunil Mohan Adapa
67e4b28aee
pagekite: Simplify code notifying domain name changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-15 09:27:26 +02:00
Sunil Mohan Adapa
98ecb6ea40
pagekite: Use Daemon component to simplify handling daemon actions
- Turn some methods in action script to private to improve abstraction.

- Always enable the predefined services when setting the configuration for the
first time.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-15 09:27:07 +02:00
Sunil Mohan Adapa
a1c1104a61
pagekite: Merge set-kite and set-frontend actions
- Simplifies the form submission code.

- When service is disabled, don't add the abort_not_configured configuration
flag. There is not need to change the configuration as disabling the daemon from
running is reliable enough.

- When the configuration is set for the first time, drop the
abort_not_configured flag and don't ever add it back.

- Set default values properly for frontend fields when no value is supplied.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Veiko Aasa <veiko17@disroot.org>
2020-03-15 09:26:57 +02: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
Joseph Nuthalapati
5b2df956e8
pagekite: Use the new app toggle button
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
2019-11-20 06:26:54 +05:30
Matt Conroy
bdb090e386
pagekite: Get rid of tabs in the configuration page
Made the changes requested in issue #1693 to the pagekite
configuration page. Removed the tabs and the javascript.
Made a sort of hacky but working solution to always having
the standard pagekite services being enabled. Put custom
services configuration below the regular configuration and
added a separate add custom service page a la the Gitweb
page.

Fixed formatting issues.

Signed-off-by: Matt Conroy <matt@mattconroy.net>
Reviewed-by: Joseph Nuthalapati <njoseph@riseup.net>
2019-11-20 04:58:03 +05:30
Sunil Mohan Adapa
867b8f3f63
pagekite: cosmetic: yapf and isort changes
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-02 17:21:42 -04:00
Sunil Mohan Adapa
cff9a61f09
pagekite: Remove first wizard step for danube edition
- The code was never used by end users.

- The code was expected to be used long back but the plans didn't materialize.

Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: James Valleroy <jvalleroy@mailbox.org>
2019-10-02 17:21:39 -04: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
Prachi Srivastava
743d976d50
security: Moves input field focus javascript to django forms
Signed-off-by: Prachi Srivastava <prachi.chs.2009@gmail.com>
Signed-off-by: Sunil Mohan Adapa <sunil@medhas.org>
Reviewed-by: Sunil Mohan Adapa <sunil@medhas.org>
2019-01-28 17:39:22 -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
e09434b998
pagekite: Fix first boot to use requests module
The intent is to use the requests module and make HTTP requests instead
of the Django requests.  This is probably a regression and this step
does not work without the change.
2016-12-04 15:24:39 -05:00
Sunil Mohan Adapa
56686b7148
firstboot: Rename views/urls to be non-numeric 2016-12-04 15:24:36 -05:00
Sunil Mohan Adapa
c37aa0fbd5
firstboot: Indentation & styling fixes
pycodestyle version used is 2.1.0 with default arguments.
2016-12-04 15:24:31 -05:00
Hemanth Kumar Veeranki
6011a7adfa
Made Suggested Changes 2016-11-03 22:06:08 -04:00
Hemanth Kumar Veeranki
0332d4489e
Added code for modules to register for first_boot #529 2016-11-03 22:06:00 -04:00
Ruben Lubbes
fad7448417 More punctuation and minor errors changed 2015-12-09 23:55:55 +05:30
fonfon
1dbc566515 names module, pagekite: moved updating names to utils 2015-11-25 15:22:27 +01:00
James Valleroy
e0bfd1401f Name Services module 2015-11-25 15:22:27 +01:00
Sunil Mohan Adapa
3df1a88824 Switch to Django i18n for code strings
Django i18n layer is on top of gettext and provide may crucial features
such as per-request locales, lazy translations etc.
2015-11-13 22:08:43 +05:30
fonfon
96a272b3b0 Added explicit port setting to pagekite configuration 2015-10-11 17:19:35 +05:30
Sean Alexandre
21b9a5b02a Passwords now sent over stdin instead of command line.
Fixes Issue #166:
Don't pass passwords on command line
https://github.com/freedombox/Plinth/issues/166

This issue was for 4 modules: Transmission, Pagekite, DynamicDNS, and Ikiwiki.
2015-08-23 15:20:08 +05:30
Sunil Mohan Adapa
517c364559 pagekite: Move to using python3-augeas
- Merge actions/pagekite_util.py into plinth/modules/pagekite/util.py.

- Rename plinth/modules/pagekite/util.py to utils.py.

- Add python-augeus as dependency.

- Move actions/util.py to plinth/action_utils.py and update services
  that use it.

- Rename _run() method to run() as it is being used publicly.

- Import the utils in a more conventional manner.

- Move all python2 bits to python3.
2015-07-19 15:37:43 -04:00
fonfon
32e94058f6 More consistent renaming from default to standard services 2015-05-04 11:04:35 +02:00
fonfon
702dbf5e61 Renamed default services to standard services 2015-05-04 10:32:53 +02:00
fonfon
0ffaaa3da7 Use JSON as pagekite action-script arguments
This allows to safe some conversions
2015-05-04 10:20:37 +02:00
fonfon
7a4486fadf pagekite: restart service when config is changed
so the changed config gets applied immediately, and
not only after enabling/disabling the service manually.
2015-05-03 16:53:47 +02:00
fonfon
ef08f40447 minor layout cleanup 2015-05-03 15:28:45 +02:00
fonfon
3cc0cb74a6 Prevent adding existing or predefined services
and improved form error handling
2015-05-03 09:44:46 +02:00
fonfon
3f2c9ff2c8 cleaned up actions and configuration form 2015-05-03 09:44:46 +02:00
fonfon
99bfda3b69 removed default frontend stuff from actions
it's all handled via get-frontend and set-frontend now.
and there are now some doctests in actions/pagekite_util.py
2015-05-03 09:44:46 +02:00
fonfon
b96c89b0ab make pagekite login-required;
restart pagekite after adding/deleting a service so the changes take
effect;
improved warnings in the UI
2015-05-03 09:44:46 +02:00
fonfon
d5d9e2df2e renamed variables for consistency
there are only 'service' and 'service_string' now, no more 'params'
2015-05-03 09:44:46 +02:00
fonfon
1fc0064fd0 refactoring pagekite: configuration form works
splitting the services to a separate page is not yet finished
2015-05-03 09:44:46 +02:00